| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1290371 | islam_2010 | Gondola (IOI14_gondola) | C++20 | 0 ms | 0 KiB |
// #include "race.h"
#include <bits/stdc++.h>
using namespace std;
const int sz = 2e5+5;
const int inf = 1e9 + 7;
int valid(int n, int inputSeq[]){
bool ok = false;
int c = 1;
int ind = -1;
for(int i = 0; i < n; i++){
if(inputSeq[i] == 1){
ind = i;
break;
}
}if(ind == -1){
return 0;
}while(c <= n){
if(c >= n){
break;
}
if(inputSeq[ind] == c){
c++;
ind = (ind+1)%n;
}else {
ok = false;
break;
}
}return ok;
}
