Codeforces Round 859 (Div. 4)

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
1807 Codeforces Round 859 (Div. 4) FINISHED False 8100 57942263 March 19, 2023, 2:55 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 20357 ) G2 Subsequence Addition (Hard Version) PROGRAMMING dp greedy implementation math sortings

B'The only difference between the two versions is that in this version, the constraints are higher. Initially, array a contains just the number 1 . You can perform several operations in order to change the array. In an operation, you can select some subsequence ^{ dagger} of a and add into a an element equal to the sum of all elements of the subsequence. You are given a final array c . Check if c can be obtained from the initial array a by performing some number (possibly 0) of operations on the initial array. ^{ dagger} A sequence b is a subsequence of a sequence a if b can be obtained from a by the deletion of several (possibly zero, but not all) elements. In other words, select k ( 1 <= q k <= q |a| ) distinct indices i_1, i_2, ... , i_k and insert anywhere into a a new element with the value equal to a_{i_1} + a_{i_2} + ... + a_{i_k} . The first line of the input contains an integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains a single integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the number of elements the final array c should have. The second line of each test case contains n space-separated integers c_i ( 1 <= q c_i <= q 2 cdot 10^5 ) -- the elements of the final array c that should be obtained from the initial array a . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output "YES" (without quotes) if such a sequence of operations exists, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer). For the first test case, the initial array a is already equal to [1] , so the answer is "YES". For the second te'...

Tutorials

114143

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
198290198 Awesome3.14 G2 March 19, 2023, 11:18 p.m. OK D TESTS 22 124 9523200
198268616 ruban G2 March 19, 2023, 6:30 p.m. OK FPC TESTS 22 155 155648000
198314797 Union G2 March 20, 2023, 5:41 a.m. OK GNU C++14 TESTS 22 62 819200
198312754 rutikdeshmukh3 G2 March 20, 2023, 5:17 a.m. OK GNU C++14 TESTS 22 62 819200
198304919 Lenlynn G2 March 20, 2023, 3:32 a.m. OK GNU C++14 TESTS 22 62 819200
198303353 hari_0oom G2 March 20, 2023, 3:03 a.m. OK GNU C++14 TESTS 22 62 819200
198301167 wsyhb G2 March 20, 2023, 2:21 a.m. OK GNU C++14 TESTS 22 62 819200
198301022 xsheng G2 March 20, 2023, 2:18 a.m. OK GNU C++14 TESTS 22 62 819200
198298723 Cabbage03 G2 March 20, 2023, 1:27 a.m. OK GNU C++14 TESTS 22 62 819200
198275771 ZeroCoolCorp G2 March 19, 2023, 7:30 p.m. OK GNU C++14 TESTS 22 62 819200
198275042 Xor_again G2 March 19, 2023, 7:23 p.m. OK GNU C++14 TESTS 22 62 819200
198274574 thumbass G2 March 19, 2023, 7:19 p.m. OK GNU C++14 TESTS 22 62 819200
198291506 Mazen_mohamed222 G2 March 19, 2023, 11:51 p.m. OK GNU C++17 TESTS 22 46 1126400
198290755 Hacker_2023 G2 March 19, 2023, 11:32 p.m. OK GNU C++17 TESTS 22 46 1126400
198302785 chakshu2022 G2 March 20, 2023, 2:53 a.m. OK GNU C++17 TESTS 22 61 819200
198314258 Ahmad-Alhamoud G2 March 20, 2023, 5:35 a.m. OK GNU C++17 TESTS 22 61 1638400
198316104 qqzj G2 March 20, 2023, 5:57 a.m. OK GNU C++17 TESTS 22 62 819200
198314905 sigma_yyf G2 March 20, 2023, 5:43 a.m. OK GNU C++17 TESTS 22 62 819200
198313764 notCF_c0der G2 March 20, 2023, 5:29 a.m. OK GNU C++17 TESTS 22 62 819200
198313645 rizwan321 G2 March 20, 2023, 5:28 a.m. OK GNU C++17 TESTS 22 62 819200
198307766 Fionn_Lee G2 March 20, 2023, 4:16 a.m. OK GNU C++17 TESTS 22 62 819200
198307123 nitin17k G2 March 20, 2023, 4:05 a.m. OK GNU C++17 TESTS 22 62 819200
198313888 alif_cse_ju G2 March 20, 2023, 5:31 a.m. OK GNU C++17 (64) TESTS 22 46 819200
198313666 Lose_Face G2 March 20, 2023, 5:28 a.m. OK GNU C++17 (64) TESTS 22 46 819200
198311633 vioalbert G2 March 20, 2023, 5:03 a.m. OK GNU C++17 (64) TESTS 22 46 819200
198301304 BlackGuy42 G2 March 20, 2023, 2:23 a.m. OK GNU C++17 (64) TESTS 22 46 819200
198299033 urBCI G2 March 20, 2023, 1:35 a.m. OK GNU C++17 (64) TESTS 22 46 819200
198271137 fdvv_i G2 March 19, 2023, 6:49 p.m. OK GNU C++17 (64) TESTS 22 46 819200
198279848 CompilationError G2 March 19, 2023, 8:16 p.m. OK GNU C++17 (64) TESTS 22 46 1024000
198316419 Misbaul_Hasan G2 March 20, 2023, 6:01 a.m. OK GNU C++17 (64) TESTS 22 46 1638400
198313246 electrojay27 G2 March 20, 2023, 5:23 a.m. OK GNU C++17 (64) TESTS 22 46 1638400
198313125 dongts G2 March 20, 2023, 5:22 a.m. OK GNU C++17 (64) TESTS 22 46 1638400
198309577 qzhfx G2 March 20, 2023, 4:40 a.m. OK GNU C++20 (64) TESTS 22 31 819200
198305473 Lazy.JPG G2 March 20, 2023, 3:41 a.m. OK GNU C++20 (64) TESTS 22 31 819200
198305036 Ycy0fmine G2 March 20, 2023, 3:34 a.m. OK GNU C++20 (64) TESTS 22 31 819200
198315077 shyamer3 G2 March 20, 2023, 5:45 a.m. OK GNU C++20 (64) TESTS 22 31 1638400
198314529 modernbeast02 G2 March 20, 2023, 5:38 a.m. OK GNU C++20 (64) TESTS 22 31 1638400
198310401 alwaysAnewbie G2 March 20, 2023, 4:49 a.m. OK GNU C++20 (64) TESTS 22 31 1638400
198306640 _jinay_09 G2 March 20, 2023, 3:58 a.m. OK GNU C++20 (64) TESTS 22 31 1638400
198301554 TASHFIQ_TAIF G2 March 20, 2023, 2:28 a.m. OK GNU C++20 (64) TESTS 22 31 1638400
198289940 S.A.Y.E.D G2 March 19, 2023, 11:12 p.m. OK GNU C++20 (64) TESTS 22 31 1638400
198275351 EgorKush G2 March 19, 2023, 7:26 p.m. OK GNU C++20 (64) TESTS 22 31 1638400
198302254 ch2001 G2 March 20, 2023, 2:43 a.m. OK Java 11 TESTS 22 187 0
198288375 dzhi G2 March 19, 2023, 10:36 p.m. OK Java 11 TESTS 22 217 0
198287276 dzhi G2 March 19, 2023, 10:12 p.m. OK Java 11 TESTS 22 217 0
198291953 etian6795 G2 March 20, 2023, 12:02 a.m. OK Java 11 TESTS 22 218 0
198288435 dzhi G2 March 19, 2023, 10:38 p.m. OK Java 11 TESTS 22 218 0
198295028 theSSS G2 March 20, 2023, 1:18 a.m. OK Java 11 TESTS 22 233 0
198300676 Ankita1129 G2 March 20, 2023, 2:11 a.m. OK Java 11 TESTS 22 249 0
198287074 dzhi G2 March 19, 2023, 10:08 p.m. OK Java 11 TESTS 22 264 4300800
198303002 riyadas.200208 G2 March 20, 2023, 2:57 a.m. OK Java 11 TESTS 22 264 19251200
198266711 g_square G2 March 19, 2023, 6:17 p.m. OK Java 11 TESTS 22 265 0
198304595 Danger_Don G2 March 20, 2023, 3:26 a.m. OK Java 17 TESTS 22 264 409600
198267637 blademo G2 March 19, 2023, 6:23 p.m. OK Java 17 TESTS 22 264 512000
198272359 Extradict G2 March 19, 2023, 6:59 p.m. OK Java 17 TESTS 22 265 409600
198313415 bleach__ G2 March 20, 2023, 5:25 a.m. OK Java 17 TESTS 22 280 614400
198290591 ansuman_83 G2 March 19, 2023, 11:28 p.m. OK Java 17 TESTS 22 296 614400
198262233 LucunJi G2 March 19, 2023, 5:51 p.m. OK Java 17 TESTS 22 311 614400
198301087 Tang7777777 G2 March 20, 2023, 2:19 a.m. OK Java 17 TESTS 22 326 1126400
198273301 andry57 G2 March 19, 2023, 7:07 p.m. OK Java 17 TESTS 22 483 819200
198263831 vijay_panwar12 G2 March 19, 2023, 6 p.m. OK Java 17 TESTS 22 483 1024000
198278460 adarsh8604707199 G2 March 19, 2023, 7:59 p.m. OK Java 17 TESTS 22 498 819200
198311175 black_demon G2 March 20, 2023, 4:58 a.m. OK Java 8 TESTS 22 140 2252800
198263442 __SSB__ G2 March 19, 2023, 5:58 p.m. OK Java 8 TESTS 22 140 2252800
198264200 __SSB__ G2 March 19, 2023, 6:02 p.m. OK Java 8 TESTS 22 155 2764800
198264022 __SSB__ G2 March 19, 2023, 6:01 p.m. OK Java 8 TESTS 22 171 2764800
198263599 mohamedhassan_c G2 March 19, 2023, 5:59 p.m. OK Java 8 TESTS 22 186 13926400
198294830 Hinnawi24 G2 March 20, 2023, 1:13 a.m. OK Java 8 TESTS 22 218 2867200
198269215 rish1896 G2 March 19, 2023, 6:34 p.m. OK Java 8 TESTS 22 218 3072000
198268665 M.Abdelnasser G2 March 19, 2023, 6:30 p.m. OK Java 8 TESTS 22 420 0
198268606 Lion_King1 G2 March 19, 2023, 6:30 p.m. OK Java 8 TESTS 22 420 0
198274202 Raj_Rawat G2 March 19, 2023, 7:15 p.m. OK Java 8 TESTS 22 421 0
198265272 aadrito G2 March 19, 2023, 6:08 p.m. OK MS C++ 2017 TESTS 22 156 819200
198293111 ishybee G2 March 20, 2023, 12:31 a.m. OK MS C++ 2017 TESTS 22 171 3174400
198270822 ayushgupta2417 G2 March 19, 2023, 6:47 p.m. OK MS C++ 2017 TESTS 22 171 3276800
198275848 DatMomoAgain G2 March 19, 2023, 7:31 p.m. OK MS C++ 2017 TESTS 22 171 4915200
198311129 IITeens G2 March 20, 2023, 4:58 a.m. OK MS C++ 2017 TESTS 22 187 3174400
198308104 b-baka G2 March 20, 2023, 4:21 a.m. OK PyPy 3 TESTS 22 140 15667200
198264402 flexr G2 March 19, 2023, 6:03 p.m. OK PyPy 3 TESTS 22 265 14643200
198262874 only_oneNinja G2 March 19, 2023, 5:54 p.m. OK PyPy 3 TESTS 22 280 17510400
198285949 oneku16 G2 March 19, 2023, 9:44 p.m. OK PyPy 3-64 TESTS 22 109 25804800
198292953 shubhamgoel0711 G2 March 20, 2023, 12:27 a.m. OK PyPy 3-64 TESTS 22 124 17510400
198277030 _Papaya_ G2 March 19, 2023, 7:43 p.m. OK PyPy 3-64 TESTS 22 124 17612800
198271732 MartinXu6 G2 March 19, 2023, 6:54 p.m. OK PyPy 3-64 TESTS 22 124 17920000
198263809 Varad G2 March 19, 2023, 6 p.m. OK PyPy 3-64 TESTS 22 124 17920000
198307512 5ujith G2 March 20, 2023, 4:12 a.m. OK PyPy 3-64 TESTS 22 124 19660800
198293575 maxliang G2 March 20, 2023, 12:43 a.m. OK PyPy 3-64 TESTS 22 124 19660800
198280609 Mohamed.Sweid G2 March 19, 2023, 8:26 p.m. OK PyPy 3-64 TESTS 22 124 19660800
198304127 Youarenotgood G2 March 20, 2023, 3:18 a.m. OK PyPy 3-64 TESTS 22 124 21196800
198266591 SoleProprietor G2 March 19, 2023, 6:16 p.m. OK PyPy 3-64 TESTS 22 124 21196800
198293117 kanth_7 G2 March 20, 2023, 12:31 a.m. OK Python 3 TESTS 22 171 12902400
198316366 sagarhasan273 G2 March 20, 2023, 6 a.m. OK Python 3 TESTS 22 186 14438400
198284353 Viper35 G2 March 19, 2023, 9:17 p.m. OK Python 3 TESTS 22 202 13209600
198284694 tristans G2 March 19, 2023, 9:22 p.m. OK Python 3 TESTS 22 202 13721600
198272865 jamerrq G2 March 19, 2023, 7:04 p.m. OK Python 3 TESTS 22 202 13926400
198271111 GinOwO G2 March 19, 2023, 6:49 p.m. OK Python 3 TESTS 22 202 14233600
198309115 fathorse G2 March 20, 2023, 4:34 a.m. OK Python 3 TESTS 22 202 14438400
198314696 avinashdoddi G2 March 20, 2023, 5:40 a.m. OK Python 3 TESTS 22 218 13312000
198310225 bkifhr9 G2 March 20, 2023, 4:48 a.m. OK Python 3 TESTS 22 218 13721600
198270671 arguarachi G2 March 19, 2023, 6:45 p.m. OK Python 3 TESTS 22 218 13926400
198310006 Tuhil G2 March 20, 2023, 4:45 a.m. OK Rust 2021 TESTS 22 31 6246400

remove filters

Back to search problems