Submission #599409

#TimeUsernameProblemLanguageResultExecution timeMemory
599409AriaHGondola (IOI14_gondola)C++17
20 / 100
9 ms1472 KiB
#include "gondola.h" #pragma GCC optimize("O3") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair < int, int > pii; typedef pair < ll, ll > pll; #define F first #define S second #define all(x) x.begin(), x.end() #define SZ(x) (int)x.size() #define Mp make_pair #define endl "\n" #define fast_io ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); const int N = 1e6 + 10; const int LOG = 20; const ll mod = 1e9 + 7; const ll inf = 8e18; int mark[N]; int valid(int n, int inputSeq[]) { int id = -1; for(int i = 0; i < n; i ++) { if(++ mark[inputSeq[i]] > 1) return 0; if(inputSeq[i] <= n) { id = i; } } if(id == -1) return 1; int start = (id - (inputSeq[id] - 1) + n + n) % n; for(int i = 0; i < n; i ++) { int j = (i + start) % n; if(inputSeq[j] > n) continue; if(inputSeq[j] != i + 1) { return 0; } } return 1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...