# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
149789 | CHT를 사랑하는 모임 (#200) | On the Grid (FXCUP4_grid) | C++17 | 8 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "grid.h"
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
#define sortv(v) sort(all(v))
#define uniqv(v) (v).erase(unique(all(v)), (v).end())
#define pb push_back
#define FI first
#define SE second
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define test 0
#define TEST if(test)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
const int MOD = 1000000007; // 998244353
const int INF = 2e9;
const ll INFLL = 1e18;
const int MAX_N = 50;
vector<int> num;
int idx[MAX_N+1];
vector<int> vt;
vector<int> fin;
vector<int> v;
int ans(){
int ret = PutDisks(v);
while(!v.empty()) v.pop_back();
return ret;
}
vector<int> SortDisks(int N) {
for(int i=0; i<N; i++) num.pb(0);
for(int i=0; i<N; i++){
vt.pb(i);
}
for(int i=N; i>=1; i--){
TEST cout<<i<<endl;
int now;
for(int j=0; j<vt.size(); j++){
v.pb(vt[j]);
for(int k : vt){
if(k!=vt[j]){
v.pb(k);
}
}
for(int k = fin.size()-1; k>=0; k--){
v.pb(fin[k]);
}
int t = ans();
TEST cout<<vt[j]<<" "<<t<<endl;
if(t==(N-1+i)){
now = vt[j];
break;
}
}
while(!vt.empty()){
if(vt.back()!=now){
v.pb(vt.back());
}
vt.pop_back();
}
while(!v.empty()){
vt.pb(v.back()); v.pop_back();
}
fin.pb(now);
num[now] = i;
TEST cout<<now<<endl;
}
return num;
}
컴파일 시 표준 에러 (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... |