제출 #415845

#제출 시각아이디문제언어결과실행 시간메모리
415845LouayFarah곤돌라 (IOI14_gondola)C++14
15 / 100
11 ms972 KiB
#include "bits/stdc++.h" #include "gondola.h" using namespace std; #define pb push_back int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return 1; } int countReplacement(int n, int inputSeq[]) { return 1; } vector<int> book; vector<int> r; int valid(int n, int inputSeq[]) { if(n==1) return 1; book.assign(n+1, 0); for(int i = 0; i<n; i++) { if(inputSeq[i]>n) { continue; } book[inputSeq[i]]++; if(book[inputSeq[i]]>1) { return 0; } } int counter = 0; int curr = 0; for(int i = 0; i<n; i++) { if(inputSeq[i]<=n) { curr = inputSeq[i]; break; } counter++; } if(curr==0) return 1; int temp = curr; for(int i = counter; i<n; i++) { if(inputSeq[i]>n) { temp++; if(temp>n) temp = 1; } else { if(inputSeq[i]!=temp) return 0; temp++; if(temp>n) temp = 1; } } temp = curr; for(int i = counter; i>=0; i--) { if(inputSeq[i]>n) { temp--; if(temp==0) temp = n; } else { if(inputSeq[i]!=temp) return 0; temp--; if(temp==0) temp = n; } } return 1; }
#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...