Task: | Lista |
Sender: | kh |
Submission time: | 2017-03-06 15:14:01 +0200 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.03 s | 1 | details |
#2 | WRONG ANSWER | 0.04 s | 1 | details |
#3 | ACCEPTED | 0.03 s | 1 | details |
#4 | WRONG ANSWER | 0.03 s | 1 | details |
#5 | ACCEPTED | 0.03 s | 1 | details |
#6 | ACCEPTED | 0.03 s | 1 | details |
#7 | ACCEPTED | 0.05 s | 1 | details |
#8 | ACCEPTED | 0.03 s | 1 | details |
#9 | ACCEPTED | 0.04 s | 1 | details |
#10 | ACCEPTED | 0.03 s | 1 | details |
#11 | WRONG ANSWER | 0.06 s | 2 | details |
#12 | RUNTIME ERROR | 0.18 s | 2 | details |
#13 | ACCEPTED | 0.06 s | 2 | details |
#14 | RUNTIME ERROR | 0.18 s | 2 | details |
#15 | RUNTIME ERROR | 0.17 s | 2 | details |
#16 | RUNTIME ERROR | 0.18 s | 2 | details |
#17 | RUNTIME ERROR | 0.16 s | 2 | details |
#18 | RUNTIME ERROR | 0.20 s | 2 | details |
#19 | RUNTIME ERROR | 0.17 s | 2 | details |
#20 | RUNTIME ERROR | 0.19 s | 2 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:22:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] for (int i = 0; i< v.size(); i++) { ^
Code
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; vector<int> v; int p[202020]; int s[202020]; for (int i = 0; i<n; i++) { int a; cin >> a; v.push_back(a); if (p[a] == 0) p[a] = i; s[a] = i; } int m = 1010101; for (int i = 0; i< v.size(); i++) { int b = v[i]; int d = p[b]+v.size()-s[b]-1; m = min(m, d); } cout << m << "\n"; return 0; }
Test details
Test 1
Group: 1
Verdict: WRONG ANSWER
input |
---|
100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
correct output |
---|
0 |
user output |
---|
1 |
Test 2
Group: 1
Verdict: WRONG ANSWER
input |
---|
100 100 100 100 100 100 100 100 10... |
correct output |
---|
0 |
user output |
---|
1 |
Test 3
Group: 1
Verdict: ACCEPTED
input |
---|
100 1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
correct output |
---|
99 |
user output |
---|
99 |
Test 4
Group: 1
Verdict: WRONG ANSWER
input |
---|
100 87 26 53 26 74 50 42 59 36 97 ... |
correct output |
---|
7 |
user output |
---|
27 |
Test 5
Group: 1
Verdict: ACCEPTED
input |
---|
100 8 13 46 3 85 40 62 70 14 29 88... |
correct output |
---|
2 |
user output |
---|
2 |
Test 6
Group: 1
Verdict: ACCEPTED
input |
---|
100 33 30 73 66 8 42 68 41 56 26 3... |
correct output |
---|
6 |
user output |
---|
6 |
Test 7
Group: 1
Verdict: ACCEPTED
input |
---|
100 16 41 11 93 19 59 1 35 1 79 45... |
correct output |
---|
18 |
user output |
---|
18 |
Test 8
Group: 1
Verdict: ACCEPTED
input |
---|
100 32 5 78 9 53 6 23 99 98 38 29 ... |
correct output |
---|
11 |
user output |
---|
11 |
Test 9
Group: 1
Verdict: ACCEPTED
input |
---|
100 70 43 99 91 87 5 26 33 3 97 60... |
correct output |
---|
11 |
user output |
---|
11 |
Test 10
Group: 1
Verdict: ACCEPTED
input |
---|
100 80 15 67 8 19 2 47 2 51 79 34 ... |
correct output |
---|
23 |
user output |
---|
23 |
Test 11
Group: 2
Verdict: WRONG ANSWER
input |
---|
100000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
correct output |
---|
0 |
user output |
---|
1 |
Test 12
Group: 2
Verdict: RUNTIME ERROR
input |
---|
100000 1000000000 1000000000 10000000... |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 13
Group: 2
Verdict: ACCEPTED
input |
---|
100000 1 2 3 4 5 6 7 8 9 10 11 12 13 ... |
correct output |
---|
99999 |
user output |
---|
99999 |
Test 14
Group: 2
Verdict: RUNTIME ERROR
input |
---|
100000 368557660 202067774 869767532 ... |
correct output |
---|
45422 |
user output |
---|
(empty) |
Test 15
Group: 2
Verdict: RUNTIME ERROR
input |
---|
100000 279796163 249838695 918802148 ... |
correct output |
---|
58055 |
user output |
---|
(empty) |
Test 16
Group: 2
Verdict: RUNTIME ERROR
input |
---|
100000 652215128 684591779 146182625 ... |
correct output |
---|
30508 |
user output |
---|
(empty) |
Test 17
Group: 2
Verdict: RUNTIME ERROR
input |
---|
100000 912992845 719581379 126326667 ... |
correct output |
---|
54978 |
user output |
---|
(empty) |
Test 18
Group: 2
Verdict: RUNTIME ERROR
input |
---|
100000 974161548 952419593 431337025 ... |
correct output |
---|
1637 |
user output |
---|
(empty) |
Test 19
Group: 2
Verdict: RUNTIME ERROR
input |
---|
100000 912344935 691159511 836812179 ... |
correct output |
---|
57759 |
user output |
---|
(empty) |
Test 20
Group: 2
Verdict: RUNTIME ERROR
input |
---|
100000 752551555 857180406 698838947 ... |
correct output |
---|
18067 |
user output |
---|
(empty) |