Submission #942389

# Submission time Handle Problem Language Result Execution time Memory
942389 2024-03-10T14:50:44 Z Pannda Broken Device 2 (JOI22_device2) C++17
80 / 100
65 ms 3372 KB
#include "Anna.h"

#include <bits/stdc++.h>
using namespace std;

int Declare() {
    return 180;
}

pair<vector<int>, vector<int> > Anna(long long x) {
    vector<int> a, b;

    int alt = 1;
    int last = 1;
    for (int i = 0; i < 60; i++) {
        int c = x >> i & 1;
        int num = c == last ? 2 : 3;
        last = c;
        while (num--) {
            a.push_back(c);
            b.push_back(alt);
            alt ^= 1;
        }
    }

    return make_pair(a, b);
}
#include "Bruno.h"

#include <bits/stdc++.h>
using namespace std;

long long Bruno(vector<int> u) {
    long long x = 0;
    int sum = 0;
    int mag = 0;
    for (int b : u) {
        sum += b == 0 ? -1 : +1;
        if (sum == -2) {
            x += 0LL << mag;
            mag++;
            sum = 0;
        }
        if (sum == +2) {
            x += 1LL << mag;
            mag++;
            sum = 0;
        }
    }
    return x;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 792 KB Output is correct
2 Correct 47 ms 2832 KB Output is correct
3 Correct 49 ms 2816 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 792 KB Output is correct
2 Correct 47 ms 2832 KB Output is correct
3 Correct 49 ms 2816 KB Output is correct
4 Correct 52 ms 2768 KB Output is correct
5 Correct 61 ms 3008 KB Output is correct
6 Correct 54 ms 2912 KB Output is correct
7 Correct 62 ms 3120 KB Output is correct
8 Correct 55 ms 2856 KB Output is correct
9 Correct 50 ms 2684 KB Output is correct
10 Correct 49 ms 2716 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 792 KB Output is correct
2 Correct 47 ms 2832 KB Output is correct
3 Correct 49 ms 2816 KB Output is correct
4 Correct 52 ms 2768 KB Output is correct
5 Correct 61 ms 3008 KB Output is correct
6 Correct 54 ms 2912 KB Output is correct
7 Correct 62 ms 3120 KB Output is correct
8 Correct 55 ms 2856 KB Output is correct
9 Correct 50 ms 2684 KB Output is correct
10 Correct 49 ms 2716 KB Output is correct
11 Correct 52 ms 2768 KB Output is correct
12 Correct 57 ms 2804 KB Output is correct
13 Correct 52 ms 2956 KB Output is correct
14 Correct 52 ms 2832 KB Output is correct
15 Correct 51 ms 2840 KB Output is correct
16 Correct 51 ms 2880 KB Output is correct
17 Correct 53 ms 2844 KB Output is correct
18 Correct 52 ms 2840 KB Output is correct
19 Correct 51 ms 2832 KB Output is correct
20 Correct 55 ms 2840 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 792 KB Output is correct
2 Correct 47 ms 2832 KB Output is correct
3 Correct 49 ms 2816 KB Output is correct
4 Correct 52 ms 2768 KB Output is correct
5 Correct 61 ms 3008 KB Output is correct
6 Correct 54 ms 2912 KB Output is correct
7 Correct 62 ms 3120 KB Output is correct
8 Correct 55 ms 2856 KB Output is correct
9 Correct 50 ms 2684 KB Output is correct
10 Correct 49 ms 2716 KB Output is correct
11 Correct 52 ms 2768 KB Output is correct
12 Correct 57 ms 2804 KB Output is correct
13 Correct 52 ms 2956 KB Output is correct
14 Correct 52 ms 2832 KB Output is correct
15 Correct 51 ms 2840 KB Output is correct
16 Correct 51 ms 2880 KB Output is correct
17 Correct 53 ms 2844 KB Output is correct
18 Correct 52 ms 2840 KB Output is correct
19 Correct 51 ms 2832 KB Output is correct
20 Correct 55 ms 2840 KB Output is correct
21 Correct 52 ms 2872 KB Output is correct
22 Correct 55 ms 2920 KB Output is correct
23 Correct 53 ms 2984 KB Output is correct
24 Correct 53 ms 2796 KB Output is correct
25 Correct 53 ms 2868 KB Output is correct
26 Correct 51 ms 2788 KB Output is correct
27 Correct 52 ms 2772 KB Output is correct
28 Correct 52 ms 2824 KB Output is correct
29 Correct 53 ms 3336 KB Output is correct
30 Correct 52 ms 2876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 792 KB Output is correct
2 Correct 47 ms 2832 KB Output is correct
3 Correct 49 ms 2816 KB Output is correct
4 Correct 52 ms 2768 KB Output is correct
5 Correct 61 ms 3008 KB Output is correct
6 Correct 54 ms 2912 KB Output is correct
7 Correct 62 ms 3120 KB Output is correct
8 Correct 55 ms 2856 KB Output is correct
9 Correct 50 ms 2684 KB Output is correct
10 Correct 49 ms 2716 KB Output is correct
11 Correct 52 ms 2768 KB Output is correct
12 Correct 57 ms 2804 KB Output is correct
13 Correct 52 ms 2956 KB Output is correct
14 Correct 52 ms 2832 KB Output is correct
15 Correct 51 ms 2840 KB Output is correct
16 Correct 51 ms 2880 KB Output is correct
17 Correct 53 ms 2844 KB Output is correct
18 Correct 52 ms 2840 KB Output is correct
19 Correct 51 ms 2832 KB Output is correct
20 Correct 55 ms 2840 KB Output is correct
21 Correct 52 ms 2872 KB Output is correct
22 Correct 55 ms 2920 KB Output is correct
23 Correct 53 ms 2984 KB Output is correct
24 Correct 53 ms 2796 KB Output is correct
25 Correct 53 ms 2868 KB Output is correct
26 Correct 51 ms 2788 KB Output is correct
27 Correct 52 ms 2772 KB Output is correct
28 Correct 52 ms 2824 KB Output is correct
29 Correct 53 ms 3336 KB Output is correct
30 Correct 52 ms 2876 KB Output is correct
31 Correct 55 ms 3120 KB Output is correct
32 Correct 55 ms 2900 KB Output is correct
33 Correct 54 ms 2976 KB Output is correct
34 Correct 65 ms 3028 KB Output is correct
35 Correct 55 ms 2980 KB Output is correct
36 Correct 53 ms 3044 KB Output is correct
37 Correct 49 ms 2788 KB Output is correct
38 Correct 53 ms 3036 KB Output is correct
39 Correct 57 ms 2996 KB Output is correct
40 Correct 53 ms 2932 KB Output is correct
# Verdict Execution time Memory Grader output
1 Partially correct 59 ms 3192 KB Output is partially correct
2 Partially correct 59 ms 3108 KB Output is partially correct
3 Partially correct 62 ms 3188 KB Output is partially correct
4 Partially correct 59 ms 3120 KB Output is partially correct
5 Partially correct 63 ms 3188 KB Output is partially correct
6 Partially correct 60 ms 3216 KB Output is partially correct
7 Partially correct 59 ms 3372 KB Output is partially correct
8 Partially correct 60 ms 3092 KB Output is partially correct
9 Partially correct 59 ms 3172 KB Output is partially correct
10 Partially correct 59 ms 3176 KB Output is partially correct
11 Partially correct 61 ms 3120 KB Output is partially correct
12 Partially correct 63 ms 3104 KB Output is partially correct
13 Partially correct 56 ms 3296 KB Output is partially correct
14 Partially correct 56 ms 3080 KB Output is partially correct
15 Partially correct 57 ms 3140 KB Output is partially correct
16 Partially correct 62 ms 3080 KB Output is partially correct
17 Partially correct 63 ms 3144 KB Output is partially correct
18 Partially correct 57 ms 3104 KB Output is partially correct
19 Partially correct 57 ms 3164 KB Output is partially correct
20 Partially correct 57 ms 3348 KB Output is partially correct