Submission #138567

#TimeUsernameProblemLanguageResultExecution timeMemory
138567Mahmoud_AdelGondola (IOI14_gondola)C++14
20 / 100
20 ms5156 KiB
#include "gondola.h" #include <bits/stdc++.h> const int N = 1e6+5; int mark[N]; int valid(int n, int inputSeq[]) { memset(mark, 0, sizeof mark); for(int i=0; i<n; i++) { if(mark[inputSeq[i]]) return 0; mark[inputSeq[i]] = 1; } int j = -1; for(int i=0; i<n; i++) if(inputSeq[i] > 0 && inputSeq[i] <= n) j = i; if(j == -1) return 1; for(int i=0; i<n; i++) { int id = (i+j)%n, jd = (i+j+1)%n; if(inputSeq[jd] > n) inputSeq[jd] = inputSeq[id]%n + 1; if(inputSeq[jd] != inputSeq[id]%n + 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...