Codeforces Round 368 (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
707 Codeforces Round 368 (Div. 2) FINISHED False 7200 260124899 Aug. 20, 2016, 1:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 12693 ) C Pythagorean Triples PROGRAMMING math number theory 1500

B'Katya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positive integers such that you can construct a right triangle with segments of lengths corresponding to triple. Such triples are called Pythagorean triples. For example, triples (3, xe2 x80 x894, xe2 x80 x895), (5, xe2 x80 x8912, xe2 x80 x8913) and (6, xe2 x80 x898, xe2 x80 x8910) are Pythagorean triples. Here Katya wondered if she can specify the length of some side of right triangle and find any Pythagorean triple corresponding to such length? Note that the side which length is specified can be a cathetus as well as hypotenuse. Katya had no problems with completing this task. Will you do the same? The only line of the input contains single integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- the length of some side of a right triangle. Print two integers m and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m, xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891018), such that n, m and k form a Pythagorean triple, in the only line. In case if there is no any Pythagorean triple containing integer n, print xe2 x80 x89- xe2 x80 x891 in the only line. If there are many answers, print any of them. Illustration for the first sample. '...

Tutorials

46662

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
22694254 lukomskiy C Dec. 4, 2016, 11:11 a.m. OK FPC TESTS 90 15 0 1500
22652916 Zeron C Dec. 2, 2016, 6:43 a.m. OK FPC TESTS 90 15 0 1500
22080111 pavudaloy C Nov. 6, 2016, 5:52 p.m. OK FPC TESTS 90 15 0 1500
32811933 TShT C Nov. 30, 2017, 5:08 p.m. OK FPC TESTS 90 15 1638400 1500
24285875 StarScreamOwl C Jan. 31, 2017, 9:22 a.m. OK FPC TESTS 90 15 1638400 1500
27747622 KagamiharaNadeshiko C June 13, 2017, 2:47 a.m. OK FPC TESTS 90 30 0 1500
20564925 yan_lazy C Sept. 13, 2016, 10:51 a.m. OK FPC TESTS 90 31 0 1500
24274454 chb19 C Jan. 30, 2017, 6:09 p.m. OK FPC TESTS 90 31 1638400 1500
20398720 tjytlxwxhyzqfw C Sept. 5, 2016, 11:44 a.m. OK GNU C TESTS 90 15 0 1500
31974834 yys4582 C Nov. 2, 2017, 10:09 a.m. OK GNU C TESTS 90 15 0 1500
32547183 Saminul_amin C Nov. 22, 2017, 10:47 a.m. OK GNU C TESTS 90 15 0 1500
31974794 vjudge1 C Nov. 2, 2017, 10:08 a.m. OK GNU C TESTS 90 15 0 1500
21865558 vjudge3 C Oct. 29, 2016, 7:07 a.m. OK GNU C TESTS 90 15 0 1500
20803669 Pranay_36 C Sept. 21, 2016, 6:23 p.m. OK GNU C TESTS 90 15 0 1500
20803535 sparsh_123 C Sept. 21, 2016, 6:16 p.m. OK GNU C TESTS 90 15 0 1500
20500664 vasiliydz C Sept. 10, 2016, 3:52 p.m. OK GNU C TESTS 90 15 0 1500
20452819 eshkin_kot C Sept. 8, 2016, 7:02 a.m. OK GNU C TESTS 90 15 0 1500
21009541 sm_yead C Sept. 30, 2016, 7:41 a.m. OK GNU C TESTS 90 15 102400 1500
32357688 vjudge3 C Nov. 16, 2017, 2:25 p.m. OK GNU C++ TESTS 90 15 0 1500
32506904 vjudge4 C Nov. 20, 2017, 5:10 p.m. OK GNU C++ TESTS 90 15 0 1500
32357662 vjudge5 C Nov. 16, 2017, 2:23 p.m. OK GNU C++ TESTS 90 15 0 1500
32241719 vjudge2 C Nov. 12, 2017, 11:22 a.m. OK GNU C++ TESTS 90 15 0 1500
32220076 vjudge1 C Nov. 11, 2017, 12:58 p.m. OK GNU C++ TESTS 90 15 0 1500
32220059 vjudge1 C Nov. 11, 2017, 12:57 p.m. OK GNU C++ TESTS 90 15 0 1500
32219826 vjudge5 C Nov. 11, 2017, 12:48 p.m. OK GNU C++ TESTS 90 15 0 1500
31978081 vjudge2 C Nov. 2, 2017, 11:40 a.m. OK GNU C++ TESTS 90 15 0 1500
31977659 vjudge3 C Nov. 2, 2017, 11:28 a.m. OK GNU C++ TESTS 90 15 0 1500
31977065 vjudge5 C Nov. 2, 2017, 11:12 a.m. OK GNU C++ TESTS 90 15 0 1500
22487899 YTMartian C Nov. 25, 2016, 11:45 a.m. OK GNU C11 TESTS 90 15 0 1500
22190581 vjudge1 C Nov. 13, 2016, 10:14 a.m. OK GNU C11 TESTS 90 15 0 1500
21009546 vjudge2 C Sept. 30, 2016, 7:41 a.m. OK GNU C11 TESTS 90 15 102400 1500
31368233 vjudge1 C Oct. 15, 2017, 2:10 p.m. OK GNU C11 TESTS 90 15 1843200 1500
22801416 ruined_shit C Dec. 8, 2016, 4:23 a.m. OK GNU C11 TESTS 90 15 1843200 1500
35612699 2017ccut_wuqishuo C Feb. 24, 2018, 1:15 a.m. OK GNU C11 TESTS 90 15 1843200 1500
35099690 vjudge5 C Feb. 9, 2018, 5:03 p.m. OK GNU C11 TESTS 90 15 1843200 1500
23803924 Amatya C Jan. 14, 2017, 10:46 a.m. OK GNU C11 TESTS 90 15 1945600 1500
22638359 somu1997 C Dec. 1, 2016, 11:53 a.m. OK GNU C11 TESTS 90 30 0 1500
69285845 mth1908 C Jan. 22, 2020, 8:08 a.m. OK GNU C11 TESTS 90 31 0 1500
29941717 Newaj_69 C Aug. 31, 2017, 12:17 p.m. OK GNU C++11 TESTS 90 15 0 1500
31223454 YazanZk C Oct. 11, 2017, 5:15 p.m. OK GNU C++11 TESTS 90 15 0 1500
30623307 javarmgar C Sept. 22, 2017, 6:40 p.m. OK GNU C++11 TESTS 90 15 0 1500
30533168 ditoly C Sept. 20, 2017, 2:59 a.m. OK GNU C++11 TESTS 90 15 0 1500
30485416 IM7MDHaMdYI C Sept. 18, 2017, 10:51 p.m. OK GNU C++11 TESTS 90 15 0 1500
30419753 Ahmad__ C Sept. 17, 2017, 11:49 a.m. OK GNU C++11 TESTS 90 15 0 1500
30381267 lRl C Sept. 16, 2017, 10:44 a.m. OK GNU C++11 TESTS 90 15 0 1500
30254088 zaidaljundi C Sept. 10, 2017, 6:59 p.m. OK GNU C++11 TESTS 90 15 0 1500
30187642 MohamedLotfy C Sept. 7, 2017, 5:45 p.m. OK GNU C++11 TESTS 90 15 0 1500
29898189 kuroshitsuji C Aug. 29, 2017, 5:49 p.m. OK GNU C++11 TESTS 90 15 0 1500
32552163 arman_ferdous C Nov. 22, 2017, 1:41 p.m. OK GNU C++14 TESTS 90 15 0 1500
32535019 stilllHungry C Nov. 21, 2017, 8:14 p.m. OK GNU C++14 TESTS 90 15 0 1500
32521468 _Plague_ C Nov. 21, 2017, 10 a.m. OK GNU C++14 TESTS 90 15 0 1500
40032016 derrgh11 C July 6, 2018, 1:46 p.m. OK GNU C++14 TESTS 90 15 0 1500
39701373 hetpandya98 C June 27, 2018, 12:29 p.m. OK GNU C++14 TESTS 90 15 0 1500
39663474 iamrk C June 26, 2018, 2:37 a.m. OK GNU C++14 TESTS 90 15 0 1500
39521077 Sarangi777 C June 22, 2018, 3:47 p.m. OK GNU C++14 TESTS 90 15 0 1500
39359273 K_K C June 18, 2018, 3:10 p.m. OK GNU C++14 TESTS 90 15 0 1500
32567879 neroond C Nov. 23, 2017, 6:43 a.m. OK GNU C++14 TESTS 90 15 0 1500
32555429 Rtn_e C Nov. 22, 2017, 3:40 p.m. OK GNU C++14 TESTS 90 15 0 1500
67971243 vjudge2 C Dec. 30, 2019, 3:06 p.m. OK GNU C++17 TESTS 90 15 0 1500
47499220 P__C_183 C Dec. 25, 2018, 4:48 p.m. OK GNU C++17 TESTS 90 15 0 1500
39082089 dasper C June 10, 2018, 3:16 a.m. OK GNU C++17 TESTS 90 15 0 1500
36241320 limn2o4 C March 13, 2018, 7:23 a.m. OK GNU C++17 TESTS 90 15 1945600 1500
35100196 munim110 C Feb. 9, 2018, 5:20 p.m. OK GNU C++17 TESTS 90 15 1945600 1500
35100642 zaber666 C Feb. 9, 2018, 5:35 p.m. OK GNU C++17 TESTS 90 15 1945600 1500
37472141 GeoJuventino C April 19, 2018, 8:01 p.m. OK GNU C++17 TESTS 90 15 3379200 1500
38762908 Ashishgup C May 30, 2018, 6:55 a.m. OK GNU C++17 TESTS 90 15 3379200 1500
37501935 vjudge1 C April 21, 2018, 3:24 a.m. OK GNU C++17 TESTS 90 15 3686400 1500
69432032 FelixDzerzhinsky C Jan. 23, 2020, 5:39 p.m. OK GNU C++17 TESTS 90 30 0 1500
34125103 LeGross C Jan. 13, 2018, 10:59 a.m. OK GNU C++17 Diagnostics TESTS 90 811 99123200 1500
36275437 bgmello C March 14, 2018, 12:35 p.m. OK GNU C++17 Diagnostics TESTS 90 935 99635200 1500
57959501 jmazon C July 29, 2019, 8:57 p.m. OK Haskell TESTS 90 46 102400 1500
57284672 morozovvp C July 18, 2019, 2:07 p.m. OK Haskell TESTS 90 46 102400 1500
57446475 Seco_seco C July 21, 2019, 8:22 a.m. OK Java 8 TESTS 90 109 0 1500
68410818 Baroudy C Jan. 8, 2020, 4:55 p.m. OK Java 8 TESTS 90 109 0 1500
66473404 MahmoudJobeel C Dec. 7, 2019, 7:25 p.m. OK Java 8 TESTS 90 109 0 1500
62317638 goyalnikhil064 C Oct. 10, 2019, 3:45 p.m. OK Java 8 TESTS 90 109 0 1500
60373027 vjudge5 C Sept. 11, 2019, 4:12 a.m. OK Java 8 TESTS 90 109 0 1500
60373014 BitShot C Sept. 11, 2019, 4:11 a.m. OK Java 8 TESTS 90 109 0 1500
55549884 zmurzagaliev C June 14, 2019, 6:21 a.m. OK Java 8 TESTS 90 109 0 1500
55013371 maheshwari29 C June 3, 2019, 11:13 a.m. OK Java 8 TESTS 90 109 0 1500
54883853 thisbeit C May 31, 2019, 4 p.m. OK Java 8 TESTS 90 109 0 1500
50577518 ExplodingFreeze C Feb. 27, 2019, 6:55 p.m. OK Java 8 TESTS 90 109 0 1500
26571335 korifey C April 22, 2017, 12:52 a.m. OK Kotlin TESTS 90 109 20582400 1500
62958832 david_varela C Oct. 19, 2019, 10:15 p.m. OK Kotlin TESTS 90 140 0 1500
44322108 nemars C Oct. 14, 2018, 2:32 p.m. OK Mono C# TESTS 90 46 102400 1500
44324566 nemars C Oct. 14, 2018, 3:28 p.m. OK Mono C# TESTS 90 62 1638400 1500
27449603 Sorryforpartyrocking C May 30, 2017, 1:59 p.m. OK MS C# TESTS 90 46 102400 1500
20437016 Chubcheg C Sept. 7, 2016, 1:33 p.m. OK MS C# TESTS 90 61 102400 1500
20929887 AnatolyTolstobrov C Sept. 26, 2016, 4:33 p.m. OK MS C# TESTS 90 62 307200 1500
23512868 artsin666 C Jan. 3, 2017, 8:47 a.m. OK MS C# TESTS 90 62 9216000 1500
28915666 Phortox C July 26, 2017, 10:33 p.m. OK MS C# TESTS 90 62 9318400 1500
21421111 og.kostya C Oct. 14, 2016, 11:25 a.m. OK MS C# TESTS 90 78 9113600 1500
27932321 Enigma314 C June 20, 2017, 9:03 p.m. OK MS C# TESTS 90 93 9216000 1500
22104141 irain C Nov. 8, 2016, 2:09 a.m. OK MS C++ TESTS 90 15 0 1500
32283651 vjudge2 C Nov. 13, 2017, 12:20 p.m. OK MS C++ TESTS 90 15 0 1500
29731620 vjudge5 C Aug. 24, 2017, 1 p.m. OK MS C++ TESTS 90 15 0 1500
22638183 vjudge2 C Dec. 1, 2016, 11:43 a.m. OK MS C++ TESTS 90 15 0 1500
22509903 vjudge4 C Nov. 26, 2016, 1:04 p.m. OK MS C++ TESTS 90 15 0 1500
22172691 vjudge4 C Nov. 12, 2016, 5:43 a.m. OK MS C++ TESTS 90 15 0 1500
22169317 AshokKnv C Nov. 11, 2016, 8:39 p.m. OK MS C++ TESTS 90 15 0 1500
22147778 vjudge2 C Nov. 10, 2016, 12:22 p.m. OK MS C++ TESTS 90 15 0 1500
22132374 vjudge5 C Nov. 9, 2016, 2:36 p.m. OK MS C++ TESTS 90 15 0 1500
22107436 vjudge2 C Nov. 8, 2016, 7:28 a.m. OK MS C++ TESTS 90 15 0 1500
53831561 kevo C May 6, 2019, 8:28 p.m. OK MS C++ 2017 TESTS 90 31 0 1500
51810251 lichunyu0212 C March 25, 2019, 4:49 a.m. OK MS C++ 2017 TESTS 90 31 0 1500
61118699 CtrlAlt C Sept. 23, 2019, 1:43 p.m. OK MS C++ 2017 TESTS 90 31 0 1500
64189653 yuanyuan2048 C Nov. 4, 2019, 7:08 a.m. OK MS C++ 2017 TESTS 90 31 307200 1500
54174140 kate_sun C May 15, 2019, 12:59 p.m. OK MS C++ 2017 TESTS 90 46 0 1500
46980126 dymeon C Dec. 13, 2018, 7:12 p.m. OK PascalABC.NET TESTS 90 62 102400 1500
61186821 mm944 C Sept. 23, 2019, 11:30 p.m. OK PascalABC.NET TESTS 90 421 409600 1500
33446615 gabe C Dec. 20, 2017, 6:19 a.m. OK Perl TESTS 90 170 5836800 1500
27506823 lateralus C June 1, 2017, 5:38 p.m. OK PyPy 2 TESTS 90 62 0 1500
20649796 Onesh0t C Sept. 15, 2016, 10:37 p.m. OK PyPy 2 TESTS 90 77 0 1500
20375461 Dirring C Sept. 4, 2016, 6 a.m. OK PyPy 2 TESTS 90 77 0 1500
29191623 sambit25 C Aug. 4, 2017, 10:54 a.m. OK PyPy 2 TESTS 90 77 21913600 1500
22611300 abhigupta4 C Nov. 29, 2016, 10:15 p.m. OK PyPy 2 TESTS 90 78 0 1500
39189099 YESMAths C June 12, 2018, 11:03 a.m. OK PyPy 2 TESTS 90 93 0 1500
20389886 lavin C Sept. 4, 2016, 9:10 p.m. OK PyPy 2 TESTS 90 93 0 1500
24814708 Trunks C Feb. 20, 2017, 3:47 a.m. OK PyPy 2 TESTS 90 109 22016000 1500
22479074 beched C Nov. 24, 2016, 9:13 p.m. OK PyPy 2 TESTS 90 139 0 1500
43336185 soumyasarkar1998 C Sept. 23, 2018, 3:08 p.m. OK PyPy 2 TESTS 90 140 0 1500
22155247 SendThemToHell C Nov. 10, 2016, 9:05 p.m. OK PyPy 3 TESTS 90 109 0 1500
21227632 Vosatorp C Oct. 6, 2016, 6:38 a.m. OK PyPy 3 TESTS 90 124 0 1500
68487976 gaidash C Jan. 10, 2020, 10:34 a.m. OK PyPy 3 TESTS 90 140 0 1500
66554246 vovik123 C Dec. 9, 2019, 4:06 p.m. OK PyPy 3 TESTS 90 140 0 1500
65286087 Mohamed_Ayman C Nov. 18, 2019, 8:08 a.m. OK PyPy 3 TESTS 90 140 0 1500
65246181 manish.17 C Nov. 17, 2019, 10:31 a.m. OK PyPy 3 TESTS 90 140 0 1500
64749539 alowator C Nov. 12, 2019, 2:44 p.m. OK PyPy 3 TESTS 90 140 0 1500
64613853 kchau C Nov. 10, 2019, 3:31 a.m. OK PyPy 3 TESTS 90 140 0 1500
63375539 meme_lord C Oct. 25, 2019, 10:54 a.m. OK PyPy 3 TESTS 90 140 0 1500
63262689 PS41 C Oct. 23, 2019, 9:13 p.m. OK PyPy 3 TESTS 90 140 0 1500
23099985 vaibhav28 C Dec. 18, 2016, 12:32 p.m. OK Python 2 TESTS 90 46 4710400 1500
22142922 franckmy C Nov. 10, 2016, 6:33 a.m. OK Python 2 TESTS 90 61 0 1500
21047779 GoNoCoder C Sept. 30, 2016, 6:33 p.m. OK Python 2 TESTS 90 61 0 1500
26061363 Neel.Puniwala C April 1, 2017, 5:55 p.m. OK Python 2 TESTS 90 61 4710400 1500
23529622 BlueHazard_rony C Jan. 4, 2017, 6:58 a.m. OK Python 2 TESTS 90 61 4710400 1500
26921202 nikhil_c C May 7, 2017, 10:30 a.m. OK Python 2 TESTS 90 62 0 1500
22071387 la_Spectator C Nov. 6, 2016, 9:01 a.m. OK Python 2 TESTS 90 62 0 1500
20560074 sigkill-uw C Sept. 13, 2016, 4:46 a.m. OK Python 2 TESTS 90 62 0 1500
20439299 nimberledge C Sept. 7, 2016, 2:50 p.m. OK Python 2 TESTS 90 62 0 1500
20406128 Meenachinmay C Sept. 5, 2016, 7:07 p.m. OK Python 2 TESTS 90 62 0 1500
32341066 ATSTNG C Nov. 15, 2017, 7:28 p.m. OK Python 3 TESTS 90 62 0 1500
30939567 treasuryonly C Oct. 2, 2017, 10:17 a.m. OK Python 3 TESTS 90 62 0 1500
27692913 arpit040199 C June 9, 2017, 4:28 p.m. OK Python 3 TESTS 90 62 0 1500
27356958 jdh C May 26, 2017, 1:54 p.m. OK Python 3 TESTS 90 62 0 1500
26827572 lavafalls C May 4, 2017, 3:27 a.m. OK Python 3 TESTS 90 62 0 1500
21893660 ray1246 C Oct. 30, 2016, 2:06 p.m. OK Python 3 TESTS 90 62 0 1500
20673399 daniil_m C Sept. 17, 2016, 5:12 a.m. OK Python 3 TESTS 90 62 0 1500
20485364 UnusedFever C Sept. 9, 2016, 7:35 p.m. OK Python 3 TESTS 90 62 0 1500
28910343 jaaguptamme C July 26, 2017, 3:55 p.m. OK Python 3 TESTS 90 62 4608000 1500
23557923 xarshila_ C Jan. 5, 2017, 3:42 p.m. OK Python 3 TESTS 90 62 4608000 1500
35096773 EthanITargaryen C Feb. 9, 2018, 3:49 p.m. OK Ruby TESTS 90 62 6451200 1500
35096831 vjudge3 C Feb. 9, 2018, 3:51 p.m. OK Ruby TESTS 90 62 6656000 1500
21591935 Saken C Oct. 19, 2016, 12:24 p.m. OK Ruby TESTS 90 77 6451200 1500
21654238 reldan C Oct. 21, 2016, 10:41 p.m. OK Scala TESTS 90 342 0 1500

remove filters

Back to search problems