Task: | Money |
Sender: | Lieska |
Submission time: | 2019-02-02 10:40:20 +0200 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
#3 | WRONG ANSWER | 0 |
#4 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.02 s | 1 | details |
#2 | WRONG ANSWER | 0.02 s | 1 | details |
#3 | WRONG ANSWER | 0.02 s | 1 | details |
#4 | WRONG ANSWER | 0.01 s | 1 | details |
#5 | ACCEPTED | 0.01 s | 1 | details |
#6 | ACCEPTED | 0.01 s | 1 | details |
#7 | WRONG ANSWER | 0.02 s | 1 | details |
#8 | WRONG ANSWER | 0.01 s | 1 | details |
#9 | WRONG ANSWER | 0.02 s | 1 | details |
#10 | WRONG ANSWER | 0.02 s | 1 | details |
#11 | ACCEPTED | 0.02 s | 1 | details |
#12 | WRONG ANSWER | 0.02 s | 1 | details |
#13 | WRONG ANSWER | 0.02 s | 1 | details |
#14 | WRONG ANSWER | 0.02 s | 1 | details |
#15 | ACCEPTED | 0.02 s | 1 | details |
#16 | WRONG ANSWER | 0.02 s | 1 | details |
#17 | WRONG ANSWER | 0.01 s | 2 | details |
#18 | ACCEPTED | 0.02 s | 2 | details |
#19 | WRONG ANSWER | 0.01 s | 2 | details |
#20 | ACCEPTED | 0.01 s | 2 | details |
#21 | WRONG ANSWER | 0.01 s | 2 | details |
#22 | WRONG ANSWER | 0.02 s | 2 | details |
#23 | WRONG ANSWER | 0.01 s | 2 | details |
#24 | ACCEPTED | 0.01 s | 2 | details |
#25 | WRONG ANSWER | 0.03 s | 2 | details |
#26 | ACCEPTED | 0.01 s | 2 | details |
#27 | WRONG ANSWER | 0.02 s | 3 | details |
#28 | WRONG ANSWER | 0.02 s | 3 | details |
#29 | WRONG ANSWER | 0.02 s | 3 | details |
#30 | WRONG ANSWER | 0.03 s | 3 | details |
#31 | ACCEPTED | 0.02 s | 3 | details |
#32 | WRONG ANSWER | 0.01 s | 3 | details |
#33 | ACCEPTED | 0.03 s | 3 | details |
#34 | ACCEPTED | 0.02 s | 3 | details |
#35 | WRONG ANSWER | 0.02 s | 3 | details |
#36 | WRONG ANSWER | 0.01 s | 3 | details |
#37 | ACCEPTED | 0.01 s | 3 | details |
#38 | ACCEPTED | 0.01 s | 3 | details |
#39 | WRONG ANSWER | 0.37 s | 4 | details |
#40 | WRONG ANSWER | 0.67 s | 4 | details |
#41 | WRONG ANSWER | 0.30 s | 4 | details |
#42 | WRONG ANSWER | 0.31 s | 4 | details |
#43 | WRONG ANSWER | 0.21 s | 4 | details |
#44 | WRONG ANSWER | 0.85 s | 4 | details |
#45 | ACCEPTED | 0.81 s | 4 | details |
#46 | ACCEPTED | 0.85 s | 4 | details |
#47 | ACCEPTED | 0.75 s | 4 | details |
#48 | WRONG ANSWER | 0.77 s | 4 | details |
#49 | WRONG ANSWER | 1.18 s | 4 | details |
#50 | ACCEPTED | 1.13 s | 4 | details |
#51 | WRONG ANSWER | 1.19 s | 4 | details |
#52 | WRONG ANSWER | 1.15 s | 4 | details |
#53 | ACCEPTED | 1.20 s | 4 | details |
#54 | WRONG ANSWER | 1.16 s | 4 | details |
#55 | TIME LIMIT EXCEEDED | -- | 4 | details |
#56 | WRONG ANSWER | 1.50 s | 4 | details |
#57 | TIME LIMIT EXCEEDED | -- | 4 | details |
#58 | TIME LIMIT EXCEEDED | -- | 4 | details |
#59 | TIME LIMIT EXCEEDED | -- | 4 | details |
#60 | TIME LIMIT EXCEEDED | -- | 4 | details |
#61 | TIME LIMIT EXCEEDED | -- | 4 | details |
#62 | TIME LIMIT EXCEEDED | -- | 4 | details |
Code
#include <bits/stdc++.h> using namespace std; int main(){ int n, a, b=0, c=0, r=1; multiset<int> s; cin >> n; cin >> a; s.insert(a); b=a; int i=2; while (c==0 && i<=n){ cin >> a; s.insert(a); if (a<b) { c=1; } else b=a; ++i; } if (c==0) cout << "1"; else { auto it=s.upper_bound(a); while (i<=n){ cin >> a; if (a<b || (s.lower_bound(a)!=it && a!=b)){ r++; it=s.upper_bound(a); } b=a; s.insert(a); ++i; } cout << r; } return 0; }
Test details
Test 1
Group: 1
Verdict: ACCEPTED
input |
---|
6 3 6 4 5 1 2 |
correct output |
---|
3 |
user output |
---|
3 |
Test 2
Group: 1
Verdict: WRONG ANSWER
input |
---|
6 1 3 5 2 4 6 |
correct output |
---|
4 |
user output |
---|
3 |
Test 3
Group: 1
Verdict: WRONG ANSWER
input |
---|
6 2 4 6 1 3 5 |
correct output |
---|
4 |
user output |
---|
3 |
Test 4
Group: 1
Verdict: WRONG ANSWER
input |
---|
6 2 3 2 3 2 3 |
correct output |
---|
3 |
user output |
---|
2 |
Test 5
Group: 1
Verdict: ACCEPTED
input |
---|
6 1 2 5 6 3 4 |
correct output |
---|
2 |
user output |
---|
2 |
Test 6
Group: 1
Verdict: ACCEPTED
input |
---|
6 1 2 5 3 4 6 |
correct output |
---|
3 |
user output |
---|
3 |
Test 7
Group: 1
Verdict: WRONG ANSWER
input |
---|
4 550483 550483 745079 243195 |
correct output |
---|
2 |
user output |
---|
1 |
Test 8
Group: 1
Verdict: WRONG ANSWER
input |
---|
8 718639 990890 718639 990890 99... |
correct output |
---|
3 |
user output |
---|
2 |
Test 9
Group: 1
Verdict: WRONG ANSWER
input |
---|
6 75094 75094 75094 576383 16236... |
correct output |
---|
3 |
user output |
---|
2 |
Test 10
Group: 1
Verdict: WRONG ANSWER
input |
---|
8 577594 541467 472059 277648 57... |
correct output |
---|
7 |
user output |
---|
6 |
Test 11
Group: 1
Verdict: ACCEPTED
input |
---|
8 831697 182542 182542 246377 24... |
correct output |
---|
4 |
user output |
---|
4 |
Test 12
Group: 1
Verdict: WRONG ANSWER
input |
---|
8 710010 388188 309143 388188 71... |
correct output |
---|
6 |
user output |
---|
5 |
Test 13
Group: 1
Verdict: WRONG ANSWER
input |
---|
8 806776 806776 223756 806776 80... |
correct output |
---|
2 |
user output |
---|
1 |
Test 14
Group: 1
Verdict: WRONG ANSWER
input |
---|
8 32911 32911 32911 32911 562837... |
correct output |
---|
3 |
user output |
---|
2 |
Test 15
Group: 1
Verdict: ACCEPTED
input |
---|
8 997465 997465 968321 968321 39... |
correct output |
---|
5 |
user output |
---|
5 |
Test 16
Group: 1
Verdict: WRONG ANSWER
input |
---|
8 468346 200735 468346 200735 88... |
correct output |
---|
7 |
user output |
---|
6 |
Test 17
Group: 2
Verdict: WRONG ANSWER
input |
---|
15 179920 568853 179920 568853 84... |
correct output |
---|
10 |
user output |
---|
9 |
Test 18
Group: 2
Verdict: ACCEPTED
input |
---|
14 626116 805032 60415 626116 388... |
correct output |
---|
12 |
user output |
---|
12 |
Test 19
Group: 2
Verdict: WRONG ANSWER
input |
---|
10 494573 746756 237932 746756 81... |
correct output |
---|
7 |
user output |
---|
6 |
Test 20
Group: 2
Verdict: ACCEPTED
input |
---|
20 371839 10893 10893 10893 98708... |
correct output |
---|
11 |
user output |
---|
11 |
Test 21
Group: 2
Verdict: WRONG ANSWER
input |
---|
20 197220 303712 197220 389265 67... |
correct output |
---|
13 |
user output |
---|
12 |
Test 22
Group: 2
Verdict: WRONG ANSWER
input |
---|
20 509271 509271 922019 509271 92... |
correct output |
---|
6 |
user output |
---|
5 |
Test 23
Group: 2
Verdict: WRONG ANSWER
input |
---|
20 757151 645451 757151 757151 75... |
correct output |
---|
8 |
user output |
---|
7 |
Test 24
Group: 2
Verdict: ACCEPTED
input |
---|
20 746146 385991 385991 350689 38... |
correct output |
---|
11 |
user output |
---|
11 |
Test 25
Group: 2
Verdict: WRONG ANSWER
input |
---|
20 440622 720564 700447 459690 72... |
correct output |
---|
16 |
user output |
---|
15 |
Test 26
Group: 2
Verdict: ACCEPTED
input |
---|
20 324662 468027 324662 324662 46... |
correct output |
---|
14 |
user output |
---|
14 |
Test 27
Group: 3
Verdict: WRONG ANSWER
input |
---|
200 165 2 175 136 128 88 33 189 14... |
correct output |
---|
196 |
user output |
---|
195 |
Test 28
Group: 3
Verdict: WRONG ANSWER
input |
---|
81 37 2 58 16 18 65 8 81 21 71 33... |
correct output |
---|
77 |
user output |
---|
76 |
Test 29
Group: 3
Verdict: WRONG ANSWER
input |
---|
84 61 43 21 4 3 45 9 72 55 50 41 ... |
correct output |
---|
80 |
user output |
---|
79 |
Test 30
Group: 3
Verdict: WRONG ANSWER
input |
---|
81 1 20 53 35 10 3 74 48 22 38 26... |
correct output |
---|
77 |
user output |
---|
76 |
Test 31
Group: 3
Verdict: ACCEPTED
input |
---|
118 43 2 28 111 5 26 3 23 76 10 11... |
correct output |
---|
110 |
user output |
---|
110 |
Test 32
Group: 3
Verdict: WRONG ANSWER
input |
---|
300 145507 564378 903068 564378 47... |
correct output |
---|
214 |
user output |
---|
213 |
Test 33
Group: 3
Verdict: ACCEPTED
input |
---|
300 198887 496454 496454 176658 19... |
correct output |
---|
180 |
user output |
---|
180 |
Test 34
Group: 3
Verdict: ACCEPTED
input |
---|
300 97004 968456 968456 968456 136... |
correct output |
---|
217 |
user output |
---|
217 |
Test 35
Group: 3
Verdict: WRONG ANSWER
input |
---|
300 376675 480811 480811 480811 48... |
correct output |
---|
78 |
user output |
---|
77 |
Test 36
Group: 3
Verdict: WRONG ANSWER
input |
---|
300 581370 581370 716169 581370 81... |
correct output |
---|
179 |
user output |
---|
178 |
Test 37
Group: 3
Verdict: ACCEPTED
input |
---|
300 531046 550600 550600 401018 40... |
correct output |
---|
258 |
user output |
---|
258 |
Test 38
Group: 3
Verdict: ACCEPTED
input |
---|
300 739447 739447 571323 571323 57... |
correct output |
---|
221 |
user output |
---|
221 |
Test 39
Group: 4
Verdict: WRONG ANSWER
input |
---|
480481 806002 806002 621477 91785 917... |
correct output |
---|
320287 |
user output |
---|
320286 |
Test 40
Group: 4
Verdict: WRONG ANSWER
input |
---|
788953 897530 211298 189842 844784 89... |
correct output |
---|
658146 |
user output |
---|
658145 |
Test 41
Group: 4
Verdict: WRONG ANSWER
input |
---|
388796 806119 739351 66427 113886 113... |
correct output |
---|
232110 |
user output |
---|
232109 |
Test 42
Group: 4
Verdict: WRONG ANSWER
input |
---|
343838 199431 288483 635849 288483 68... |
correct output |
---|
297964 |
user output |
---|
297963 |
Test 43
Group: 4
Verdict: WRONG ANSWER
input |
---|
242351 818489 249811 887102 290660 88... |
correct output |
---|
211988 |
user output |
---|
211987 |
Test 44
Group: 4
Verdict: WRONG ANSWER
input |
---|
1000000 738237 738237 893082 490298 43... |
correct output |
---|
777569 |
user output |
---|
777568 |
Test 45
Group: 4
Verdict: ACCEPTED
input |
---|
1000000 74304 74304 74304 325602 71262... |
correct output |
---|
714524 |
user output |
---|
714524 |
Test 46
Group: 4
Verdict: ACCEPTED
input |
---|
1000000 254366 875788 564327 564327 43... |
correct output |
---|
777558 |
user output |
---|
777558 |
Test 47
Group: 4
Verdict: ACCEPTED
input |
---|
1000000 937517 114387 114387 114387 93... |
correct output |
---|
249890 |
user output |
---|
249890 |
Test 48
Group: 4
Verdict: WRONG ANSWER
input |
---|
1000000 814027 682934 214670 214670 81... |
correct output |
---|
500240 |
user output |
---|
500239 |
Test 49
Group: 4
Verdict: WRONG ANSWER
input |
---|
1000000 717896 297551 254872 297551 61... |
correct output |
---|
833179 |
user output |
---|
833178 |
Test 50
Group: 4
Verdict: ACCEPTED
input |
---|
1000000 563974 664553 563974 609181 56... |
correct output |
---|
750197 |
user output |
---|
750197 |
Test 51
Group: 4
Verdict: WRONG ANSWER
input |
---|
1000000 173690 978648 978648 978648 90... |
correct output |
---|
874390 |
user output |
---|
874389 |
Test 52
Group: 4
Verdict: WRONG ANSWER
input |
---|
1000000 785890 785890 785890 785890 78... |
correct output |
---|
750316 |
user output |
---|
750315 |
Test 53
Group: 4
Verdict: ACCEPTED
input |
---|
1000000 119439 119439 119439 354111 73... |
correct output |
---|
798579 |
user output |
---|
798579 |
Test 54
Group: 4
Verdict: WRONG ANSWER
input |
---|
1000000 749078 95090 749078 276834 950... |
correct output |
---|
750593 |
user output |
---|
750592 |
Test 55
Group: 4
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 137937 689287 749751 213838 32... |
correct output |
---|
981871 |
user output |
---|
(empty) |
Test 56
Group: 4
Verdict: WRONG ANSWER
input |
---|
1000000 473653 274191 673488 575890 73... |
correct output |
---|
981543 |
user output |
---|
981542 |
Test 57
Group: 4
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 913583 648901 29748 168104 439... |
correct output |
---|
981717 |
user output |
---|
(empty) |
Test 58
Group: 4
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 890981 682430 885587 406305 60... |
correct output |
---|
981788 |
user output |
---|
(empty) |
Test 59
Group: 4
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 1 2 247847 4 767575 281751 982... |
correct output |
---|
981660 |
user output |
---|
(empty) |
Test 60
Group: 4
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 285138 720188 820135 821835 91... |
correct output |
---|
982003 |
user output |
---|
(empty) |
Test 61
Group: 4
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 421947 680547 224842 941720 26... |
correct output |
---|
981663 |
user output |
---|
(empty) |
Test 62
Group: 4
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000 963500 2 664028 4 692637 80284... |
correct output |
---|
981624 |
user output |
---|
(empty) |