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
Gleb is a famous competitive programming teacher from Innopolis. He is planning a trip to N programming camps in the nearest future. Each camp will be held in a different country. For each of them, Gleb needs to apply for a visa. For each of these trips Gleb knows three integers: the number of the first day of the trip s i , the length of the trip in days len i , and the number of days t i this country's consulate will take to process a visa application and stick a visa in a passport. Gleb has P ( 1 ≤ P ≤ 2 ) valid passports and is able to decide which visa he wants to put in which passport. For each trip, Gleb will have a flight to that country early in the morning of the day s i and will return back late in the evening of the day s i + len i - 1 . To apply for a visa on the day d , Gleb needs to be in Innopolis in the middle of this day. So he can't apply for a visa while he is on a trip, including the first and the last days. If a trip starts the next day after the end of the other one, Gleb can't apply for a visa between them as well. The earliest Gleb can apply for a visa is day 1. After applying for a visa of country i on day d , Gleb will get his passport back in the middle of the day d + t i . Consulates use delivery services, so Gleb can get his passport back even if he is not in Innopolis on this day. Gleb can apply for another visa on the same day he received his passport back, if he is in Innopolis this day. Gleb will not be able to start his trip on day s i if he doesn't has a passport with a visa for the corresponding country in the morning of day s i . In particular, the passport should not be in another country's consulate for visa processing. Help Gleb to decide which visas he needs to receive in which passport, and when he should apply for each visa. In the first line of the input there are two integers N ( 1 ≤ N ≤ 22 ) and P ( 1 ≤ P ≤ 2 )—the number of trips and the number of passports Gleb has, respectively. The next N lines describe Gl |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|
41413530 |
samjia2000 |
F |
Aug. 9, 2018, 11:27 p.m. |
OK |
GNU C++ |
TESTS |
106 |
1309 |
84070400 |
|
3200 |
|
52149464 |
xgcxgc |
F |
April 1, 2019, 11:02 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
546 |
33689600 |
|
3200 |
|
52143933 |
luogu_bot3 |
F |
April 1, 2019, 8:21 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
546 |
33689600 |
|
3200 |
|
48049915 |
rk1 |
F |
Jan. 7, 2019, 8:05 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
592 |
16793600 |
|
3200 |
|
52630572 |
dushaolong |
F |
April 12, 2019, 6:49 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
592 |
33689600 |
|
3200 |
|
52626176 |
SYCstudio |
F |
April 12, 2019, 3:39 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
592 |
33689600 |
|
3200 |
|
48114130 |
ldy419 |
F |
Jan. 9, 2019, 11:34 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
607 |
50483200 |
|
3200 |
|
49554103 |
frodakcin |
F |
Feb. 7, 2019, 8:27 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
607 |
67276800 |
|
3200 |
|
48115887 |
Buzhibujue |
F |
Jan. 9, 2019, 12:43 p.m. |
OK |
GNU C++11 |
TESTS |
106 |
607 |
134451200 |
|
3200 |
|
48104846 |
251 |
F |
Jan. 9, 2019, 3:28 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
623 |
33484800 |
|
3200 |
|
48104890 |
251 |
F |
Jan. 9, 2019, 3:32 a.m. |
OK |
GNU C++11 |
TESTS |
106 |
702 |
33484800 |
|
3200 |
|
56188505 |
Newusers |
F |
June 28, 2019, 6:19 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
561 |
50483200 |
|
3200 |
|
43167675 |
usaco_dp |
F |
Sept. 21, 2018, 6:12 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
639 |
66764800 |
|
3200 |
|
44675251 |
newbiegcz |
F |
Oct. 22, 2018, 3:19 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
654 |
100864000 |
|
3200 |
|
40976936 |
ReaLNero1 |
F |
July 30, 2018, 3:57 p.m. |
OK |
GNU C++14 |
TESTS |
106 |
655 |
66457600 |
|
3200 |
|
40975225 |
TLE |
F |
July 30, 2018, 3:05 p.m. |
OK |
GNU C++14 |
TESTS |
106 |
655 |
66457600 |
|
3200 |
|
47891537 |
iqqsoszs |
F |
Jan. 4, 2019, 6:59 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
670 |
50483200 |
|
3200 |
|
41335815 |
DEMOPON |
F |
Aug. 8, 2018, noon |
OK |
GNU C++14 |
TESTS |
106 |
670 |
66457600 |
|
3200 |
|
41294072 |
apiadu |
F |
Aug. 7, 2018, 6:02 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
732 |
50483200 |
|
3200 |
|
41557815 |
consecutivelimit |
F |
Aug. 13, 2018, 12:25 p.m. |
OK |
GNU C++14 |
TESTS |
106 |
811 |
20992000 |
|
3200 |
|
59972280 |
Scut82 |
F |
Sept. 4, 2019, 2:41 a.m. |
OK |
GNU C++14 |
TESTS |
106 |
1107 |
67276800 |
|
3200 |
|
56301607 |
Theo830 |
F |
June 30, 2019, 9:12 a.m. |
OK |
GNU C++17 |
TESTS |
106 |
576 |
50483200 |
|
3200 |
|
52154112 |
Rose_max |
F |
April 1, 2019, 12:47 p.m. |
OK |
GNU C++17 |
TESTS |
106 |
592 |
50380800 |
|
3200 |
|
48926482 |
majk |
F |
Jan. 25, 2019, 10:43 a.m. |
OK |
GNU C++17 |
TESTS |
106 |
608 |
50790400 |
|
3200 |
|
48926240 |
majk |
F |
Jan. 25, 2019, 10:37 a.m. |
OK |
GNU C++17 |
TESTS |
106 |
623 |
50688000 |
|
3200 |
|
48926274 |
majk |
F |
Jan. 25, 2019, 10:37 a.m. |
OK |
GNU C++17 |
TESTS |
106 |
638 |
50688000 |
|
3200 |
|
48926928 |
majk |
F |
Jan. 25, 2019, 10:58 a.m. |
OK |
GNU C++17 |
TESTS |
106 |
639 |
50790400 |
|
3200 |
|
41334650 |
WLZ |
F |
Aug. 8, 2018, 11:12 a.m. |
OK |
GNU C++17 |
TESTS |
106 |
670 |
50483200 |
|
3200 |
|
48926110 |
majk |
F |
Jan. 25, 2019, 10:33 a.m. |
OK |
GNU C++17 |
TESTS |
106 |
685 |
50688000 |
|
3200 |
|
48927133 |
majk |
F |
Jan. 25, 2019, 11:03 a.m. |
OK |
GNU C++17 |
TESTS |
106 |
685 |
50790400 |
|
3200 |
|
48926890 |
majk |
F |
Jan. 25, 2019, 10:57 a.m. |
OK |
GNU C++17 |
TESTS |
106 |
732 |
50790400 |
|
3200 |
|
41510707 |
mmaxio |
F |
Aug. 12, 2018, 2 a.m. |
OK |
Java 8 |
TESTS |
106 |
1434 |
59084800 |
|
3200 |
remove filters
Back to search problems