# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
149789 | CHT를 사랑하는 모임 (#200) | On the Grid (FXCUP4_grid) | C++17 | 8 ms | 384 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
}
Compilation message (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... |