답안 #557995

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
557995 2022-05-06T12:53:52 Z AdamGS The Collection Game (BOI21_swaps) C++17
21 / 100
1024 ms 516 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(a+1, b+1);
			V.pb({a, b});
		}
		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:27:3: note: in expansion of macro 'rep'
   27 |   rep(i, P.size()) if(!P[i]) swap(T[V[i].st], T[V[i].nd]);
      |   ^~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 54 ms 292 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 53 ms 208 KB Not correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 208 KB Correct
2 Correct 130 ms 208 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 36 ms 208 KB Correct
2 Correct 130 ms 208 KB Correct
3 Incorrect 41 ms 208 KB Not correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 53 ms 208 KB Correct
2 Correct 138 ms 300 KB Correct
3 Correct 410 ms 208 KB Correct
4 Correct 1024 ms 504 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 53 ms 208 KB Correct
2 Correct 138 ms 300 KB Correct
3 Correct 410 ms 208 KB Correct
4 Correct 1024 ms 504 KB Correct
5 Incorrect 42 ms 208 KB Not correct
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 53 ms 208 KB Correct
2 Correct 165 ms 208 KB Correct
3 Correct 403 ms 208 KB Correct
4 Correct 1016 ms 516 KB Correct
5 Correct 104 ms 288 KB Correct
# 결과 실행 시간 메모리 Grader output
1 Correct 53 ms 208 KB Correct
2 Correct 165 ms 208 KB Correct
3 Correct 403 ms 208 KB Correct
4 Correct 1016 ms 516 KB Correct
5 Correct 104 ms 288 KB Correct
6 Incorrect 40 ms 208 KB Not correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 47 ms 208 KB Correct
2 Correct 154 ms 296 KB Correct
3 Correct 389 ms 208 KB Correct
4 Correct 1008 ms 484 KB Correct
5 Correct 104 ms 292 KB Correct
6 Incorrect 21 ms 284 KB Not correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 47 ms 208 KB Correct
2 Correct 154 ms 296 KB Correct
3 Correct 389 ms 208 KB Correct
4 Correct 1008 ms 484 KB Correct
5 Correct 104 ms 292 KB Correct
6 Incorrect 21 ms 284 KB Not correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 296 KB Correct
2 Correct 144 ms 208 KB Correct
3 Correct 375 ms 208 KB Correct
4 Correct 994 ms 428 KB Correct
5 Correct 113 ms 284 KB Correct
6 Incorrect 18 ms 276 KB Not correct
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 32 ms 296 KB Correct
2 Correct 144 ms 208 KB Correct
3 Correct 375 ms 208 KB Correct
4 Correct 994 ms 428 KB Correct
5 Correct 113 ms 284 KB Correct
6 Incorrect 18 ms 276 KB Not correct
7 Halted 0 ms 0 KB -