답안 #905271

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
905271 2024-01-12T21:47:40 Z MinaRagy06 The Collection Game (BOI21_swaps) C++17
50 / 100
351 ms 1928 KB
#include <bits/stdc++.h>
#include "swaps.h"
#ifdef MINA
    #include "grader.cpp"
#endif
using namespace std;
typedef int64_t ll;
 
void solve(int n, int v) {
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        a[i] = i + 1;
    }
    for (int cur = 0; cur < v; cur++) {
        for (int i = (cur & 1); i + 1 < n; i += 2) {
            schedule(a[i], a[i + 1]);
        }
        vector<int> ret = visit();
        int idx = 0;
        for (int i = (cur & 1); i + 1 < n; i += 2) {
            if (!ret[idx]) {
                swap(a[i], a[i + 1]);
            }
            idx++;
        }
    }
    answer(a);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 344 KB Correct
2 Correct 82 ms 344 KB Correct
3 Correct 167 ms 416 KB Correct
4 Correct 319 ms 1424 KB Correct
5 Correct 340 ms 1668 KB Correct
6 Correct 336 ms 1424 KB Correct
7 Correct 332 ms 1324 KB Correct
8 Correct 351 ms 1672 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 344 KB Correct
2 Correct 78 ms 344 KB Correct
3 Correct 172 ms 412 KB Correct
4 Correct 333 ms 1380 KB Correct
5 Correct 331 ms 1444 KB Correct
6 Correct 326 ms 1528 KB Correct
7 Correct 324 ms 1424 KB Correct
8 Correct 314 ms 1660 KB Correct
9 Correct 65 ms 1172 KB Correct
10 Correct 65 ms 1672 KB Correct
11 Correct 63 ms 1676 KB Correct
12 Correct 63 ms 1424 KB Correct
13 Correct 67 ms 1176 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 344 KB Correct
2 Correct 76 ms 344 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 344 KB Correct
2 Correct 76 ms 344 KB Correct
3 Correct 28 ms 344 KB Correct
4 Correct 79 ms 340 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 344 KB Correct
2 Correct 79 ms 344 KB Correct
3 Correct 168 ms 408 KB Correct
4 Correct 309 ms 1652 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 28 ms 344 KB Correct
2 Correct 79 ms 344 KB Correct
3 Correct 168 ms 408 KB Correct
4 Correct 309 ms 1652 KB Correct
5 Correct 37 ms 344 KB Correct
6 Correct 80 ms 344 KB Correct
7 Correct 167 ms 412 KB Correct
8 Correct 312 ms 1160 KB Correct
9 Correct 305 ms 1340 KB Correct
10 Correct 304 ms 1580 KB Correct
11 Correct 310 ms 1796 KB Correct
12 Correct 315 ms 1428 KB Correct
13 Correct 27 ms 344 KB Correct
14 Correct 78 ms 344 KB Correct
15 Correct 168 ms 416 KB Correct
16 Correct 324 ms 1440 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 344 KB Correct
2 Correct 76 ms 344 KB Correct
3 Correct 161 ms 412 KB Correct
4 Correct 313 ms 1348 KB Correct
5 Correct 32 ms 936 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 26 ms 344 KB Correct
2 Correct 76 ms 344 KB Correct
3 Correct 161 ms 412 KB Correct
4 Correct 313 ms 1348 KB Correct
5 Correct 32 ms 936 KB Correct
6 Correct 24 ms 344 KB Correct
7 Correct 76 ms 344 KB Correct
8 Correct 168 ms 408 KB Correct
9 Correct 311 ms 1432 KB Correct
10 Correct 307 ms 1176 KB Correct
11 Correct 307 ms 1464 KB Correct
12 Correct 313 ms 1472 KB Correct
13 Correct 314 ms 1372 KB Correct
14 Correct 63 ms 692 KB Correct
15 Correct 63 ms 1928 KB Correct
16 Correct 62 ms 940 KB Correct
17 Correct 63 ms 1180 KB Correct
18 Correct 63 ms 1672 KB Correct
19 Correct 28 ms 344 KB Correct
20 Correct 76 ms 344 KB Correct
21 Correct 174 ms 756 KB Correct
22 Correct 318 ms 1664 KB Correct
23 Correct 39 ms 940 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 30 ms 344 KB Correct
2 Correct 75 ms 344 KB Correct
3 Correct 162 ms 408 KB Correct
4 Correct 310 ms 1644 KB Correct
5 Correct 31 ms 1176 KB Correct
6 Incorrect 7 ms 832 KB Not correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 30 ms 344 KB Correct
2 Correct 75 ms 344 KB Correct
3 Correct 162 ms 408 KB Correct
4 Correct 310 ms 1644 KB Correct
5 Correct 31 ms 1176 KB Correct
6 Incorrect 7 ms 832 KB Not correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 344 KB Correct
2 Correct 76 ms 344 KB Correct
3 Correct 162 ms 596 KB Correct
4 Correct 315 ms 1712 KB Correct
5 Correct 31 ms 1168 KB Correct
6 Incorrect 9 ms 856 KB Not correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 344 KB Correct
2 Correct 76 ms 344 KB Correct
3 Correct 162 ms 596 KB Correct
4 Correct 315 ms 1712 KB Correct
5 Correct 31 ms 1168 KB Correct
6 Incorrect 9 ms 856 KB Not correct
7 Halted 0 ms 0 KB -