Codeforces Round 345 (Div. 1)

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
650 Codeforces Round 345 (Div. 1) FINISHED False 7200 274480499 March 7, 2016, 9:25 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 15577 ) A Watchmen PROGRAMMING data structures geometry math 1500

B'Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, xe2 x80 x89yi). They need to arrange a plan, but there are some difficulties on their way. As you know, Doctor Manhattan considers the distance between watchmen i and j to be |xi xe2 x80 x89- xe2 x80 x89xj| xe2 x80 x89+ xe2 x80 x89|yi xe2 x80 x89- xe2 x80 x89yj|. Daniel, as an ordinary person, calculates the distance using the formula . The success of the operation relies on the number of pairs (i, xe2 x80 x89j) (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89< xe2 x80 x89j xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n), such that the distance between watchman i and watchmen j calculated by Doctor Manhattan is equal to the distance between them calculated by Daniel. You were asked to compute the number of such pairs. The first line of the input contains the single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89200 xe2 x80 x89000) -- the number of watchmen. Each of the following n lines contains two integers xi and yi (|xi|, xe2 x80 x89|yi| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109). Some positions may coincide. Print the number of pairs of watchmen such that the distance between them calculated by Doctor Manhattan is equal to the distance calculated by Daniel. In the first sample, the distance between watchman 1 and watchman 2 is equal to |1 xe2 x80 x89- xe2 x80 x897| xe2 x80 x89+ xe2 x80 x89|1 xe2 x80 x89- xe2 x80 x895| xe2 x80 x89= xe2 x80 x8910 for Doctor Manhattan and for Daniel. For pairs (1, xe2 x80 x891), (1, xe2 x80 x895) and (7, xe2 x80 x895), (1, xe2 x80 x895) Doctor Manhattan and Daniel will calculate the same distances.'...

Tutorials

Codeforces Round #345: editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
16568279 Gassa A March 7, 2016, 9:50 a.m. OK D TESTS 71 514 35942400 1500
26316366 bzh A April 12, 2017, 11:54 a.m. OK FPC TESTS 71 140 3276800 1500
16687677 wtltw A March 13, 2016, 7:59 a.m. OK FPC TESTS 71 140 7987200 1500
16881718 DonutsDose_ A March 23, 2016, 6:56 a.m. OK FPC TESTS 71 140 81920000 1500
16651331 Johnson_Nguyen A March 11, 2016, 3:12 p.m. OK FPC TESTS 71 155 1638400 1500
16606005 Andrey15253545 A March 8, 2016, 5:52 p.m. OK FPC TESTS 71 155 1638400 1500
49346579 PhuongPeu A Feb. 2, 2019, 5:54 a.m. OK FPC TESTS 71 170 1638400 1500
16837040 zhaoxinyi A March 20, 2016, 11:38 a.m. OK FPC TESTS 71 217 6553600 1500
16634374 math4 A March 10, 2016, 2:32 p.m. OK FPC TESTS 71 280 6451200 1500
18014758 ice_tea A May 21, 2016, 7:16 a.m. OK FPC TESTS 71 358 9011200 1500
17422297 andreumat A April 21, 2016, 4:24 p.m. OK FPC TESTS 71 483 214630400 1500
17027748 NoSoul A March 30, 2016, 3:28 a.m. OK GNU C TESTS 71 156 5222400 1500
17248677 GusztavSzmolik A April 9, 2016, 6:41 a.m. OK GNU C TESTS 71 171 3686400 1500
18814036 yigezhe A June 30, 2016, 1:20 a.m. OK GNU C TESTS 71 202 3174400 1500
18538062 Rizro A June 17, 2016, 7:19 a.m. OK GNU C TESTS 71 202 3174400 1500
16619262 fmfkfd A March 9, 2016, 3:06 p.m. OK GNU C TESTS 71 202 3174400 1500
34659094 tSHAARK A Jan. 29, 2018, 11:24 a.m. OK GNU C TESTS 71 202 11468800 1500
19302576 rudr A July 21, 2016, 1:01 p.m. OK GNU C TESTS 71 217 3174400 1500
18510145 kuan A June 16, 2016, 1:58 a.m. OK GNU C TESTS 71 234 3174400 1500
16856025 SuperString A March 21, 2016, 12:44 p.m. OK GNU C TESTS 71 1933 5427200 1500
31168237 bestFy A Oct. 9, 2017, 1:16 p.m. OK GNU C++ TESTS 71 78 1433600 1500
18162613 Lightning34 A May 31, 2016, 1:36 a.m. OK GNU C++ TESTS 71 78 3788800 1500
37284933 Ctrl2333 A April 13, 2018, 1:01 p.m. OK GNU C++ TESTS 71 78 6860800 1500
16595484 zhenGG A March 8, 2016, 4:51 a.m. OK GNU C++ TESTS 71 93 3174400 1500
26217041 czllgzmzl A April 8, 2017, 11:06 a.m. OK GNU C++ TESTS 71 93 3686400 1500
32183412 Scut82 A Nov. 10, 2017, 12:08 a.m. OK GNU C++ TESTS 71 93 8089600 1500
20106764 ljh2000 A Aug. 24, 2016, 1:49 p.m. OK GNU C++ TESTS 71 108 3686400 1500
32183411 Scut82 A Nov. 10, 2017, 12:08 a.m. OK GNU C++ TESTS 71 108 8089600 1500
16563476 NanoApe A March 7, 2016, 9:31 a.m. OK GNU C++ TESTS 71 109 1433600 1500
16602450 grated A March 8, 2016, 1:56 p.m. OK GNU C++ TESTS 71 109 1638400 1500
44490928 ara_duarte A Oct. 18, 2018, 2:26 p.m. OK GNU C11 TESTS 71 187 9625600 1500
44491160 MiguelDoCarmo A Oct. 18, 2018, 2:31 p.m. OK GNU C11 TESTS 71 187 9625600 1500
16878478 srijansingh A March 22, 2016, 10:16 p.m. OK GNU C11 TESTS 71 218 11468800 1500
17259789 Dirak A April 10, 2016, 4:32 a.m. OK GNU C++11 TESTS 71 78 1433600 1500
16595895 FISHTOBY A March 8, 2016, 5:41 a.m. OK GNU C++11 TESTS 71 78 3174400 1500
40984767 ReaLNero1 A July 30, 2018, 7:34 p.m. OK GNU C++11 TESTS 71 93 1433600 1500
34190159 Wattonz A Jan. 15, 2018, 6:47 a.m. OK GNU C++11 TESTS 71 93 5324800 1500
28200243 orzccz A July 2, 2017, 12:54 a.m. OK GNU C++11 TESTS 71 93 5939200 1500
16615491 dlehdgh A March 9, 2016, 11:42 a.m. OK GNU C++11 TESTS 71 109 1433600 1500
16725362 tanphatls987 A March 15, 2016, 9:45 a.m. OK GNU C++11 TESTS 71 109 1638400 1500
16667311 hugehuge A March 12, 2016, 7:10 a.m. OK GNU C++11 TESTS 71 109 3174400 1500
21396682 shahriar_lu A Oct. 13, 2016, 6:14 a.m. OK GNU C++11 TESTS 71 109 3788800 1500
25456038 zZoKONGoZz A March 13, 2017, 2:27 p.m. OK GNU C++11 TESTS 71 109 7680000 1500
36763878 alwaysGREEEN A March 31, 2018, 5:28 a.m. OK GNU C++14 TESTS 71 124 5734400 1500
30617673 TasneemSherif A Sept. 22, 2017, 2:40 p.m. OK GNU C++14 TESTS 71 140 1638400 1500
55115056 ae04071 A June 5, 2019, 8:16 a.m. OK GNU C++14 TESTS 71 140 1843200 1500
63934799 harlequen A Oct. 31, 2019, 3:30 p.m. OK GNU C++14 TESTS 71 155 3174400 1500
49043892 vjudge5 A Jan. 27, 2019, 7:49 a.m. OK GNU C++14 TESTS 71 156 1638400 1500
48965155 AryaKnight A Jan. 26, 2019, 7:11 a.m. OK GNU C++14 TESTS 71 156 1638400 1500
52749588 vjudge4 A April 14, 2019, 1:22 p.m. OK GNU C++14 TESTS 71 156 1638400 1500
52637545 vjudge5 A April 12, 2019, 10:56 a.m. OK GNU C++14 TESTS 71 156 1638400 1500
26592758 EbraM96 A April 22, 2017, 11:50 p.m. OK GNU C++14 TESTS 71 156 3481600 1500
64638383 vjudge5 A Nov. 10, 2019, 12:18 p.m. OK GNU C++14 TESTS 71 156 4198400 1500
50668472 ACtowards A March 2, 2019, 5:45 a.m. OK GNU C++17 TESTS 71 140 1638400 1500
50669593 ACtowards A March 2, 2019, 6:17 a.m. OK GNU C++17 TESTS 71 155 1638400 1500
63380148 saketh A Oct. 25, 2019, 12:14 p.m. OK GNU C++17 TESTS 71 156 1638400 1500
51364702 ICL A March 16, 2019, 9:01 a.m. OK GNU C++17 TESTS 71 156 3174400 1500
52606499 BloodMaster06 A April 11, 2019, 2:05 p.m. OK GNU C++17 TESTS 71 156 4812800 1500
55080922 chongryong A June 4, 2019, 10:41 a.m. OK GNU C++17 TESTS 71 171 2457600 1500
55064832 chongryong A June 4, 2019, 2:48 a.m. OK GNU C++17 TESTS 71 186 1638400 1500
63952589 Magneto_07 A Oct. 31, 2019, 10:30 p.m. OK GNU C++17 TESTS 71 187 3174400 1500
56989055 mad_i A July 13, 2019, 5:14 p.m. OK GNU C++17 TESTS 71 187 6451200 1500
47358836 nagpaljatin1411 A Dec. 22, 2018, 7:37 a.m. OK GNU C++17 TESTS 71 202 3174400 1500
16564306 Martynas A March 7, 2016, 9:34 a.m. OK Go TESTS 71 218 21708800 1500
20204609 guzhoudiaoke A Aug. 28, 2016, 3:18 a.m. OK Go TESTS 71 249 23654400 1500
20204582 guzhoudiaoke A Aug. 28, 2016, 3:14 a.m. OK Go TESTS 71 249 34099200 1500
20204613 guzhoudiaoke A Aug. 28, 2016, 3:19 a.m. OK Go TESTS 71 249 34099200 1500
17021673 lvchaxj A March 29, 2016, 3:03 p.m. OK Go TESTS 71 732 37273600 1500
26634916 yuliang A April 24, 2017, 7:15 a.m. OK Go TESTS 71 982 95744000 1500
18176273 CyberZHG A June 1, 2016, 3:07 a.m. OK Haskell TESTS 71 1154 103424000 1500
16566148 autotaker A March 7, 2016, 9:41 a.m. OK Haskell TESTS 71 1637 50790400 1500
27931061 karlm A June 20, 2017, 7:12 p.m. OK Haskell TESTS 71 1793 113356800 1500
67501626 ashanksingh1997 A Dec. 24, 2019, 5:02 a.m. OK Java 11 TESTS 71 1419 50176000 1500
17133490 stolis A April 2, 2016, 4:06 p.m. OK Java 7 TESTS 71 249 39321600 1500
17557214 Joromero A April 28, 2016, 6:42 p.m. OK Java 7 TESTS 71 389 39424000 1500
17257414 jose.tapia A April 9, 2016, 9:32 p.m. OK Java 7 TESTS 71 592 52428800 1500
16582837 xiaowuc1 A March 7, 2016, 1:44 p.m. OK Java 7 TESTS 71 639 30822400 1500
16642242 idn A March 11, 2016, 3:16 a.m. OK Java 7 TESTS 71 685 31232000 1500
16655955 fabiankasUN A March 11, 2016, 5:43 p.m. OK Java 7 TESTS 71 748 60211200 1500
18238422 frktry A June 4, 2016, 2:03 a.m. OK Java 7 TESTS 71 748 101580800 1500
17521360 lebaur A April 26, 2016, 12:36 p.m. OK Java 7 TESTS 71 873 99737600 1500
17176544 mohon55555 A April 5, 2016, 6:24 p.m. OK Java 7 TESTS 71 1013 45056000 1500
17775908 IsAmAre A May 7, 2016, 9:56 a.m. OK Java 7 TESTS 71 1028 107520000 1500
36778416 ShowStopper728 A March 31, 2018, 3:54 p.m. OK Java 8 TESTS 71 249 20787200 1500
50431396 ExplodingFreeze A Feb. 24, 2019, 2:14 p.m. OK Java 8 TESTS 71 296 1638400 1500
16624051 beroul A March 9, 2016, 8:31 p.m. OK Java 8 TESTS 71 311 0 1500
62885806 Azakarka A Oct. 18, 2019, 6:21 p.m. OK Java 8 TESTS 71 327 0 1500
16940805 eric_sweg_munny A March 25, 2016, 9:56 p.m. OK Java 8 TESTS 71 327 20787200 1500
16940699 eric_sweg_munny A March 25, 2016, 9:41 p.m. OK Java 8 TESTS 71 342 20889600 1500
17156288 trunghieu11 A April 4, 2016, 10:41 a.m. OK Java 8 TESTS 71 358 20684800 1500
35107394 vjudge4 A Feb. 9, 2018, 10:54 p.m. OK Java 8 TESTS 71 373 20787200 1500
21378560 pssm318 A Oct. 12, 2016, 10:18 a.m. OK Java 8 TESTS 71 374 20480000 1500
18450415 U_Square A June 14, 2016, 11:58 a.m. OK Java 8 TESTS 71 374 20684800 1500
17165786 OmniSliver A April 5, 2016, 3:13 a.m. OK JavaScript TESTS 71 826 37478400 1500
16741626 supachawal A March 16, 2016, 10:28 a.m. OK JavaScript TESTS 71 1403 88985600 1500
62929956 david_varela A Oct. 19, 2019, 12:26 p.m. OK Kotlin TESTS 71 1169 55910400 1500
44004137 nemars A Oct. 8, 2018, 3:05 p.m. OK Mono C# TESTS 71 451 34304000 1500
41159246 NEvOl A Aug. 3, 2018, 2:10 p.m. OK Mono C# TESTS 71 545 50278400 1500
16568242 og.kostya A March 7, 2016, 9:50 a.m. OK MS C# TESTS 71 265 4198400 1500
19966397 nrvg A Aug. 19, 2016, 3:06 p.m. OK MS C# TESTS 71 373 49971200 1500
17330977 Arcey A April 15, 2016, 6:56 p.m. OK MS C# TESTS 71 405 29388800 1500
16635892 dementevdn A March 10, 2016, 4:09 p.m. OK MS C# TESTS 71 405 42598400 1500
16563588 azukun A March 7, 2016, 9:31 a.m. OK MS C# TESTS 71 421 32153600 1500
16637098 sundown A March 10, 2016, 5:21 p.m. OK MS C# TESTS 71 436 36147200 1500
27112062 VCipher A May 14, 2017, 7:52 p.m. OK MS C# TESTS 71 436 36249600 1500
16864408 freepvps A March 21, 2016, 9:49 p.m. OK MS C# TESTS 71 467 47616000 1500
20280309 Chubcheg A Aug. 30, 2016, 1:10 p.m. OK MS C# TESTS 71 468 16691200 1500
23586703 artsin666 A Jan. 6, 2017, 1:54 p.m. OK MS C# TESTS 71 468 46592000 1500
16580479 TLE A March 7, 2016, 11:22 a.m. OK MS C++ TESTS 71 124 1843200 1500
16566988 Andrew.D.F A March 7, 2016, 9:44 a.m. OK MS C++ TESTS 71 124 3276800 1500
16562891 LLI_E_P_JI_O_K A March 7, 2016, 9:29 a.m. OK MS C++ TESTS 71 124 3993600 1500
62337125 vjudge1 A Oct. 11, 2019, 2:23 a.m. OK MS C++ TESTS 71 139 3174400 1500
16566760 UminchuR A March 7, 2016, 9:43 a.m. OK MS C++ TESTS 71 139 3584000 1500
16565605 iblacksun A March 7, 2016, 9:39 a.m. OK MS C++ TESTS 71 140 1638400 1500
49041337 vjudge3 A Jan. 27, 2019, 6:36 a.m. OK MS C++ TESTS 71 140 1843200 1500
18105549 vjudge1 A May 26, 2016, 2:22 p.m. OK MS C++ TESTS 71 140 3788800 1500
16985099 vjudge3 A March 28, 2016, 10:25 a.m. OK MS C++ TESTS 71 140 3788800 1500
16609143 Nadezhda A March 8, 2016, 10:10 p.m. OK MS C++ TESTS 71 140 4915200 1500
53949593 F91WoDaGe A May 10, 2019, 8:47 a.m. OK MS C++ 2017 TESTS 71 529 21504000 1500
60693565 CtrlAlt A Sept. 16, 2019, 6:25 p.m. OK MS C++ 2017 TESTS 71 670 17510400 1500
51265570 The_Fiery_Soul A March 13, 2019, 3:22 p.m. OK MS C++ 2017 TESTS 71 702 17510400 1500
68937917 JuicyCloud12609 A Jan. 16, 2020, 1:28 p.m. OK MS C++ 2017 TESTS 71 717 17510400 1500
49693648 Gladius_Smerch A Feb. 10, 2019, 12:37 p.m. OK MS C++ 2017 TESTS 71 748 21196800 1500
55308494 0-jij-0 A June 8, 2019, 4:02 p.m. OK MS C++ 2017 TESTS 71 794 25702400 1500
69699125 DEV10 A Jan. 28, 2020, 10:32 p.m. OK MS C++ 2017 TESTS 71 795 17510400 1500
61840671 vjudge2 A Oct. 4, 2019, 9:32 a.m. OK MS C++ 2017 TESTS 71 888 45363200 1500
65766467 MRamanauskas A Nov. 26, 2019, 6:12 p.m. OK MS C++ 2017 TESTS 71 1123 24678400 1500
16681965 NegrN7 A March 12, 2016, 9:11 p.m. OK Perl TESTS 71 1404 64614400 1500
26287724 TangentOfA A April 11, 2017, 2:08 a.m. OK PyPy 2 TESTS 71 920 49254400 1500
25110579 Unlenin A Feb. 28, 2017, 9:04 p.m. OK PyPy 2 TESTS 71 982 52633600 1500
37297583 FatherofBenoni A April 13, 2018, 8:40 p.m. OK PyPy 2 TESTS 71 998 53145600 1500
20405002 dsharma080 A Sept. 5, 2016, 5:38 p.m. OK PyPy 2 TESTS 71 1153 50790400 1500
51333228 ashok123 A March 15, 2019, 12:59 p.m. OK PyPy 2 TESTS 71 1528 43212800 1500
16673831 hodduc A March 12, 2016, 12:44 p.m. OK PyPy 2 TESTS 71 2262 22016000 1500
61581018 MA123 A Oct. 1, 2019, 1:45 a.m. OK PyPy 3 TESTS 71 858 26214400 1500
58404222 koptev A Aug. 6, 2019, 7:29 p.m. OK PyPy 3 TESTS 71 904 47206400 1500
56188819 kgmkr00001 A June 28, 2019, 6:28 a.m. OK PyPy 3 TESTS 71 1154 52019200 1500
61353347 darkkcyan A Sept. 27, 2019, 9:23 a.m. OK PyPy 3 TESTS 71 1262 16793600 1500
54496177 iamprayush A May 22, 2019, 5:51 p.m. OK PyPy 3 TESTS 71 1918 27238400 1500
68674484 smoke_bellew A Jan. 12, 2020, 6:02 p.m. OK PyPy 3 TESTS 71 1949 26726400 1500
48691349 Well_Checked A Jan. 21, 2019, 6 p.m. OK PyPy 3 TESTS 71 1964 36966400 1500
68212791 kchau A Jan. 4, 2020, 8:22 p.m. OK PyPy 3 TESTS 71 1980 26931200 1500
68387567 gaidash A Jan. 8, 2020, 6:49 a.m. OK PyPy 3 TESTS 71 1980 49971200 1500
59891217 saurabh247 A Sept. 2, 2019, 10:28 a.m. OK PyPy 3 TESTS 71 2074 49664000 1500
46262634 noobie_x A Nov. 26, 2018, 9:34 p.m. OK Python 2 TESTS 71 592 37068800 1500
17032901 akshay91 A March 30, 2016, 11:43 a.m. OK Python 2 TESTS 71 670 38400000 1500
16634439 vovaminiof A March 10, 2016, 2:37 p.m. OK Python 2 TESTS 71 701 28672000 1500
16689119 SerejaCoder A March 13, 2016, 9:29 a.m. OK Python 2 TESTS 71 858 31129600 1500
26348875 pinerojuancruz1988 A April 14, 2017, 12:50 a.m. OK Python 2 TESTS 71 904 40550400 1500
16633233 DMH A March 10, 2016, 1:26 p.m. OK Python 2 TESTS 71 936 30822400 1500
16603883 nealzane A March 8, 2016, 3:24 p.m. OK Python 2 TESTS 71 951 30822400 1500
16750208 zafar11235 A March 16, 2016, 5:03 p.m. OK Python 2 TESTS 71 997 30822400 1500
17390989 PostRocker A April 19, 2016, 6:15 p.m. OK Python 2 TESTS 71 997 35737600 1500
47162201 FlyingBag65 A Dec. 17, 2018, 10:33 a.m. OK Python 2 TESTS 71 998 26931200 1500
50347687 Kirillov_Alexey A Feb. 23, 2019, 7:08 a.m. OK Python 3 TESTS 71 779 31232000 1500
55613387 donkappa A June 16, 2019, 7:22 a.m. OK Python 3 TESTS 71 780 33894400 1500
57149420 chaudhary_19 A July 16, 2019, 2:11 p.m. OK Python 3 TESTS 71 857 28979200 1500
68921920 nethish A Jan. 16, 2020, 9:35 a.m. OK Python 3 TESTS 71 873 44646400 1500
35201576 MaxHo A Feb. 13, 2018, 2:04 p.m. OK Python 3 TESTS 71 904 43315200 1500
62083432 newbie18 A Oct. 7, 2019, 10:51 p.m. OK Python 3 TESTS 71 935 28979200 1500
55310186 l3r4in A June 8, 2019, 5:06 p.m. OK Python 3 TESTS 71 966 29593600 1500
62625444 kaif_7 A Oct. 15, 2019, 1:56 p.m. OK Python 3 TESTS 71 982 28979200 1500
53931420 irza_law A May 9, 2019, 6:01 p.m. OK Python 3 TESTS 71 997 28979200 1500
27353805 jdh A May 26, 2017, 10:42 a.m. OK Python 3 TESTS 71 998 28979200 1500
16907024 _ShadowSong A March 24, 2016, 1:42 p.m. OK Ruby TESTS 71 1669 109260800 1500
18510846 MoOfMo A June 16, 2016, 3:03 a.m. OK Ruby TESTS 71 1762 36761600 1500
40085329 pratikbh06 A July 8, 2018, 12:38 p.m. OK Ruby TESTS 71 2324 61542400 1500
68212327 StrausMG A Jan. 4, 2020, 8:03 p.m. OK Rust TESTS 71 202 25702400 1500
25467869 techaddict A March 14, 2017, 7:42 a.m. OK Scala TESTS 71 1107 63795200 1500
25467784 techaddict A March 14, 2017, 7:37 a.m. OK Scala TESTS 71 1138 63795200 1500
25467750 techaddict A March 14, 2017, 7:35 a.m. OK Scala TESTS 71 1153 63795200 1500
25467652 techaddict A March 14, 2017, 7:28 a.m. OK Scala TESTS 71 1216 63078400 1500
16854509 reldan A March 21, 2016, 11:11 a.m. OK Scala TESTS 71 2448 157184000 1500

remove filters

Back to search problems