Submission #1017599

#TimeUsernameProblemLanguageResultExecution timeMemory
1017599serkanrashidGondola (IOI14_gondola)C++14
20 / 100
6 ms1372 KiB
#include "gondola.h" #include <bits/stdc++.h> using namespace std; const int maxn = 1e5+5; int used[maxn]; int valid(int n, int inputSeq[]) { int st = -1; for(int i = 0; i < n; i++) { if(used[inputSeq[i]]) return false; used[inputSeq[i]]++; if(1 <= inputSeq[i] && inputSeq[i] <= n) st = i; } if(st==-1) return true; bool f = true; int last = inputSeq[st]; int i = st+1; if(i==n) i = 0; while(i!=st) { last++; if(last>n) last = 1; if(1 <= inputSeq[i] && inputSeq[i] <= n) { if(last!=inputSeq[i]) return false; } i++; if(i==n) i = 0; } return true; } int replacement(int n, int gondolaSeq[], int replacementSeq[]) { } int countReplacement(int n, int inputSeq[]) { }

Compilation message (stderr)

gondola.cpp: In function 'int valid(int, int*)':
gondola.cpp:21:10: warning: unused variable 'f' [-Wunused-variable]
   21 |     bool f = true;
      |          ^
gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:42:1: warning: no return statement in function returning non-void [-Wreturn-type]
   42 | }
      | ^
gondola.cpp: In function 'int countReplacement(int, int*)':
gondola.cpp:47:1: warning: no return statement in function returning non-void [-Wreturn-type]
   47 | }
      | ^
#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...