# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
238651 | 2020-06-12T09:03:15 Z | Ruxandra985 | 곤돌라 (IOI14_gondola) | C++14 | 5 ms | 384 KB |
#include <bits/stdc++.h> #include "gondola.h" using namespace std; int f[100010]; int valid(int n, int v[]){ int i , found , poz , ok , pin , fi , space; found = 0; poz = 0; ok = 0; for (i = 0 ; i < n ; i++) v[i]--; for (i = 0 ; i < n ; i++){ if (f[v[i]]) return 0; f[v[i]] = 1; if (v[i] < n){ if (found == 0){ found = v[i]; poz = i; pin = i; fi = v[i]; } else { if (found > v[i]){ if (ok == 1) return 0; ok = 1; space = n - 1 - found + v[i]; if (space != i - poz - 1) return 0; found = v[i]; poz = i; } else { space = v[i] - found - 1; if (space != i - poz - 1) return 0; found = v[i]; poz = i; } } } } /// verif cu ult poz si prima poz if (!found) return 1; if (found > fi){ if (ok == 1) return 0; ok = 1; space = n - 1 - found + fi; if (space != (n - 1) - poz + pin) return 0; } else { space = n - 1 - fi + found; if (space != (n - 1) - poz + pin) return 0; } return 1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { return -2; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 384 KB | Integer -2 violates the range [0, 350000] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Integer -2 violates the range [0, 350000] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 384 KB | Integer -2 violates the range [0, 350000] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 384 KB | Integer -3 violates the range [0, 1000000008] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 384 KB | Integer -3 violates the range [0, 1000000008] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 5 ms | 256 KB | Integer -3 violates the range [0, 1000000008] |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 4 ms | 384 KB | Integer -3 violates the range [0, 1000000008] |
2 | Halted | 0 ms | 0 KB | - |