Submission #1034993

# Submission time Handle Problem Language Result Execution time Memory
1034993 2024-07-26T02:18:07 Z adaawf Broken Device (JOI17_broken_device) C++17
0 / 100
26 ms 3008 KB
#include "Annalib.h"
#include <bits/stdc++.h>
using namespace std;
int dd[1005];
void Anna(int N, long long int X, int K, int P[]) {
    for (int i = 0; i < N; i++) dd[i] = 0;
    for (int i = 0; i < K; i++) {
        dd[P[i]] = 1;
    }
    vector<int> v;
    int z = 0, t = 0;
    string s = "";
    for (int i = 0; i < 60; i++) {
        if (X & (1ll << i)) {
            s += '1';
        }
        else s += '0';
        Set(i, s[i] - '0');
    }
    z = s.size() - 1;
    while (z >= t) {
        if (s[t] == '0' || dd[t] == 1) {
            if (s[t] == '0') {
                z++;
                s += '1';
                Set(z, 1);
            }
            else {
                z++;
                s += '0';
                Set(z, 0);
            }
        }
        if (z == N - 1) break;
        t++;
    }
    for (int i = s.size(); i < N; i++) Set(i, 0);
}
#include "Brunolib.h"
#include <bits/stdc++.h>
using namespace std;
long long int Bruno(int N, int A[]) {
    int z = 0, flag = 0;
    vector<int> v, res(61, 0);
    while (!v.empty()) {
        vector<int> vv;
        for (int i = z; i < z + v.size(); i++) {
            if (i == N) {
                flag = 1;
                break;
            }
            if (A[i] == 0) {
                res[v[i - z]] ^= 1;
                vv.push_back(v[i - z]);
            }
        }
        if (flag == 1) break;
        z += v.size();
        v = vv;
    }
    long long int c = 0;
    for (int i = 0; i < 60; i++) {
        if (res[i] == 1) {
            c += (1ll << i);
        }
    }
    return c;
}

Compilation message

Bruno.cpp: In function 'long long int Bruno(int, int*)':
Bruno.cpp:9:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |         for (int i = z; i < z + v.size(); i++) {
      |                         ~~^~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
2 Partially correct 20 ms 2768 KB Output isn't correct - L* = 0
3 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
4 Partially correct 20 ms 2828 KB Output isn't correct - L* = 0
5 Partially correct 22 ms 2760 KB Output isn't correct - L* = 0
6 Partially correct 22 ms 2764 KB Output isn't correct - L* = 0
7 Partially correct 20 ms 2760 KB Output isn't correct - L* = 0
8 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
9 Partially correct 20 ms 2740 KB Output isn't correct - L* = 0
10 Partially correct 20 ms 2840 KB Output isn't correct - L* = 0
11 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
12 Partially correct 23 ms 2756 KB Output isn't correct - L* = 0
13 Partially correct 20 ms 2760 KB Output isn't correct - L* = 0
14 Partially correct 20 ms 2904 KB Output isn't correct - L* = 0
15 Partially correct 23 ms 2756 KB Output isn't correct - L* = 0
16 Partially correct 20 ms 2760 KB Output isn't correct - L* = 0
17 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
18 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
19 Partially correct 22 ms 2760 KB Output isn't correct - L* = 0
20 Partially correct 20 ms 2768 KB Output isn't correct - L* = 0
21 Partially correct 26 ms 2756 KB Output isn't correct - L* = 0
22 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
23 Partially correct 20 ms 3008 KB Output isn't correct - L* = 0
24 Partially correct 23 ms 2728 KB Output isn't correct - L* = 0
25 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
26 Partially correct 20 ms 2764 KB Output isn't correct - L* = 0
27 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
28 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
29 Partially correct 20 ms 2760 KB Output isn't correct - L* = 0
30 Partially correct 20 ms 2760 KB Output isn't correct - L* = 0
31 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
32 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
33 Partially correct 22 ms 2840 KB Output isn't correct - L* = 0
34 Partially correct 20 ms 2756 KB Output isn't correct - L* = 0
35 Partially correct 20 ms 2828 KB Output isn't correct - L* = 0
36 Partially correct 20 ms 2760 KB Output isn't correct - L* = 0
37 Partially correct 22 ms 2760 KB Output isn't correct - L* = 0
38 Partially correct 20 ms 2724 KB Output isn't correct - L* = 0
39 Partially correct 20 ms 2848 KB Output isn't correct - L* = 0
40 Partially correct 20 ms 2760 KB Output isn't correct - L* = 0