Submission #1017060

# Submission time Handle Problem Language Result Execution time Memory
1017060 2024-07-08T19:51:37 Z MohamedFaresNebili The Collection Game (BOI21_swaps) C++14
50 / 100
343 ms 1740 KB
    #include <bits/stdc++.h>
    #include "swaps.h"
     
     
            using namespace std;
     
            void solve(int N, int V) {
                vector<int> res(N);
                for(int l = 0; l < N; l++)
                    res[l] = l + 1;
                bool ok = false;

                for(int i = 0; i < V; i++) {
                    for(int l = i % 2; l + 1 < N; l += 2) 
                        schedule(res[l], res[l + 1]);
                    vector<int> K = visit();
                    for(int l = i % 2, cur = 0; l + 1 < N; l += 2, cur++) {
                        if(K[cur] == 0) {
                            swap(res[l], res[l + 1]);
                        }
                    }
                }
                answer(res);
            }

Compilation message

swaps.cpp: In function 'void solve(int, int)':
swaps.cpp:11:22: warning: unused variable 'ok' [-Wunused-variable]
   11 |                 bool ok = false;
      |                      ^~
# Verdict Execution time Memory Grader output
1 Correct 26 ms 344 KB Correct
2 Correct 77 ms 344 KB Correct
3 Correct 168 ms 416 KB Correct
4 Correct 256 ms 1520 KB Correct
5 Correct 244 ms 1100 KB Correct
6 Correct 260 ms 916 KB Correct
7 Correct 270 ms 852 KB Correct
8 Correct 259 ms 660 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 344 KB Correct
2 Correct 71 ms 344 KB Correct
3 Correct 155 ms 416 KB Correct
4 Correct 254 ms 1108 KB Correct
5 Correct 257 ms 1424 KB Correct
6 Correct 252 ms 1360 KB Correct
7 Correct 270 ms 1672 KB Correct
8 Correct 256 ms 1460 KB Correct
9 Correct 49 ms 440 KB Correct
10 Correct 51 ms 1076 KB Correct
11 Correct 51 ms 412 KB Correct
12 Correct 51 ms 656 KB Correct
13 Correct 51 ms 1284 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 340 KB Correct
2 Correct 89 ms 344 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 340 KB Correct
2 Correct 89 ms 344 KB Correct
3 Correct 32 ms 344 KB Correct
4 Correct 87 ms 344 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 38 ms 344 KB Correct
2 Correct 73 ms 344 KB Correct
3 Correct 139 ms 412 KB Correct
4 Correct 288 ms 1740 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 38 ms 344 KB Correct
2 Correct 73 ms 344 KB Correct
3 Correct 139 ms 412 KB Correct
4 Correct 288 ms 1740 KB Correct
5 Correct 26 ms 344 KB Correct
6 Correct 88 ms 344 KB Correct
7 Correct 154 ms 416 KB Correct
8 Correct 244 ms 552 KB Correct
9 Correct 280 ms 864 KB Correct
10 Correct 281 ms 916 KB Correct
11 Correct 300 ms 1424 KB Correct
12 Correct 268 ms 1352 KB Correct
13 Correct 27 ms 344 KB Correct
14 Correct 80 ms 344 KB Correct
15 Correct 184 ms 412 KB Correct
16 Correct 343 ms 1224 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 344 KB Correct
2 Correct 71 ms 344 KB Correct
3 Correct 140 ms 412 KB Correct
4 Correct 289 ms 1392 KB Correct
5 Correct 37 ms 644 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 344 KB Correct
2 Correct 71 ms 344 KB Correct
3 Correct 140 ms 412 KB Correct
4 Correct 289 ms 1392 KB Correct
5 Correct 37 ms 644 KB Correct
6 Correct 27 ms 344 KB Correct
7 Correct 73 ms 344 KB Correct
8 Correct 162 ms 412 KB Correct
9 Correct 281 ms 1152 KB Correct
10 Correct 270 ms 1104 KB Correct
11 Correct 276 ms 1052 KB Correct
12 Correct 277 ms 692 KB Correct
13 Correct 293 ms 1160 KB Correct
14 Correct 52 ms 644 KB Correct
15 Correct 66 ms 852 KB Correct
16 Correct 63 ms 1100 KB Correct
17 Correct 50 ms 660 KB Correct
18 Correct 48 ms 672 KB Correct
19 Correct 26 ms 344 KB Correct
20 Correct 79 ms 344 KB Correct
21 Correct 162 ms 412 KB Correct
22 Correct 292 ms 916 KB Correct
23 Correct 29 ms 876 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 344 KB Correct
2 Correct 79 ms 344 KB Correct
3 Correct 167 ms 408 KB Correct
4 Correct 245 ms 1556 KB Correct
5 Correct 25 ms 416 KB Correct
6 Incorrect 5 ms 624 KB Not correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 33 ms 344 KB Correct
2 Correct 79 ms 344 KB Correct
3 Correct 167 ms 408 KB Correct
4 Correct 245 ms 1556 KB Correct
5 Correct 25 ms 416 KB Correct
6 Incorrect 5 ms 624 KB Not correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 30 ms 344 KB Correct
2 Correct 79 ms 344 KB Correct
3 Correct 126 ms 412 KB Correct
4 Correct 278 ms 1068 KB Correct
5 Correct 24 ms 448 KB Correct
6 Incorrect 5 ms 444 KB Not correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 30 ms 344 KB Correct
2 Correct 79 ms 344 KB Correct
3 Correct 126 ms 412 KB Correct
4 Correct 278 ms 1068 KB Correct
5 Correct 24 ms 448 KB Correct
6 Incorrect 5 ms 444 KB Not correct
7 Halted 0 ms 0 KB -