Submission #557999

# Submission time Handle Problem Language Result Execution time Memory
557999 2022-05-06T13:00:42 Z AdamGS The Collection Game (BOI21_swaps) C++17
21 / 100
519 ms 448 KB
#include "swaps.h"
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
const int LIM=507;
int T[LIM];
void solve(int n, int v) {
	rep(i, n) T[i]=i;
	while(v--) {
		vector<pair<int,int>>V;
		for(int i=v%2; i+1<n; i+=2) {
			int a, b;
			rep(j, n) {
				if(T[j]==i) a=j;
				if(T[j]==i+1) b=j;
			}
			schedule(i+1, i+2);
			V.pb({i, i+1});
		}
		vector<int>P=visit();
		//rep(i, P.size()) if(!P[i]) swap(T[V[i].st], T[V[i].nd]);
	}
	vector<int>ans;
	rep(i, n) rep(j, n) if(T[j]==i) ans.pb(i+1);
	answer(ans);
}

Compilation message

swaps.cpp: In function 'void solve(int, int)':
swaps.cpp:18:8: warning: variable 'a' set but not used [-Wunused-but-set-variable]
   18 |    int a, b;
      |        ^
swaps.cpp:18:11: warning: variable 'b' set but not used [-Wunused-but-set-variable]
   18 |    int a, b;
      |           ^
# Verdict Execution time Memory Grader output
1 Incorrect 26 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 27 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 58 ms 208 KB Correct
2 Correct 133 ms 208 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 58 ms 208 KB Correct
2 Correct 133 ms 208 KB Correct
3 Incorrect 52 ms 208 KB Not correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 73 ms 208 KB Correct
2 Correct 129 ms 208 KB Correct
3 Correct 227 ms 208 KB Correct
4 Correct 457 ms 444 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 73 ms 208 KB Correct
2 Correct 129 ms 208 KB Correct
3 Correct 227 ms 208 KB Correct
4 Correct 457 ms 444 KB Correct
5 Incorrect 39 ms 208 KB Not correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 59 ms 208 KB Correct
2 Correct 131 ms 208 KB Correct
3 Correct 236 ms 208 KB Correct
4 Correct 488 ms 380 KB Correct
5 Correct 46 ms 448 KB Correct
# Verdict Execution time Memory Grader output
1 Correct 59 ms 208 KB Correct
2 Correct 131 ms 208 KB Correct
3 Correct 236 ms 208 KB Correct
4 Correct 488 ms 380 KB Correct
5 Correct 46 ms 448 KB Correct
6 Incorrect 53 ms 208 KB Not correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 54 ms 208 KB Correct
2 Correct 124 ms 208 KB Correct
3 Correct 256 ms 208 KB Correct
4 Correct 443 ms 392 KB Correct
5 Correct 46 ms 304 KB Correct
6 Incorrect 11 ms 288 KB Not correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 54 ms 208 KB Correct
2 Correct 124 ms 208 KB Correct
3 Correct 256 ms 208 KB Correct
4 Correct 443 ms 392 KB Correct
5 Correct 46 ms 304 KB Correct
6 Incorrect 11 ms 288 KB Not correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 46 ms 208 KB Correct
2 Correct 147 ms 208 KB Correct
3 Correct 255 ms 208 KB Correct
4 Correct 519 ms 408 KB Correct
5 Correct 62 ms 308 KB Correct
6 Incorrect 10 ms 288 KB Not correct
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 46 ms 208 KB Correct
2 Correct 147 ms 208 KB Correct
3 Correct 255 ms 208 KB Correct
4 Correct 519 ms 408 KB Correct
5 Correct 62 ms 308 KB Correct
6 Incorrect 10 ms 288 KB Not correct
7 Halted 0 ms 0 KB -