Kotlin Heroes: Episode 7

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
1533 Kotlin Heroes: Episode 7 FINISHED False 9000 106845899 June 29, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 44 ) J Pawns PROGRAMMING *special

B'There is an infinite chessboard, divided into cells. The cell (x, y) is the cell on the intersection of the x_i -th row and y_i -th column. n black pawns are placed on the board, the i -th black pawn occupies the cell (x_i, y_i) . You want to capture all black pawns. In order to do so, you may perform the following actions: Recall that when you make a move with a white pawn in the cell (x, y) , the chess rules allow you to choose exactly one of these actions: You may perform any finite sequence of actions (placing white pawns and moving them). You want to capture all of the black pawns, and it can be shown that it is always possible; and you want to do it placing as few white pawns as possible. What is the minimum number of white pawns you have to place to capture all n black pawns? The first line contains one integer n ( 1 <= n <= 5 cdot 10^5 ) -- the number of black pawns. Then n lines follow. The i -th line contains two integers x_i and y_i ( 1 <= x_i, y_i <= 5 cdot 10^5 ) denoting a black pawn in the cell (x_i, y_i) . No cell is occupied by two or more black pawns. Print one integer -- the minimum number of white pawns you have to place to capture all n black pawns. '...

Tutorials

Kotlin Heroes 7 — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
120920576 b2jena J June 30, 2021, 4:13 a.m. OK Kotlin TESTS 43 576 5324800
120896750 Petr J June 29, 2021, 4:47 p.m. OK Kotlin TESTS 43 608 5324800
120912715 Benq J June 29, 2021, 10:56 p.m. OK Kotlin TESTS 43 826 139161600
120907205 Algo.1067 J June 29, 2021, 7:41 p.m. OK Kotlin TESTS 43 1934 72499200
120894716 tourist J June 29, 2021, 4:23 p.m. OK Kotlin TESTS 43 2074 72499200
120896988 Maksim1744 J June 29, 2021, 4:50 p.m. OK Kotlin TESTS 43 2432 263270400

remove filters

Back to search problems