Submission #411543

# Submission time Handle Problem Language Result Execution time Memory
411543 2021-05-25T13:28:05 Z 반딧불(#7604) The Collection Game (BOI21_swaps) C++17
15 / 100
66 ms 672 KB
#include <bits/stdc++.h>
#include "swaps.h"

using namespace std;

int n;
vector<int> vec;
bool mat[502][502];

void solve(int _n, int _lim){
    n = _n;

    for(int d=1; d<n; d++){
        for(int i=1; i<=n-d; i++){
            if((i-1)%(d+d) < d) schedule(i, i+d);
        }
        vector<int> tv = visit();
        int pnt = 0;
        for(int i=1; i<=n-d; i++){
            if((i-1)%(d+d) < d){
                mat[i][i+d] = tv[pnt];
                mat[i+d][i] = !tv[pnt];
                pnt++;
            }
        }

        for(int i=1; i<=n-d; i++){
            if((i-1)%(d+d) >= d) schedule(i, i+d);
        }
        tv = visit();
        pnt = 0;
        for(int i=1; i<=n-d; i++){
            if((i-1)%(d+d) >= d){
                mat[i][i+d] = tv[pnt];
                mat[i+d][i] = !tv[pnt];
                pnt++;
            }
        }
    }

    for(int i=1; i<=n; i++) vec.push_back(i);
    sort(vec.begin(), vec.end(), [&](int &x, int &y){
        return mat[x][y];
    });
    answer(vec);
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 5 ms 328 KB Correct
3 Correct 19 ms 420 KB Correct
4 Correct 55 ms 564 KB Correct
5 Correct 61 ms 560 KB Correct
6 Correct 58 ms 576 KB Correct
7 Correct 50 ms 560 KB Correct
8 Correct 55 ms 556 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 200 KB Correct
2 Correct 6 ms 328 KB Correct
3 Correct 20 ms 432 KB Correct
4 Correct 58 ms 556 KB Correct
5 Correct 55 ms 556 KB Correct
6 Correct 61 ms 608 KB Correct
7 Correct 56 ms 652 KB Correct
8 Correct 59 ms 556 KB Correct
9 Correct 66 ms 560 KB Correct
10 Correct 57 ms 672 KB Correct
11 Correct 65 ms 564 KB Correct
12 Correct 55 ms 556 KB Correct
13 Correct 65 ms 560 KB Correct
# 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 Incorrect 1 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 Incorrect 1 ms 200 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 220 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 220 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 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 Incorrect 1 ms 200 KB Not correct
2 Halted 0 ms 0 KB -