COMPFEST 13 - Finals Online Mirror (Unrated, ICPC Rules, Teams Preferred)

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
1575 COMPFEST 13 - Finals Online Mirror (Unrated, ICPC Rules, Teams Preferred) FINISHED False 18000 98641499 Oct. 2, 2021, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 252 ) M Managing Telephone Poles PROGRAMMING

B"Mr. Chanek's city can be represented as a plane. He wants to build a housing complex in the city. There are some telephone poles on the plane, which is represented by a grid a of size (n + 1) x (m + 1) . There is a telephone pole at (x, y) if a_{x, y} = 1 . For each point (x, y) , define S(x, y) as the square of the Euclidean distance between the nearest pole and (x, y) . Formally, the square of the Euclidean distance between two points (x_1, y_1) and (x_2, y_2) is (x_2 - x_1)^2 + (y_2 - y_1)^2 . To optimize the building plan, the project supervisor asks you the sum of all S(x, y) for each 0 <= q x <= q n and 0 <= q y <= q m . Help him by finding the value of sum_{x=0}^{n} { sum_{y=0}^{m} {S(x, y)}} . The first line contains two integers n and m ( 0 <= q n, m < 2000 ) -- the size of the grid. Then (n + 1) lines follow, each containing (m + 1) integers a_{i, j} ( 0 <= q a_{i, j} <= q 1 ) -- the grid denoting the positions of telephone poles in the plane. There is at least one telephone pole in the given grid. Output an integer denoting the value of sum_{x=0}^{n} { sum_{y=0}^{m} {S(x, y)}} . In the first example, the nearest telephone pole for the points (0,0) , (1,0) , (2,0) , (0,1) , (1,1) , and (2,1) is at (0, 0) . While the nearest telephone pole for the points (0, 2) , (1,2) , and (2,2) is at (0, 2) . Thus, sum_{x=0}^{n} { sum_{y=0}^{m} {S(x, y)}} = (0 + 1 + 4) + (1 + 2 + 5) + (0 + 1 + 4) = 18 . "...

Tutorials

COMPFEST 13 — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
130572261 Retired_MiFaFaOvO TLE Miracle03 M Oct. 2, 2021, 2:32 p.m. OK GNU C++17 TESTS 50 234 23961600
130595423 old_player M Oct. 2, 2021, 7:33 p.m. OK GNU C++17 TESTS 50 280 40652800
130583579 RedstoneGamer22 Autron AlexLuchianov M Oct. 2, 2021, 4:38 p.m. OK GNU C++17 TESTS 50 1169 40448000
130589148 googol_S0 PCTprobability M Oct. 2, 2021, 5:54 p.m. OK GNU C++17 TESTS 50 1340 86220800
130618712 rniya M Oct. 3, 2021, 6:04 a.m. OK GNU C++17 (64) TESTS 50 295 77209600
130584918 coolers RyoPham quocnguyen M Oct. 2, 2021, 4:56 p.m. OK GNU C++17 (64) TESTS 50 311 52736000
130586994 heno239 M Oct. 2, 2021, 5:24 p.m. OK GNU C++17 (64) TESTS 50 342 40652800
130589293 riantkb nuip mtsd M Oct. 2, 2021, 5:56 p.m. OK GNU C++17 (64) TESTS 50 545 143462400
130595020 errorgorn M Oct. 2, 2021, 7:25 p.m. OK GNU C++17 (64) TESTS 50 639 44134400
130588971 googol_S0 PCTprobability M Oct. 2, 2021, 5:51 p.m. OK GNU C++17 (64) TESTS 50 764 91648000
130586472 insert_cool_handle M Oct. 2, 2021, 5:17 p.m. OK Java 11 TESTS 50 576 101683200
130595362 sansen M Oct. 2, 2021, 7:32 p.m. OK Rust TESTS 50 374 78745600
130592139 sansen M Oct. 2, 2021, 6:34 p.m. OK Rust TESTS 50 529 78233600
130592167 sansen M Oct. 2, 2021, 6:34 p.m. OK Rust TESTS 50 546 78745600

remove filters

Back to search problems