Codeforces Round 814 (Div. 1)

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
1718 Codeforces Round 814 (Div. 1) FINISHED False 7200 76519463 Aug. 16, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3089 ) B Fibonacci Strings PROGRAMMING brute force data structures greedy implementation math number theory

B'In all schools in Buryatia, in the 1 class, everyone is told the theory of Fibonacci strings. "A block is a subsegment of a string where all the letters are the same and are bounded on the left and right by the ends of the string or by letters other than the letters in the block. A string is called a Fibonacci string if, when it is divided into blocks, their lengths in the order they appear in the string form the Fibonacci sequence ( f_0 = f_1 = 1 , f_i = f_{i-2} + f_{i-1} ), starting from the zeroth member of this sequence. A string is called semi-Fibonacci if it possible to reorder its letters to get a Fibonacci string." Burenka decided to enter the Buryat State University, but at the entrance exam she was given a difficult task. She was given a string consisting of the letters of the Buryat alphabet (which contains exactly k letters), and was asked if the given string is semi-Fibonacci. The string can be very long, so instead of the string, she was given the number of appearances of each letter ( c_i for the i -th letter) in that string. Unfortunately, Burenka no longer remembers the theory of Fibonacci strings, so without your help she will not pass the exam. The first line contains one integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. The following is a description of the input data sets. The first line of each test case contains one integer k ( 1 <= q k <= q 100 ) -- the number of letters in the alphabet. The second line of each test case contains k integers c_1, c_2, ldots, c_k ( 1 <= q c_i <= q 10^9 ) -- the number of occurrences of each letter in the string. For each test case print the string "YES" if the corresponding string is semi-Fibonacci, and "NO" if it is not. You can print "YES" and "NO" in any case (for example, the strings "yEs", "yes", "Yes" will be recognized as a positive answer). In the first test case, a one-character string is semi-Fibonacci, being '...

Tutorials

Codeforces Round #814 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
168577167 mban259 B Aug. 16, 2022, 3:53 p.m. OK C# 10 TESTS 25 109 3379200
168548824 Gassa B Aug. 16, 2022, 3:11 p.m. OK D TESTS 25 249 1945600
168585939 chro4896 B Aug. 16, 2022, 4:08 p.m. OK GNU C11 TESTS 25 202 0
168566583 SeiunSky B Aug. 16, 2022, 3:36 p.m. OK GNU C++14 TESTS 25 46 8089600
168573779 jiangbowen B Aug. 16, 2022, 3:47 p.m. OK GNU C++14 TESTS 25 93 26112000
168570299 Winterfrost B Aug. 16, 2022, 3:41 p.m. OK GNU C++14 TESTS 25 108 2662400
168596431 ZhangCW_QwQ B Aug. 16, 2022, 4:28 p.m. OK GNU C++14 TESTS 25 124 2252800
168570573 __sleep B Aug. 16, 2022, 3:42 p.m. OK GNU C++14 TESTS 25 156 204800
168563499 PurpleWonder B Aug. 16, 2022, 3:31 p.m. OK GNU C++14 TESTS 25 171 6348800
168585864 Jimanbanashi B Aug. 16, 2022, 4:08 p.m. OK GNU C++14 TESTS 25 186 0
168562905 jrscy B Aug. 16, 2022, 3:30 p.m. OK GNU C++14 TESTS 25 186 204800
168554325 Aokana B Aug. 16, 2022, 3:18 p.m. OK GNU C++14 TESTS 25 186 204800
168572022 XfarawayX B Aug. 16, 2022, 3:44 p.m. OK GNU C++14 TESTS 25 186 204800
168585122 kk19212 B Aug. 16, 2022, 4:07 p.m. OK GNU C++17 TESTS 25 61 1228800
168611736 Bobocan B Aug. 16, 2022, 6:14 p.m. OK GNU C++17 TESTS 27 62 716800
168545271 zemen B Aug. 16, 2022, 3:06 p.m. OK GNU C++17 TESTS 25 140 204800
168607408 S_ky B Aug. 16, 2022, 5:46 p.m. OK GNU C++17 TESTS 26 155 204800
168647961 Sutaner B Aug. 17, 2022, 4:21 a.m. OK GNU C++17 TESTS 27 155 2355200
168539596 DerekFeng B Aug. 16, 2022, 2:59 p.m. OK GNU C++17 TESTS 25 156 0
168571335 abc864197532 B Aug. 16, 2022, 3:43 p.m. OK GNU C++17 TESTS 25 156 307200
168538843 cadmiumky B Aug. 16, 2022, 2:59 p.m. OK GNU C++17 TESTS 25 170 4198400
168581431 IsaacMoris B Aug. 16, 2022, 4 p.m. OK GNU C++17 TESTS 25 171 204800
168606456 P500 B Aug. 16, 2022, 5:42 p.m. OK GNU C++17 TESTS 25 171 204800
168579543 Cocoly1990 B Aug. 16, 2022, 3:57 p.m. OK GNU C++17 (64) TESTS 25 62 142540800
168561795 jo_on B Aug. 16, 2022, 3:28 p.m. OK GNU C++17 (64) TESTS 25 93 102400
168556869 yzc2005 B Aug. 16, 2022, 3:21 p.m. OK GNU C++17 (64) TESTS 25 108 102400
168583504 allay B Aug. 16, 2022, 4:04 p.m. OK GNU C++17 (64) TESTS 25 108 1945600
168573960 yanx B Aug. 16, 2022, 3:47 p.m. OK GNU C++17 (64) TESTS 25 109 0
168552747 TheLostCookie B Aug. 16, 2022, 3:16 p.m. OK GNU C++17 (64) TESTS 25 109 102400
168565731 ttttan B Aug. 16, 2022, 3:34 p.m. OK GNU C++17 (64) TESTS 25 124 0
168543902 kotatsugame B Aug. 16, 2022, 3:04 p.m. OK GNU C++17 (64) TESTS 25 124 0
168587847 rniya B Aug. 16, 2022, 4:12 p.m. OK GNU C++17 (64) TESTS 25 124 0
168606759 QAQqqqqqq B Aug. 16, 2022, 5:43 p.m. OK GNU C++17 (64) TESTS 25 124 102400
168655250 lndjy B Aug. 17, 2022, 6 a.m. OK GNU C++20 (64) TESTS 28 46 2048000
168574187 Bench0310 B Aug. 16, 2022, 3:48 p.m. OK GNU C++20 (64) TESTS 25 78 102400
168547336 maximumSHOT B Aug. 16, 2022, 3:09 p.m. OK GNU C++20 (64) TESTS 25 78 102400
168561950 faustaadp B Aug. 16, 2022, 3:29 p.m. OK GNU C++20 (64) TESTS 25 78 4812800
168606897 trainwithoutpain B Aug. 16, 2022, 5:43 p.m. OK GNU C++20 (64) TESTS 25 93 102400
168590798 rushitote B Aug. 16, 2022, 4:17 p.m. OK GNU C++20 (64) TESTS 25 93 102400
168607156 VLamarca B Aug. 16, 2022, 5:45 p.m. OK GNU C++20 (64) TESTS 26 93 102400
168581560 VHTung B Aug. 16, 2022, 4 p.m. OK GNU C++20 (64) TESTS 25 93 102400
168574074 Prabhakar_987 B Aug. 16, 2022, 3:48 p.m. OK GNU C++20 (64) TESTS 25 93 102400
168584456 hotboy2703 B Aug. 16, 2022, 4:06 p.m. OK GNU C++20 (64) TESTS 25 93 102400
168582494 knightL B Aug. 16, 2022, 4:02 p.m. OK Java 11 TESTS 25 451 0
168570833 MagentaCobra B Aug. 16, 2022, 3:42 p.m. OK Java 8 TESTS 25 358 0
168567937 Hakiobo B Aug. 16, 2022, 3:38 p.m. OK Kotlin 1.4 TESTS 25 311 1126400
168559872 arvindf232 B Aug. 16, 2022, 3:26 p.m. OK Kotlin 1.6 TESTS 25 280 921600
168553278 Tlatoani B Aug. 16, 2022, 3:16 p.m. OK Kotlin 1.6 TESTS 25 639 1126400
168615929 pavelk108 B Aug. 16, 2022, 6:50 p.m. OK Kotlin 1.6 TESTS 27 1715 102400
168549875 KroosTheKeenGlint B Aug. 16, 2022, 3:12 p.m. OK MS C++ 2017 TESTS 25 218 0
168588264 LXl491214 B Aug. 16, 2022, 4:13 p.m. OK MS C++ 2017 TESTS 25 733 0
168606471 misorin B Aug. 16, 2022, 5:42 p.m. OK PyPy 3 TESTS 25 311 18739200
168586147 conqueror_of_tourist B Aug. 16, 2022, 4:09 p.m. OK PyPy 3-64 TESTS 25 343 9113600
168585184 shobonvip B Aug. 16, 2022, 4:07 p.m. OK PyPy 3-64 TESTS 25 389 20480000
168566696 huangxw B Aug. 16, 2022, 3:36 p.m. OK PyPy 3-64 TESTS 25 420 22118400
168543978 asdsasd B Aug. 16, 2022, 3:05 p.m. OK PyPy 3-64 TESTS 25 467 21504000
168631508 duck702702 B Aug. 16, 2022, 11:01 p.m. OK PyPy 3-64 TESTS 27 499 11571200
168567767 chinerist B Aug. 16, 2022, 3:37 p.m. OK PyPy 3-64 TESTS 25 561 10752000
168559946 shotoyoo B Aug. 16, 2022, 3:26 p.m. OK PyPy 3-64 TESTS 25 670 11673600
168590442 xxh1999 B Aug. 16, 2022, 4:17 p.m. OK PyPy 3-64 TESTS 25 841 24166400
168553089 savsmail B Aug. 16, 2022, 3:16 p.m. OK Python 3 TESTS 25 421 307200
168620422 CinaDor B Aug. 16, 2022, 7:40 p.m. OK Python 3 TESTS 27 857 614400
168537510 Egor B Aug. 16, 2022, 2:57 p.m. OK Rust 2021 TESTS 25 46 0
168565105 Niklassanden B Aug. 16, 2022, 3:33 p.m. OK Rust 2021 TESTS 25 46 102400
168550936 sansen B Aug. 16, 2022, 3:13 p.m. OK Rust 2021 TESTS 25 46 13721600
168596922 LittleCyan B Aug. 16, 2022, 4:28 p.m. OK Rust 2021 TESTS 25 78 13721600
168555863 qwerty787788 B Aug. 16, 2022, 3:20 p.m. OK Rust 2021 TESTS 25 280 102400

remove filters

Back to search problems