Kotlin Heroes: Episode 8

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
1571 Kotlin Heroes: Episode 8 FINISHED False 9900 103649063 Oct. 7, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 51 ) H Laser Beams PROGRAMMING *special geometry probabilities

B"Ira is developing a computer game. This game features randomized generation and difficulty of levels. To achieve randomized difficulty, some enemies in each level are randomly replaced with stronger ones. To describe how do the levels in the game look, let's introduce a coordinate system in such a way that Ox axis goes from left to right, and Oy axis goes from bottom to top. A level is a rectangle with opposite corners in points (0, 0) and (a, b) . Each enemy's position is a point in this rectangle. As for now, Ira has implemented one type of enemy in the game, in two different versions -- basic and upgraded. Both versions of enemies Ira has implemented fire laser rays in several directions: Laser rays pass through enemies and are blocked only by the borders of the level (sides of the rectangle that denotes the level). Enemies are unaffected by lasers. The level Ira is working on has n enemies. The i -th enemy is in the point (x_i, y_i) , and it has a probability of p_i to be upgraded (it's either upgraded with probability p_i , or basic with probability 1-p_i ). All these events are independent. Ira wants to estimate the expected difficulty. She considers that a good way to evaluate the difficulty of the level is to count the number of parts in which the level is divided by the laser rays. So, she wants to calculate the expected number of these parts. Help her to do the evaluation of the level! The first line contains three integers n , a and b ( 1 <= n <= 100 ; 2 <= a, b <= 100 ) -- the number of enemies in the level and the dimensions of the level. Then n lines follow, the i -th of them contains three integers x_i , y_i and p'_i ( 1 <= x_i <= a - 1 ; 1 <= y_i <= b - 1 ; 1 <= p'_i <= 999999 ), meaning that the i -th enemy is located at (x_i, y_i) and has a probability of frac{p'_i}{10^6} to be upgraded"...

Tutorials

Kotlin Heroes 8 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
131091968 knightL H Oct. 7, 2021, 5:26 p.m. OK Kotlin 1.4 TESTS 49 140 22220800
131087928 SpyCheese H Oct. 7, 2021, 4:11 p.m. OK Kotlin 1.4 TESTS 49 155 23040000
131089555 eatmore H Oct. 7, 2021, 4:50 p.m. OK Kotlin 1.4 TESTS 49 171 21606400
131090234 Golovanov399 H Oct. 7, 2021, 5:03 p.m. OK Kotlin 1.4 TESTS 49 171 23244800
131091002 Nikitosh H Oct. 7, 2021, 5:12 p.m. OK Kotlin 1.4 TESTS 49 171 23961600
131089085 Heltion H Oct. 7, 2021, 4:36 p.m. OK Kotlin 1.4 TESTS 49 171 23961600
131088993 353cerega H Oct. 7, 2021, 4:33 p.m. OK Kotlin 1.4 TESTS 49 187 23244800
131089169 Egor H Oct. 7, 2021, 4:38 p.m. OK Kotlin 1.5 TESTS 49 187 25395200
131089618 Vercingetorix H Oct. 7, 2021, 4:53 p.m. OK Kotlin 1.5 TESTS 49 202 26214400
131106766 darnley H Oct. 7, 2021, 10:47 p.m. OK Kotlin 1.5 TESTS 49 217 26316800
131088124 darnley H Oct. 7, 2021, 4:13 p.m. OK Kotlin 1.5 TESTS 49 217 26419200
131107641 darnley H Oct. 7, 2021, 11:26 p.m. OK Kotlin 1.5 TESTS 49 217 27545600
131091395 uwi H Oct. 7, 2021, 5:17 p.m. OK Kotlin 1.5 TESTS 49 218 26214400
131091227 Potassium H Oct. 7, 2021, 5:15 p.m. OK Kotlin 1.5 TESTS 49 218 26419200
131089653 Maksim1744 H Oct. 7, 2021, 4:55 p.m. OK Kotlin 1.5 TESTS 49 280 28672000

remove filters

Back to search problems