Educational Codeforces Round 113 (Rated for Div. 2)

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.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
1569 Educational Codeforces Round 113 (Rated for Div. 2) FINISHED False 7200 100711499 Sept. 8, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4401 ) D Inconvenient Pairs PROGRAMMING data structures implementation sortings two pointers

B"There is a city that can be represented as a square grid with corner points in (0, 0) and (10^6, 10^6) . The city has n vertical and m horizontal streets that goes across the whole city, i. e. the i -th vertical streets goes from (x_i, 0) to (x_i, 10^6) and the j -th horizontal street goes from (0, y_j) to (10^6, y_j) . All streets are bidirectional. Borders of the city are streets as well. There are k persons staying on the streets: the p -th person at point (x_p, y_p) (so either x_p equal to some x_i or y_p equal to some y_j , or both). Let's say that a pair of persons form an inconvenient pair if the shortest path from one person to another going only by streets is strictly greater than the Manhattan distance between them. Calculate the number of inconvenient pairs of persons (pairs (x, y) and (y, x) are the same pair). Let's recall that Manhattan distance between points (x_1, y_1) and (x_2, y_2) is |x_1 - x_2| + |y_1 - y_2| . The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The first line of each test case contains three integers n , m and k ( 2 <= n, m <= 2 cdot 10^5 ; 2 <= k <= 3 cdot 10^5 ) -- the number of vertical and horizontal streets and the number of persons. The second line of each test case contains n integers x_1, x_2, ... , x_n ( 0 = x_1 < x_2 < ... < x_{n - 1} < x_n = 10^6 ) -- the x -coordinates of vertical streets. The third line contains m integers y_1, y_2, ... , y_m ( 0 = y_1 < y_2 < ... < y_{m - 1} < y_m = 10^6 ) -- the y -coordinates of horizontal streets. Next k lines contains description of people. The p -th line contains two integers x_p and y_p ( 0 <= x_p, y_p <= 10^6 ; x_p in {x_1, ... , x_n } or y_p in {y_1, ... , y_m "...

Tutorials

94721

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
128289981 eastnman D Sept. 8, 2021, 6:28 p.m. OK Delphi TESTS 10 654 30208000
128311545 et3_tsy3.0 D Sept. 9, 2021, 4:43 a.m. OK GNU C++14 TESTS 10 109 45363200
128291901 Liameitimie D Sept. 8, 2021, 7 p.m. OK GNU C++14 TESTS 10 156 22835200
128273280 huangyi10040 D Sept. 8, 2021, 4:21 p.m. OK GNU C++14 TESTS 10 218 12902400
128303993 horbivores1 D Sept. 9, 2021, 1:22 a.m. OK GNU C++14 TESTS 10 249 16588800
128274037 zf_cjzhqdt D Sept. 8, 2021, 4:23 p.m. OK GNU C++14 TESTS 10 249 21401600
128305295 xjq D Sept. 9, 2021, 2:07 a.m. OK GNU C++14 TESTS 10 249 23756800
128283863 wdkklsw D Sept. 8, 2021, 5:08 p.m. OK GNU C++14 TESTS 10 265 12185600
128302322 Luzivanlt D Sept. 9, 2021, 12:28 a.m. OK GNU C++14 TESTS 10 265 35840000
128286219 shy_orz D Sept. 8, 2021, 5:34 p.m. OK GNU C++14 TESTS 10 280 12800000
128273505 zxjk D Sept. 8, 2021, 4:22 p.m. OK GNU C++14 TESTS 10 280 14540800

remove filters

Back to search problems