답안 #1114076

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

using namespace std;

int lg = 60, k = 21;

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 = 21;

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 301 ms 21752 KB Output is correct
3 Correct 321 ms 21880 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 772 KB Output is correct
2 Correct 301 ms 21752 KB Output is correct
3 Correct 321 ms 21880 KB Output is correct
4 Correct 353 ms 21708 KB Output is correct
5 Correct 409 ms 21604 KB Output is correct
6 Correct 331 ms 21600 KB Output is correct
7 Correct 340 ms 21712 KB Output is correct
8 Correct 339 ms 21604 KB Output is correct
9 Correct 361 ms 21604 KB Output is correct
10 Correct 325 ms 21608 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 772 KB Output is correct
2 Correct 301 ms 21752 KB Output is correct
3 Correct 321 ms 21880 KB Output is correct
4 Correct 353 ms 21708 KB Output is correct
5 Correct 409 ms 21604 KB Output is correct
6 Correct 331 ms 21600 KB Output is correct
7 Correct 340 ms 21712 KB Output is correct
8 Correct 339 ms 21604 KB Output is correct
9 Correct 361 ms 21604 KB Output is correct
10 Correct 325 ms 21608 KB Output is correct
11 Correct 351 ms 21788 KB Output is correct
12 Correct 337 ms 21680 KB Output is correct
13 Correct 348 ms 21604 KB Output is correct
14 Correct 375 ms 21632 KB Output is correct
15 Correct 354 ms 21604 KB Output is correct
16 Correct 335 ms 21980 KB Output is correct
17 Correct 350 ms 21604 KB Output is correct
18 Correct 334 ms 21836 KB Output is correct
19 Correct 331 ms 21600 KB Output is correct
20 Incorrect 304 ms 21836 KB Output isn't correct
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 772 KB Output is correct
2 Correct 301 ms 21752 KB Output is correct
3 Correct 321 ms 21880 KB Output is correct
4 Correct 353 ms 21708 KB Output is correct
5 Correct 409 ms 21604 KB Output is correct
6 Correct 331 ms 21600 KB Output is correct
7 Correct 340 ms 21712 KB Output is correct
8 Correct 339 ms 21604 KB Output is correct
9 Correct 361 ms 21604 KB Output is correct
10 Correct 325 ms 21608 KB Output is correct
11 Correct 351 ms 21788 KB Output is correct
12 Correct 337 ms 21680 KB Output is correct
13 Correct 348 ms 21604 KB Output is correct
14 Correct 375 ms 21632 KB Output is correct
15 Correct 354 ms 21604 KB Output is correct
16 Correct 335 ms 21980 KB Output is correct
17 Correct 350 ms 21604 KB Output is correct
18 Correct 334 ms 21836 KB Output is correct
19 Correct 331 ms 21600 KB Output is correct
20 Incorrect 304 ms 21836 KB Output isn't correct
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 772 KB Output is correct
2 Correct 301 ms 21752 KB Output is correct
3 Correct 321 ms 21880 KB Output is correct
4 Correct 353 ms 21708 KB Output is correct
5 Correct 409 ms 21604 KB Output is correct
6 Correct 331 ms 21600 KB Output is correct
7 Correct 340 ms 21712 KB Output is correct
8 Correct 339 ms 21604 KB Output is correct
9 Correct 361 ms 21604 KB Output is correct
10 Correct 325 ms 21608 KB Output is correct
11 Correct 351 ms 21788 KB Output is correct
12 Correct 337 ms 21680 KB Output is correct
13 Correct 348 ms 21604 KB Output is correct
14 Correct 375 ms 21632 KB Output is correct
15 Correct 354 ms 21604 KB Output is correct
16 Correct 335 ms 21980 KB Output is correct
17 Correct 350 ms 21604 KB Output is correct
18 Correct 334 ms 21836 KB Output is correct
19 Correct 331 ms 21600 KB Output is correct
20 Incorrect 304 ms 21836 KB Output isn't correct
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 383 ms 21856 KB Output is partially correct
2 Partially correct 366 ms 21788 KB Output is partially correct
3 Partially correct 360 ms 21604 KB Output is partially correct
4 Partially correct 332 ms 21712 KB Output is partially correct
5 Partially correct 316 ms 21636 KB Output is partially correct
6 Partially correct 316 ms 21716 KB Output is partially correct
7 Partially correct 316 ms 21604 KB Output is partially correct
8 Partially correct 316 ms 21716 KB Output is partially correct
9 Partially correct 337 ms 21724 KB Output is partially correct
10 Partially correct 343 ms 21712 KB Output is partially correct
11 Partially correct 379 ms 21632 KB Output is partially correct
12 Partially correct 351 ms 21600 KB Output is partially correct
13 Partially correct 349 ms 21704 KB Output is partially correct
14 Partially correct 332 ms 21604 KB Output is partially correct
15 Partially correct 359 ms 21800 KB Output is partially correct
16 Partially correct 336 ms 21600 KB Output is partially correct
17 Partially correct 360 ms 21952 KB Output is partially correct
18 Partially correct 349 ms 21600 KB Output is partially correct
19 Partially correct 362 ms 21608 KB Output is partially correct
20 Partially correct 374 ms 21720 KB Output is partially correct