# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
583330 | WongChun1234 | The Collection Game (BOI21_swaps) | C++14 | 50 ms | 352 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//
// --- 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 "swaps.h"
#include<bits/stdc++.h>
using namespace std;
const int N=550;
int rrl[N];
vector<pair<int,int>> sch;
void solve(int n, int v) {
// TODO implement this function
for (int i=1;i<=n;i++) rrl[i]=i;
for (int i=2;i<=n;i++){
for (int j=(i%2)+1;j<i;j+=2){
schedule(rrl[j],rrl[j+1]);
sch.push_back({rrl[j],rrl[j+1]});
}
vector<int> res=visit();
for (int j=0,pos=(i%2)+1;j<res.size();j++,pos+=2){
if (res[j]){
//frnt < back, 60% must
//rrl[j] now has smaller one
}else{
//rrl[j] has bigger one
swap(rrl[pos],rrl[pos+1]);
}
}
sch.clear();
}
for (int i=n-1;i>=2;i--){
for (int j=(i%2)+1;j<i;j+=2){
schedule(rrl[j],rrl[j+1]);
sch.push_back({rrl[j],rrl[j+1]});
}
vector<int> res=visit();
for (int j=0,pos=(i%2)+1;j<res.size();j++,pos+=2){
if (res[j]){
//frnt < back, 60% must
//rrl[j] now has smaller one
}else{
//rrl[j] has bigger one
swap(rrl[pos],rrl[pos+1]);
}
}
sch.clear();
}
vector<int> ans(n);
for (int i=1;i<=n;i++) ans[rrl[i]-1]=i;
answer(ans);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |