제출 #218860

#제출 시각아이디문제언어결과실행 시간메모리
218860Kenzo_1114곤돌라 (IOI14_gondola)C++17
20 / 100
21 ms1536 KiB
#include "gondola.h" #include<bits/stdc++.h> using namespace std; const int MAXN = 100010; int correct[MAXN]; bool marc[3 * MAXN]; int valid(int n, int seq[]) { int id = 0; for(int i = 0; i < n; i++) if(seq[i] <= n) { id = i; break; } correct[id] = seq[id]; for(int i = id + 1; i < n; i++) { correct[i] = correct[i - 1] + 1; if(correct[i] > n) correct[i] = 1; } for(int i = id - 1; i >= 0; i--) { correct[i] = correct[i + 1] - 1; if(correct[i] < 1) correct[i] = n; } for(int i = 0; i < n; i++) { if(seq[i] <= n && correct[i] != seq[i]) return 0; if(seq[i] > n && marc[seq[i]]) return 0; marc[seq[i]] = true; } return 1; } int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -1; } int countReplacement(int n, int inputSeq[]) { return -1; } /* int N, SEQ[MAXN]; int main () { scanf("%d", &N); for(int i = 0; i < N; i++) scanf("%d", &SEQ[i]); printf("%d\n", valid(N, SEQ)); } */
#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...