Codeforces Round 283 (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
497 Codeforces Round 283 (Div. 1) FINISHED False 7200 312989399 Dec. 17, 2014, 4:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 285 ) E Subsequences Return PROGRAMMING dp matrices 2900

B'Assume that sk(n) equals the sum of digits of number n in the k-based notation. For example, s2(5) xe2 x80 x89= xe2 x80 x89s2(1012) xe2 x80 x89= xe2 x80 x891 xe2 x80 x89+ xe2 x80 x890 xe2 x80 x89+ xe2 x80 x891 xe2 x80 x89= xe2 x80 x892, s3(14) xe2 x80 x89= xe2 x80 x89s3(1123) xe2 x80 x89= xe2 x80 x891 xe2 x80 x89+ xe2 x80 x891 xe2 x80 x89+ xe2 x80 x892 xe2 x80 x89= xe2 x80 x894. The sequence of integers a0, xe2 x80 x89..., xe2 x80 x89an xe2 x80 x89- xe2 x80 x891 is defined as . Your task is to calculate the number of distinct subsequences of sequence a0, xe2 x80 x89..., xe2 x80 x89an xe2 x80 x89- xe2 x80 x891. Calculate the answer modulo 109 xe2 x80 x89+ xe2 x80 x897. Sequence a1, xe2 x80 x89..., xe2 x80 x89ak is called to be a subsequence of sequence b1, xe2 x80 x89..., xe2 x80 x89bl, if there is a sequence of indices 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i1 xe2 x80 x89< xe2 x80 x89... xe2 x80 x89< xe2 x80 x89ik xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89l, such that a1 xe2 x80 x89= xe2 x80 x89bi1, ..., ak xe2 x80 x89= xe2 x80 x89bik. In particular, an empty sequence (i.e. the sequence consisting of zero elements) is a subsequence of any sequence. The first line contains two space-separated numbers n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891018, 2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x8930). In a single line print the answer to the problem modulo 109 xe2 x80 x89+ xe2 x80 x897. In the first sample the sequence ai looks as follows: (0, xe2 x80 x891, xe2 x80 x891, xe2 x80 x890). All the possible subsequences are: In the second sample the sequence ai looks as follows: (0, xe2 x80 x891, xe2 x80 x892, xe2 x80 x893, xe2 x80 x894, xe2 x80 x895, xe2 x80 x896). The subsequences of this sequence are exactly all increasing sequences formed from numbers from 0 to 6. It is easy to see that there are 27 xe2 x80 x89= xe2 x80 x89128 such sequences.'...

Tutorials

15208

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
9386175 aaaaajack E Jan. 8, 2015, 12:59 p.m. OK GNU C++ TESTS 60 46 1331200 2900
13919130 130705009 E Oct. 28, 2015, 4:37 p.m. OK GNU C++ TESTS 60 46 1331200 2900
18177170 AcrossTheSky E June 1, 2016, 5:16 a.m. OK GNU C++ TESTS 60 62 2662400 2900
17393999 jcvb E April 20, 2016, 2:30 a.m. OK GNU C++ TESTS 60 62 2662400 2900
9174196 rowdark E Dec. 17, 2014, 6:01 p.m. OK GNU C++ TESTS 60 124 14848000 2900
15142665 HappyNewYearMike E Dec. 31, 2015, 10:38 p.m. OK GNU C++ TESTS 60 124 22220800 2900
9182120 bool_kzf E Dec. 18, 2014, 3:59 a.m. OK GNU C++ TESTS 60 124 22425600 2900
9493514 awc E Jan. 21, 2015, 2:16 p.m. OK GNU C++ TESTS 60 155 12083200 2900
9284764 fruwajacybyk E Dec. 27, 2014, 1:59 p.m. OK GNU C++ TESTS 60 155 32768000 2900
9181349 Syloviaely E Dec. 18, 2014, 1:16 a.m. OK GNU C++ TESTS 60 156 307200 2900
9446597 Shapo E Jan. 16, 2015, 10:08 p.m. OK GNU C++0x TESTS 60 46 204800 2900
9446631 Shapo E Jan. 16, 2015, 10:22 p.m. OK GNU C++0x TESTS 60 46 512000 2900
9199333 Marcin_smu E Dec. 19, 2014, 4:54 p.m. OK GNU C++0x TESTS 60 62 1024000 2900
9185571 Kurpilyansky E Dec. 18, 2014, 10:50 a.m. OK GNU C++0x TESTS 60 77 614400 2900
9265789 andrew.volchek E Dec. 25, 2014, 9:23 a.m. OK GNU C++0x TESTS 60 93 3276800 2900
9175252 Marcin_smu E Dec. 17, 2014, 6:12 p.m. OK GNU C++0x TESTS 60 109 512000 2900
9405471 Shapo E Jan. 11, 2015, 9:40 p.m. OK GNU C++0x TESTS 60 109 716800 2900
9446575 Shapo E Jan. 16, 2015, 10:01 p.m. OK GNU C++0x TESTS 60 124 307200 2900
9446582 Shapo E Jan. 16, 2015, 10:03 p.m. OK GNU C++0x TESTS 60 124 307200 2900
9405446 Shapo E Jan. 11, 2015, 9:32 p.m. OK GNU C++0x TESTS 60 171 35123200 2900
28023322 FizzyDavid E June 25, 2017, 2:05 p.m. OK GNU C++11 TESTS 60 46 2457600 2900
17159363 freebsdx E April 4, 2016, 2:40 p.m. OK GNU C++11 TESTS 60 46 3584000 2900
46894186 zjp_shadow E Dec. 11, 2018, 8:11 a.m. OK GNU C++11 TESTS 60 46 4812800 2900
40987515 ReaLNero1 E July 30, 2018, 9:18 p.m. OK GNU C++11 TESTS 60 62 102400 2900
46927804 dogcdt E Dec. 12, 2018, 9:50 a.m. OK GNU C++11 TESTS 60 108 9420800 2900
41273997 jhdjames37 E Aug. 6, 2018, 12:12 p.m. OK GNU C++11 TESTS 60 155 207769600 2900
44566863 Timsei E Oct. 20, 2018, 1:17 a.m. OK GNU C++11 TESTS 60 156 204697600 2900
46950810 kefaa2 E Dec. 12, 2018, 8:14 p.m. OK GNU C++11 TESTS 60 171 204800 2900
44961624 zyding E Oct. 27, 2018, 4:48 p.m. OK GNU C++11 TESTS 60 249 19353600 2900
68382369 vjudge3 E Jan. 8, 2020, 2:44 a.m. OK GNU C++11 TESTS 60 249 38502400 2900
67270859 ElangBondol E Dec. 20, 2019, 8:15 a.m. OK GNU C++14 TESTS 60 46 409600 2900
36569697 zhou888 E March 24, 2018, 9:38 a.m. OK GNU C++14 TESTS 60 62 3993600 2900
36567260 zhou888 E March 24, 2018, 7:54 a.m. OK GNU C++14 TESTS 60 62 9011200 2900
56830823 Scut82 E July 11, 2019, 6:56 a.m. OK GNU C++14 TESTS 60 78 8601600 2900
39399716 FallDream E June 19, 2018, 5:55 a.m. OK GNU C++14 TESTS 60 156 307200 2900
58706709 sumitacchan E Aug. 13, 2019, 10:10 a.m. OK GNU C++14 TESTS 60 171 204800 2900
38393294 cyz666 E May 18, 2018, 7:40 a.m. OK GNU C++14 TESTS 60 234 1740800 2900
28031647 la1la1la E June 25, 2017, 3:36 p.m. OK GNU C++14 TESTS 60 312 5529600 2900
37487759 AwD E April 20, 2018, 12:57 p.m. OK GNU C++14 TESTS 60 358 39833600 2900
23648252 natsugiri E Jan. 8, 2017, 3 p.m. OK GNU C++14 TESTS 60 390 9728000 2900
53225578 jah_melon E April 24, 2019, 2:16 p.m. OK GNU C++17 TESTS 60 62 13209600 2900
58922575 Benq E Aug. 16, 2019, 5:52 p.m. OK GNU C++17 TESTS 60 124 307200 2900
58698354 kort0n E Aug. 13, 2019, 6:56 a.m. OK GNU C++17 TESTS 60 140 3481600 2900
46291602 MAMBA E Nov. 27, 2018, 8:10 p.m. OK GNU C++17 TESTS 60 202 819200 2900
65161280 ivan100sic E Nov. 16, 2019, 11:29 a.m. OK GNU C++17 TESTS 60 234 9523200 2900
61963125 ruo E Oct. 6, 2019, 8:04 a.m. OK GNU C++17 TESTS 60 545 32460800 2900
47174932 Shayan.P E Dec. 17, 2018, 5 p.m. OK GNU C++17 TESTS 60 592 512000 2900
58698246 kort0n E Aug. 13, 2019, 6:54 a.m. OK GNU C++17 TESTS 60 748 17920000 2900
58712078 tempura0224 E Aug. 13, 2019, 12:39 p.m. OK GNU C++17 TESTS 60 764 2969600 2900
58807060 ymatsux E Aug. 14, 2019, 9:18 a.m. OK GNU C++17 TESTS 60 779 1024000 2900
9178782 uwi E Dec. 17, 2014, 7:54 p.m. OK Java 7 TESTS 60 951 0 2900
9178859 uwi E Dec. 17, 2014, 7:58 p.m. OK Java 7 TESTS 60 982 0 2900
10655091 odorf E April 11, 2015, 5:58 a.m. OK Java 7 TESTS 60 997 0 2900
9172622 Petr E Dec. 17, 2014, 5:45 p.m. OK Java 8 TESTS 60 171 0 2900
9177608 TomConerly E Dec. 17, 2014, 7:15 p.m. OK Java 8 TESTS 60 233 0 2900
9176793 TomConerly E Dec. 17, 2014, 6:27 p.m. OK Java 8 TESTS 60 280 0 2900
10031531 dnk E Feb. 26, 2015, 11:42 a.m. OK Java 8 TESTS 60 670 0 2900
9178876 uwi E Dec. 17, 2014, 7:59 p.m. OK Java 8 TESTS 60 733 0 2900
9214052 Togrul_Gasimov E Dec. 21, 2014, 9:27 a.m. OK MS C++ TESTS 60 186 14848000 2900
10167200 Manul E March 5, 2015, 5:08 p.m. OK MS C++ TESTS 60 296 3686400 2900
18886001 DEGwer E July 4, 2016, 3:57 p.m. OK MS C++ TESTS 60 374 204800 2900
9187886 Merlininice E Dec. 18, 2014, 2:05 p.m. OK MS C++ TESTS 60 842 102400 2900
13419706 ch_egor E Oct. 5, 2015, 4:50 p.m. OK MS C++ TESTS 60 936 819200 2900

remove filters

Back to search problems