# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
966996 | 2024-04-20T20:22:06 Z | VMaksimoski008 | Gondola (IOI14_gondola) | C++14 | 20 ms | 4956 KB |
#include "gondola.h" #include <bits/stdc++.h> using namespace std; using ll = long long; int valid(int n, int inputSeq[]) { int ans = 1; int cnt = 0; set<int> s; int big = 0; for(int i=0; i<n; i++) { if(inputSeq[i] > n) big++; } if(big == n) return 1; vector<int> v(n); int pos = -1; for(int i=0; i<n; i++) { if(inputSeq[i] <= n) { pos = i; v[i] = inputSeq[i]; break; } } for(int i=pos+1; i<n; i++) { v[i] = v[i-1] + 1; //if(v[i] > n) v[i] -= n; } for(int i=pos-1; i>=0; i--) { v[i] = v[i+1] - 1; //if(v[i] <= 0) } for(int i=0; i<n; i++) { if(v[i] > n) v[i] -= n; else if(v[i] <= 0) v[i] += n; } for(int i=0; i<n; i++) { if(inputSeq[i] > n) continue; if(inputSeq[i] != v[i]) return 0; } for(int i=0; i<n; i++) s.insert(inputSeq[i]); if(s.size() < n) return 0; return 1; } //---------------------- int replacement(int n, int gondolaSeq[], int replacementSeq[]) { int cnt = 0; return cnt; } //---------------------- int countReplacement(int n, int inputSeq[]) { return -3; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 0 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 8 ms | 2396 KB | Output is correct |
7 | Correct | 7 ms | 1116 KB | Output is correct |
8 | Correct | 15 ms | 4188 KB | Output is correct |
9 | Correct | 5 ms | 1628 KB | Output is correct |
10 | Correct | 19 ms | 4956 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 348 KB | Output is correct |
4 | Correct | 0 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 348 KB | Output is correct |
6 | Correct | 8 ms | 2396 KB | Output is correct |
7 | Correct | 8 ms | 1012 KB | Output is correct |
8 | Correct | 18 ms | 4172 KB | Output is correct |
9 | Correct | 5 ms | 1624 KB | Output is correct |
10 | Correct | 20 ms | 4956 KB | Output is correct |
11 | Correct | 1 ms | 348 KB | Output is correct |
12 | Correct | 0 ms | 348 KB | Output is correct |
13 | Correct | 3 ms | 860 KB | Output is correct |
14 | Incorrect | 0 ms | 348 KB | Output isn't correct |
15 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Integer -3 violates the range [0, 1000000008] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Integer -3 violates the range [0, 1000000008] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 348 KB | Integer -3 violates the range [0, 1000000008] |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 348 KB | Integer -3 violates the range [0, 1000000008] |
2 | Halted | 0 ms | 0 KB | - |