| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 340479 | Kerim | Gondola (IOI14_gondola) | C++17 | 24 ms | 3564 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "gondola.h"
#include "bits/stdc++.h"
#define MAXN 300009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x) cerr<< #x <<" = "<< x<<endl;
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
int vis[MAXN];
int valid(int n, int arr[]){
memset(vis,0,sizeof vis);
int mn=INF,who;
for(int i=0;i<n;i++){
if(vis[arr[i]])return 0;
if(arr[i]<=n){
if(umin(mn,arr[i]))
who=i;
}
vis[arr[i]]=1;
}
if(mn>n)
return 1;
int res=1;
for(int i=0;i<n;i++){
int to=(who+i)%n;
res&=((arr[to]>n) or arr[to]==mn+i);
}
return res;
}
//----------------------
int replacement(int n, int arr[], int ans[]){
assert(valid(n,arr));
memset(vis,0,sizeof vis);
int mn=INF,mx=0,who,am;
for(int i=0;i<n;i++){
if(umin(mn,arr[i]))
who=i;
umax(mx,arr[i]);
}
if(mx<=n)
return 0;
if(mn>n)who=0,mn=1;
who=(who-(mn-1)+n)%n;
int last,res=0;
for(int i=0;i<n;i++){
int to=(who+i)%n;
if(arr[to]>n){
if(arr[to]==mx)
last=i+1;
else
vis[arr[to]]=i+1;
}
}
for(int i=n+1;i<=mx;i++){
if(!vis[i])
ans[res++]=last,last=i;
else
ans[res++]=vis[i];
}
return res;
}
//----------------------
int countReplacement(int n, int inputSeq[])
{
return -3;
}
컴파일 시 표준 에러 (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... | ||||
