Codeforces Round 492 (Div. 1) [Thanks, uDebug!]

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
995 Codeforces Round 492 (Div. 1) [Thanks, uDebug!] FINISHED False 7200 201965099 June 24, 2018, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1904 ) C Leaving the Bar PROGRAMMING brute force data structures geometry greedy math sortings 2200

B"For a vector vec{v} = (x, y) , define |v| = sqrt{x^2 + y^2} . Allen had a bit too much to drink at the bar, which is at the origin. There are n vectors vec{v_1}, vec{v_2}, cdots, vec{v_n} . Allen will make n moves. As Allen's sense of direction is impaired, during the i -th move he will either move in the direction vec{v_i} or - vec{v_i} . In other words, if his position is currently p = (x, y) , he will either move to p + vec{v_i} or p - vec{v_i} . Allen doesn't want to wander too far from home (which happens to also be the bar). You need to help him figure out a sequence of moves (a sequence of signs for the vectors) such that his final position p satisfies |p| <= 1.5 cdot 10^6 so that he can stay safe. The first line contains a single integer n ( 1 <= n <= 10^5 ) -- the number of moves. Each of the following lines contains two space-separated integers x_i and y_i , meaning that vec{v_i} = (x_i, y_i) . We have that |v_i| <= 10^6 for all i . Output a single line containing n integers c_1, c_2, cdots, c_n , each of which is either 1 or -1 . Your solution is correct if the value of p = sum_{i = 1}^n c_i vec{v_i} , satisfies |p| <= 1.5 cdot 10^6 . It can be shown that a solution always exists under the given constraints. "...

Tutorials

Editorial for Codeforces Round #492 [Thanks u-Debug!]

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
39650763 ytj2 C June 25, 2018, 1:27 p.m. OK Clang++17 Diagnostics TESTS 105 514 22835200 2200
69504464 hos.lyric C Jan. 25, 2020, 7:57 a.m. OK D TESTS 105 171 11980800 2200
39624918 Gassa C June 24, 2018, 6:06 p.m. OK D TESTS 105 702 11878400 2200
39623874 matipau C June 24, 2018, 5:58 p.m. OK GNU C TESTS 105 77 3788800 2200
39794460 Scut82 C June 30, 2018, 10:23 a.m. OK GNU C++ TESTS 105 46 1228800 2200
39821356 ILLENIUM C July 1, 2018, 12:37 p.m. OK GNU C++ TESTS 105 46 3174400 2200
40014668 jzqjzq C July 6, 2018, 12:37 a.m. OK GNU C++ TESTS 105 46 3276800 2200
39819406 smallling C July 1, 2018, 11:07 a.m. OK GNU C++ TESTS 105 62 1638400 2200
39856853 HbFS- C July 2, 2018, 4:35 a.m. OK GNU C++ TESTS 105 62 1638400 2200
40771177 luogu_bot1 C July 26, 2018, 8:38 a.m. OK GNU C++ TESTS 105 62 3276800 2200
39623335 yasugongshang C June 24, 2018, 5:53 p.m. OK GNU C++ TESTS 105 62 3993600 2200
39690268 ccosi C June 27, 2018, 3:47 a.m. OK GNU C++ TESTS 105 77 1228800 2200
39800238 xryjr233 C June 30, 2018, 2:09 p.m. OK GNU C++ TESTS 105 77 14028800 2200
39794342 Scut82 C June 30, 2018, 10:18 a.m. OK GNU C++ TESTS 105 77 32051200 2200
47314716 luogu_bot2 C Dec. 21, 2018, 1:15 a.m. OK GNU C++11 TESTS 105 46 1228800 2200
47314705 Althen C Dec. 21, 2018, 1:14 a.m. OK GNU C++11 TESTS 105 46 1228800 2200
39624435 jhn333 C June 24, 2018, 6:02 p.m. OK GNU C++11 TESTS 105 46 1638400 2200
47315428 luogu_bot4 C Dec. 21, 2018, 2:36 a.m. OK GNU C++11 TESTS 105 46 1638400 2200
47315052 Clao_015 C Dec. 21, 2018, 1:58 a.m. OK GNU C++11 TESTS 105 46 1638400 2200
39648508 rxdoi C June 25, 2018, 11:56 a.m. OK GNU C++11 TESTS 105 46 1638400 2200
41669933 lpa20020220 C Aug. 17, 2018, 4:02 a.m. OK GNU C++11 TESTS 105 46 2662400 2200
60220342 oduesp C Sept. 7, 2019, 1:22 p.m. OK GNU C++11 TESTS 105 46 3174400 2200
40874914 CMXRYNP C July 28, 2018, 8:02 a.m. OK GNU C++11 TESTS 105 46 12902400 2200
39626157 __math C June 24, 2018, 6:16 p.m. OK GNU C++11 TESTS 105 46 13516800 2200
55809570 Scut82 C June 20, 2019, 2:37 a.m. OK GNU C++14 TESTS 105 62 1228800 2200
55809481 Scut82 C June 20, 2019, 2:33 a.m. OK GNU C++14 TESTS 105 62 1228800 2200
45989313 5_Problems_1_Day C Nov. 20, 2018, 8:44 a.m. OK GNU C++14 TESTS 105 62 2867200 2200
44351153 bzh C Oct. 15, 2018, 10:13 a.m. OK GNU C++14 TESTS 105 62 5632000 2200
40651065 tymo C July 22, 2018, 9:44 p.m. OK GNU C++14 TESTS 105 77 1228800 2200
50074282 PaPaxe C Feb. 17, 2019, 7:51 p.m. OK GNU C++14 TESTS 105 77 1536000 2200
40441225 TadijaSebez C July 16, 2018, 4:16 p.m. OK GNU C++14 TESTS 105 77 1536000 2200
39617499 MiFaFaOvO C June 24, 2018, 5:12 p.m. OK GNU C++14 TESTS 105 77 1638400 2200
39980444 CrazySona C July 5, 2018, 10:19 a.m. OK GNU C++14 TESTS 105 77 1945600 2200
44363327 Ninjaboy97 C Oct. 15, 2018, 3:31 p.m. OK GNU C++14 TESTS 105 77 2457600 2200
39636042 q234rty C June 25, 2018, 2:23 a.m. OK GNU C++17 TESTS 105 31 12083200 2200
40931739 ReaLNero1 C July 30, 2018, 1:16 a.m. OK GNU C++17 TESTS 105 46 12083200 2200
40424712 Twishkle.Aevdark C July 16, 2018, 3:07 p.m. OK GNU C++17 TESTS 105 77 1638400 2200
42789381 Martin53 C Sept. 12, 2018, 7:20 a.m. OK GNU C++17 TESTS 105 77 1843200 2200
56698830 rindzor C July 8, 2019, 8:15 a.m. OK GNU C++17 TESTS 105 77 2867200 2200
56703241 nkko.l C July 8, 2019, 10:06 a.m. OK GNU C++17 TESTS 105 77 2867200 2200
59905736 Arpa C Sept. 2, 2019, 3:17 p.m. OK GNU C++17 TESTS 105 78 1228800 2200
39621745 Errichto C June 24, 2018, 5:41 p.m. OK GNU C++17 TESTS 105 78 1228800 2200
40395754 ZhihuiLiu C July 16, 2018, 5:03 a.m. OK GNU C++17 TESTS 105 78 1638400 2200
39672562 paradox C June 26, 2018, 10:23 a.m. OK GNU C++17 TESTS 105 78 1638400 2200
39633923 pili C June 24, 2018, 11:07 p.m. OK Java 8 TESTS 105 171 0 2200
39640436 uwi C June 25, 2018, 6:38 a.m. OK Java 8 TESTS 105 186 0 2200
39633953 pili C June 24, 2018, 11:10 p.m. OK Java 8 TESTS 105 186 0 2200
64664063 ijxjdjd C Nov. 10, 2019, 11:55 p.m. OK Java 8 TESTS 105 218 0 2200
39642349 aabdelzaher C June 25, 2018, 7:52 a.m. OK Java 8 TESTS 105 218 0 2200
39630678 fetetriste C June 24, 2018, 8:18 p.m. OK Java 8 TESTS 105 218 0 2200
39854413 bluesky111 C July 2, 2018, 1:44 a.m. OK Java 8 TESTS 105 218 9216000 2200
41289710 Suzukaze C Aug. 7, 2018, 1:37 a.m. OK Java 8 TESTS 105 233 0 2200
39630342 xiaowuc1 C June 24, 2018, 8:11 p.m. OK Java 8 TESTS 105 233 0 2200
39623543 qwerty787788 C June 24, 2018, 5:55 p.m. OK Java 8 TESTS 105 249 9011200 2200
39624773 ymatsux C June 24, 2018, 6:05 p.m. OK Kotlin TESTS 105 389 921600 2200
39621398 mircea85 C June 24, 2018, 5:38 p.m. OK Mono C# TESTS 105 218 10035200 2200
39626078 wa1tz719 C June 24, 2018, 6:15 p.m. OK MS C++ TESTS 105 62 1638400 2200
39619323 RAVEman C June 24, 2018, 5:24 p.m. OK MS C++ TESTS 105 78 8806400 2200
44896153 LoneFox C Oct. 26, 2018, 6:43 a.m. OK MS C++ TESTS 105 171 11366400 2200
57750519 vjudge5 C July 25, 2019, 2:38 p.m. OK MS C++ TESTS 105 202 2048000 2200
42481388 math957963 C Sept. 5, 2018, 5:49 a.m. OK MS C++ TESTS 105 202 5017600 2200
47194221 Arey125 C Dec. 18, 2018, 1:45 p.m. OK MS C++ TESTS 105 233 6656000 2200
39659013 mdeacu C June 25, 2018, 7:40 p.m. OK MS C++ TESTS 105 234 4198400 2200
69076301 .__. C Jan. 19, 2020, 3:24 a.m. OK Ocaml TESTS 105 109 11161600 2200
69075815 .__. C Jan. 19, 2020, 3:01 a.m. OK Ocaml TESTS 105 109 11264000 2200
69076200 .__. C Jan. 19, 2020, 3:20 a.m. OK Ocaml TESTS 105 109 11264000 2200
69076408 .__. C Jan. 19, 2020, 3:31 a.m. OK Ocaml TESTS 105 109 11264000 2200
69076019 .__. C Jan. 19, 2020, 3:11 a.m. OK Ocaml TESTS 105 109 11264000 2200
69075760 .__. C Jan. 19, 2020, 2:58 a.m. OK Ocaml TESTS 105 140 11264000 2200
69075491 .__. C Jan. 19, 2020, 2:43 a.m. OK Ocaml TESTS 105 156 11161600 2200
69075681 .__. C Jan. 19, 2020, 2:53 a.m. OK Ocaml TESTS 105 171 11161600 2200
44844376 test616.cpp C Oct. 25, 2018, 1:56 p.m. OK PyPy 2 TESTS 105 1231 26726400 2200
44844464 test616.cpp C Oct. 25, 2018, 1:58 p.m. OK Python 2 TESTS 105 1107 16281600 2200
39730085 orailly C June 28, 2018, 1:06 a.m. OK Python 3 TESTS 105 452 14950400 2200
39681829 Butskhrikidze C June 26, 2018, 5:05 p.m. OK Python 3 TESTS 105 1091 13107200 2200
39681809 Butskhrikidze C June 26, 2018, 5:04 p.m. OK Python 3 TESTS 105 1091 13312000 2200
39681645 Butskhrikidze C June 26, 2018, 4:57 p.m. OK Python 3 TESTS 105 1169 15872000 2200
41121596 Pyromio C Aug. 2, 2018, 12:14 p.m. OK Python 3 TESTS 105 1762 14745600 2200

remove filters

Back to search problems