Codeforces Round 510 (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
1042 Codeforces Round 510 (Div. 2) FINISHED False 7200 200354123 Sept. 17, 2018, 8:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4767 ) C Array Product PROGRAMMING constructive algorithms greedy math 1700

B"You are given an array a consisting of n integers. You can perform the following operations with it: The number of elements decreases by one after each operation. However, the indexing of positions stays the same. Deleted numbers can't be used in the later operations. Your task is to perform exactly n - 1 operations with the array in such a way that the only number that remains in the array is maximum possible. This number can be rather large, so instead of printing it you need to print any sequence of operations which leads to this maximum number. Read the output format to understand what exactly you need to print. The first line contains a single integer n ( 2 <= n <= 2 cdot 10^5 ) -- the number of elements in the array. The second line contains n integers a_1, a_2, ... , a_n ( -10^9 <= a_i <= 10^9 ) -- the elements of the array. Print n - 1 lines. The k -th line should contain one of the two possible operations. The operation of the first type should look like this: 1~ i_k~ j_k , where 1 is the type of operation, i_k and j_k are the positions of the chosen elements. The operation of the second type should look like this: 2~ i_k , where 2 is the type of operation, i_k is the position of the chosen element. Note that there should be no more than one such operation. If there are multiple possible sequences of operations leading to the maximum number -- print any of them. Let X be the removed number in the array. Let's take a look at all the examples: The first example has, for example, the following sequence of transformations of the array: [5, -2, 0, 1, -3] to [5, -2, X, 1, -3] to [X, -10, X, 1, -3] to [X, X, X, -10, -3] to [X, X, X, X, 30] . Thus, the maximum answer is 30 . Note, that other sequences that lead to the answer 30 are also correct. The second example has, for example, the following sequence of transformations of "...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
50532609 Mcccree C Feb. 26, 2019, 2:16 p.m. OK Clang++17 Diagnostics TESTS 75 218 2048000 1700
43006148 wangwangxiaokucha C Sept. 17, 2018, 4 p.m. OK Clang++17 Diagnostics TESTS 74 623 20377600 1700
43006190 wangwangxiaokucha C Sept. 17, 2018, 4:02 p.m. OK Clang++17 Diagnostics TESTS 74 670 20377600 1700
42985216 ia7ck C Sept. 17, 2018, 9:21 a.m. OK D TESTS 74 265 22425600 1700
42984558 petr577 C Sept. 17, 2018, 9:16 a.m. OK FPC TESTS 74 623 204800 1700
42985951 PY_Fighter C Sept. 17, 2018, 9:26 a.m. OK FPC TESTS 74 670 1843200 1700
44221346 TShT C Oct. 12, 2018, 5:23 p.m. OK FPC TESTS 75 685 1843200 1700
44475689 jasshangoel C Oct. 18, 2018, 8:49 a.m. OK GNU C11 TESTS 75 795 2355200 1700
43660390 freyes C Oct. 1, 2018, 7:01 p.m. OK GNU C11 TESTS 75 998 819200 1700
43018324 ljnk975 C Sept. 18, 2018, 2:04 a.m. OK GNU C11 TESTS 74 998 819200 1700
43073930 gihanchanaka C Sept. 19, 2018, 10:48 a.m. OK GNU C11 TESTS 75 998 819200 1700
43115096 sparsh_123 C Sept. 20, 2018, 1:24 p.m. OK GNU C11 TESTS 75 998 1126400 1700
48866176 81179332 C Jan. 24, 2019, 3:17 a.m. OK GNU C++11 TESTS 75 46 2252800 1700
43017521 Umi C Sept. 18, 2018, 1:04 a.m. OK GNU C++11 TESTS 74 61 2560000 1700
50490245 Scut82 C Feb. 25, 2019, 1:04 p.m. OK GNU C++11 TESTS 75 61 7270400 1700
43781959 CYJJJian C Oct. 4, 2018, 10:56 a.m. OK GNU C++11 TESTS 75 62 1024000 1700
44751569 ReaLNero1 C Oct. 23, 2018, 8:13 p.m. OK GNU C++11 TESTS 75 62 1536000 1700
54007193 7NationTengri C May 11, 2019, 9:02 p.m. OK GNU C++11 TESTS 75 62 1945600 1700
42989157 LucidaLu C Sept. 17, 2018, 9:50 a.m. OK GNU C++11 TESTS 74 62 2355200 1700
56734148 LittleBaby C July 9, 2019, 3:50 a.m. OK GNU C++11 TESTS 75 62 3379200 1700
56734125 zrmpaul C July 9, 2019, 3:49 a.m. OK GNU C++11 TESTS 75 62 3379200 1700
50480375 Scut82 C Feb. 25, 2019, 8:38 a.m. OK GNU C++11 TESTS 75 62 4915200 1700
42986800 nickluo C Sept. 17, 2018, 9:32 a.m. OK GNU C++14 TESTS 74 108 4608000 1700
47172429 vjudge5 C Dec. 17, 2018, 3:44 p.m. OK GNU C++14 TESTS 75 109 1024000 1700
47172412 OO0OO0OO0OO0 C Dec. 17, 2018, 3:43 p.m. OK GNU C++14 TESTS 75 109 1024000 1700
46207441 VictorForbes C Nov. 25, 2018, 3:11 p.m. OK GNU C++14 TESTS 75 109 3788800 1700
42987879 yirannn C Sept. 17, 2018, 9:41 a.m. OK GNU C++14 TESTS 74 109 4198400 1700
46059090 Ehanla0 C Nov. 22, 2018, 12:26 p.m. OK GNU C++14 TESTS 75 124 819200 1700
47036727 jt_112 C Dec. 15, 2018, 12:37 p.m. OK GNU C++14 TESTS 75 124 819200 1700
45122074 daniel071292 C Oct. 31, 2018, 5:26 a.m. OK GNU C++14 TESTS 75 124 819200 1700
44240388 wilson.ho C Oct. 13, 2018, 6:43 a.m. OK GNU C++14 TESTS 75 124 1024000 1700
45513212 zbaxrl2000 C Nov. 10, 2018, 2:13 p.m. OK GNU C++14 TESTS 75 124 1228800 1700
46465841 A_Wanderer C Dec. 2, 2018, 2:58 a.m. OK GNU C++17 TESTS 75 124 819200 1700
42996407 kenimo C Sept. 17, 2018, 12:12 p.m. OK GNU C++17 TESTS 74 124 819200 1700
44167377 yaovpn C Oct. 12, 2018, 2:53 a.m. OK GNU C++17 TESTS 75 124 1024000 1700
44241715 Liwj C Oct. 13, 2018, 7:12 a.m. OK GNU C++17 TESTS 75 124 1024000 1700
49857640 happy_ C Feb. 13, 2019, 8 a.m. OK GNU C++17 TESTS 75 124 2457600 1700
46835186 andrew4936 C Dec. 10, 2018, 1:11 a.m. OK GNU C++17 TESTS 75 124 2457600 1700
43017999 GStnt C Sept. 18, 2018, 1:43 a.m. OK GNU C++17 TESTS 74 124 2662400 1700
44447624 tomandjake C Oct. 17, 2018, 2:33 p.m. OK GNU C++17 TESTS 75 124 3481600 1700
63773594 KrK C Oct. 30, 2019, 8:47 a.m. OK GNU C++17 TESTS 75 124 3686400 1700
45258257 MathisBouverot C Nov. 3, 2018, 9:47 p.m. OK GNU C++17 TESTS 75 124 4300800 1700
43028609 Marii C Sept. 18, 2018, 10:21 a.m. OK Go TESTS 74 343 7168000 1700
42997101 Haar C Sept. 17, 2018, 12:28 p.m. OK Haskell TESTS 74 421 22220800 1700
47794411 llamaoo7 C Dec. 31, 2018, 3:42 p.m. OK Java 8 TESTS 75 202 11468800 1700
44092486 aitch_nu C Oct. 10, 2018, 8:18 p.m. OK Java 8 TESTS 75 202 14950400 1700
43271524 krit_patel C Sept. 22, 2018, 7:12 p.m. OK Java 8 TESTS 75 218 0 1700
43175661 In_The_Name_Of_Love C Sept. 21, 2018, 11:11 a.m. OK Java 8 TESTS 75 218 0 1700
43013916 apurvaj C Sept. 17, 2018, 8:40 p.m. OK Java 8 TESTS 74 218 0 1700
42994510 SrapZark C Sept. 17, 2018, 11:34 a.m. OK Java 8 TESTS 74 218 0 1700
42993739 chaku84 C Sept. 17, 2018, 11:19 a.m. OK Java 8 TESTS 74 218 0 1700
43018908 NguyenHungCuong C Sept. 18, 2018, 2:36 a.m. OK Java 8 TESTS 74 218 18944000 1700
42997011 chandan5284 C Sept. 17, 2018, 12:26 p.m. OK Java 8 TESTS 74 233 0 1700
43024362 mandark27 C Sept. 18, 2018, 7:38 a.m. OK Java 8 TESTS 74 233 0 1700
42995482 kuuso C Sept. 17, 2018, 11:53 a.m. OK Mono C# TESTS 74 404 39219200 1700
42995272 kuuso C Sept. 17, 2018, 11:49 a.m. OK Mono C# TESTS 74 421 41676800 1700
42988505 kuuso C Sept. 17, 2018, 9:46 a.m. OK Mono C# TESTS 74 436 39219200 1700
42992963 kuuso C Sept. 17, 2018, 11:06 a.m. OK Mono C# TESTS 74 436 39219200 1700
43095059 silvavelosa C Sept. 19, 2018, 10:22 p.m. OK Mono C# TESTS 75 841 36249600 1700
42997878 eki C Sept. 17, 2018, 12:44 p.m. OK Mono C# TESTS 74 873 34201600 1700
42989911 omikad C Sept. 17, 2018, 9:56 a.m. OK Mono C# TESTS 74 919 40857600 1700
50532677 vjudge4 C Feb. 26, 2019, 2:18 p.m. OK MS C++ TESTS 75 124 1638400 1700
44380789 vjudge5 C Oct. 16, 2018, 3:34 a.m. OK MS C++ TESTS 75 124 1638400 1700
49041853 vjudge4 C Jan. 27, 2019, 6:49 a.m. OK MS C++ TESTS 75 124 2457600 1700
44167385 vjudge5 C Oct. 12, 2018, 2:54 a.m. OK MS C++ TESTS 75 140 819200 1700
43025399 CrashMaster C Sept. 18, 2018, 8:19 a.m. OK MS C++ TESTS 74 140 1126400 1700
50350923 vjudge2 C Feb. 23, 2019, 8:30 a.m. OK MS C++ TESTS 75 140 1638400 1700
44073999 vjudge2 C Oct. 10, 2018, 12:35 p.m. OK MS C++ TESTS 75 155 1024000 1700
54475211 vjudge4 C May 22, 2019, 8:02 a.m. OK MS C++ TESTS 75 155 1638400 1700
43075785 a19160293 C Sept. 19, 2018, 11:42 a.m. OK MS C++ TESTS 75 156 1638400 1700
42989558 math957963 C Sept. 17, 2018, 9:53 a.m. OK MS C++ TESTS 74 156 4198400 1700
65158127 WrongWayboyyy C Nov. 16, 2019, 10:12 a.m. OK MS C++ 2017 TESTS 75 358 7577600 1700
65156434 SunshineLuminous C Nov. 16, 2019, 9:30 a.m. OK MS C++ 2017 TESTS 75 452 6144000 1700
65156327 SunshineLuminous C Nov. 16, 2019, 9:28 a.m. OK MS C++ 2017 TESTS 75 467 6144000 1700
65156366 SunshineLuminous C Nov. 16, 2019, 9:29 a.m. OK MS C++ 2017 TESTS 75 467 6144000 1700
65155659 SunshineLuminous C Nov. 16, 2019, 9:13 a.m. OK MS C++ 2017 TESTS 75 499 6144000 1700
55579741 Timonnable C June 15, 2019, 5:49 a.m. OK MS C++ 2017 TESTS 75 904 10547200 1700
42995199 Karo3u9 C Sept. 17, 2018, 11:47 a.m. OK PyPy 2 TESTS 74 780 43622400 1700
42995030 ItsLastDay C Sept. 17, 2018, 11:44 a.m. OK PyPy 2 TESTS 74 811 44544000 1700
57115551 pa.n.ik C July 15, 2019, 7:52 p.m. OK PyPy 2 TESTS 75 889 41472000 1700
42987287 tanmay28 C Sept. 17, 2018, 9:36 a.m. OK PyPy 3 TESTS 74 576 27340800 1700
46853215 FireFoxIl C Dec. 10, 2018, 1:22 p.m. OK PyPy 3 TESTS 75 639 26931200 1700
42989312 Onesh0t C Sept. 17, 2018, 9:51 a.m. OK PyPy 3 TESTS 74 654 31436800 1700
44702985 inishchith. C Oct. 22, 2018, 3:33 p.m. OK PyPy 3 TESTS 75 654 33075200 1700
47514153 bupt.wc C Dec. 26, 2018, 8:42 a.m. OK PyPy 3 TESTS 75 670 32256000 1700
44576330 omarnvidia C Oct. 20, 2018, 7:13 a.m. OK PyPy 3 TESTS 75 685 39321600 1700
42993460 tanmay28 C Sept. 17, 2018, 11:14 a.m. OK PyPy 3 TESTS 74 733 26726400 1700
43024690 freedom_dr C Sept. 18, 2018, 7:50 a.m. OK PyPy 3 TESTS 74 764 26931200 1700
43017880 chandak_vikas C Sept. 18, 2018, 1:34 a.m. OK PyPy 3 TESTS 74 780 33075200 1700
43055742 kgcurry59 C Sept. 19, 2018, 3:35 a.m. OK PyPy 3 TESTS 74 794 31539200 1700
46015243 EoinDavey C Nov. 21, 2018, 2:23 a.m. OK Python 2 TESTS 75 608 11264000 1700
43091160 J.S. C Sept. 19, 2018, 7 p.m. OK Python 2 TESTS 75 623 13414400 1700
43105640 Djok216 C Sept. 20, 2018, 8:27 a.m. OK Python 2 TESTS 75 748 11571200 1700
42985659 jassi9c C Sept. 17, 2018, 9:24 a.m. OK Python 2 TESTS 74 764 11673600 1700
43096628 aeternalis1 C Sept. 20, 2018, 12:50 a.m. OK Python 2 TESTS 75 920 26009600 1700
44077667 SerChirag C Oct. 10, 2018, 1:41 p.m. OK Python 2 TESTS 75 967 32256000 1700
42996729 Dambola C Sept. 17, 2018, 12:20 p.m. OK Python 3 TESTS 74 670 32153600 1700
43064915 daniloaf C Sept. 19, 2018, 4:22 a.m. OK Python 3 TESTS 74 701 23756800 1700
43064905 daniloaf C Sept. 19, 2018, 4:21 a.m. OK Python 3 TESTS 74 717 23756800 1700
43090167 orailly C Sept. 19, 2018, 6:26 p.m. OK Python 3 TESTS 75 794 32256000 1700
43924184 EliasMera C Oct. 7, 2018, 3:32 a.m. OK Python 3 TESTS 75 795 32051200 1700
46019862 Firepaw C Nov. 21, 2018, 7:12 a.m. OK Python 3 TESTS 75 795 39014400 1700
42993133 tanmay28 C Sept. 17, 2018, 11:09 a.m. OK Python 3 TESTS 74 982 18022400 1700
43089832 WENOUT C Sept. 19, 2018, 6:14 p.m. OK Python 3 TESTS 75 982 19046400 1700
48453054 tohidul_asif C Jan. 16, 2019, 11:32 a.m. OK Python 3 TESTS 75 998 29081600 1700
42992836 koikotya C Sept. 17, 2018, 11:04 a.m. OK Ruby TESTS 74 638 37478400 1700
42987380 yakamoto C Sept. 17, 2018, 9:37 a.m. OK Scala TESTS 74 826 23244800 1700

remove filters

Back to search problems