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 |
---|---|---|---|---|---|---|
1375 | Codeforces Global Round 9 | FINISHED | False | 9000 | 143478911 | July 4, 2020, 2:45 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 18457 ) | A | Sign Flipping | PROGRAMMING | constructive algorithms |
B"You are given n integers a_1, a_2, ... , a_n , where n is odd. You are allowed to flip the sign of some (possibly all or none) of them. You wish to perform these flips in such a way that the following conditions hold: Find any valid way to flip the signs. It can be shown that under the given constraints, there always exists at least one choice of signs to flip that satisfies the required condition. If there are several solutions, you can find any of them. The input consists of multiple test cases. The first line contains an integer t ( 1 <= t <= 500 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains an integer n ( 3 <= n <= 99 , n is odd) -- the number of integers given to you. The second line of each test case contains n integers a_1, a_2, ... , a_n ( -10^9 <= a_i <= 10^9 ) -- the numbers themselves. It is guaranteed that the sum of n over all test cases does not exceed 10000 . For each test case, print n integers b_1, b_2, ... , b_n , corresponding to the integers after flipping signs. b_i has to be equal to either a_i or -a_i , and of the adjacent differences b_{i + 1} - b_i for i = 1, ... , n - 1 , at least frac{n - 1}{2} should be non-negative and at least frac{n - 1}{2} should be non-positive. It can be shown that under the given constraints, there always exists at least one choice of signs to flip that satisfies the required condition. If there are several solutions, you can find any of them. In the first test case, the difference (-4) - (-2) = -2 is non-positive, while the difference 3 - (-4) = 7 is non-negative. In the second test case, we don't have to flip any signs. All 4 differences are equal to 0 , which is both non-positive and non-negative. In the third test case, 7 - (-4) and 4 - (-6) are non-negative,"... |
79731 |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
86021273 | fpc_coder | A | July 5, 2020, 3:46 a.m. | OK | FPC | TESTS | 11 | 62 | 3379200 | ||
86006105 | AbirChy | A | July 4, 2020, 7:20 p.m. | OK | GNU C11 | TESTS | 11 | 46 | 3686400 | ||
85965143 | Jidan_Abrar79 | A | July 4, 2020, 3:46 p.m. | OK | GNU C11 | TESTS | 11 | 61 | 3686400 | ||
85962925 | u1904080 | A | July 4, 2020, 3:41 p.m. | OK | GNU C11 | TESTS | 11 | 62 | 3686400 | ||
85983361 | raman0971 | A | July 4, 2020, 4:37 p.m. | OK | GNU C11 | TESTS | 11 | 62 | 3686400 | ||
86007766 | 0x3337 | A | July 4, 2020, 7:50 p.m. | OK | GNU C11 | TESTS | 11 | 62 | 3686400 | ||
85999004 | Wecther115 | A | July 4, 2020, 5:49 p.m. | OK | GNU C11 | TESTS | 11 | 62 | 3686400 | ||
85974182 | akash456 | A | July 4, 2020, 4:09 p.m. | OK | GNU C11 | TESTS | 11 | 62 | 3686400 | ||
85968819 | chowdhuryshashwoto | A | July 4, 2020, 3:55 p.m. | OK | GNU C11 | TESTS | 11 | 62 | 3686400 | ||
85964633 | Himelcse005 | A | July 4, 2020, 3:45 p.m. | OK | GNU C11 | TESTS | 11 | 62 | 3686400 | ||
85964543 | Eftekhar_Nahim_CoU14 | A | July 4, 2020, 3:45 p.m. | OK | GNU C11 | TESTS | 11 | 62 | 3686400 | ||
86020248 | nkwnc | A | July 5, 2020, 3:17 a.m. | OK | GNU C++11 | TESTS | 11 | 15 | 3686400 | ||
86013893 | Alpha_Q | A | July 4, 2020, 10:51 p.m. | OK | GNU C++11 | TESTS | 11 | 15 | 3891200 | ||
85957324 | ayushim | A | July 4, 2020, 3:29 p.m. | OK | GNU C++11 | TESTS | 11 | 15 | 3891200 | ||
86019565 | 72012123 | A | July 5, 2020, 2:59 a.m. | OK | GNU C++11 | TESTS | 11 | 15 | 3891200 | ||
86017881 | DWAE86 | A | July 5, 2020, 2:03 a.m. | OK | GNU C++11 | TESTS | 11 | 15 | 3891200 | ||
86015507 | luogu_bot2 | A | July 5, 2020, 12:12 a.m. | OK | GNU C++11 | TESTS | 11 | 15 | 3891200 | ||
86021054 | SOSCHINA | A | July 5, 2020, 3:39 a.m. | OK | GNU C++11 | TESTS | 11 | 30 | 3686400 | ||
85965000 | chenshi028 | A | July 4, 2020, 3:46 p.m. | OK | GNU C++11 | TESTS | 11 | 30 | 3686400 | ||
86016035 | vjudge3 | A | July 5, 2020, 12:37 a.m. | OK | GNU C++11 | TESTS | 11 | 30 | 3891200 | ||
86018241 | lszxj | A | July 5, 2020, 2:16 a.m. | OK | GNU C++11 | TESTS | 11 | 30 | 3891200 | ||
85995894 | suzuken_w | A | July 4, 2020, 5:12 p.m. | OK | GNU C++14 | TESTS | 11 | 30 | 3686400 | ||
85987882 | NeIrka2.0 | A | July 4, 2020, 4:50 p.m. | OK | GNU C++14 | TESTS | 11 | 30 | 3686400 | ||
85984803 | namanaggarwal45 | A | July 4, 2020, 4:41 p.m. | OK | GNU C++14 | TESTS | 11 | 30 | 3686400 | ||
85981537 | vishal87 | A | July 4, 2020, 4:31 p.m. | OK | GNU C++14 | TESTS | 11 | 30 | 3686400 | ||
86003431 | code_red | A | July 4, 2020, 6:36 p.m. | OK | GNU C++14 | TESTS | 11 | 30 | 3686400 | ||
86017261 | sam997 | A | July 5, 2020, 1:36 a.m. | OK | GNU C++14 | TESTS | 11 | 30 | 3686400 | ||
86026839 | abhishek_990 | A | July 5, 2020, 5:51 a.m. | OK | GNU C++14 | TESTS | 11 | 30 | 3686400 | ||
86002103 | AlexanderPr | A | July 4, 2020, 6:18 p.m. | OK | GNU C++14 | TESTS | 11 | 30 | 3686400 | ||
86001270 | McCheng | A | July 4, 2020, 6:08 p.m. | OK | GNU C++14 | TESTS | 11 | 30 | 3686400 | ||
85999019 | shivam_hbtu | A | July 4, 2020, 5:49 p.m. | OK | GNU C++14 | TESTS | 11 | 30 | 3686400 | ||
85998641 | 2fid | A | July 4, 2020, 5:48 p.m. | OK | GNU C++17 | TESTS | 11 | 15 | 3686400 | ||
85962506 | pitsu | A | July 4, 2020, 3:40 p.m. | OK | GNU C++17 | TESTS | 11 | 15 | 3686400 | ||
85990533 | hitman_akash | A | July 4, 2020, 4:59 p.m. | OK | GNU C++17 | TESTS | 11 | 15 | 19763200 | ||
86017448 | tinsupate | A | July 5, 2020, 1:45 a.m. | OK | GNU C++17 | TESTS | 11 | 30 | 3686400 | ||
86012773 | amar_dara_hoibo_na | A | July 4, 2020, 10:04 p.m. | OK | GNU C++17 | TESTS | 11 | 30 | 3686400 | ||
86010986 | FreymanLozanoq | A | July 4, 2020, 9:07 p.m. | OK | GNU C++17 | TESTS | 11 | 30 | 3686400 | ||
86010982 | sakost | A | July 4, 2020, 9:07 p.m. | OK | GNU C++17 | TESTS | 11 | 30 | 3686400 | ||
86008624 | rakinrkz | A | July 4, 2020, 8:07 p.m. | OK | GNU C++17 | TESTS | 11 | 30 | 3686400 | ||
86026601 | _kaizoku_ | A | July 5, 2020, 5:46 a.m. | OK | GNU C++17 | TESTS | 11 | 30 | 3686400 | ||
86021637 | pranet | A | July 5, 2020, 3:56 a.m. | OK | GNU C++17 | TESTS | 11 | 30 | 3686400 | ||
86000178 | john__wick | A | July 4, 2020, 5:57 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 4300800 | ||
86023361 | hungt1 | A | July 5, 2020, 4:41 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 4300800 | ||
85980498 | kb_1024bytes | A | July 4, 2020, 4:28 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 4300800 | ||
85975774 | Alan_Mgine | A | July 4, 2020, 4:14 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 4300800 | ||
85971217 | hello_codeforces | A | July 4, 2020, 4:02 p.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 4300800 | ||
86027571 | i_will_be_less_than_zero | A | July 5, 2020, 6:02 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 4608000 | ||
86027670 | Alisher_Kamolov | A | July 5, 2020, 6:04 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 4608000 | ||
86024016 | dhiraj-01 | A | July 5, 2020, 4:56 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 15 | 4608000 | ||
86015926 | Ameliorate | A | July 5, 2020, 12:32 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 30 | 4300800 | ||
86024397 | Mormo_1703119 | A | July 5, 2020, 5:04 a.m. | OK | GNU C++17 (64) | TESTS | 11 | 30 | 4300800 | ||
85955968 | Aidar.Babanov | A | July 4, 2020, 3:27 p.m. | OK | Go | TESTS | 11 | 77 | 10649600 | ||
86017792 | SeongMenJeon | A | July 5, 2020, 1:59 a.m. | OK | Go | TESTS | 11 | 343 | 10854400 | ||
86000640 | skittles1412 | A | July 4, 2020, 6:02 p.m. | OK | Java 11 | TESTS | 11 | 171 | 23859200 | ||
85956475 | akokoz | A | July 4, 2020, 3:28 p.m. | OK | Java 11 | TESTS | 11 | 186 | 23756800 | ||
86027588 | yahoo1529 | A | July 5, 2020, 6:03 a.m. | OK | Java 11 | TESTS | 11 | 186 | 23961600 | ||
86003597 | K.A.R.M.A | A | July 4, 2020, 6:38 p.m. | OK | Java 11 | TESTS | 11 | 186 | 24064000 | ||
86014195 | bubbl | A | July 4, 2020, 11:05 p.m. | OK | Java 11 | TESTS | 11 | 187 | 23961600 | ||
86012419 | jay_vish | A | July 4, 2020, 9:52 p.m. | OK | Java 11 | TESTS | 11 | 187 | 23961600 | ||
86005178 | RockStar_14 | A | July 4, 2020, 7:03 p.m. | OK | Java 11 | TESTS | 11 | 187 | 23961600 | ||
86004773 | In_The_Name_Of_Love | A | July 4, 2020, 6:56 p.m. | OK | Java 11 | TESTS | 11 | 187 | 23961600 | ||
86004211 | franchester | A | July 4, 2020, 6:47 p.m. | OK | Java 11 | TESTS | 11 | 187 | 23961600 | ||
85965597 | ak363255 | A | July 4, 2020, 3:48 p.m. | OK | Java 11 | TESTS | 11 | 187 | 24064000 | ||
86021169 | Manan8686 | A | July 5, 2020, 3:42 a.m. | OK | Java 8 | TESTS | 11 | 108 | 20480000 | ||
86010822 | bluesky111 | A | July 4, 2020, 9:02 p.m. | OK | Java 8 | TESTS | 11 | 109 | 20377600 | ||
85999701 | Pranay2516 | A | July 4, 2020, 5:54 p.m. | OK | Java 8 | TESTS | 11 | 109 | 20377600 | ||
85972194 | Bhavya_Arora | A | July 4, 2020, 4:04 p.m. | OK | Java 8 | TESTS | 11 | 109 | 20377600 | ||
86027579 | Oland | A | July 5, 2020, 6:02 a.m. | OK | Java 8 | TESTS | 11 | 109 | 20480000 | ||
86022467 | ashraybharambe | A | July 5, 2020, 4:19 a.m. | OK | Java 8 | TESTS | 11 | 109 | 20480000 | ||
86015677 | Great_Expectations_ | A | July 5, 2020, 12:20 a.m. | OK | Java 8 | TESTS | 11 | 109 | 20480000 | ||
86007290 | treacherous_tiwari | A | July 4, 2020, 7:40 p.m. | OK | Java 8 | TESTS | 11 | 109 | 20480000 | ||
85983677 | WickJohn | A | July 4, 2020, 4:38 p.m. | OK | Java 8 | TESTS | 11 | 109 | 20787200 | ||
85981421 | internship_dilado | A | July 4, 2020, 4:31 p.m. | OK | Java 8 | TESTS | 11 | 109 | 20787200 | ||
86009320 | ekaerovets | A | July 4, 2020, 8:23 p.m. | OK | Kotlin | TESTS | 11 | 124 | 20992000 | ||
85998902 | sylvyrfysh | A | July 4, 2020, 5:49 p.m. | OK | Kotlin | TESTS | 11 | 124 | 20992000 | ||
86015284 | Spheniscine | A | July 4, 2020, 11:59 p.m. | OK | Kotlin | TESTS | 11 | 139 | 22118400 | ||
85967132 | slemus | A | July 4, 2020, 3:51 p.m. | OK | Kotlin | TESTS | 11 | 155 | 21094400 | ||
85965384 | Glamdring | A | July 4, 2020, 3:47 p.m. | OK | Kotlin | TESTS | 11 | 171 | 21708800 | ||
86009054 | ekaerovets | A | July 4, 2020, 8:17 p.m. | OK | Kotlin | TESTS | 11 | 187 | 21094400 | ||
86008668 | ekaerovets | A | July 4, 2020, 8:08 p.m. | OK | Kotlin | TESTS | 11 | 202 | 21299200 | ||
86008799 | ekaerovets | A | July 4, 2020, 8:11 p.m. | OK | Kotlin | TESTS | 11 | 233 | 21299200 | ||
85959459 | Myeongjoon | A | July 4, 2020, 3:34 p.m. | OK | Mono C# | TESTS | 11 | 61 | 11673600 | ||
85975699 | mbakalov | A | July 4, 2020, 4:14 p.m. | OK | Mono C# | TESTS | 11 | 78 | 14950400 | ||
85964521 | mustafa7 | A | July 4, 2020, 3:45 p.m. | OK | Mono C# | TESTS | 11 | 93 | 10649600 | ||
85971564 | cdl19408203 | A | July 4, 2020, 4:03 p.m. | OK | MS C++ | TESTS | 11 | 46 | 3891200 | ||
86024838 | sudarshan333u | A | July 5, 2020, 5:13 a.m. | OK | MS C++ | TESTS | 11 | 46 | 4198400 | ||
85960712 | MShetta | A | July 4, 2020, 3:36 p.m. | OK | MS C++ 2017 | TESTS | 11 | 31 | 3686400 | ||
85956937 | HighOne | A | July 4, 2020, 3:28 p.m. | OK | MS C++ 2017 | TESTS | 11 | 31 | 3686400 | ||
86011204 | P___ | A | July 4, 2020, 9:14 p.m. | OK | MS C++ 2017 | TESTS | 11 | 31 | 3686400 | ||
85970979 | wp32pw | A | July 4, 2020, 4:01 p.m. | OK | MS C++ 2017 | TESTS | 11 | 31 | 3788800 | ||
85964385 | _vanger_ | A | July 4, 2020, 3:45 p.m. | OK | MS C++ 2017 | TESTS | 11 | 31 | 3788800 | ||
85995831 | carlo.collodel | A | July 4, 2020, 5:12 p.m. | OK | MS C++ 2017 | TESTS | 11 | 31 | 3788800 | ||
86017022 | Cube219 | A | July 5, 2020, 1:25 a.m. | OK | MS C++ 2017 | TESTS | 11 | 31 | 3993600 | ||
85967992 | tarattata1 | A | July 4, 2020, 3:53 p.m. | OK | MS C++ 2017 | TESTS | 11 | 31 | 4300800 | ||
86024098 | pjh6792 | A | July 5, 2020, 4:58 a.m. | OK | MS C++ 2017 | TESTS | 11 | 46 | 3686400 | ||
86024533 | jingzi523 | A | July 5, 2020, 5:07 a.m. | OK | MS C++ 2017 | TESTS | 11 | 46 | 3686400 | ||
86001727 | sanyacoder | A | July 4, 2020, 6:14 p.m. | OK | Perl | TESTS | 11 | 46 | 2150400 | ||
86007242 | mayakin | A | July 4, 2020, 7:39 p.m. | OK | PHP | TESTS | 11 | 31 | 6041600 | ||
85973454 | crapplet | A | July 4, 2020, 4:07 p.m. | OK | PyPy 2 | TESTS | 11 | 124 | 24268800 | ||
85981959 | Ekinak | A | July 4, 2020, 4:32 p.m. | OK | PyPy 2 | TESTS | 11 | 124 | 24678400 | ||
86011143 | beethoven97 | A | July 4, 2020, 9:12 p.m. | OK | PyPy 2 | TESTS | 11 | 139 | 24985600 | ||
85957385 | lebron87 | A | July 4, 2020, 3:29 p.m. | OK | PyPy 2 | TESTS | 11 | 186 | 26419200 | ||
85965440 | mo-hit | A | July 4, 2020, 3:47 p.m. | OK | PyPy 2 | TESTS | 11 | 233 | 32665600 | ||
85977506 | ksdthegr8 | A | July 4, 2020, 4:19 p.m. | OK | PyPy 2 | TESTS | 11 | 249 | 24166400 | ||
86000845 | womogenes | A | July 4, 2020, 6:04 p.m. | OK | PyPy 3 | TESTS | 11 | 171 | 22118400 | ||
86016757 | YMSeah | A | July 5, 2020, 1:12 a.m. | OK | PyPy 3 | TESTS | 11 | 171 | 22528000 | ||
85961881 | YMSeah | A | July 4, 2020, 3:39 p.m. | OK | PyPy 3 | TESTS | 11 | 171 | 22835200 | ||
86017498 | EpicChadGamer | A | July 5, 2020, 1:47 a.m. | OK | PyPy 3 | TESTS | 11 | 171 | 22937600 | ||
85976972 | GoatTimeDavis | A | July 4, 2020, 4:18 p.m. | OK | PyPy 3 | TESTS | 11 | 171 | 22937600 | ||
86002983 | 2019ucp1350 | A | July 4, 2020, 6:30 p.m. | OK | PyPy 3 | TESTS | 11 | 171 | 23449600 | ||
85998791 | codershuvo | A | July 4, 2020, 5:48 p.m. | OK | PyPy 3 | TESTS | 11 | 171 | 23654400 | ||
85970758 | SpicyKong | A | July 4, 2020, 4 p.m. | OK | PyPy 3 | TESTS | 11 | 171 | 24166400 | ||
85960814 | voitenko_down | A | July 4, 2020, 3:37 p.m. | OK | PyPy 3 | TESTS | 11 | 171 | 24268800 | ||
86000161 | Coki628 | A | July 4, 2020, 5:57 p.m. | OK | PyPy 3 | TESTS | 11 | 171 | 24371200 | ||
86021321 | hardkaur1632 | A | July 5, 2020, 3:47 a.m. | OK | Python 3 | TESTS | 11 | 108 | 6758400 | ||
86007993 | goelshashank007 | A | July 4, 2020, 7:55 p.m. | OK | Python 3 | TESTS | 11 | 108 | 7065600 | ||
86022251 | komirishetty_vinay_kumar | A | July 5, 2020, 4:13 a.m. | OK | Python 3 | TESTS | 11 | 109 | 6963200 | ||
86022160 | MILOY | A | July 5, 2020, 4:10 a.m. | OK | Python 3 | TESTS | 11 | 109 | 6963200 | ||
86021566 | 0raj | A | July 5, 2020, 3:54 a.m. | OK | Python 3 | TESTS | 11 | 109 | 6963200 | ||
86020938 | rahin1301 | A | July 5, 2020, 3:36 a.m. | OK | Python 3 | TESTS | 11 | 109 | 6963200 | ||
86015970 | the_irresponsible_coder | A | July 5, 2020, 12:34 a.m. | OK | Python 3 | TESTS | 11 | 109 | 6963200 | ||
86009991 | Liberator187 | A | July 4, 2020, 8:38 p.m. | OK | Python 3 | TESTS | 11 | 109 | 6963200 | ||
86004902 | Towhed80 | A | July 4, 2020, 6:58 p.m. | OK | Python 3 | TESTS | 11 | 109 | 6963200 | ||
86003087 | kamleshsah123 | A | July 4, 2020, 6:31 p.m. | OK | Python 3 | TESTS | 11 | 109 | 6963200 | ||
86000428 | yuxxxx | A | July 4, 2020, 6 p.m. | OK | Ruby | TESTS | 11 | 499 | 49049600 | ||
85959962 | tanavamsikrishna | A | July 4, 2020, 3:35 p.m. | OK | Rust | TESTS | 11 | 31 | 3891200 | ||
85979958 | cotton100pc | A | July 4, 2020, 4:26 p.m. | OK | Rust | TESTS | 11 | 31 | 4096000 | ||
86015426 | t_uchida | A | July 5, 2020, 12:08 a.m. | OK | Rust | TESTS | 11 | 46 | 3788800 |
Back to search problems