답안 #1114052

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1114052 2024-11-18T07:11:55 Z Wansur Broken Device 2 (JOI22_device2) C++17
55 / 100
683 ms 32592 KB
#include "Anna.h"
#include <bits/stdc++.h>

using namespace std;

int Declare() {
    return 2000;
}

pair<vector<int>, vector<int>> Anna(long long x) {
    vector<int> a, b;
    int lg = 60, k = 32;
    a.push_back(1);
    for(int i = 0; i < lg; i++) {
        int t = ((x >> i) & 1);
        for(int j = 0; j < k; j++){
            a.push_back(t);
        }
        if(i + 1 < lg) a.push_back(1);
    }
    while(b.size() < a.size()) {
        b.push_back(0);
    }
    return {a, b};
}
#include "Bruno.h"
#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

long long Bruno(vector<int> u) {
    int n = (int) u.size();
    ll ans = 0, b = 0;
    for(int i = 0; i + 1 < (int)u.size(); i++) {
        if(u[i] == 0) {
            continue;
        }
        int fg = 0;
        for(int j = i + 1; j <= i + 32; j++) {
            fg |= u[j];
        }
        if(fg) {
            ans |= (1ll << b);
            int cnt = 0, j = i;
            while(cnt < 32) {
                j++;
                cnt += u[j];
            }
            i = j;
        }
        b++;
    }
    return ans;
}

Compilation message

Bruno.cpp: In function 'long long int Bruno(std::vector<int>)':
Bruno.cpp:8:9: warning: unused variable 'n' [-Wunused-variable]
    8 |     int n = (int) u.size();
      |         ^
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 776 KB Output is correct
2 Correct 458 ms 32220 KB Output is correct
3 Correct 455 ms 32348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 776 KB Output is correct
2 Correct 458 ms 32220 KB Output is correct
3 Correct 455 ms 32348 KB Output is correct
4 Correct 447 ms 32136 KB Output is correct
5 Correct 462 ms 32316 KB Output is correct
6 Correct 479 ms 32312 KB Output is correct
7 Correct 494 ms 32264 KB Output is correct
8 Correct 511 ms 32196 KB Output is correct
9 Correct 476 ms 32272 KB Output is correct
10 Correct 472 ms 32196 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 776 KB Output is correct
2 Correct 458 ms 32220 KB Output is correct
3 Correct 455 ms 32348 KB Output is correct
4 Correct 447 ms 32136 KB Output is correct
5 Correct 462 ms 32316 KB Output is correct
6 Correct 479 ms 32312 KB Output is correct
7 Correct 494 ms 32264 KB Output is correct
8 Correct 511 ms 32196 KB Output is correct
9 Correct 476 ms 32272 KB Output is correct
10 Correct 472 ms 32196 KB Output is correct
11 Correct 490 ms 32280 KB Output is correct
12 Correct 482 ms 32128 KB Output is correct
13 Correct 487 ms 32304 KB Output is correct
14 Correct 511 ms 32364 KB Output is correct
15 Correct 448 ms 32196 KB Output is correct
16 Correct 475 ms 32200 KB Output is correct
17 Correct 431 ms 32320 KB Output is correct
18 Correct 460 ms 32256 KB Output is correct
19 Correct 493 ms 32304 KB Output is correct
20 Correct 498 ms 32240 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 776 KB Output is correct
2 Correct 458 ms 32220 KB Output is correct
3 Correct 455 ms 32348 KB Output is correct
4 Correct 447 ms 32136 KB Output is correct
5 Correct 462 ms 32316 KB Output is correct
6 Correct 479 ms 32312 KB Output is correct
7 Correct 494 ms 32264 KB Output is correct
8 Correct 511 ms 32196 KB Output is correct
9 Correct 476 ms 32272 KB Output is correct
10 Correct 472 ms 32196 KB Output is correct
11 Correct 490 ms 32280 KB Output is correct
12 Correct 482 ms 32128 KB Output is correct
13 Correct 487 ms 32304 KB Output is correct
14 Correct 511 ms 32364 KB Output is correct
15 Correct 448 ms 32196 KB Output is correct
16 Correct 475 ms 32200 KB Output is correct
17 Correct 431 ms 32320 KB Output is correct
18 Correct 460 ms 32256 KB Output is correct
19 Correct 493 ms 32304 KB Output is correct
20 Correct 498 ms 32240 KB Output is correct
21 Correct 496 ms 32248 KB Output is correct
22 Correct 481 ms 32232 KB Output is correct
23 Correct 469 ms 32196 KB Output is correct
24 Correct 466 ms 32320 KB Output is correct
25 Correct 490 ms 32488 KB Output is correct
26 Correct 478 ms 32292 KB Output is correct
27 Correct 460 ms 32324 KB Output is correct
28 Correct 481 ms 32300 KB Output is correct
29 Correct 490 ms 32316 KB Output is correct
30 Correct 477 ms 32320 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 776 KB Output is correct
2 Correct 458 ms 32220 KB Output is correct
3 Correct 455 ms 32348 KB Output is correct
4 Correct 447 ms 32136 KB Output is correct
5 Correct 462 ms 32316 KB Output is correct
6 Correct 479 ms 32312 KB Output is correct
7 Correct 494 ms 32264 KB Output is correct
8 Correct 511 ms 32196 KB Output is correct
9 Correct 476 ms 32272 KB Output is correct
10 Correct 472 ms 32196 KB Output is correct
11 Correct 490 ms 32280 KB Output is correct
12 Correct 482 ms 32128 KB Output is correct
13 Correct 487 ms 32304 KB Output is correct
14 Correct 511 ms 32364 KB Output is correct
15 Correct 448 ms 32196 KB Output is correct
16 Correct 475 ms 32200 KB Output is correct
17 Correct 431 ms 32320 KB Output is correct
18 Correct 460 ms 32256 KB Output is correct
19 Correct 493 ms 32304 KB Output is correct
20 Correct 498 ms 32240 KB Output is correct
21 Correct 496 ms 32248 KB Output is correct
22 Correct 481 ms 32232 KB Output is correct
23 Correct 469 ms 32196 KB Output is correct
24 Correct 466 ms 32320 KB Output is correct
25 Correct 490 ms 32488 KB Output is correct
26 Correct 478 ms 32292 KB Output is correct
27 Correct 460 ms 32324 KB Output is correct
28 Correct 481 ms 32300 KB Output is correct
29 Correct 490 ms 32316 KB Output is correct
30 Correct 477 ms 32320 KB Output is correct
31 Correct 488 ms 32320 KB Output is correct
32 Correct 471 ms 32152 KB Output is correct
33 Correct 461 ms 32300 KB Output is correct
34 Correct 455 ms 32200 KB Output is correct
35 Correct 462 ms 32204 KB Output is correct
36 Correct 479 ms 32432 KB Output is correct
37 Correct 505 ms 32420 KB Output is correct
38 Correct 486 ms 32324 KB Output is correct
39 Correct 485 ms 32320 KB Output is correct
40 Correct 497 ms 32324 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 500 ms 32252 KB Output is partially correct
2 Partially correct 524 ms 32288 KB Output is partially correct
3 Partially correct 513 ms 32260 KB Output is partially correct
4 Partially correct 479 ms 32152 KB Output is partially correct
5 Partially correct 469 ms 32332 KB Output is partially correct
6 Partially correct 469 ms 32264 KB Output is partially correct
7 Partially correct 462 ms 32264 KB Output is partially correct
8 Partially correct 464 ms 32312 KB Output is partially correct
9 Partially correct 487 ms 32344 KB Output is partially correct
10 Partially correct 511 ms 32392 KB Output is partially correct
11 Partially correct 480 ms 32240 KB Output is partially correct
12 Partially correct 517 ms 32208 KB Output is partially correct
13 Partially correct 505 ms 32208 KB Output is partially correct
14 Partially correct 464 ms 32344 KB Output is partially correct
15 Partially correct 494 ms 32336 KB Output is partially correct
16 Partially correct 488 ms 32236 KB Output is partially correct
17 Partially correct 484 ms 32232 KB Output is partially correct
18 Partially correct 490 ms 32448 KB Output is partially correct
19 Partially correct 683 ms 32592 KB Output is partially correct
20 Partially correct 493 ms 32352 KB Output is partially correct