답안 #642738

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
642738 2022-09-20T12:30:39 Z qwerasdfzxcl Broken Device 2 (JOI22_device2) C++17
80 / 100
84 ms 3656 KB
#include "Anna.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

namespace {

}

int Declare() {
    return 178;
}

std::pair<std::vector<int>, std::vector<int> > Anna(long long A) {
    vector<int> ret[2];
    for (int i=0;i<60;i++){
        if (A&(1LL<<i)) for (int j=0;j<(i==59?1:3);j++) ret[0].push_back(1);
        else for (int j=0;j<(i==59?1:3);j++) ret[0].push_back(0);
    }

    for (int i=0;i<178;i++) ret[1].push_back(!(i&1));
    return {ret[0], ret[1]};
}
#include "Bruno.h"
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

namespace {

}

long long Bruno(std::vector<int> U) {
    ll ans = 0;
    int i = 0, pt = 0, cur = 0, val = 0;
    for (;i<59;i++){
        while(pt<(int)U.size()){
            cur += U[pt]?1:-1;
            ++pt;
            if (cur==val+3 || cur==val-2) break;
        }

        assert(cur==val+3 || cur==val-2);
        if (cur==val+3) ans |= (1LL<<i), val += 3;
        else val -= 3;
    }

    while(pt<(int)U.size()){
        cur += U[pt]?1:-1;
        ++pt;
    }

    assert(cur==val+1 || cur==val-1);
    if (cur==val+1) ans |= (1LL<<59);

    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 68 ms 3384 KB Output is correct
3 Correct 69 ms 3468 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 68 ms 3384 KB Output is correct
3 Correct 69 ms 3468 KB Output is correct
4 Correct 78 ms 3656 KB Output is correct
5 Correct 73 ms 3336 KB Output is correct
6 Correct 72 ms 3428 KB Output is correct
7 Correct 75 ms 3472 KB Output is correct
8 Correct 72 ms 3416 KB Output is correct
9 Correct 84 ms 3324 KB Output is correct
10 Correct 68 ms 3424 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 68 ms 3384 KB Output is correct
3 Correct 69 ms 3468 KB Output is correct
4 Correct 78 ms 3656 KB Output is correct
5 Correct 73 ms 3336 KB Output is correct
6 Correct 72 ms 3428 KB Output is correct
7 Correct 75 ms 3472 KB Output is correct
8 Correct 72 ms 3416 KB Output is correct
9 Correct 84 ms 3324 KB Output is correct
10 Correct 68 ms 3424 KB Output is correct
11 Correct 73 ms 3432 KB Output is correct
12 Correct 72 ms 3412 KB Output is correct
13 Correct 72 ms 3588 KB Output is correct
14 Correct 71 ms 3376 KB Output is correct
15 Correct 69 ms 3384 KB Output is correct
16 Correct 68 ms 3460 KB Output is correct
17 Correct 68 ms 3472 KB Output is correct
18 Correct 72 ms 3376 KB Output is correct
19 Correct 71 ms 3452 KB Output is correct
20 Correct 69 ms 3452 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 68 ms 3384 KB Output is correct
3 Correct 69 ms 3468 KB Output is correct
4 Correct 78 ms 3656 KB Output is correct
5 Correct 73 ms 3336 KB Output is correct
6 Correct 72 ms 3428 KB Output is correct
7 Correct 75 ms 3472 KB Output is correct
8 Correct 72 ms 3416 KB Output is correct
9 Correct 84 ms 3324 KB Output is correct
10 Correct 68 ms 3424 KB Output is correct
11 Correct 73 ms 3432 KB Output is correct
12 Correct 72 ms 3412 KB Output is correct
13 Correct 72 ms 3588 KB Output is correct
14 Correct 71 ms 3376 KB Output is correct
15 Correct 69 ms 3384 KB Output is correct
16 Correct 68 ms 3460 KB Output is correct
17 Correct 68 ms 3472 KB Output is correct
18 Correct 72 ms 3376 KB Output is correct
19 Correct 71 ms 3452 KB Output is correct
20 Correct 69 ms 3452 KB Output is correct
21 Correct 69 ms 3376 KB Output is correct
22 Correct 72 ms 3432 KB Output is correct
23 Correct 74 ms 3564 KB Output is correct
24 Correct 71 ms 3444 KB Output is correct
25 Correct 73 ms 3444 KB Output is correct
26 Correct 69 ms 3480 KB Output is correct
27 Correct 73 ms 3456 KB Output is correct
28 Correct 71 ms 3336 KB Output is correct
29 Correct 72 ms 3444 KB Output is correct
30 Correct 72 ms 3432 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 512 KB Output is correct
2 Correct 68 ms 3384 KB Output is correct
3 Correct 69 ms 3468 KB Output is correct
4 Correct 78 ms 3656 KB Output is correct
5 Correct 73 ms 3336 KB Output is correct
6 Correct 72 ms 3428 KB Output is correct
7 Correct 75 ms 3472 KB Output is correct
8 Correct 72 ms 3416 KB Output is correct
9 Correct 84 ms 3324 KB Output is correct
10 Correct 68 ms 3424 KB Output is correct
11 Correct 73 ms 3432 KB Output is correct
12 Correct 72 ms 3412 KB Output is correct
13 Correct 72 ms 3588 KB Output is correct
14 Correct 71 ms 3376 KB Output is correct
15 Correct 69 ms 3384 KB Output is correct
16 Correct 68 ms 3460 KB Output is correct
17 Correct 68 ms 3472 KB Output is correct
18 Correct 72 ms 3376 KB Output is correct
19 Correct 71 ms 3452 KB Output is correct
20 Correct 69 ms 3452 KB Output is correct
21 Correct 69 ms 3376 KB Output is correct
22 Correct 72 ms 3432 KB Output is correct
23 Correct 74 ms 3564 KB Output is correct
24 Correct 71 ms 3444 KB Output is correct
25 Correct 73 ms 3444 KB Output is correct
26 Correct 69 ms 3480 KB Output is correct
27 Correct 73 ms 3456 KB Output is correct
28 Correct 71 ms 3336 KB Output is correct
29 Correct 72 ms 3444 KB Output is correct
30 Correct 72 ms 3432 KB Output is correct
31 Correct 72 ms 3336 KB Output is correct
32 Correct 76 ms 3408 KB Output is correct
33 Correct 72 ms 3340 KB Output is correct
34 Correct 72 ms 3428 KB Output is correct
35 Correct 72 ms 3516 KB Output is correct
36 Correct 72 ms 3424 KB Output is correct
37 Correct 73 ms 3400 KB Output is correct
38 Correct 74 ms 3428 KB Output is correct
39 Correct 72 ms 3408 KB Output is correct
40 Correct 73 ms 3500 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 73 ms 3468 KB Output is partially correct
2 Partially correct 81 ms 3348 KB Output is partially correct
3 Partially correct 74 ms 3464 KB Output is partially correct
4 Partially correct 73 ms 3552 KB Output is partially correct
5 Partially correct 71 ms 3440 KB Output is partially correct
6 Partially correct 79 ms 3532 KB Output is partially correct
7 Partially correct 69 ms 3400 KB Output is partially correct
8 Partially correct 73 ms 3468 KB Output is partially correct
9 Partially correct 72 ms 3576 KB Output is partially correct
10 Partially correct 73 ms 3476 KB Output is partially correct
11 Partially correct 74 ms 3612 KB Output is partially correct
12 Partially correct 73 ms 3364 KB Output is partially correct
13 Partially correct 71 ms 3460 KB Output is partially correct
14 Partially correct 71 ms 3408 KB Output is partially correct
15 Partially correct 72 ms 3372 KB Output is partially correct
16 Partially correct 77 ms 3320 KB Output is partially correct
17 Partially correct 74 ms 3460 KB Output is partially correct
18 Partially correct 72 ms 3504 KB Output is partially correct
19 Partially correct 75 ms 3444 KB Output is partially correct
20 Partially correct 74 ms 3420 KB Output is partially correct