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'The red pandas are in town to meet their relatives, the blue pandas! The town is modeled by a number line. The pandas have already planned their meetup, but the schedule keeps changing. You are given q updates of the form x t c. The updates will be given in order of non-decreasing x values. After each update, please print the maximum number of friendships if the red pandas move in an optimal order based on all the updates given in the input above (and including) this update. The order in which a red panda moves can change between updates. The first line contains q ( 1 <= q q <= q 2 cdot 10^5 ) xe2 x80 x93 the number of updates. The i -th line of the next q lines consists of 3 integers x_i , t_i and c_i ( 0 <= q x_i <= q 10^9 , 0 <= q t_i <= q 10^9 , 0 < |c_i| <= q 1000 ) xe2 x80 x93 the description of the i -th update. It is guaranteed that the x_i will be given in non-decreasing order. After each update, print the maximum number of friendships that can be formed. In the first example, the number of friendships after each update can be optimized as follows: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
215278501 |
Leoknowstheway |
F |
July 23, 2023, 10:53 p.m. |
OK |
GNU C++17 (64) |
TESTS |
127 |
2308 |
72192000 |
|
|
215299832 |
Hritik12 |
F |
July 24, 2023, 4:36 a.m. |
OK |
GNU C++20 (64) |
TESTS |
127 |
280 |
14438400 |
|
|
215285692 |
ecnerwala |
F |
July 24, 2023, 1:25 a.m. |
OK |
GNU C++20 (64) |
TESTS |
127 |
280 |
14438400 |
|
|
215262240 |
FZFFFFFF |
F |
July 23, 2023, 6:47 p.m. |
OK |
GNU C++20 (64) |
TESTS |
127 |
436 |
28160000 |
|
|
215258181 |
jiangly |
F |
July 23, 2023, 6:10 p.m. |
OK |
GNU C++20 (64) |
TESTS |
127 |
436 |
28160000 |
|
|
215262200 |
FZFFFFFF |
F |
July 23, 2023, 6:47 p.m. |
OK |
GNU C++20 (64) |
TESTS |
127 |
1153 |
28262400 |
|
|
215261939 |
uchiha2504 |
F |
July 23, 2023, 6:44 p.m. |
OK |
GNU C++20 (64) |
TESTS |
127 |
2167 |
72192000 |
|
|
215255031 |
milk_81 |
F |
July 23, 2023, 5:48 p.m. |
OK |
GNU C++20 (64) |
TESTS |
127 |
2167 |
72192000 |
|
|
remove filters
Back to search problems