Submission #100075

# Submission time Handle Problem Language Result Execution time Memory
100075 2019-03-09T08:13:27 Z shenxy Broken Device (JOI17_broken_device) C++11
41 / 100
81 ms 3072 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);
          	ptr += 2;
          	continue;
        } 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) ans = ans;
        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:30: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 Partially correct 55 ms 2800 KB Output is partially correct - L* = 15
2 Partially correct 55 ms 2800 KB Output is partially correct - L* = 15
3 Partially correct 53 ms 3056 KB Output is partially correct - L* = 16
4 Partially correct 48 ms 3056 KB Output is partially correct - L* = 15
5 Partially correct 48 ms 3056 KB Output is partially correct - L* = 15
6 Partially correct 48 ms 3072 KB Output is partially correct - L* = 15
7 Partially correct 48 ms 3056 KB Output is partially correct - L* = 15
8 Partially correct 49 ms 2808 KB Output is partially correct - L* = 15
9 Partially correct 45 ms 3072 KB Output is partially correct - L* = 16
10 Partially correct 48 ms 3056 KB Output is partially correct - L* = 16
11 Partially correct 56 ms 3056 KB Output is partially correct - L* = 15
12 Partially correct 45 ms 2800 KB Output is partially correct - L* = 16
13 Partially correct 53 ms 2800 KB Output is partially correct - L* = 15
14 Partially correct 52 ms 3056 KB Output is partially correct - L* = 15
15 Partially correct 47 ms 2816 KB Output is partially correct - L* = 15
16 Partially correct 55 ms 3056 KB Output is partially correct - L* = 15
17 Partially correct 61 ms 3072 KB Output is partially correct - L* = 15
18 Partially correct 48 ms 3072 KB Output is partially correct - L* = 15
19 Partially correct 51 ms 3056 KB Output is partially correct - L* = 16
20 Partially correct 52 ms 3000 KB Output is partially correct - L* = 15
21 Partially correct 56 ms 3056 KB Output is partially correct - L* = 15
22 Partially correct 56 ms 2800 KB Output is partially correct - L* = 15
23 Partially correct 81 ms 2800 KB Output is partially correct - L* = 15
24 Partially correct 55 ms 2800 KB Output is partially correct - L* = 15
25 Partially correct 49 ms 2992 KB Output is partially correct - L* = 15
26 Partially correct 50 ms 3056 KB Output is partially correct - L* = 15
27 Partially correct 51 ms 3056 KB Output is partially correct - L* = 15
28 Partially correct 48 ms 3056 KB Output is partially correct - L* = 15
29 Partially correct 51 ms 2800 KB Output is partially correct - L* = 15
30 Partially correct 54 ms 2960 KB Output is partially correct - L* = 15
31 Partially correct 77 ms 3000 KB Output is partially correct - L* = 15
32 Partially correct 64 ms 3056 KB Output is partially correct - L* = 16
33 Partially correct 66 ms 3056 KB Output is partially correct - L* = 15
34 Partially correct 55 ms 2800 KB Output is partially correct - L* = 15
35 Partially correct 51 ms 3072 KB Output is partially correct - L* = 15
36 Partially correct 51 ms 3056 KB Output is partially correct - L* = 15
37 Partially correct 50 ms 3056 KB Output is partially correct - L* = 16
38 Partially correct 46 ms 2832 KB Output is partially correct - L* = 15
39 Partially correct 41 ms 3064 KB Output is partially correct - L* = 15
40 Partially correct 41 ms 3000 KB Output is partially correct - L* = 15