Submission #471487

# Submission time Handle Problem Language Result Execution time Memory
471487 2021-09-09T13:36:10 Z Rainbowbunny Broken Device (JOI17_broken_device) C++17
0 / 100
60 ms 2520 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;

int num[] = {0, 0, 1, 0, 0, 1, 2, 3};
int sd[] = {0, 1, 1, 0, 2, 2, 2, 2};

void Anna(int n, long long X, int k, int P[])
{
    vector <int> A;
    vector <int> G;
    for(int i = 0; i < n; i++)
    {
        A.push_back(X & 1);
        X >>= 1;
        G.push_back(0);
    }
    for(int i = 0; i < k; i++)
    {
        G[P[i]] = 1; 
    }
    int pos = 0;
    for(int i = 0; i < n; i += 3)
    {
        int tmp = G[i] * 4 + G[i + 1] * 2 + G[i + 2];
        int t = 0;
        for(int j = 0; j < 8; j++)
        {
            if((tmp & j) == 0)
            {
                int zz = num[j], nn = 1;
                for(int k = 0; k < sd[j]; k++)
                {
                    zz -= nn * A[pos + k];
                    nn *= 2;
                }
                if(zz == 0 and sd[t] < sd[j])
                {
                    t = j;
                }
            }
        }
        for(int j = 0; j < 3; j++)
        {
            Set(i + j, (t >> j) & 1);
        }
        pos += sd[t];
    }
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;

int num[] = {0, 0, 1, 0, 0, 1, 2, 3};
int sd[] = {0, 1, 1, 0, 2, 2, 2, 2};

long long Bruno(int n, int A[])
{
    vector <int> V;
    for(int i = 0; i < n; i += 3)
    {
        int tmp = A[i] * 4 + A[i + 1] * 2 + A[i + 2];
        for(int j = 0; j < sd[tmp]; j++)
        {
            V.push_back((num[tmp] >> j) & 1);
        }    
    }
    long long ans = 0, bit = 1;
    for(int i = 0; i < 60; i++)
    {
        ans += bit * V[i];
        bit *= 2;
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Partially correct 43 ms 2192 KB Output isn't correct - L* = 0
2 Runtime error 40 ms 2360 KB Execution killed with signal 11
3 Runtime error 28 ms 2356 KB Execution killed with signal 11
4 Runtime error 40 ms 2396 KB Execution killed with signal 11
5 Runtime error 44 ms 2288 KB Execution killed with signal 11
6 Runtime error 30 ms 2332 KB Execution killed with signal 11
7 Runtime error 26 ms 2420 KB Execution killed with signal 11
8 Runtime error 39 ms 2308 KB Execution killed with signal 11
9 Runtime error 34 ms 2332 KB Execution killed with signal 11
10 Runtime error 28 ms 2360 KB Execution killed with signal 11
11 Partially correct 41 ms 2224 KB Output isn't correct - L* = 0
12 Runtime error 38 ms 2360 KB Execution killed with signal 11
13 Partially correct 47 ms 2352 KB Output isn't correct - L* = 0
14 Runtime error 32 ms 2340 KB Execution killed with signal 11
15 Runtime error 30 ms 2336 KB Execution killed with signal 11
16 Partially correct 47 ms 2336 KB Output isn't correct - L* = 0
17 Runtime error 32 ms 2448 KB Execution killed with signal 11
18 Runtime error 29 ms 2424 KB Execution killed with signal 11
19 Runtime error 27 ms 2404 KB Execution killed with signal 11
20 Runtime error 27 ms 2324 KB Execution killed with signal 11
21 Runtime error 35 ms 2416 KB Execution killed with signal 11
22 Runtime error 28 ms 2296 KB Execution killed with signal 11
23 Runtime error 36 ms 2324 KB Execution killed with signal 11
24 Partially correct 47 ms 2308 KB Output isn't correct - L* = 0
25 Runtime error 35 ms 2372 KB Execution killed with signal 11
26 Runtime error 29 ms 2332 KB Execution killed with signal 11
27 Runtime error 29 ms 2380 KB Execution killed with signal 11
28 Runtime error 32 ms 2320 KB Execution killed with signal 11
29 Runtime error 27 ms 2464 KB Execution killed with signal 11
30 Runtime error 28 ms 2520 KB Execution killed with signal 11
31 Partially correct 52 ms 2320 KB Output isn't correct - L* = 0
32 Runtime error 26 ms 2300 KB Execution killed with signal 11
33 Partially correct 41 ms 2276 KB Output isn't correct - L* = 0
34 Runtime error 29 ms 2396 KB Execution killed with signal 11
35 Runtime error 34 ms 2352 KB Execution killed with signal 11
36 Runtime error 37 ms 2432 KB Execution killed with signal 11
37 Runtime error 32 ms 2332 KB Execution killed with signal 11
38 Partially correct 60 ms 2256 KB Output isn't correct - L* = 0
39 Partially correct 41 ms 2264 KB Output isn't correct - L* = 0
40 Runtime error 34 ms 2324 KB Execution killed with signal 11