# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
463492 | 2021-08-11T08:57:07 Z | kilikuma | Exam (eJOI20_exam) | C++14 | 16 ms | 1316 KB |
#include <bits/stdc++.h> using namespace std; int main() { int nbEleves; scanf("%d",&nbEleves); int A[100000+42]; for (int i = 1; i<= nbEleves; i++) { scanf("%d",&A[i]); } vector<int> obstacles; obstacles.push_back(0); int objectif; scanf("%d",&objectif); for (int i=1;i<=nbEleves; i++) { if (A[i] > objectif) { obstacles.push_back(i); } } obstacles.push_back(nbEleves+1); int maxi = 0; for (int i=0;i<obstacles.size()-1;i++) { bool cond =false; for (int a = obstacles[i]+1; a < obstacles[i+1]; a ++) { if (A[a] == objectif) cond = true; } if (cond ){ maxi += (obstacles[i+1]-obstacles[i]-1); } } cout << maxi << endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 588 KB | Output is correct |
2 | Incorrect | 1 ms | 588 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 588 KB | Output is correct |
2 | Correct | 4 ms | 588 KB | Output is correct |
3 | Correct | 11 ms | 1060 KB | Output is correct |
4 | Correct | 10 ms | 588 KB | Output is correct |
5 | Correct | 15 ms | 680 KB | Output is correct |
6 | Correct | 12 ms | 1316 KB | Output is correct |
7 | Correct | 11 ms | 676 KB | Output is correct |
8 | Correct | 16 ms | 972 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 588 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 588 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 588 KB | Output is correct |
2 | Incorrect | 1 ms | 588 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 588 KB | Output is correct |
2 | Incorrect | 1 ms | 588 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |