# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
136224 | 2019-07-25T04:07:23 Z | vince | 곤돌라 (IOI14_gondola) | C++14 | 3 ms | 376 KB |
#include "gondola.h" #include <set> #include <stdio.h> using namespace std; int valid(int n, int inputSeq[]) { return -1; set<int> st; int num = -1; for(int i = 0; i < n; i++) { st.insert(inputSeq[i]); int idx = i%n; if(inputSeq[idx] <= n && num == -1) num = inputSeq[idx]; if(inputSeq[idx] <= n & num != inputSeq[idx]) return 0; if(num != -1) { num++; if(num == n+1) num -= n; } } return st.size() == n; } //---------------------- bool ada[250003]; int A[250003]; int pos[250003]; int replacement(int n, int gondolaSeq[], int replacementSeq[]) { int mx = 0; for(int i = 0; i < n; i++) { A[i] = gondolaSeq[i]; mx = max(mx, A[i]); ada[A[i]] = 1; pos[A[i]] = i; } for(int i = 1; i < 2*n; i++) { if(A[(i-1)%n] <= n) A[i%n] = A[(i-1)%n]+1; if(A[i%n] == n+1) A[i%n] = 1; } int sz = 0; for(int i = n+1; i <= mx; i++) { if(pos[i] == 0) replacementSeq[sz++] = A[pos[mx]], A[pos[mx]] = i; else replacementSeq[sz++] = A[pos[i]], A[pos[i]] = i; } // for(int i = 0; i < n; i++) // printf("%d ", A[i]); // printf("\n"); return sz; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Integer -1 violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Integer -1 violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Integer -1 violates the range [0, 1] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 248 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Incorrect | 2 ms | 376 KB | Integer 4650 violates the range [1, 72] |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Incorrect | 3 ms | 376 KB | Integer 4650 violates the range [1, 72] |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 376 KB | Integer -3 violates the range [0, 1000000008] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Integer -3 violates the range [0, 1000000008] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Integer -3 violates the range [0, 1000000008] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Integer -3 violates the range [0, 1000000008] |
2 | Halted | 0 ms | 0 KB | - |