Submission #558001

# Submission time Handle Problem Language Result Execution time Memory
558001 2022-05-06T13:05:44 Z AdamGS The Collection Game (BOI21_swaps) C++17
0 / 100
1 ms 208 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) {
			schedule(T[i]+1, T[i+1]+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:6:36: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    6 | #define rep(a, b) for(int a = 0; a < (b); ++a)
      |                                    ^
swaps.cpp:22:3: note: in expansion of macro 'rep'
   22 |   rep(i, P.size()) if(!P[i]) swap(T[V[i].st], T[V[i].nd]);
      |   ^~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 208 KB Not correct
2 Halted 0 ms 0 KB -