Solutions are presented as using the least memory and the fastest execution time. It also takes the top
10 most recent solutions from each language. If you want to limit to a specific index, click the
"Solved" button and go to that problem.
Problems
B'Polycarp studies in Berland State University. Soon he will have to take his exam. He has to pass exactly n exams. For the each exam i there are known two days: a_i -- day of the first opportunity to pass the exam, b_i -- day of the second opportunity to pass the exam ( a_i < b_i ). Polycarp can pass at most one exam during each day. For each exam Polycarp chooses by himself which day he will pass this exam. He has to pass all the n exams. Polycarp wants to pass all the exams as soon as possible. Print the minimum index of day by which Polycarp can pass all the n exams, or print -1 if he cannot pass all the exams at all. The first line of the input contains one integer n ( 1 <= n <= 10^6 ) -- the number of exams. The next n lines contain two integers each: a_i and b_i ( 1 <= a_i < b_i <= 10^9 ), where a_i is the number of day of the first passing the i -th exam and b_i is the number of day of the second passing the i -th exam. If Polycarp cannot pass all the n exams, print -1. Otherwise print the minimum index of day by which Polycarp can do that. '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
42199034 |
vjudge2 |
F |
Aug. 28, 2018, 7:54 a.m. |
OK |
GNU C++ |
TESTS |
86 |
326 |
109363200 |
|
2400 |
42146757 |
dyxx |
F |
Aug. 27, 2018, 9:19 a.m. |
OK |
GNU C++ |
TESTS |
86 |
764 |
40038400 |
|
2400 |
41951957 |
fwat |
F |
Aug. 22, 2018, 2:24 a.m. |
OK |
GNU C++ |
TESTS |
85 |
764 |
40140800 |
|
2400 |
41951166 |
fwat |
F |
Aug. 22, 2018, 1:33 a.m. |
OK |
GNU C++ |
TESTS |
85 |
779 |
20275200 |
|
2400 |
41881178 |
Leo-JAM |
F |
Aug. 20, 2018, 1:37 a.m. |
OK |
GNU C++ |
TESTS |
85 |
780 |
20275200 |
|
2400 |
41951952 |
fwat |
F |
Aug. 22, 2018, 2:23 a.m. |
OK |
GNU C++ |
TESTS |
85 |
780 |
40140800 |
|
2400 |
41881148 |
Leo-JAM |
F |
Aug. 20, 2018, 1:36 a.m. |
OK |
GNU C++ |
TESTS |
85 |
795 |
20275200 |
|
2400 |
42154218 |
changxv |
F |
Aug. 27, 2018, 1:47 p.m. |
OK |
GNU C++ |
TESTS |
86 |
811 |
86937600 |
|
2400 |
42295180 |
shuitiacji |
F |
Aug. 31, 2018, 2:19 a.m. |
OK |
GNU C++ |
TESTS |
86 |
873 |
56320000 |
|
2400 |
41815665 |
Dedicatus545 |
F |
Aug. 19, 2018, 6:25 a.m. |
OK |
GNU C++ |
TESTS |
85 |
951 |
64102400 |
|
2400 |
57324020 |
sansen |
F |
July 19, 2019, 11:18 a.m. |
OK |
GNU C11 |
TESTS |
86 |
1746 |
90419200 |
|
2400 |
55269446 |
rainboy |
F |
June 7, 2019, 3:48 p.m. |
OK |
GNU C11 |
TESTS |
86 |
1840 |
114176000 |
|
2400 |
57323022 |
sansen |
F |
July 19, 2019, 10:54 a.m. |
OK |
GNU C11 |
TESTS |
86 |
3993 |
40038400 |
|
2400 |
42199014 |
ouqingliang |
F |
Aug. 28, 2018, 7:53 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
327 |
109363200 |
|
2400 |
42696054 |
ReaLNero1 |
F |
Sept. 9, 2018, 7:13 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
327 |
109363200 |
|
2400 |
43887693 |
vjudge5 |
F |
Oct. 6, 2018, 8:11 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
327 |
109363200 |
|
2400 |
64896507 |
EncodeTalker |
F |
Nov. 14, 2019, 4:49 p.m. |
OK |
GNU C++11 |
TESTS |
86 |
607 |
48128000 |
|
2400 |
64896220 |
EncodeTalker |
F |
Nov. 14, 2019, 4:42 p.m. |
OK |
GNU C++11 |
TESTS |
86 |
607 |
48128000 |
|
2400 |
44732467 |
zhangleo |
F |
Oct. 23, 2018, 11:18 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
623 |
40038400 |
|
2400 |
41988677 |
ZqlwMatt |
F |
Aug. 23, 2018, 7:32 a.m. |
OK |
GNU C++11 |
TESTS |
85 |
623 |
40140800 |
|
2400 |
42607499 |
kamiyoru |
F |
Sept. 7, 2018, 8:53 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
639 |
25907200 |
|
2400 |
44704228 |
LiGuanlin |
F |
Oct. 22, 2018, 4:05 p.m. |
OK |
GNU C++11 |
TESTS |
86 |
639 |
39936000 |
|
2400 |
43476244 |
_Dispwnl |
F |
Sept. 27, 2018, 3:31 a.m. |
OK |
GNU C++11 |
TESTS |
86 |
639 |
82432000 |
|
2400 |
41891791 |
T.V_N |
F |
Aug. 20, 2018, 7:33 a.m. |
OK |
GNU C++14 |
TESTS |
85 |
904 |
24064000 |
|
2400 |
45446496 |
ductuanlhp |
F |
Nov. 8, 2018, 1:40 p.m. |
OK |
GNU C++14 |
TESTS |
86 |
904 |
104960000 |
|
2400 |
41826359 |
humveea6 |
F |
Aug. 19, 2018, 12:15 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
919 |
24064000 |
|
2400 |
42149634 |
nickluo |
F |
Aug. 27, 2018, 11:23 a.m. |
OK |
GNU C++14 |
TESTS |
86 |
966 |
60825600 |
|
2400 |
57743017 |
vjudge5 |
F |
July 25, 2019, 12:04 p.m. |
OK |
GNU C++14 |
TESTS |
86 |
1045 |
82022400 |
|
2400 |
41898225 |
forerunner |
F |
Aug. 20, 2018, 10:46 a.m. |
OK |
GNU C++14 |
TESTS |
85 |
1060 |
64102400 |
|
2400 |
42952586 |
hatuank97lhp |
F |
Sept. 16, 2018, 2:48 p.m. |
OK |
GNU C++14 |
TESTS |
86 |
1060 |
104960000 |
|
2400 |
42005211 |
ddolgu14 |
F |
Aug. 23, 2018, 5:55 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
1075 |
32051200 |
|
2400 |
41796789 |
CK6100LGEV2 |
F |
Aug. 18, 2018, 5:03 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
1076 |
106188800 |
|
2400 |
41867937 |
bbtl |
F |
Aug. 19, 2018, 5:33 p.m. |
OK |
GNU C++14 |
TESTS |
85 |
1107 |
32051200 |
|
2400 |
43343119 |
HIT_TOM |
F |
Sept. 23, 2018, 6:46 p.m. |
OK |
GNU C++17 |
TESTS |
86 |
826 |
72499200 |
|
2400 |
60373149 |
haleyk100198 |
F |
Sept. 11, 2019, 4:20 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
873 |
65433600 |
|
2400 |
41811724 |
chenyeyuan |
F |
Aug. 19, 2018, 3:31 a.m. |
OK |
GNU C++17 |
TESTS |
85 |
904 |
24064000 |
|
2400 |
41935694 |
IronKing |
F |
Aug. 21, 2018, 12:52 p.m. |
OK |
GNU C++17 |
TESTS |
85 |
982 |
24064000 |
|
2400 |
42350440 |
q234rty |
F |
Sept. 2, 2018, 4:38 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
998 |
110489600 |
|
2400 |
44184179 |
vjudge3 |
F |
Oct. 12, 2018, 12:33 p.m. |
OK |
GNU C++17 |
TESTS |
86 |
1044 |
82022400 |
|
2400 |
41950730 |
ecnerwala |
F |
Aug. 22, 2018, 12:58 a.m. |
OK |
GNU C++17 |
TESTS |
85 |
1076 |
32051200 |
|
2400 |
46923993 |
myx12345 |
F |
Dec. 12, 2018, 7:20 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
1076 |
84172800 |
|
2400 |
64720847 |
EDawn |
F |
Nov. 12, 2019, 3:21 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
1091 |
56115200 |
|
2400 |
56020230 |
Yzm007 |
F |
June 25, 2019, 2:30 a.m. |
OK |
GNU C++17 |
TESTS |
86 |
1092 |
56115200 |
|
2400 |
42078071 |
tri |
F |
Aug. 25, 2018, 6:49 a.m. |
OK |
Java 8 |
TESTS |
85 |
1465 |
62464000 |
|
2400 |
42078983 |
tri |
F |
Aug. 25, 2018, 7:16 a.m. |
OK |
Java 8 |
TESTS |
85 |
1543 |
62464000 |
|
2400 |
42079626 |
tri |
F |
Aug. 25, 2018, 7:35 a.m. |
OK |
Java 8 |
TESTS |
85 |
1809 |
70963200 |
|
2400 |
42218969 |
Baelish |
F |
Aug. 28, 2018, 7:02 p.m. |
OK |
Java 8 |
TESTS |
86 |
2043 |
38912000 |
|
2400 |
42218929 |
Baelish |
F |
Aug. 28, 2018, 7:01 p.m. |
OK |
Java 8 |
TESTS |
86 |
2090 |
38912000 |
|
2400 |
42079752 |
tri |
F |
Aug. 25, 2018, 7:39 a.m. |
OK |
Java 8 |
TESTS |
85 |
2136 |
58470400 |
|
2400 |
42080317 |
tri |
F |
Aug. 25, 2018, 7:54 a.m. |
OK |
Java 8 |
TESTS |
85 |
2214 |
71680000 |
|
2400 |
42218785 |
Baelish |
F |
Aug. 28, 2018, 6:56 p.m. |
OK |
Java 8 |
TESTS |
86 |
2511 |
103014400 |
|
2400 |
42218888 |
Baelish |
F |
Aug. 28, 2018, 6:59 p.m. |
OK |
Java 8 |
TESTS |
86 |
2667 |
103014400 |
|
2400 |
42218823 |
Baelish |
F |
Aug. 28, 2018, 6:57 p.m. |
OK |
Java 8 |
TESTS |
86 |
3228 |
103014400 |
|
2400 |
41828220 |
elizarov |
F |
Aug. 19, 2018, 1:13 p.m. |
OK |
Kotlin |
TESTS |
85 |
3915 |
93798400 |
|
2400 |
57722293 |
vjudge5 |
F |
July 25, 2019, 5:57 a.m. |
OK |
MS C++ |
TESTS |
86 |
1153 |
78131200 |
|
2400 |
57753101 |
vjudge4 |
F |
July 25, 2019, 3:24 p.m. |
OK |
MS C++ |
TESTS |
86 |
1247 |
91136000 |
|
2400 |
57750383 |
vjudge5 |
F |
July 25, 2019, 2:36 p.m. |
OK |
MS C++ |
TESTS |
86 |
1263 |
114176000 |
|
2400 |
41796538 |
lxn |
F |
Aug. 18, 2018, 5 p.m. |
OK |
MS C++ |
TESTS |
85 |
1435 |
34611200 |
|
2400 |
41821303 |
lucyanna2018 |
F |
Aug. 19, 2018, 9:43 a.m. |
OK |
MS C++ |
TESTS |
85 |
1809 |
48128000 |
|
2400 |
41813673 |
nywoo20 |
F |
Aug. 19, 2018, 5:16 a.m. |
OK |
MS C++ |
TESTS |
85 |
2168 |
43724800 |
|
2400 |
57718755 |
vjudge5 |
F |
July 25, 2019, 4:08 a.m. |
OK |
MS C++ |
TESTS |
86 |
2277 |
40140800 |
|
2400 |
41897022 |
Corvus |
F |
Aug. 20, 2018, 10:03 a.m. |
OK |
MS C++ |
TESTS |
85 |
2433 |
55910400 |
|
2400 |
44179827 |
vjudge2 |
F |
Oct. 12, 2018, 10:42 a.m. |
OK |
MS C++ |
TESTS |
86 |
3135 |
90316800 |
|
2400 |
52740536 |
vjudge5 |
F |
April 14, 2019, 8:46 a.m. |
OK |
MS C++ |
TESTS |
86 |
3961 |
200601600 |
|
2400 |
remove filters
Back to search problems