답안 #1024070

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1024070 2024-07-15T10:58:56 Z Unforgettablepl Broken Device 2 (JOI22_device2) C++17
80 / 100
66 ms 4116 KB
#include "Anna.h"
#include <bits/stdc++.h>
using namespace std;
 
const int BITS = 60;
const int M = BITS*3 + 1;

namespace {
}
 
int Declare() {return M;}
 
pair<vector<int>, vector<int>> Anna(long long A) {
    vector<int> ans,b(M);
    for(int i=0;i<M;i+=2)b[i]=1;
    if(A&1){
        ans.emplace_back(1);
        ans.emplace_back(1);
    } else {
        ans.emplace_back(0);
        ans.emplace_back(0);
        ans.emplace_back(0);
        ans.emplace_back(0);
    }
    for(int bit=1;bit<BITS;bit++){
        int a = min(A&(1ll<<bit),1ll);
        ans.emplace_back(a);
        ans.emplace_back(a);
        ans.emplace_back(a);
    }
    b.resize(ans.size());
    return {ans,b};
}
#include "Bruno.h"
#include <bits/stdc++.h>
using namespace std;
 
const int BITS = 60;
const int M = BITS*3 + 1;

namespace {
}
 
long long Bruno(vector<int> u) {
    // assert(u.size()==2*M);
    for(int&x:u)if(x==0)x=-1;
    vector<int> ans;
    int sum = 0;
    int lastsum = 0;
    for(int&x:u){
        sum+=x;
        if(((sum%3)+3)%3 == 1)continue;
        if(sum<lastsum-1){
            ans.emplace_back(0);
            lastsum = sum;
        } else if(sum>lastsum+1){
            ans.emplace_back(1);
            lastsum = sum;
        }
    }
    assert(ans.size()==BITS);
    long long res = 0;
    for(int bit=0;bit<BITS;bit++)if(ans[bit])res|=(1ll<<bit);
    return res;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 780 KB Output is correct
2 Correct 46 ms 3540 KB Output is correct
3 Correct 44 ms 3704 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 780 KB Output is correct
2 Correct 46 ms 3540 KB Output is correct
3 Correct 44 ms 3704 KB Output is correct
4 Correct 53 ms 3632 KB Output is correct
5 Correct 51 ms 3648 KB Output is correct
6 Correct 51 ms 3536 KB Output is correct
7 Correct 49 ms 3572 KB Output is correct
8 Correct 48 ms 3572 KB Output is correct
9 Correct 50 ms 3620 KB Output is correct
10 Correct 43 ms 3612 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 780 KB Output is correct
2 Correct 46 ms 3540 KB Output is correct
3 Correct 44 ms 3704 KB Output is correct
4 Correct 53 ms 3632 KB Output is correct
5 Correct 51 ms 3648 KB Output is correct
6 Correct 51 ms 3536 KB Output is correct
7 Correct 49 ms 3572 KB Output is correct
8 Correct 48 ms 3572 KB Output is correct
9 Correct 50 ms 3620 KB Output is correct
10 Correct 43 ms 3612 KB Output is correct
11 Correct 61 ms 3536 KB Output is correct
12 Correct 49 ms 3628 KB Output is correct
13 Correct 48 ms 3636 KB Output is correct
14 Correct 48 ms 3548 KB Output is correct
15 Correct 49 ms 3472 KB Output is correct
16 Correct 44 ms 3640 KB Output is correct
17 Correct 43 ms 3696 KB Output is correct
18 Correct 48 ms 3576 KB Output is correct
19 Correct 49 ms 3812 KB Output is correct
20 Correct 49 ms 3716 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 780 KB Output is correct
2 Correct 46 ms 3540 KB Output is correct
3 Correct 44 ms 3704 KB Output is correct
4 Correct 53 ms 3632 KB Output is correct
5 Correct 51 ms 3648 KB Output is correct
6 Correct 51 ms 3536 KB Output is correct
7 Correct 49 ms 3572 KB Output is correct
8 Correct 48 ms 3572 KB Output is correct
9 Correct 50 ms 3620 KB Output is correct
10 Correct 43 ms 3612 KB Output is correct
11 Correct 61 ms 3536 KB Output is correct
12 Correct 49 ms 3628 KB Output is correct
13 Correct 48 ms 3636 KB Output is correct
14 Correct 48 ms 3548 KB Output is correct
15 Correct 49 ms 3472 KB Output is correct
16 Correct 44 ms 3640 KB Output is correct
17 Correct 43 ms 3696 KB Output is correct
18 Correct 48 ms 3576 KB Output is correct
19 Correct 49 ms 3812 KB Output is correct
20 Correct 49 ms 3716 KB Output is correct
21 Correct 48 ms 3544 KB Output is correct
22 Correct 50 ms 3572 KB Output is correct
23 Correct 49 ms 3644 KB Output is correct
24 Correct 49 ms 3616 KB Output is correct
25 Correct 55 ms 3540 KB Output is correct
26 Correct 50 ms 3512 KB Output is correct
27 Correct 40 ms 3576 KB Output is correct
28 Correct 50 ms 3536 KB Output is correct
29 Correct 49 ms 3548 KB Output is correct
30 Correct 49 ms 3484 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 780 KB Output is correct
2 Correct 46 ms 3540 KB Output is correct
3 Correct 44 ms 3704 KB Output is correct
4 Correct 53 ms 3632 KB Output is correct
5 Correct 51 ms 3648 KB Output is correct
6 Correct 51 ms 3536 KB Output is correct
7 Correct 49 ms 3572 KB Output is correct
8 Correct 48 ms 3572 KB Output is correct
9 Correct 50 ms 3620 KB Output is correct
10 Correct 43 ms 3612 KB Output is correct
11 Correct 61 ms 3536 KB Output is correct
12 Correct 49 ms 3628 KB Output is correct
13 Correct 48 ms 3636 KB Output is correct
14 Correct 48 ms 3548 KB Output is correct
15 Correct 49 ms 3472 KB Output is correct
16 Correct 44 ms 3640 KB Output is correct
17 Correct 43 ms 3696 KB Output is correct
18 Correct 48 ms 3576 KB Output is correct
19 Correct 49 ms 3812 KB Output is correct
20 Correct 49 ms 3716 KB Output is correct
21 Correct 48 ms 3544 KB Output is correct
22 Correct 50 ms 3572 KB Output is correct
23 Correct 49 ms 3644 KB Output is correct
24 Correct 49 ms 3616 KB Output is correct
25 Correct 55 ms 3540 KB Output is correct
26 Correct 50 ms 3512 KB Output is correct
27 Correct 40 ms 3576 KB Output is correct
28 Correct 50 ms 3536 KB Output is correct
29 Correct 49 ms 3548 KB Output is correct
30 Correct 49 ms 3484 KB Output is correct
31 Correct 50 ms 3640 KB Output is correct
32 Correct 49 ms 3508 KB Output is correct
33 Correct 55 ms 3564 KB Output is correct
34 Correct 49 ms 3668 KB Output is correct
35 Correct 49 ms 3544 KB Output is correct
36 Correct 52 ms 3704 KB Output is correct
37 Correct 41 ms 3644 KB Output is correct
38 Correct 48 ms 3656 KB Output is correct
39 Correct 54 ms 3564 KB Output is correct
40 Correct 49 ms 3480 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 51 ms 3588 KB Output is partially correct
2 Partially correct 50 ms 3768 KB Output is partially correct
3 Partially correct 51 ms 3576 KB Output is partially correct
4 Partially correct 52 ms 3872 KB Output is partially correct
5 Partially correct 54 ms 4116 KB Output is partially correct
6 Partially correct 50 ms 3548 KB Output is partially correct
7 Partially correct 52 ms 3596 KB Output is partially correct
8 Partially correct 51 ms 3516 KB Output is partially correct
9 Partially correct 50 ms 3688 KB Output is partially correct
10 Partially correct 53 ms 3620 KB Output is partially correct
11 Partially correct 49 ms 3644 KB Output is partially correct
12 Partially correct 49 ms 3624 KB Output is partially correct
13 Partially correct 46 ms 3580 KB Output is partially correct
14 Partially correct 41 ms 3668 KB Output is partially correct
15 Partially correct 49 ms 3548 KB Output is partially correct
16 Partially correct 66 ms 3744 KB Output is partially correct
17 Partially correct 49 ms 3648 KB Output is partially correct
18 Partially correct 50 ms 3588 KB Output is partially correct
19 Partially correct 49 ms 3580 KB Output is partially correct
20 Partially correct 59 ms 3492 KB Output is partially correct