Submission #444320

# Submission time Handle Problem Language Result Execution time Memory
444320 2021-07-13T15:23:40 Z blue The Collection Game (BOI21_swaps) C++17
21 / 100
55 ms 496 KB
#include "swaps.h"
#include <vector>
using namespace std;


void solve(int N, int V)
{
    vector<int> r(N);
    for(int i = 1; i <= N; i++) r[i - 1] = i;

    for(int v = 1; v <= min(V, N); v++)
    {
        if(v % 2 == 0)
        {
            for(int i = 0; i+1 < N; i += 2) schedule(r[i], r[i+1]);
            vector<int> C = visit();

            for(int i = 0; i+1 < N; i += 2)
                if(C[i/2] == 0)
                    swap(r[i+1], r[i]);
        }
        else
        {
            for(int i = 1; i+1 < N; i += 2) schedule(r[i], r[i+1]);
            vector<int> C = visit();

            for(int i = 0; i+1 < N; i += 2)
                if(C[i/2] == 0)
                    swap(r[i+1], r[i]);
        }
    }

    answer(r);
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 200 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 200 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 3 ms 200 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 3 ms 200 KB Correct
3 Incorrect 1 ms 200 KB Not correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB Correct
2 Correct 4 ms 200 KB Correct
3 Correct 15 ms 256 KB Correct
4 Correct 48 ms 452 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB Correct
2 Correct 4 ms 200 KB Correct
3 Correct 15 ms 256 KB Correct
4 Correct 48 ms 452 KB Correct
5 Incorrect 0 ms 200 KB Not correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB Correct
2 Correct 3 ms 200 KB Correct
3 Correct 14 ms 200 KB Correct
4 Correct 55 ms 360 KB Correct
5 Correct 50 ms 260 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB Correct
2 Correct 3 ms 200 KB Correct
3 Correct 14 ms 200 KB Correct
4 Correct 55 ms 360 KB Correct
5 Correct 50 ms 260 KB Correct
6 Incorrect 0 ms 200 KB Not correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB Correct
2 Correct 3 ms 200 KB Correct
3 Correct 14 ms 256 KB Correct
4 Correct 49 ms 496 KB Correct
5 Correct 50 ms 284 KB Correct
6 Incorrect 10 ms 264 KB Not correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 200 KB Correct
2 Correct 3 ms 200 KB Correct
3 Correct 14 ms 256 KB Correct
4 Correct 49 ms 496 KB Correct
5 Correct 50 ms 284 KB Correct
6 Incorrect 10 ms 264 KB Not correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 3 ms 200 KB Correct
3 Correct 15 ms 260 KB Correct
4 Correct 49 ms 284 KB Correct
5 Correct 50 ms 284 KB Correct
6 Incorrect 11 ms 260 KB Not correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 3 ms 200 KB Correct
3 Correct 15 ms 260 KB Correct
4 Correct 49 ms 284 KB Correct
5 Correct 50 ms 284 KB Correct
6 Incorrect 11 ms 260 KB Not correct
7 Halted 0 ms 0 KB -