Submission #530488

# Submission time Handle Problem Language Result Execution time Memory
530488 2022-02-25T14:23:24 Z byunjaewoo Broken Device (JOI17_broken_device) C++17
51 / 100
38 ms 2424 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;

bool chk[155];

void Anna( int N, long long X, int K, int P[] ){
    fill(chk, chk+151, 0);
    for(int i=0; i<K; i++) chk[P[i]]=true;
    vector<int> V;
    while(X) {
        V.push_back(X%2);
        X/=2;
    }
    if(V.size()%2) V.push_back(0);
    for(int i=0, p=0; i<150; i+=3) {
        if(chk[i] || chk[i+1] || chk[i+2] || p>=V.size()) {
            Set(i, 0); Set(i+1, 0); Set(i+2, 0); continue;
        }
        int a, b, c;
        if(V[p]) a=1, b=0;
        else a=1, b=1;
        if(V[p+1]) c=!b;
        else c=b;
        Set(i, a); Set(i+1, b); Set(i+2, c);
        p+=2;
    }
}
#include <bits/stdc++.h>
using namespace std;
#include "Brunolib.h"

long long Bruno( int N, int A[] ){
    long long x=0;
    for(int i=N-1; i>=0; i-=3) {
        if(!A[i] && !A[i-1] && !A[i-2]) continue;
        x*=2; x+=(A[i]^A[i-1]);
        x*=2; x+=(A[i-1]^A[i-2]);
    }
    return x;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:17:47: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |         if(chk[i] || chk[i+1] || chk[i+2] || p>=V.size()) {
      |                                              ~^~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Partially correct 38 ms 2172 KB Output is partially correct - L* = 20
2 Partially correct 30 ms 2204 KB Output is partially correct - L* = 20
3 Partially correct 28 ms 2304 KB Output is partially correct - L* = 20
4 Partially correct 27 ms 2276 KB Output is partially correct - L* = 20
5 Partially correct 27 ms 2300 KB Output is partially correct - L* = 20
6 Partially correct 27 ms 2224 KB Output is partially correct - L* = 20
7 Partially correct 27 ms 2256 KB Output is partially correct - L* = 20
8 Partially correct 27 ms 2224 KB Output is partially correct - L* = 20
9 Partially correct 27 ms 2280 KB Output is partially correct - L* = 20
10 Partially correct 27 ms 2224 KB Output is partially correct - L* = 21
11 Partially correct 27 ms 2220 KB Output is partially correct - L* = 20
12 Partially correct 27 ms 2224 KB Output is partially correct - L* = 21
13 Partially correct 27 ms 2324 KB Output is partially correct - L* = 20
14 Partially correct 27 ms 2304 KB Output is partially correct - L* = 20
15 Partially correct 36 ms 2192 KB Output is partially correct - L* = 20
16 Partially correct 27 ms 2236 KB Output is partially correct - L* = 21
17 Partially correct 27 ms 2204 KB Output is partially correct - L* = 20
18 Partially correct 30 ms 2224 KB Output is partially correct - L* = 20
19 Partially correct 30 ms 2300 KB Output is partially correct - L* = 20
20 Partially correct 27 ms 2312 KB Output is partially correct - L* = 20
21 Partially correct 29 ms 2268 KB Output is partially correct - L* = 20
22 Partially correct 35 ms 2268 KB Output is partially correct - L* = 20
23 Partially correct 33 ms 2160 KB Output is partially correct - L* = 20
24 Partially correct 28 ms 2392 KB Output is partially correct - L* = 21
25 Partially correct 28 ms 2404 KB Output is partially correct - L* = 21
26 Partially correct 27 ms 2300 KB Output is partially correct - L* = 20
27 Partially correct 28 ms 2332 KB Output is partially correct - L* = 20
28 Partially correct 30 ms 2208 KB Output is partially correct - L* = 20
29 Partially correct 27 ms 2408 KB Output is partially correct - L* = 20
30 Partially correct 27 ms 2284 KB Output is partially correct - L* = 20
31 Partially correct 27 ms 2308 KB Output is partially correct - L* = 20
32 Partially correct 27 ms 2224 KB Output is partially correct - L* = 20
33 Partially correct 28 ms 2220 KB Output is partially correct - L* = 20
34 Partially correct 30 ms 2208 KB Output is partially correct - L* = 20
35 Partially correct 28 ms 2372 KB Output is partially correct - L* = 20
36 Partially correct 27 ms 2372 KB Output is partially correct - L* = 20
37 Partially correct 27 ms 2228 KB Output is partially correct - L* = 20
38 Partially correct 28 ms 2356 KB Output is partially correct - L* = 20
39 Partially correct 28 ms 2424 KB Output is partially correct - L* = 21
40 Partially correct 27 ms 2208 KB Output is partially correct - L* = 21