Codeforces Beta Round 97 (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
135 Codeforces Beta Round 97 (Div. 1) FINISHED False 7200 408380099 Dec. 9, 2011, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 306 ) E Weak Subsequence PROGRAMMING combinatorics 2800

B'Little Petya very much likes strings. Recently he has received a voucher to purchase a string as a gift from his mother. The string can be bought in the local shop. One can consider that the shop has all sorts of strings over the alphabet of fixed size. The size of the alphabet is equal to k. However, the voucher has a string type limitation: specifically, the voucher can be used to purchase string s if the length of string 's longest substring that is also its weak subsequence (see the definition given below) equals w. String a with the length of n is considered the weak subsequence of the string s with the length of m, if there exists such a set of indexes 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i1 xe2 x80 x89< xe2 x80 x89i2 xe2 x80 x89< xe2 x80 x89... xe2 x80 x89< xe2 x80 x89in xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m, that has the following two properties: Petya got interested how many different strings are available for him to purchase in the shop. As the number of strings can be very large, please find it modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). If there are infinitely many such strings, print "-1". The first line contains two integers k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89106) and w (2 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89w xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- the alphabet size and the required length of the maximum substring that also is the weak subsequence, correspondingly. Print a single number -- the number of strings Petya can buy using the voucher, modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). If there are infinitely many such strings, print "-1" (without the quotes). In the first sample Petya can buy the following strings: aaa, aab, abab, abb, abba, baa, baab, baba, bba, bbb.'...

Tutorials

Codeforces Beta Round #97: editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
14183062 130705009 E Nov. 10, 2015, 11:02 a.m. OK GNU C++ TESTS 101 124 3993600 2800
35838789 ______n______ E March 2, 2018, 1:40 p.m. OK GNU C++ TESTS 101 124 6246400 2800
35838788 ______u______ E March 2, 2018, 1:40 p.m. OK GNU C++ TESTS 101 124 6246400 2800
35838688 _____i_____ E March 2, 2018, 1:38 p.m. OK GNU C++ TESTS 101 124 6246400 2800
35838683 _____k_____ E March 2, 2018, 1:38 p.m. OK GNU C++ TESTS 101 124 6246400 2800
35834238 ______h______ E March 2, 2018, 11:58 a.m. OK GNU C++ TESTS 101 124 6246400 2800
35834230 ______k______ E March 2, 2018, 11:58 a.m. OK GNU C++ TESTS 101 124 6246400 2800
35831963 ______i______ E March 2, 2018, 10:02 a.m. OK GNU C++ TESTS 101 124 6246400 2800
35830610 ______M______ E March 2, 2018, 9:22 a.m. OK GNU C++ TESTS 101 124 6246400 2800
15762611 nxihkke E Feb. 3, 2016, 5:37 a.m. OK GNU C++ TESTS 101 155 16076800 2800
2624883 roosephu E Nov. 22, 2012, 7:03 a.m. OK GNU C++0x TESTS 101 296 17612800 2800
972210 Archon.JK E Dec. 22, 2011, 10:12 p.m. OK GNU C++0x TESTS 101 360 13414400 2800
2640650 apia E Nov. 25, 2012, 9:54 a.m. OK GNU C++0x TESTS 101 2312 32051200 2800
2923155 llj_bash E Jan. 14, 2013, 7:41 a.m. OK GNU C++0x TESTS 101 2328 16076800 2800
2818363 qiandichen E Dec. 23, 2012, 8:22 a.m. OK GNU C++0x TESTS 101 2359 11980800 2800
972208 Archon.JK E Dec. 22, 2011, 10:06 p.m. OK GNU C++0x TESTS 101 2360 13414400 2800
2832934 bakabakashyoshyo E Dec. 27, 2012, 12:22 p.m. OK GNU C++0x TESTS 101 2453 24064000 2800
9790201 Pudge123 E Feb. 10, 2015, 2:42 p.m. OK GNU C++0x TESTS 101 3556 48128000 2800
57903265 lopare E July 28, 2019, 4:33 p.m. OK GNU C++11 TESTS 101 124 3993600 2800
57616003 chengyufeng E July 24, 2019, 1:34 a.m. OK GNU C++11 TESTS 101 140 7987200 2800
57615986 vjudge2 E July 24, 2019, 1:33 a.m. OK GNU C++11 TESTS 101 140 7987200 2800
59099403 wuhuang1 E Aug. 19, 2019, 3:27 p.m. OK GNU C++11 TESTS 101 140 16076800 2800
17084025 freebsdx E April 1, 2016, 3 a.m. OK GNU C++11 TESTS 101 155 6246400 2800
66639964 AnnieCai E Dec. 11, 2019, 2:21 p.m. OK GNU C++11 TESTS 101 155 64102400 2800
33825957 hawkomg E Dec. 31, 2017, 6:38 a.m. OK GNU C++11 TESTS 101 233 34099200 2800
33825811 hawkomg E Dec. 31, 2017, 6:25 a.m. OK GNU C++11 TESTS 101 249 34099200 2800
12896940 fwm94 E Sept. 8, 2015, 12:12 p.m. OK GNU C++11 TESTS 101 343 24064000 2800
55748969 EncodeTalker E June 19, 2019, 11:40 a.m. OK GNU C++11 TESTS 101 498 16076800 2800
23670819 Ali.Pi E Jan. 9, 2017, 8:38 p.m. OK GNU C++14 TESTS 101 124 5939200 2800
26651787 chuminhhai E April 25, 2017, 2:19 a.m. OK GNU C++14 TESTS 101 140 5939200 2800
40992065 ReaLNero1 E July 31, 2018, 1:03 a.m. OK GNU C++14 TESTS 101 155 3993600 2800
44391440 rawatds E Oct. 16, 2018, 8:48 a.m. OK GNU C++14 TESTS 101 156 11980800 2800
32613041 Flash-boy E Nov. 24, 2017, 7:23 a.m. OK GNU C++14 TESTS 101 608 17920000 2800
50931524 MessyShen E March 7, 2019, 2:09 p.m. OK GNU C++14 TESTS 101 608 32358400 2800
67203301 ElangBondol E Dec. 19, 2019, 11:37 a.m. OK GNU C++14 TESTS 101 857 12288000 2800
34437437 Cyanic E Jan. 22, 2018, 7:54 a.m. OK GNU C++14 TESTS 101 966 9932800 2800
52619521 abeker E April 11, 2019, 8:32 p.m. OK GNU C++14 TESTS 101 1153 8294400 2800
35549797 iqqsoszs E Feb. 21, 2018, 2:08 p.m. OK GNU C++14 TESTS 101 1419 9932800 2800
57615967 chengyufeng E July 24, 2019, 1:32 a.m. OK GNU C++17 TESTS 101 140 7987200 2800
58207448 me_Rose_max_Always_AK E Aug. 3, 2019, 7:36 a.m. OK GNU C++17 TESTS 101 467 16076800 2800
69197238 hjk1030 E Jan. 20, 2020, 3:19 p.m. OK GNU C++17 TESTS 101 499 16076800 2800
58195923 Benq E Aug. 3, 2019, 12:11 a.m. OK GNU C++17 TESTS 101 889 40345600 2800
61042185 Zory E Sept. 22, 2019, 1:36 a.m. OK GNU C++17 TESTS 101 904 32051200 2800
63434567 Fulisike E Oct. 26, 2019, 10:13 a.m. OK GNU C++17 TESTS 101 935 160358400 2800
61185004 kefaa2 E Sept. 23, 2019, 9:51 p.m. OK GNU C++17 TESTS 101 1419 24064000 2800
41999534 ruo E Aug. 23, 2018, 2:12 p.m. OK GNU C++17 TESTS 101 1466 24064000 2800
953483 uwi E Dec. 13, 2011, 3:30 a.m. OK Java 6 TESTS 101 2030 66662400 2800
952733 FattyPenguin E Dec. 12, 2011, 11:25 a.m. OK Java 6 TESTS 101 3090 43212800 2800
1965762 ysyshtc E July 31, 2012, 5:34 p.m. OK Java 6 TESTS 101 3480 111923200 2800
946794 ivan.popelyshev E Dec. 9, 2011, 5:03 p.m. OK Java 6 TESTS 101 3730 59494400 2800
12592988 mz_observer E Aug. 18, 2015, 6:52 p.m. OK Java 8 TESTS 101 312 0 2800
12592946 mz_observer E Aug. 18, 2015, 6:48 p.m. OK Java 8 TESTS 101 951 0 2800
953515 riversouther E Dec. 13, 2011, 3:57 a.m. OK MS C++ TESTS 101 720 1433600 2800
950498 Shef E Dec. 10, 2011, 7:14 p.m. OK MS C++ TESTS 101 1530 26624000 2800

remove filters

Back to search problems