# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
212636 | 2020-03-23T22:22:26 Z | mohamedsobhi777 | 곤돌라 (IOI14_gondola) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> #include "gondola.h" using namespace std ; const int N = 3e5 + 7 ; int valid(int n, int inputSeq[]){ vector<int> vis(N , 0) ; int cur = inputSeq[0] -1 ; for(int i = 0 ; i < n; i++){ if(vis[inputSeq[i]]++)return 0 ; if(--inputSeq[i]!=cur) return 0 ; cur = (cur+1) %n ; } return 1 ; }