Submission #100066

# Submission time Handle Problem Language Result Execution time Memory
100066 2019-03-09T07:59:27 Z shenxy Broken Device (JOI17_broken_device) C++11
0 / 100
76 ms 3328 KB
#include "Annalib.h"
#include <algorithm>
#include <deque>
#include <unordered_set>
using namespace std;
void Anna(int N, long long X, int K, int P[]) {
    deque<int> mybitset;
    int ptr = 0;
    unordered_set<int> brokenbits;
    for (int i = 0; i < K; i++) brokenbits.insert(P[i]);
    while (X) {
        if (brokenbits.find(ptr) != brokenbits.end() || brokenbits.find(ptr + 1) != brokenbits.end()) {
            mybitset.push_back(0);
            mybitset.push_back(0);
        } else {
            if (X % 2) {
                mybitset.push_back(1);
                mybitset.push_back(0);
            } else {
                mybitset.push_back(1);
                mybitset.push_back(1);
            }
        }
        ptr += 2;
        X = X >> 1;
    }
    for (int i = 0; i < N; i++) {
        if (i < mybitset.size()) Set(i, mybitset[i]);
        else Set(i, 0);
    }
}
#include "Brunolib.h"
#include <algorithm>
using namespace std;
long long Bruno(int N, int A[]) {
    int ptr = N - 2;
    long long int ans = 0;
    while (ptr >= 0) {
        int a = A[ptr], b = A[ptr + 1];
        if (a == 0 && b == 0);
        else if (a == 1 && b == 1) ans *= 2;
        else ans = ans * 2 + 1;
        ptr -= 2;
    }
    return ans;
}

Compilation message

Anna.cpp: In function 'void Anna(int, long long int, int, int*)':
Anna.cpp:28:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         if (i < mybitset.size()) Set(i, mybitset[i]);
             ~~^~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 55 ms 2840 KB Output isn't correct - L* = 0
2 Incorrect 52 ms 2816 KB Output isn't correct - L* = 0
3 Incorrect 48 ms 2920 KB Output isn't correct - L* = 0
4 Incorrect 64 ms 3056 KB Output isn't correct - L* = 0
5 Incorrect 53 ms 2824 KB Output isn't correct - L* = 0
6 Incorrect 41 ms 3120 KB Output isn't correct - L* = 0
7 Incorrect 60 ms 2960 KB Output isn't correct - L* = 0
8 Incorrect 60 ms 2856 KB Output isn't correct - L* = 0
9 Incorrect 49 ms 3056 KB Output isn't correct - L* = 0
10 Incorrect 57 ms 2800 KB Output isn't correct - L* = 0
11 Incorrect 56 ms 2816 KB Output isn't correct - L* = 0
12 Incorrect 57 ms 2896 KB Output isn't correct - L* = 0
13 Incorrect 57 ms 3056 KB Output isn't correct - L* = 0
14 Incorrect 62 ms 3056 KB Output isn't correct - L* = 0
15 Incorrect 50 ms 2800 KB Output isn't correct - L* = 0
16 Incorrect 46 ms 3072 KB Output isn't correct - L* = 0
17 Incorrect 44 ms 3056 KB Output isn't correct - L* = 0
18 Incorrect 76 ms 2800 KB Output isn't correct - L* = 0
19 Incorrect 50 ms 3056 KB Output isn't correct - L* = 0
20 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
21 Incorrect 53 ms 2816 KB Output isn't correct - L* = 0
22 Incorrect 45 ms 3328 KB Output isn't correct - L* = 0
23 Incorrect 57 ms 2800 KB Output isn't correct - L* = 0
24 Incorrect 49 ms 3056 KB Output isn't correct - L* = 0
25 Incorrect 51 ms 3056 KB Output isn't correct - L* = 0
26 Incorrect 68 ms 3056 KB Output isn't correct - L* = 0
27 Incorrect 61 ms 2800 KB Output isn't correct - L* = 0
28 Incorrect 55 ms 2800 KB Output isn't correct - L* = 0
29 Incorrect 54 ms 2848 KB Output isn't correct - L* = 0
30 Incorrect 50 ms 3072 KB Output isn't correct - L* = 0
31 Incorrect 55 ms 2800 KB Output isn't correct - L* = 0
32 Incorrect 48 ms 3056 KB Output isn't correct - L* = 0
33 Incorrect 55 ms 3056 KB Output isn't correct - L* = 0
34 Incorrect 69 ms 2800 KB Output isn't correct - L* = 0
35 Incorrect 59 ms 2800 KB Output isn't correct - L* = 0
36 Incorrect 51 ms 2800 KB Output isn't correct - L* = 0
37 Incorrect 76 ms 3056 KB Output isn't correct - L* = 0
38 Incorrect 63 ms 3056 KB Output isn't correct - L* = 0
39 Incorrect 57 ms 3056 KB Output isn't correct - L* = 0
40 Incorrect 49 ms 3144 KB Output isn't correct - L* = 0