Codeforces Round 478 (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
975 Codeforces Round 478 (Div. 2) FINISHED False 7200 211996463 May 1, 2018, 2:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2258 ) D Ghosts PROGRAMMING geometry math 2000

B'Ghosts live in harmony and peace, they travel the space without any purpose other than scare whoever stands in their way. There are n ghosts in the universe, they move in the OXY plane, each one of them has its own velocity that does not change in time: overrightarrow{V} = V_{x} overrightarrow{i} + V_{y} overrightarrow{j} where V_{x} is its speed on the x -axis and V_{y} is on the y -axis. A ghost i has experience value EX_i , which represent how many ghosts tried to scare him in his past. Two ghosts scare each other if they were in the same cartesian point at a moment of time. As the ghosts move with constant speed, after some moment of time there will be no further scaring (what a relief!) and the experience of ghost kind GX = sum_{i=1}^{n} EX_i will never increase. Tameem is a red giant, he took a picture of the cartesian plane at a certain moment of time T , and magically all the ghosts were aligned on a line of the form y = a cdot x + b . You have to compute what will be the experience index of the ghost kind GX in the indefinite future, this is your task for today. Note that when Tameem took the picture, GX may already be greater than 0 , because many ghosts may have scared one another at any moment between [- infty, T] . The first line contains three integers n , a and b ( 1 <= q n <= q 200000 , 1 <= q |a| <= q 10^9 , 0 <= |b| <= 10^9 ) -- the number of ghosts in the universe and the parameters of the straight line. Each of the next n lines contains three integers x_i , V_{xi} , V_{yi} ( -10^9 <= q x_i <= q 10^9 , -10^9 <= q V_{x i}, V_{y i} <= q 10^9 ), where x_i is the current x -coordinate of the i -th ghost (and y_i = a cdot x_i + b ). It is guaranteed that no two ghosts share the same initial position, in other words, it is guaranteed that for all (i,j) x_i '...

Tutorials

Codeforces Round #478 (Div. 2), Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
38386946 admire.japan D May 18, 2018, 2:44 a.m. OK D TESTS 36 343 11571200 2000
37821049 rainboy D May 1, 2018, 5:03 p.m. OK GNU C TESTS 36 171 6553600 2000
40932309 ReaLNero1 D July 30, 2018, 1:42 a.m. OK GNU C++ TESTS 36 62 4300800 2000
37814799 Windows_XP D May 1, 2018, 3:19 p.m. OK GNU C++ TESTS 36 77 7577600 2000
37814093 emofunc D May 1, 2018, 3:14 p.m. OK GNU C++ TESTS 36 124 5734400 2000
37831902 suchang D May 2, 2018, 6:03 a.m. OK GNU C++ TESTS 36 140 13414400 2000
39641669 vjudge3 D June 25, 2018, 7:27 a.m. OK GNU C++ TESTS 36 155 3276800 2000
37818348 Lich_King D May 1, 2018, 3:51 p.m. OK GNU C++ TESTS 36 155 5120000 2000
37828923 WHZ0325 D May 2, 2018, 2:24 a.m. OK GNU C++ TESTS 36 155 11571200 2000
37986147 Kananix D May 7, 2018, 6:01 a.m. OK GNU C++ TESTS 36 156 11571200 2000
37839111 vjudge5 D May 2, 2018, 12:07 p.m. OK GNU C++ TESTS 36 156 11571200 2000
37810277 yhx-12243 D May 1, 2018, 2:48 p.m. OK GNU C++ TESTS 36 156 13107200 2000
37824537 A.Freeman D May 1, 2018, 7:33 p.m. OK GNU C11 TESTS 36 202 6553600 2000
52766388 SylvanasS D April 15, 2019, 4:12 a.m. OK GNU C++11 TESTS 36 93 7987200 2000
60956844 luogu_bot4 D Sept. 21, 2019, 3:10 a.m. OK GNU C++11 TESTS 36 124 3174400 2000
37860916 mihail.jianu D May 3, 2018, 11:50 a.m. OK GNU C++11 TESTS 36 124 4915200 2000
37813371 mxzf0213 D May 1, 2018, 3:08 p.m. OK GNU C++11 TESTS 36 124 5632000 2000
37818762 SidneySaturn D May 1, 2018, 3:55 p.m. OK GNU C++11 TESTS 36 124 6553600 2000
37817623 little_misfortune D May 1, 2018, 3:44 p.m. OK GNU C++11 TESTS 36 124 8806400 2000
37810480 Jos.M D May 1, 2018, 2:49 p.m. OK GNU C++11 TESTS 36 124 9625600 2000
37806190 Lytning D May 1, 2018, 2:28 p.m. OK GNU C++11 TESTS 36 124 9625600 2000
37810818 MagolorSoul D May 1, 2018, 2:51 p.m. OK GNU C++11 TESTS 36 124 11161600 2000
37817696 __santongding D May 1, 2018, 3:45 p.m. OK GNU C++11 TESTS 36 124 18534400 2000
37843398 Linkus D May 2, 2018, 2:51 p.m. OK GNU C++14 TESTS 36 140 11571200 2000
38475342 RobeZH D May 21, 2018, 6:20 a.m. OK GNU C++14 TESTS 36 156 2662400 2000
61208270 bhaag_milkha D Sept. 24, 2019, 10:35 a.m. OK GNU C++14 TESTS 36 156 3174400 2000
37817362 Help.me D May 1, 2018, 3:42 p.m. OK GNU C++14 TESTS 36 156 11878400 2000
49521354 dlwocks31 D Feb. 6, 2019, 8:12 a.m. OK GNU C++14 TESTS 36 171 3993600 2000
37808477 maximumSHOT D May 1, 2018, 2:38 p.m. OK GNU C++14 TESTS 36 171 5734400 2000
37810734 natsugiri D May 1, 2018, 2:51 p.m. OK GNU C++14 TESTS 36 171 8192000 2000
37817099 KATATONIA D May 1, 2018, 3:39 p.m. OK GNU C++14 TESTS 36 171 8704000 2000
37834063 farukkastamonuda D May 2, 2018, 8:17 a.m. OK GNU C++14 TESTS 36 171 8704000 2000
38072894 AgReB D May 9, 2018, 1:33 p.m. OK GNU C++14 TESTS 36 171 8908800 2000
37810757 KellyL D May 1, 2018, 2:51 p.m. OK GNU C++17 TESTS 36 156 7065600 2000
37881011 RDDCCD D May 4, 2018, 11:14 a.m. OK GNU C++17 TESTS 36 187 7680000 2000
52507593 MetB D April 8, 2019, 7:42 p.m. OK GNU C++17 TESTS 36 187 51302400 2000
62506881 copperium D Oct. 13, 2019, 12:35 p.m. OK GNU C++17 TESTS 36 202 4812800 2000
37848896 Silver_ D May 2, 2018, 8:13 p.m. OK GNU C++17 TESTS 36 202 8192000 2000
44259925 Vip_jai D Oct. 13, 2018, 2:02 p.m. OK GNU C++17 TESTS 36 217 7065600 2000
37816537 xzm200l D May 1, 2018, 3:34 p.m. OK GNU C++17 TESTS 36 217 10035200 2000
53435790 fakeacc007 D April 27, 2019, 7:06 p.m. OK GNU C++17 TESTS 36 217 12492800 2000
37814969 memcpy D May 1, 2018, 3:21 p.m. OK GNU C++17 TESTS 36 217 14336000 2000
55415734 chongryong D June 11, 2019, 2:03 a.m. OK GNU C++17 TESTS 36 218 5632000 2000
37880036 aitorortiz D May 4, 2018, 10:23 a.m. OK Go TESTS 36 686 55705600 2000
37824558 vanchope D May 1, 2018, 7:34 p.m. OK Java 8 TESTS 36 264 62976000 2000
37816422 uwi D May 1, 2018, 3:33 p.m. OK Java 8 TESTS 36 265 27648000 2000
37891005 ntviet18 D May 4, 2018, 8:04 p.m. OK Java 8 TESTS 36 311 40448000 2000
37824904 vanchope D May 1, 2018, 7:59 p.m. OK Java 8 TESTS 36 311 63590400 2000
39246397 xodiac D June 14, 2018, 2:01 p.m. OK Java 8 TESTS 36 342 14848000 2000
37809615 pandusonu D May 1, 2018, 2:45 p.m. OK Java 8 TESTS 36 342 28569600 2000
38100778 baobab D May 10, 2018, 8 p.m. OK Java 8 TESTS 36 342 34816000 2000
38106504 rahulkhairwar D May 11, 2018, 6:01 a.m. OK Java 8 TESTS 36 343 39526400 2000
37917701 OMGTallMonster D May 6, 2018, 3:18 a.m. OK Java 8 TESTS 36 374 36864000 2000
37814345 Dukkha D May 1, 2018, 3:15 p.m. OK Java 8 TESTS 36 389 20787200 2000
37894911 exs D May 5, 2018, 3:09 a.m. OK Kotlin TESTS 36 514 41779200 2000
37815391 koyaaniqatsi D May 1, 2018, 3:24 p.m. OK Mono C# TESTS 36 296 30003200 2000
37835570 kuuso D May 2, 2018, 9:37 a.m. OK Mono C# TESTS 36 326 33792000 2000
37985328 wj2dy D May 7, 2018, 5:04 a.m. OK MS C++ TESTS 36 171 6758400 2000
49244942 vjudge5 D Jan. 31, 2019, 12:10 p.m. OK MS C++ TESTS 36 218 11264000 2000
38153620 vjudge5 D May 13, 2018, 6:30 a.m. OK MS C++ TESTS 36 249 14848000 2000
38069006 vjudge1 D May 9, 2018, 11:20 a.m. OK MS C++ TESTS 36 249 14848000 2000
49245414 vjudge3 D Jan. 31, 2019, 12:26 p.m. OK MS C++ TESTS 36 249 17715200 2000
37803961 rkm0959 D May 1, 2018, 2:19 p.m. OK MS C++ TESTS 36 311 16691200 2000
49324739 vjudge4 D Feb. 1, 2019, 1:39 p.m. OK MS C++ TESTS 36 312 16076800 2000
37814627 Ivan_Bondarev D May 1, 2018, 3:18 p.m. OK MS C++ TESTS 36 561 10035200 2000
37923553 vjudge5 D May 6, 2018, 8:33 a.m. OK MS C++ TESTS 36 623 35635200 2000
56956485 vjudge3 D July 13, 2019, 4:57 a.m. OK MS C++ TESTS 36 639 8089600 2000
55215647 h.mokdad D June 6, 2019, 4:35 p.m. OK MS C++ 2017 TESTS 36 685 9420800 2000
37831070 YESMAths D May 2, 2018, 5:04 a.m. OK PyPy 2 TESTS 36 468 59494400 2000
38315036 Ehzyo D May 16, 2018, 9:10 a.m. OK PyPy 2 TESTS 36 483 46694400 2000
41250750 Onesh0t D Aug. 5, 2018, 4:03 p.m. OK PyPy 2 TESTS 36 951 18124800 2000
37855317 WyattWismer D May 3, 2018, 6:58 a.m. OK PyPy 2 TESTS 36 1028 45363200 2000
37851130 wolffd D May 3, 2018, 12:49 a.m. OK PyPy 2 TESTS 36 1840 49766400 2000
37832807 neverwin D May 2, 2018, 7:08 a.m. OK PyPy 3 TESTS 36 514 39628800 2000
37832746 neverwin D May 2, 2018, 7:03 a.m. OK PyPy 3 TESTS 36 545 39833600 2000
37832891 neverwin D May 2, 2018, 7:14 a.m. OK PyPy 3 TESTS 36 795 73011200 2000
59381001 xuzhengqi D Aug. 24, 2019, 3:04 a.m. OK PyPy 3 TESTS 36 857 27340800 2000
37821422 yhn112 D May 1, 2018, 5:13 p.m. OK PyPy 3 TESTS 36 935 74444800 2000
37816548 Teferi D May 1, 2018, 3:34 p.m. OK PyPy 3 TESTS 36 935 74444800 2000
37821467 yhn112 D May 1, 2018, 5:14 p.m. OK PyPy 3 TESTS 36 951 74444800 2000
37832760 neverwin D May 2, 2018, 7:04 a.m. OK PyPy 3 TESTS 36 1138 43520000 2000
37832970 neverwin D May 2, 2018, 7:18 a.m. OK PyPy 3 TESTS 36 1294 103219200 2000
38435195 Ali_Pi D May 19, 2018, 3:20 p.m. OK Python 2 TESTS 36 1185 24985600 2000
37829666 Yee_172 D May 2, 2018, 3:28 a.m. OK Python 3 TESTS 36 904 43008000 2000
37984269 CountZero D May 7, 2018, 3:47 a.m. OK Python 3 TESTS 36 935 35532800 2000
38009117 GautamManohar D May 8, 2018, 1:13 a.m. OK Python 3 TESTS 36 982 27750400 2000
37984437 CountZero D May 7, 2018, 4:01 a.m. OK Python 3 TESTS 36 982 42700800 2000
37890373 fromexptolog D May 4, 2018, 7:23 p.m. OK Python 3 TESTS 36 998 27852800 2000
37832732 neverwin D May 2, 2018, 7:02 a.m. OK Python 3 TESTS 36 1014 30105600 2000
37833857 heraclai D May 2, 2018, 8:07 a.m. OK Python 3 TESTS 36 1060 29184000 2000
37832703 neverwin D May 2, 2018, 6:59 a.m. OK Python 3 TESTS 36 1060 29593600 2000
37830619 Lancern D May 2, 2018, 4:32 a.m. OK Python 3 TESTS 36 1075 46080000 2000
37820643 maximpetrov D May 1, 2018, 4:55 p.m. OK Python 3 TESTS 36 1107 32972800 2000
37996299 Hillmouse D May 7, 2018, 1:17 p.m. OK Rust TESTS 36 249 28262400 2000

remove filters

Back to search problems