Codeforces Round 271 (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
474 Codeforces Round 271 (Div. 2) FINISHED False 9000 325002604 Oct. 6, 2014, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3162 ) C Captain Marmot PROGRAMMING brute force geometry 1900

B'Captain Marmot wants to prepare a huge and important battle against his enemy, Captain Snake. For this battle he has n regiments, each consisting of 4 moles. Initially, each mole i (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x894n) is placed at some position (xi, xe2 x80 x89yi) in the Cartesian plane. Captain Marmot wants to move some moles to make the regiments compact, if it 's possible. Each mole i has a home placed at the position (ai, xe2 x80 x89bi). Moving this mole one time means rotating his position point (xi, xe2 x80 x89yi) 90 degrees counter-clockwise around it 's home point (ai, xe2 x80 x89bi). A regiment is compact only if the position points of the 4 moles form a square with non-zero area. Help Captain Marmot to find out for each regiment the minimal number of moves required to make that regiment compact, if it 's possible. The first line contains one integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100), the number of regiments. The next 4n lines contain 4 integers xi, yi, ai, bi ( xe2 x80 x89- xe2 x80 x89104 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89xi, xe2 x80 x89yi, xe2 x80 x89ai, xe2 x80 x89bi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89104). Print n lines to the standard output. If the regiment i can be made compact, the i-th line should contain one integer, the minimal number of required moves. Otherwise, on the i-th line print "-1" (without quotes). In the first regiment we can move once the second or the third mole. We can 't make the second regiment compact. In the third regiment, from the last 3 moles we can move once one and twice another one. In the fourth regiment, we can move twice the first mole and once the third mole.'...

Tutorials

Codeforces Round #271 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
59647868 Andsc C Aug. 29, 2019, 6:48 a.m. OK Clang++17 Diagnostics TESTS 57 77 0 1900
39083642 Angry_penguin C June 10, 2018, 5:16 a.m. OK GNU C++ TESTS 57 31 0 1900
38629377 dpkun C May 26, 2018, 9:07 a.m. OK GNU C++ TESTS 57 31 0 1900
40987837 ReaLNero1 C July 30, 2018, 9:31 p.m. OK GNU C++ TESTS 57 31 0 1900
41888422 Ace_02 C Aug. 20, 2018, 5:39 a.m. OK GNU C++ TESTS 57 31 0 1900
38872579 Scut82 C June 2, 2018, 3:59 a.m. OK GNU C++ TESTS 57 31 3481600 1900
40720405 aro1 C July 25, 2018, 12:42 a.m. OK GNU C++ TESTS 57 46 0 1900
57863911 rainboy C July 27, 2019, 7:32 p.m. OK GNU C11 TESTS 57 31 0 1900
36306419 Renaats C March 15, 2018, 3:50 p.m. OK GNU C++11 TESTS 57 15 2048000 1900
64853614 mj101 C Nov. 13, 2019, 9:02 p.m. OK GNU C++11 TESTS 57 31 0 1900
64258360 luengjon C Nov. 4, 2019, 3:42 p.m. OK GNU C++11 TESTS 57 31 0 1900
63691146 VROOM_VARUN C Oct. 29, 2019, 2:42 a.m. OK GNU C++11 TESTS 57 31 0 1900
63290280 Debasish1610177113 C Oct. 24, 2019, 11:34 a.m. OK GNU C++11 TESTS 57 31 0 1900
62947925 pkj C Oct. 19, 2019, 6:03 p.m. OK GNU C++11 TESTS 57 31 0 1900
61859573 MavrosOplarxigos C Oct. 4, 2019, 2:58 p.m. OK GNU C++11 TESTS 57 31 0 1900
61335171 vjudge5 C Sept. 26, 2019, 4:12 p.m. OK GNU C++11 TESTS 57 31 0 1900
60185941 _double C Sept. 6, 2019, 6:29 p.m. OK GNU C++11 TESTS 57 31 0 1900
68036358 Elghareb C Jan. 1, 2020, 12:15 p.m. OK GNU C++11 TESTS 57 31 0 1900
61790045 fraz123x C Oct. 3, 2019, 3:38 p.m. OK GNU C++14 TESTS 57 15 0 1900
38394891 musafir_v C May 18, 2018, 8:36 a.m. OK GNU C++14 TESTS 57 15 307200 1900
35865252 Hosamk92 C March 3, 2018, 12:17 a.m. OK GNU C++14 TESTS 57 15 1945600 1900
35860609 ye_account_delete_kardo C March 2, 2018, 9:45 p.m. OK GNU C++14 TESTS 57 15 1945600 1900
35220554 nadhemm C Feb. 13, 2018, 11:25 p.m. OK GNU C++14 TESTS 57 15 1945600 1900
35175648 OkRint C Feb. 12, 2018, 11:06 a.m. OK GNU C++14 TESTS 57 15 1945600 1900
35129867 arpit040199 C Feb. 10, 2018, 3:38 p.m. OK GNU C++14 TESTS 57 15 1945600 1900
36125202 panipuri8 C March 9, 2018, 5:26 p.m. OK GNU C++14 TESTS 57 15 1945600 1900
36148936 l0gic_b0mb C March 10, 2018, 11:40 a.m. OK GNU C++14 TESTS 57 15 2048000 1900
37095190 Photon_ C April 8, 2018, 11:02 a.m. OK GNU C++14 TESTS 57 15 3481600 1900
61472809 vjudge5 C Sept. 29, 2019, 1:03 p.m. OK GNU C++17 TESTS 57 30 0 1900
51424185 kaizen19 C March 17, 2019, 6:14 p.m. OK GNU C++17 TESTS 57 30 0 1900
67627527 Muhammad.Magdi C Dec. 25, 2019, 11:35 p.m. OK GNU C++17 TESTS 57 31 0 1900
69887794 sawhil C Jan. 31, 2020, 8:52 a.m. OK GNU C++17 TESTS 57 31 0 1900
69543883 adamant C Jan. 26, 2020, 12:08 a.m. OK GNU C++17 TESTS 57 31 0 1900
68645873 -v_v- C Jan. 12, 2020, 9:03 a.m. OK GNU C++17 TESTS 57 31 0 1900
68486746 seleznev_dima C Jan. 10, 2020, 10:03 a.m. OK GNU C++17 TESTS 57 31 0 1900
65926483 amankrsingh C Nov. 28, 2019, 6:33 p.m. OK GNU C++17 TESTS 57 31 0 1900
65892697 AlwaysGray C Nov. 28, 2019, 4:22 a.m. OK GNU C++17 TESTS 57 31 0 1900
64898915 gamegame C Nov. 14, 2019, 5:55 p.m. OK GNU C++17 TESTS 57 31 0 1900
58559852 saurabhs1206 C Aug. 11, 2019, 5:07 a.m. OK Java 8 TESTS 57 124 0 1900
52084644 Ahmed.Shawky C March 31, 2019, 1:47 p.m. OK Java 8 TESTS 57 124 0 1900
49025560 KulikAlex C Jan. 26, 2019, 6:52 p.m. OK Java 8 TESTS 57 124 0 1900
47272267 jenish9599 C Dec. 19, 2018, 5:16 p.m. OK Java 8 TESTS 57 124 0 1900
67663231 chojh1222 C Dec. 26, 2019, 4:45 p.m. OK Java 8 TESTS 57 140 0 1900
49926857 __Melodies C Feb. 14, 2019, 11:52 p.m. OK Java 8 TESTS 57 140 0 1900
49926120 MuhammedAbdalla C Feb. 14, 2019, 10:48 p.m. OK Java 8 TESTS 57 140 0 1900
45706849 mandark27 C Nov. 14, 2018, 12:01 p.m. OK Java 8 TESTS 57 140 0 1900
39862147 dipankar12 C July 2, 2018, 8:40 a.m. OK Java 8 TESTS 57 140 0 1900
37383587 Suzukaze C April 16, 2018, 10:16 p.m. OK Java 8 TESTS 57 140 20684800 1900
48639910 vjudge5 C Jan. 20, 2019, 3:07 p.m. OK MS C++ TESTS 57 46 0 1900
35539913 pavankatta C Feb. 21, 2018, 7 a.m. OK PyPy 2 TESTS 57 202 23654400 1900
66645713 chaudhary_19 C Dec. 11, 2019, 4:38 p.m. OK PyPy 3 TESTS 57 186 3788800 1900
67315621 ashok123 C Dec. 21, 2019, 5:51 a.m. OK PyPy 3 TESTS 57 187 4403200 1900
35874687 ______u______ C March 3, 2018, 7:57 a.m. OK PyPy 3 TESTS 57 202 22732800 1900
35874591 ______n______ C March 3, 2018, 7:56 a.m. OK PyPy 3 TESTS 57 202 22732800 1900
35873970 _____k_____ C March 3, 2018, 7:40 a.m. OK PyPy 3 TESTS 57 202 22732800 1900
35873776 _____i_____ C March 3, 2018, 7:37 a.m. OK PyPy 3 TESTS 57 202 22732800 1900
35870402 ______h______ C March 3, 2018, 6:28 a.m. OK PyPy 3 TESTS 57 202 22732800 1900
35870393 ______k______ C March 3, 2018, 6:28 a.m. OK PyPy 3 TESTS 57 202 22732800 1900
35864113 ______i______ C March 2, 2018, 11:02 p.m. OK PyPy 3 TESTS 57 202 22732800 1900
35862647 ______M______ C March 2, 2018, 10:30 p.m. OK PyPy 3 TESTS 57 202 22732800 1900
43588202 Hildegrin C Sept. 29, 2018, 9:48 p.m. OK Python 2 TESTS 57 655 0 1900
44674009 animando C Oct. 22, 2018, 1:19 a.m. OK Python 3 TESTS 57 326 512000 1900
49687974 nethish C Feb. 10, 2019, 8:58 a.m. OK Python 3 TESTS 57 498 307200 1900
37531047 nowyyz C April 22, 2018, 10:44 a.m. OK Python 3 TESTS 57 530 7372800 1900
42135716 Mk_Python_v1 C Aug. 26, 2018, 11:34 p.m. OK Python 3 TESTS 57 561 102400 1900
47723924 yakamoto C Dec. 30, 2018, 1:07 p.m. OK Scala TESTS 57 639 102400 1900

remove filters

Back to search problems