답안 #1114058

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

using namespace std;

int lg = 60, k = 20;

int Declare() {
    return lg * (k + 1);
}

pair<vector<int>, vector<int>> Anna(long long x) {
    vector<int> a, b;
    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;

int tk = 20;

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 + tk; j++) {
            fg |= u[j];
        }
        if(fg) {
            ans |= (1ll << b);
            int cnt = 0, j = i;
            while(cnt < tk) {
                j++;
                cnt += u[j];
            }
            i = j;
        }
        b++;
    }
    return ans;
}

Compilation message

Bruno.cpp: In function 'long long int Bruno(std::vector<int>)':
Bruno.cpp:10:9: warning: unused variable 'n' [-Wunused-variable]
   10 |     int n = (int) u.size();
      |         ^
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 772 KB Output is correct
2 Correct 315 ms 20848 KB Output is correct
3 Correct 310 ms 20828 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 772 KB Output is correct
2 Correct 315 ms 20848 KB Output is correct
3 Correct 310 ms 20828 KB Output is correct
4 Correct 347 ms 20904 KB Output is correct
5 Correct 329 ms 20764 KB Output is correct
6 Correct 341 ms 20964 KB Output is correct
7 Correct 356 ms 20960 KB Output is correct
8 Correct 306 ms 20872 KB Output is correct
9 Correct 323 ms 20868 KB Output is correct
10 Correct 308 ms 21052 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 772 KB Output is correct
2 Correct 315 ms 20848 KB Output is correct
3 Correct 310 ms 20828 KB Output is correct
4 Correct 347 ms 20904 KB Output is correct
5 Correct 329 ms 20764 KB Output is correct
6 Correct 341 ms 20964 KB Output is correct
7 Correct 356 ms 20960 KB Output is correct
8 Correct 306 ms 20872 KB Output is correct
9 Correct 323 ms 20868 KB Output is correct
10 Correct 308 ms 21052 KB Output is correct
11 Correct 307 ms 20724 KB Output is correct
12 Correct 311 ms 20812 KB Output is correct
13 Correct 290 ms 20772 KB Output is correct
14 Correct 291 ms 20872 KB Output is correct
15 Correct 306 ms 20960 KB Output is correct
16 Correct 316 ms 20876 KB Output is correct
17 Correct 301 ms 20860 KB Output is correct
18 Correct 330 ms 20848 KB Output is correct
19 Correct 333 ms 20780 KB Output is correct
20 Correct 322 ms 20972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 772 KB Output is correct
2 Correct 315 ms 20848 KB Output is correct
3 Correct 310 ms 20828 KB Output is correct
4 Correct 347 ms 20904 KB Output is correct
5 Correct 329 ms 20764 KB Output is correct
6 Correct 341 ms 20964 KB Output is correct
7 Correct 356 ms 20960 KB Output is correct
8 Correct 306 ms 20872 KB Output is correct
9 Correct 323 ms 20868 KB Output is correct
10 Correct 308 ms 21052 KB Output is correct
11 Correct 307 ms 20724 KB Output is correct
12 Correct 311 ms 20812 KB Output is correct
13 Correct 290 ms 20772 KB Output is correct
14 Correct 291 ms 20872 KB Output is correct
15 Correct 306 ms 20960 KB Output is correct
16 Correct 316 ms 20876 KB Output is correct
17 Correct 301 ms 20860 KB Output is correct
18 Correct 330 ms 20848 KB Output is correct
19 Correct 333 ms 20780 KB Output is correct
20 Correct 322 ms 20972 KB Output is correct
21 Correct 345 ms 20956 KB Output is correct
22 Correct 314 ms 20956 KB Output is correct
23 Correct 346 ms 20960 KB Output is correct
24 Correct 317 ms 20844 KB Output is correct
25 Correct 310 ms 20964 KB Output is correct
26 Correct 296 ms 20860 KB Output is correct
27 Correct 283 ms 20964 KB Output is correct
28 Correct 294 ms 20968 KB Output is correct
29 Correct 299 ms 20996 KB Output is correct
30 Correct 311 ms 20716 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 772 KB Output is correct
2 Correct 315 ms 20848 KB Output is correct
3 Correct 310 ms 20828 KB Output is correct
4 Correct 347 ms 20904 KB Output is correct
5 Correct 329 ms 20764 KB Output is correct
6 Correct 341 ms 20964 KB Output is correct
7 Correct 356 ms 20960 KB Output is correct
8 Correct 306 ms 20872 KB Output is correct
9 Correct 323 ms 20868 KB Output is correct
10 Correct 308 ms 21052 KB Output is correct
11 Correct 307 ms 20724 KB Output is correct
12 Correct 311 ms 20812 KB Output is correct
13 Correct 290 ms 20772 KB Output is correct
14 Correct 291 ms 20872 KB Output is correct
15 Correct 306 ms 20960 KB Output is correct
16 Correct 316 ms 20876 KB Output is correct
17 Correct 301 ms 20860 KB Output is correct
18 Correct 330 ms 20848 KB Output is correct
19 Correct 333 ms 20780 KB Output is correct
20 Correct 322 ms 20972 KB Output is correct
21 Correct 345 ms 20956 KB Output is correct
22 Correct 314 ms 20956 KB Output is correct
23 Correct 346 ms 20960 KB Output is correct
24 Correct 317 ms 20844 KB Output is correct
25 Correct 310 ms 20964 KB Output is correct
26 Correct 296 ms 20860 KB Output is correct
27 Correct 283 ms 20964 KB Output is correct
28 Correct 294 ms 20968 KB Output is correct
29 Correct 299 ms 20996 KB Output is correct
30 Correct 311 ms 20716 KB Output is correct
31 Correct 301 ms 20888 KB Output is correct
32 Correct 295 ms 20784 KB Output is correct
33 Correct 306 ms 20844 KB Output is correct
34 Correct 324 ms 20852 KB Output is correct
35 Correct 322 ms 20956 KB Output is correct
36 Correct 334 ms 20880 KB Output is correct
37 Correct 308 ms 20636 KB Output is correct
38 Correct 336 ms 20920 KB Output is correct
39 Correct 315 ms 20964 KB Output is correct
40 Correct 328 ms 20848 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 331 ms 20960 KB Output is partially correct
2 Partially correct 326 ms 20968 KB Output is partially correct
3 Partially correct 346 ms 20960 KB Output is partially correct
4 Partially correct 350 ms 20968 KB Output is partially correct
5 Partially correct 303 ms 20956 KB Output is partially correct
6 Partially correct 319 ms 20956 KB Output is partially correct
7 Partially correct 303 ms 20876 KB Output is partially correct
8 Partially correct 303 ms 20956 KB Output is partially correct
9 Partially correct 311 ms 20844 KB Output is partially correct
10 Partially correct 299 ms 20844 KB Output is partially correct
11 Partially correct 302 ms 20960 KB Output is partially correct
12 Partially correct 312 ms 20980 KB Output is partially correct
13 Partially correct 329 ms 20672 KB Output is partially correct
14 Partially correct 297 ms 20960 KB Output is partially correct
15 Partially correct 317 ms 20828 KB Output is partially correct
16 Partially correct 323 ms 20876 KB Output is partially correct
17 Partially correct 323 ms 20676 KB Output is partially correct
18 Partially correct 323 ms 20952 KB Output is partially correct
19 Incorrect 349 ms 20940 KB Output isn't correct
20 Halted 0 ms 0 KB -