Codeforces Round 736 (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
1548 Codeforces Round 736 (Div. 1) FINISHED False 8700 103994699 Aug. 1, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1841 ) C The Three Little Pigs PROGRAMMING combinatorics dp fft math

B"Three little pigs from all over the world are meeting for a convention! Every minute, a triple of 3 new pigs arrives on the convention floor. After the n -th minute, the convention ends. The big bad wolf has learned about this convention, and he has an attack plan. At some minute in the convention, he will arrive and eat exactly x pigs. Then he will get away. The wolf wants Gregor to help him figure out the number of possible attack plans that involve eating exactly x pigs for various values of x ( 1 <= x <= 3n ). Two attack plans are considered different, if they occur at different times or if the sets of little pigs to eat are different. Note that all queries are independent, that is, the wolf does not eat the little pigs, he only makes plans! The first line of input contains two integers n and q ( 1 <= n <= 10^6 , 1 <= q <= 2 cdot 10^5 ), the number of minutes the convention lasts and the number of queries the wolf asks. Each of the next q lines contains a single integer x_i ( 1 <= x_i <= 3n ), the number of pigs the wolf will eat in the i -th query. You should print q lines, with line i representing the number of attack plans if the wolf wants to eat x_i pigs. Since each query answer can be large, output each answer modulo 10^9+7 . In the example test, n=2 . Thus, there are 3 pigs at minute 1 , and 6 pigs at minute 2 . There are three queries: x=1 , x=5 , and x=6 . If the wolf wants to eat 1 pig, he can do so in 3+6=9 possible attack plans, depending on whether he arrives at minute 1 or 2 . If the wolf wants to eat 5 pigs, the wolf cannot arrive at minute 1 , since there aren't enough pigs at that time. Therefore, the wolf has to arrive at minute 2 , and there are 6 possible attack plans. If the wolf wants to eat 6 pigs, his only plan is to arrive at the end of t"...

Tutorials

Codeforces Round 736 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
124572254 LJC00118 C Aug. 1, 2021, 3:44 p.m. OK GNU C++11 TESTS 12 249 39936000
124578871 Daas C Aug. 1, 2021, 3:59 p.m. OK GNU C++11 TESTS 12 265 39936000
124626644 jerry3128 C Aug. 2, 2021, 12:32 a.m. OK GNU C++11 TESTS 12 265 126156800
124634214 _hikari_ C Aug. 2, 2021, 2:47 a.m. OK GNU C++11 TESTS 12 280 52019200
124593398 fishcathu. C Aug. 1, 2021, 4:34 p.m. OK GNU C++11 TESTS 12 280 52019200
124579974 knil_GMO C Aug. 1, 2021, 4:01 p.m. OK GNU C++11 TESTS 12 280 63795200
124559512 cjy2003 C Aug. 1, 2021, 3:21 p.m. OK GNU C++11 TESTS 12 280 63795200
124558789 He_Ren C Aug. 1, 2021, 3:19 p.m. OK GNU C++11 TESTS 12 280 64000000
124647128 YangTY C Aug. 2, 2021, 5:34 a.m. OK GNU C++11 TESTS 12 280 67993600
124626599 AoLiGei C Aug. 2, 2021, 12:31 a.m. OK GNU C++11 TESTS 12 280 100044800
124561525 ugly2333 C Aug. 1, 2021, 3:24 p.m. OK GNU C++14 TESTS 12 280 51814400
124556859 nealchen C Aug. 1, 2021, 3:16 p.m. OK GNU C++14 TESTS 12 296 63897600
124630279 hyta4982 C Aug. 2, 2021, 1:47 a.m. OK GNU C++14 TESTS 12 311 27750400
124550009 MagicSpark C Aug. 1, 2021, 3:07 p.m. OK GNU C++14 TESTS 12 327 43827200
124571570 axs7384 C Aug. 1, 2021, 3:43 p.m. OK GNU C++14 TESTS 12 327 51814400
124623220 Graphter C Aug. 1, 2021, 10:42 p.m. OK GNU C++14 TESTS 12 327 63897600
124627414 AhoCorasick C Aug. 2, 2021, 12:50 a.m. OK GNU C++14 TESTS 12 327 65945600
124555634 Subconscious C Aug. 1, 2021, 3:14 p.m. OK GNU C++14 TESTS 12 373 79257600
124643556 WhyWhy C Aug. 2, 2021, 4:53 a.m. OK GNU C++14 TESTS 12 405 75878400
124626938 _nuclear_ C Aug. 2, 2021, 12:40 a.m. OK GNU C++14 TESTS 12 405 124006400
124564930 Roundgod C Aug. 1, 2021, 3:30 p.m. OK GNU C++17 TESTS 12 295 63897600
124543126 yhx-12243 C Aug. 1, 2021, 2:59 p.m. OK GNU C++17 TESTS 12 296 51814400
124588928 paulica C Aug. 1, 2021, 4:23 p.m. OK GNU C++17 TESTS 12 296 63897600
124634742 flashmt C Aug. 2, 2021, 2:54 a.m. OK GNU C++17 TESTS 12 311 39833600
124582645 chinerist C Aug. 1, 2021, 4:07 p.m. OK GNU C++17 TESTS 12 312 27750400
124556659 Namnamseo C Aug. 1, 2021, 3:16 p.m. OK GNU C++17 TESTS 12 312 51814400
124602616 gyh20 C Aug. 1, 2021, 4:56 p.m. OK GNU C++17 TESTS 12 312 55808000
124637691 farmerboy C Aug. 2, 2021, 3:34 a.m. OK GNU C++17 TESTS 12 326 63897600
124616364 AlbertoTDNeto C Aug. 1, 2021, 8:20 p.m. OK GNU C++17 TESTS 12 326 87859200
124639916 bkifhr9 C Aug. 2, 2021, 4:05 a.m. OK GNU C++17 TESTS 12 327 63897600
124564453 Kude C Aug. 1, 2021, 3:29 p.m. OK GNU C++17 (64) TESTS 12 170 40345600
124630462 Thallium54 C Aug. 2, 2021, 1:51 a.m. OK GNU C++17 (64) TESTS 12 171 40345600
124617930 islingr C Aug. 1, 2021, 8:40 p.m. OK GNU C++17 (64) TESTS 12 171 40345600
124585843 Ormlis C Aug. 1, 2021, 4:15 p.m. OK GNU C++17 (64) TESTS 12 171 40345600
124559563 maroonrk C Aug. 1, 2021, 3:21 p.m. OK GNU C++17 (64) TESTS 12 186 52428800
124603216 dblark C Aug. 1, 2021, 4:57 p.m. OK GNU C++17 (64) TESTS 12 186 365056000
124566407 cuiaoxiang C Aug. 1, 2021, 3:32 p.m. OK GNU C++17 (64) TESTS 12 187 52428800
124548776 jiangly C Aug. 1, 2021, 3:05 p.m. OK GNU C++17 (64) TESTS 12 187 52428800
124647967 YLWang C Aug. 2, 2021, 5:43 a.m. OK GNU C++17 (64) TESTS 12 187 52531200
124633228 Fysty C Aug. 2, 2021, 2:32 a.m. OK GNU C++17 (64) TESTS 12 187 76492800
124582279 clyring C Aug. 1, 2021, 4:07 p.m. OK Haskell TESTS 12 763 39014400
124583498 knightL C Aug. 1, 2021, 4:09 p.m. OK Kotlin TESTS 12 873 92262400
124621441 new_acc_ C Aug. 1, 2021, 9:53 p.m. OK MS C++ 2017 TESTS 12 608 63897600
124551477 sansen C Aug. 1, 2021, 3:09 p.m. OK Rust TESTS 12 187 66867200

remove filters

Back to search problems