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"Little W and Little P decided to send letters to each other regarding the most important events during a day. There are n events during a day: at time moment t_i something happens to the person p_i ( p_i is either W or P, denoting Little W and Little P, respectively), so he needs to immediately send a letter to the other person. They can send a letter using one of the two ways: Help the friends determine the minimum possible total cost of sending all letters. The first line contains three integers n, c, d ( 1 <= q n <= q 10^5 , 1 <= q c <= q 10^2 , 1 <= q d <= q 10^8 ) -- the number of letters, the cost of storing a letter for one time unit at Wise R's den and the cost of delivering a letter via Friendly O. The next n describe the events. The i -th of them contains an integer t_i and a character p_i ( 0 <= q t_i <= q 10^6 , p_i is either W or P) -- the time the i -th event happens and the person the event happens to. The last line contains a single integer t_{n + 1} ( 0 <= q t_{n+1} <= q 10^6 ) -- the time when everybody comes to Wise R for a tea and takes all remaining letters. It is guaranteed that t_i < t_{i + 1} for all i from 1 to n . Print a single integer -- the minimum possible cost of delivery of all letters. One of optimal solutions in the first example: The total cost of delivery is thus 1 + 4 + 4 + 5 + 2 = 16 acorns. "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
51320489 |
y2823774827y |
F |
March 15, 2019, 6:38 a.m. |
OK |
GNU C++11 |
TESTS |
21 |
31 |
512000 |
|
2900 |
51318427 |
y2823774827y |
F |
March 15, 2019, 3:31 a.m. |
OK |
GNU C++11 |
TESTS |
21 |
31 |
512000 |
|
2900 |
51318334 |
y2823774827y |
F |
March 15, 2019, 3:20 a.m. |
OK |
GNU C++11 |
TESTS |
21 |
31 |
512000 |
|
2900 |
59902842 |
hankeke |
F |
Sept. 2, 2019, 2:15 p.m. |
OK |
GNU C++11 |
TESTS |
21 |
31 |
819200 |
|
2900 |
51922421 |
cuizhuyefei |
F |
March 28, 2019, 5:28 a.m. |
OK |
GNU C++11 |
TESTS |
21 |
31 |
1638400 |
|
2900 |
57866951 |
lopare |
F |
July 27, 2019, 9:47 p.m. |
OK |
GNU C++11 |
TESTS |
21 |
46 |
512000 |
|
2900 |
54162897 |
vjudge4 |
F |
May 15, 2019, 7:25 a.m. |
OK |
GNU C++11 |
TESTS |
21 |
46 |
512000 |
|
2900 |
54089272 |
Master_Yi |
F |
May 14, 2019, 9:37 a.m. |
OK |
GNU C++11 |
TESTS |
21 |
46 |
512000 |
|
2900 |
53564729 |
hjmmm |
F |
April 30, 2019, 11:47 a.m. |
OK |
GNU C++11 |
TESTS |
21 |
46 |
614400 |
|
2900 |
51317333 |
1592063346 |
F |
March 15, 2019, 2:12 a.m. |
OK |
GNU C++11 |
TESTS |
21 |
46 |
614400 |
|
2900 |
60284171 |
Scut82 |
F |
Sept. 9, 2019, 12:24 a.m. |
OK |
GNU C++14 |
TESTS |
21 |
46 |
512000 |
|
2900 |
50802469 |
gtrhetr |
F |
March 5, 2019, 1:38 a.m. |
OK |
GNU C++14 |
TESTS |
21 |
46 |
512000 |
|
2900 |
53541168 |
RNS_KSB |
F |
April 30, 2019, 6:50 a.m. |
OK |
GNU C++14 |
TESTS |
21 |
46 |
819200 |
|
2900 |
50802273 |
mayaohua2003 |
F |
March 5, 2019, 1:23 a.m. |
OK |
GNU C++14 |
TESTS |
21 |
46 |
819200 |
|
2900 |
50771714 |
HIR180 |
F |
March 4, 2019, 5:24 a.m. |
OK |
GNU C++14 |
TESTS |
21 |
46 |
921600 |
|
2900 |
51572874 |
jerome_wei |
F |
March 20, 2019, 12:09 p.m. |
OK |
GNU C++14 |
TESTS |
21 |
46 |
1228800 |
|
2900 |
67850643 |
Scut82 |
F |
Dec. 29, 2019, 2:39 a.m. |
OK |
GNU C++14 |
TESTS |
21 |
46 |
1331200 |
|
2900 |
61760461 |
_DYT |
F |
Oct. 3, 2019, 6:56 a.m. |
OK |
GNU C++14 |
TESTS |
21 |
46 |
1638400 |
|
2900 |
54172389 |
vjudge4 |
F |
May 15, 2019, 11:56 a.m. |
OK |
GNU C++14 |
TESTS |
21 |
46 |
1638400 |
|
2900 |
51056520 |
BSBandme |
F |
March 8, 2019, 11:06 p.m. |
OK |
GNU C++14 |
TESTS |
21 |
46 |
1638400 |
|
2900 |
50912867 |
Kalashnikov |
F |
March 7, 2019, 4:01 a.m. |
OK |
GNU C++17 |
TESTS |
21 |
46 |
819200 |
|
2900 |
50812548 |
zhaimingshuzms |
F |
March 5, 2019, 9:39 a.m. |
OK |
GNU C++17 |
TESTS |
21 |
46 |
1126400 |
|
2900 |
57326050 |
cerberus97 |
F |
July 19, 2019, 12:10 p.m. |
OK |
GNU C++17 |
TESTS |
21 |
46 |
1331200 |
|
2900 |
54658246 |
bmerry |
F |
May 26, 2019, 9:24 a.m. |
OK |
GNU C++17 |
TESTS |
21 |
46 |
1638400 |
|
2900 |
57751322 |
Nakagawa.Kanon |
F |
July 25, 2019, 2:52 p.m. |
OK |
GNU C++17 |
TESTS |
21 |
46 |
1945600 |
|
2900 |
54658193 |
bmerry |
F |
May 26, 2019, 9:23 a.m. |
OK |
GNU C++17 |
TESTS |
21 |
46 |
2457600 |
|
2900 |
52564014 |
Kmcode |
F |
April 10, 2019, 11:45 a.m. |
OK |
GNU C++17 |
TESTS |
21 |
46 |
2457600 |
|
2900 |
50878826 |
yzyyylx |
F |
March 6, 2019, 8:03 a.m. |
OK |
GNU C++17 |
TESTS |
21 |
46 |
2457600 |
|
2900 |
56607308 |
AlphaWA |
F |
July 6, 2019, 5:31 a.m. |
OK |
GNU C++17 |
TESTS |
21 |
46 |
2764800 |
|
2900 |
66143636 |
vjudge3 |
F |
Dec. 1, 2019, 3:33 p.m. |
OK |
GNU C++17 |
TESTS |
21 |
61 |
1638400 |
|
2900 |
remove filters
Back to search problems