Submission #847343

# Submission time Handle Problem Language Result Execution time Memory
847343 2023-09-09T13:47:55 Z Ahmed57 The Collection Game (BOI21_swaps) C++17
50 / 100
333 ms 2172 KB
#include <bits/stdc++.h>
using namespace std;
#include "swaps.h"
void solve(int n,int v){
    int rnks[n+1];
    for(int i = 1;i<=n;i++)rnks[i] = i;
    bool odd = 0;
    int its = v;
    while(its--){
        int st = odd+1;
        for(;st<n;st+=2){
            schedule(rnks[st+1],rnks[st]);
        }
        vector<int> vis = visit();
        st = odd+1;int ind = 0;
        for(;st<n;st+=2){
            if(vis[ind])swap(rnks[st],rnks[st+1]);
            ind++;
        }
        odd = !odd;
    }vector<int> lol;
    for(int i = 1;i<=n;i++){
        lol.push_back(rnks[i]);
    }
    answer(lol);
}
# Verdict Execution time Memory Grader output
1 Correct 32 ms 344 KB Correct
2 Correct 85 ms 344 KB Correct
3 Correct 167 ms 416 KB Correct
4 Correct 317 ms 1672 KB Correct
5 Correct 313 ms 1716 KB Correct
6 Correct 314 ms 1816 KB Correct
7 Correct 324 ms 1420 KB Correct
8 Correct 329 ms 1876 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 344 KB Correct
2 Correct 78 ms 344 KB Correct
3 Correct 175 ms 412 KB Correct
4 Correct 333 ms 1728 KB Correct
5 Correct 319 ms 1708 KB Correct
6 Correct 317 ms 1752 KB Correct
7 Correct 325 ms 2032 KB Correct
8 Correct 323 ms 1668 KB Correct
9 Correct 71 ms 1164 KB Correct
10 Correct 71 ms 1416 KB Correct
11 Correct 65 ms 1420 KB Correct
12 Correct 72 ms 1416 KB Correct
13 Correct 67 ms 1924 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 344 KB Correct
2 Correct 89 ms 344 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 344 KB Correct
2 Correct 89 ms 344 KB Correct
3 Correct 30 ms 344 KB Correct
4 Correct 87 ms 344 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 29 ms 344 KB Correct
2 Correct 88 ms 344 KB Correct
3 Correct 165 ms 408 KB Correct
4 Correct 315 ms 1640 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 29 ms 344 KB Correct
2 Correct 88 ms 344 KB Correct
3 Correct 165 ms 408 KB Correct
4 Correct 315 ms 1640 KB Correct
5 Correct 36 ms 344 KB Correct
6 Correct 79 ms 344 KB Correct
7 Correct 168 ms 416 KB Correct
8 Correct 314 ms 1340 KB Correct
9 Correct 323 ms 1648 KB Correct
10 Correct 312 ms 1808 KB Correct
11 Correct 316 ms 1668 KB Correct
12 Correct 319 ms 1564 KB Correct
13 Correct 34 ms 344 KB Correct
14 Correct 85 ms 344 KB Correct
15 Correct 175 ms 412 KB Correct
16 Correct 330 ms 1556 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 344 KB Correct
2 Correct 80 ms 344 KB Correct
3 Correct 171 ms 408 KB Correct
4 Correct 320 ms 1672 KB Correct
5 Correct 33 ms 1924 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 344 KB Correct
2 Correct 80 ms 344 KB Correct
3 Correct 171 ms 408 KB Correct
4 Correct 320 ms 1672 KB Correct
5 Correct 33 ms 1924 KB Correct
6 Correct 38 ms 344 KB Correct
7 Correct 84 ms 596 KB Correct
8 Correct 170 ms 408 KB Correct
9 Correct 320 ms 1464 KB Correct
10 Correct 319 ms 1920 KB Correct
11 Correct 317 ms 1760 KB Correct
12 Correct 317 ms 1636 KB Correct
13 Correct 323 ms 1744 KB Correct
14 Correct 65 ms 1416 KB Correct
15 Correct 62 ms 1420 KB Correct
16 Correct 66 ms 1664 KB Correct
17 Correct 66 ms 1420 KB Correct
18 Correct 64 ms 1180 KB Correct
19 Correct 34 ms 344 KB Correct
20 Correct 86 ms 344 KB Correct
21 Correct 175 ms 416 KB Correct
22 Correct 324 ms 1560 KB Correct
23 Correct 33 ms 1424 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 31 ms 344 KB Correct
2 Correct 77 ms 344 KB Correct
3 Correct 161 ms 416 KB Correct
4 Correct 313 ms 1608 KB Correct
5 Correct 33 ms 1664 KB Correct
6 Incorrect 8 ms 600 KB Not correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 31 ms 344 KB Correct
2 Correct 77 ms 344 KB Correct
3 Correct 161 ms 416 KB Correct
4 Correct 313 ms 1608 KB Correct
5 Correct 33 ms 1664 KB Correct
6 Incorrect 8 ms 600 KB Not correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 34 ms 344 KB Correct
2 Correct 84 ms 344 KB Correct
3 Correct 166 ms 408 KB Correct
4 Correct 318 ms 2172 KB Correct
5 Correct 32 ms 1188 KB Correct
6 Incorrect 7 ms 1340 KB Not correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 34 ms 344 KB Correct
2 Correct 84 ms 344 KB Correct
3 Correct 166 ms 408 KB Correct
4 Correct 318 ms 2172 KB Correct
5 Correct 32 ms 1188 KB Correct
6 Incorrect 7 ms 1340 KB Not correct
7 Halted 0 ms 0 KB -