Submission #403593

# Submission time Handle Problem Language Result Execution time Memory
403593 2021-05-13T09:52:18 Z b00n0rp The Collection Game (BOI21_swaps) C++17
0 / 100
1 ms 200 KB
//
// --- Sample implementation for the task swaps ---
//
// To compile this program with the sample grader, place:
//     swaps.h swaps_sample.cpp sample_grader.cpp
// in a single folder and run:
//     g++ swaps_sample.cpp sample_grader.cpp
// in this folder.
//
#include<bits/stdc++.h>
#include "swaps.h"
using namespace std;

void solve(int N, int V) {
    // // TODO implement this function
    // schedule(1, 2);
    // std::vector<int> v = visit();
    // if (v[0] == 1)
    //     answer({1, 2, 3, 4});
    // else
    //     answer({2, 1, 3, 4});
	for(int k = 2; k <= N; k *= 2){
		for(int j = k/2; j >= 1; j/= 2){
			for(int i = 0; i < N; i ++){
				int l = (i^j);
				if(l > i){
					if((i&k)){
						schedule(i+1,l+1);
					}
					else{
						schedule(l+1,i+1);
					}
				}
			}
			visit();
		}
	}
	vector<int> ans;
	for(int i = 1; i <= N; i ++) ans.push_back(i);
	answer(ans);
}
# 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 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 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 -