# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
807849 | 2023-08-05T03:06:29 Z | OrazB | Gondola (IOI14_gondola) | C++14 | 0 ms | 0 KB |
#include <bits/stdc++.h> #include "gondola.h" using namespace std; #define all(x) (x).begin(), (x).end() #define ll long long int #define pii pair <int, int> #define pb push_back #define ff first #define ss second const int N = 1e5+5; int valid(int n, int A[]){ int pos = -1; for (int i = 0; i < n; i++){ if (A[i] <= n){pos = i; break;} } if (pos == -1) return 1; int x = A[pos]; for (int i = pos; i < n; i++){ if (A[i] <= n and A[i] != x) return 0; x++; if (x == n+1) x = 1; } return 1; } // int main () // { // ios::sync_with_stdio(false); // cin.tie(0); // cin >> t; // while (t--){ // } // }