Submission #1016615

# Submission time Handle Problem Language Result Execution time Memory
1016615 2024-07-08T09:13:09 Z MohamedFaresNebili The Collection Game (BOI21_swaps) C++14
0 / 100
1 ms 344 KB
#include <bits/stdc++.h>
#include "swaps.h"
 
 
        using namespace std;
 
        vector<int> dcS(vector<int> A) {
            bool ok = false;
            int N = A.size();
            while(ok == false) {
                ok = true;
                for(int l = 0; l < N; l += 2) 
                    schedule(A[l], A[l + 1]);
                vector<int> K = visit();
                for(int l = 0, cur = 0; l < N; l += 2, cur++) {
                    if(K[cur] == 0) {
                        ok = false;
                        swap(A[l], A[l + 1]);
                    }
                }
 
                for(int l = 1; l < N; l += 2) 
                    schedule(A[l], A[l + 1]);
                K.clear(); K = visit();
                for(int l = 1, cur = 0; l < N; l += 2, cur++) {
                    if(K[cur] == 0) {
                        ok = false;
                        swap(A[l], A[l + 1]);
                    }
                }
            }
            return A;
        }
 
        void solve(int N, int V) {
            vector<int> res(N);
            for(int l = 0; l < N; l++)
                res[l] = l + 1;
            res = dcS(res);
            answer(res);
        }
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Not correct
2 Halted 0 ms 0 KB -