Submission #1099267

#TimeUsernameProblemLanguageResultExecution timeMemory
1099267LuvidiGondola (IOI14_gondola)C++17
20 / 100
12 ms2396 KiB
#include <bits/stdc++.h> #include "gondola.h" using namespace std; int valid(int n, int a[]) { set<int> s; int sh=0; for(int i=0;i<n;i++){ if(a[i]>n){ if(s.count(a[i]))return 0; s.insert(a[i]); }else{ sh=i+1-a[i]; } } for(int i=0;i<n;i++){ int idx=i+sh; idx=(idx%n+n)%n; if(a[idx]<=n&&a[idx]!=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...