Submission #29364

#TimeUsernameProblemLanguageResultExecution timeMemory
29364cki86201Gondola (IOI14_gondola)C++11
20 / 100
16 ms4364 KiB
#include "gondola.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <memory.h> #include <math.h> #include <assert.h> #include <queue> #include <map> #include <set> #include <string> #include <algorithm> #include <iostream> #include <functional> #include <unordered_map> #include <unordered_set> #include <list> #include <bitset> using namespace std; typedef pair<int, int> pii; typedef long long ll; #define Fi first #define Se second #define pb(x) push_back(x) #define sz(x) ((int)(x).size()) #define rep(i, n) for(int i=0;i<n;i++) #define all(x) (x).begin(), (x).end() typedef tuple<int, int, int> t3; typedef pair<ll, ll> Pll; typedef long double ldouble; int vchk[250050] = {}; int valid(int n, int inputSeq[]) { int L = *max_element(inputSeq, inputSeq + n); rep(i, L+1) vchk[i] = -1; rep(i, n) { if(vchk[inputSeq[i]] != -1) return 0; vchk[ inputSeq[i] ] = i; } pii f = pii(-1, -1); for(int i=0;i<n;i++) if(inputSeq[i] <= n) f = pii(inputSeq[i], i); if(f == pii(-1, -1)) return 1; for(int i=0;i<n;i++) if(inputSeq[i] <= n) { int exp = (i - f.Se) + f.Fi; if(exp > n) exp -= n; if(exp <= 0) exp += n; if(exp != inputSeq[i]) 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...