| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1340810 | sally | Gondola (IOI14_gondola) | C++20 | 0 ms | 0 KiB |
#include<iostream>
#include<vector>
using namespace std;
int valid(int N, int seq[]) {
int flag = 1;
for(int i=1; i<N; i++) {
if(seq[i] != (seq[i-1])%N +1) {
flag = 0;
break;
}
}
return flag;
}
// int main() {
// int seq[7] = {1,5,3,4,2,7,6};
// cout<<valid(7, seq);
// }