Codeforces Round 104 (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
145 Codeforces Round 104 (Div. 1) FINISHED False 7200 410741951 Jan. 22, 2012, 7 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1927 ) C Lucky Subsequence PROGRAMMING combinatorics dp math 2200

B"Petya loves lucky numbers very much. Everybody knows that lucky numbers are positive integers whose decimal record contains only the lucky digits 4 and 7. For example, numbers 47, 744, 4 are lucky and 5, 17, 467 are not. Petya has sequence a consisting of n integers. The subsequence of the sequence a is such subsequence that can be obtained from a by removing zero or more of its elements. Two sequences are considered different if index sets of numbers included in them are different. That is, the values xe2 x80 x8bof the elements xe2 x80 x8bdo not matter in the comparison of subsequences. In particular, any sequence of length n has exactly 2n different subsequences (including an empty subsequence). A subsequence is considered lucky if it has a length exactly k and does not contain two identical lucky numbers (unlucky numbers can be repeated any number of times). Help Petya find the number of different lucky subsequences of the sequence a. As Petya's parents don't let him play with large numbers, you should print the result modulo prime number 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). The first line contains two integers n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). The next line contains n integers ai (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ai xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- the sequence a. On the single line print the single number -- the answer to the problem modulo prime number 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). In the first sample all 3 subsequences of the needed length are considered lucky. In the second sample there are 4 lucky subsequences. For them the sets of indexes equal (the indexation starts from 1): {1, xe2 x80 x893}, {1, xe2 x80 x894}, {2, xe2 x80 x893} and {2, xe2 x80 x894}."...

Tutorials

Codeforces Round #104 - Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
1112564 Sereja C Jan. 23, 2012, 2:01 p.m. OK Delphi TESTS 58 280 75468800 2200
3700319 MrJigan1488 C May 10, 2013, 7:13 p.m. OK Delphi TESTS 58 281 42598400 2200
1110941 Quercitron C Jan. 22, 2012, 5:10 p.m. OK Delphi TESTS 58 330 13107200 2200
1110939 Quercitron C Jan. 22, 2012, 5:09 p.m. OK Delphi TESTS 58 340 13107200 2200
1737109 hung06061995 C May 28, 2012, 3:38 p.m. OK FPC TESTS 58 110 3686400 2200
1108700 Nomad C Jan. 22, 2012, 10 a.m. OK FPC TESTS 58 110 12083200 2200
1768750 landscape95 C June 7, 2012, 7:27 a.m. OK FPC TESTS 58 130 76185600 2200
1112393 Sereja C Jan. 23, 2012, 12:29 p.m. OK FPC TESTS 58 140 75571200 2200
1119874 zanoes C Jan. 27, 2012, 4:24 a.m. OK FPC TESTS 58 170 14643200 2200
1863102 ACTheory C July 4, 2012, 7:36 a.m. OK FPC TESTS 58 220 12492800 2200
1119872 zanoes C Jan. 27, 2012, 4:23 a.m. OK FPC TESTS 58 220 39526400 2200
1107770 tourist C Jan. 22, 2012, 8:53 a.m. OK FPC TESTS 58 230 18841600 2200
1119868 zanoes C Jan. 27, 2012, 4:22 a.m. OK FPC TESTS 58 230 39526400 2200
1108527 sillycross C Jan. 22, 2012, 9:50 a.m. OK FPC TESTS 58 250 10649600 2200
1121160 mage C Jan. 27, 2012, 5:13 p.m. OK GNU C TESTS 58 170 1843200 2200
1108762 kawatea C Jan. 22, 2012, 10:04 a.m. OK GNU C TESTS 58 890 2764800 2200
2799019 .o. C Dec. 20, 2012, 2:29 p.m. OK GNU C++ TESTS 58 62 819200 2200
4200191 Petar C July 29, 2013, 3:02 p.m. OK GNU C++ TESTS 58 62 9830400 2200
3724938 frog1902 C May 15, 2013, 7:50 p.m. OK GNU C++ TESTS 58 62 10649600 2200
3146844 taojiaen C Feb. 19, 2013, 12:06 p.m. OK GNU C++ TESTS 58 78 1740800 2200
3034989 pimpke C Jan. 29, 2013, 8:36 p.m. OK GNU C++ TESTS 58 78 4915200 2200
3724941 vjudge5 C May 15, 2013, 7:51 p.m. OK GNU C++ TESTS 58 78 10649600 2200
3452886 rng_58 C April 2, 2013, 12:55 p.m. OK GNU C++ TESTS 58 78 14028800 2200
1118542 hta C Jan. 26, 2012, 10:38 a.m. OK GNU C++ TESTS 58 80 2252800 2200
1320299 lllcfr C March 9, 2012, 11:32 a.m. OK GNU C++ TESTS 58 80 2560000 2200
1119193 LGM C Jan. 26, 2012, 3:40 p.m. OK GNU C++ TESTS 58 80 10035200 2200
6405574 wanbo C April 18, 2014, 4:27 p.m. OK GNU C++0x TESTS 58 92 2457600 2200
6570166 marat.snowbear C May 8, 2014, 3:05 a.m. OK GNU C++0x TESTS 58 92 3584000 2200
5869792 dasko1 C Feb. 2, 2014, 6:27 p.m. OK GNU C++0x TESTS 58 92 4812800 2200
7795838 SealView C Sept. 14, 2014, 4:25 p.m. OK GNU C++0x TESTS 58 92 17408000 2200
1106041 mengpq C Jan. 22, 2012, 8:12 a.m. OK GNU C++0x TESTS 58 110 4300800 2200
7619846 apia C Aug. 29, 2014, 9:15 a.m. OK GNU C++0x TESTS 58 122 1843200 2200
6150001 RedOne C March 26, 2014, 5:29 p.m. OK GNU C++0x TESTS 58 122 10240000 2200
10152830 Nik_Storm_2010 C March 4, 2015, 7:27 p.m. OK GNU C++0x TESTS 58 122 16896000 2200
9564166 sdya C Jan. 26, 2015, 6:19 p.m. OK GNU C++0x TESTS 58 124 33382400 2200
8675764 aliasadiiii C Nov. 12, 2014, 8:16 p.m. OK GNU C++0x TESTS 58 124 36147200 2200
60190233 rainboy C Sept. 6, 2019, 8:50 p.m. OK GNU C11 TESTS 58 156 1228800 2200
54894911 SoiMae C June 1, 2019, 1:26 a.m. OK GNU C++11 TESTS 58 92 409600 2200
14340209 Irkutsk_ISRU C Nov. 19, 2015, 10:30 a.m. OK GNU C++11 TESTS 58 92 1433600 2200
10398699 Errichto C March 22, 2015, 11:49 a.m. OK GNU C++11 TESTS 58 92 1638400 2200
54896551 SoiMae C June 1, 2019, 3:15 a.m. OK GNU C++11 TESTS 58 92 1638400 2200
12968019 jiyutian C Sept. 12, 2015, 4:44 a.m. OK GNU C++11 TESTS 58 92 1843200 2200
13484650 tapan0007 C Oct. 7, 2015, 9 p.m. OK GNU C++11 TESTS 58 92 2048000 2200
15426746 fengsuiyan C Jan. 18, 2016, 12:24 p.m. OK GNU C++11 TESTS 58 92 2048000 2200
31050204 _gXX C Oct. 6, 2017, 1:30 a.m. OK GNU C++11 TESTS 58 92 2252800 2200
33863464 orbitingflea C Jan. 2, 2018, 12:21 p.m. OK GNU C++11 TESTS 58 92 3072000 2200
23676777 lzr_010506 C Jan. 10, 2017, 7:50 a.m. OK GNU C++11 TESTS 58 92 3686400 2200
25790063 preicousmouse C March 25, 2017, 6:49 a.m. OK GNU C++14 TESTS 58 92 3788800 2200
47839916 terminator C Jan. 2, 2019, 11:13 a.m. OK GNU C++14 TESTS 58 92 9625600 2200
48394369 nan0S C Jan. 14, 2019, 4:54 p.m. OK GNU C++14 TESTS 58 122 1024000 2200
54212766 alimagde C May 15, 2019, 6:09 p.m. OK GNU C++14 TESTS 58 122 5017600 2200
37654235 ZYCSwing C April 27, 2018, 8:19 a.m. OK GNU C++14 TESTS 58 122 5427200 2200
45279283 zuhiul C Nov. 4, 2018, 12:50 p.m. OK GNU C++14 TESTS 58 122 18841600 2200
61101921 Fasho C Sept. 23, 2019, 7:15 a.m. OK GNU C++14 TESTS 58 124 1024000 2200
41951017 TooDumbToWin C Aug. 22, 2018, 1:22 a.m. OK GNU C++14 TESTS 58 124 1024000 2200
30942990 chaemon C Oct. 2, 2017, 12:54 p.m. OK GNU C++14 TESTS 58 124 1433600 2200
69421125 yan-zp C Jan. 23, 2020, 2:26 p.m. OK GNU C++14 TESTS 58 124 1433600 2200
36893772 LiChenKoh C April 3, 2018, 5:50 a.m. OK GNU C++17 TESTS 58 92 5120000 2200
56740378 tnakao C July 9, 2019, 7:25 a.m. OK GNU C++17 TESTS 58 122 5427200 2200
41261767 Zerokei C Aug. 6, 2018, 3:20 a.m. OK GNU C++17 TESTS 58 124 1331200 2200
45163018 ruslanjan C Nov. 1, 2018, 10:02 a.m. OK GNU C++17 TESTS 58 124 1331200 2200
53589691 kefaa2 C April 30, 2019, 9:38 p.m. OK GNU C++17 TESTS 58 124 1433600 2200
41261783 vjudge5 C Aug. 6, 2018, 3:21 a.m. OK GNU C++17 TESTS 58 124 1433600 2200
60502677 zaher__ C Sept. 13, 2019, 7:31 p.m. OK GNU C++17 TESTS 58 124 4915200 2200
55499891 designer C June 12, 2019, 2:32 p.m. OK GNU C++17 TESTS 58 124 5427200 2200
61258443 stArliGht C Sept. 25, 2019, 10:55 a.m. OK GNU C++17 TESTS 58 124 5836800 2200
54005617 JovanB C May 11, 2019, 7:41 p.m. OK GNU C++17 TESTS 58 124 34099200 2200
2225463 Azat_Yusupov C Sept. 21, 2012, 6:17 a.m. OK Java 6 TESTS 58 234 44134400 2200
1105229 uwi C Jan. 22, 2012, 7:55 a.m. OK Java 6 TESTS 58 250 43212800 2200
1108452 Omar.Darwish C Jan. 22, 2012, 9:47 a.m. OK Java 6 TESTS 58 250 43417600 2200
1108211 S.Yesipenko C Jan. 22, 2012, 9:36 a.m. OK Java 6 TESTS 58 270 43315200 2200
1151094 anhdt C Feb. 5, 2012, 12:49 p.m. OK Java 6 TESTS 58 270 55091200 2200
1114492 Jokser C Jan. 24, 2012, 12:23 p.m. OK Java 6 TESTS 58 310 43417600 2200
1124028 Ahmed_Salama C Jan. 28, 2012, 3:16 p.m. OK Java 6 TESTS 58 310 65945600 2200
1105225 bjin C Jan. 22, 2012, 7:55 a.m. OK Java 6 TESTS 58 330 43417600 2200
1108364 Di735 C Jan. 22, 2012, 9:44 a.m. OK Java 6 TESTS 58 340 43212800 2200
1112085 sayuan C Jan. 23, 2012, 8:50 a.m. OK Java 6 TESTS 58 340 43315200 2200
13865645 xiaowuc1 C Oct. 26, 2015, 3:19 a.m. OK Java 7 TESTS 58 310 0 2200
7939853 cvm C Sept. 24, 2014, 6:39 p.m. OK Java 7 TESTS 58 436 512000 2200
12417464 alibaba C Aug. 8, 2015, 5:46 p.m. OK Java 7 TESTS 58 622 0 2200
47269024 ankurdua15 C Dec. 19, 2018, 3:43 p.m. OK Java 8 TESTS 58 342 1638400 2200
56186645 Ahmad C June 28, 2019, 5:17 a.m. OK Java 8 TESTS 58 372 0 2200
26785200 Kammola C May 1, 2017, 12:18 p.m. OK Java 8 TESTS 58 404 21811200 2200
24914935 MazzForces C Feb. 23, 2017, 11:30 a.m. OK Java 8 TESTS 58 404 32972800 2200
43234435 aabdelzaher C Sept. 22, 2018, 7:31 a.m. OK Java 8 TESTS 58 434 11161600 2200
39524606 amnesiac_dusk C June 22, 2018, 6:05 p.m. OK Java 8 TESTS 58 592 0 2200
55730369 spar5h C June 18, 2019, 8:39 p.m. OK Java 8 TESTS 58 624 0 2200
40296041 Jeel_Vaishnav C July 13, 2018, 8:15 p.m. OK Java 8 TESTS 58 716 5734400 2200
60190232 Dukkha C Sept. 6, 2019, 8:50 p.m. OK Java 8 TESTS 58 778 0 2200
60291511 satya26 C Sept. 9, 2019, 7:31 a.m. OK Java 8 TESTS 58 872 11468800 2200
52054599 hongquanntct C March 30, 2019, 7:11 p.m. OK Mono C# TESTS 58 216 19251200 2200
1105785 it4.kp C Jan. 22, 2012, 8:06 a.m. OK Mono C# TESTS 58 230 23040000 2200
1150226 tsun C Feb. 5, 2012, 3:03 a.m. OK Mono C# TESTS 58 280 20275200 2200
1122131 onigiri C Jan. 28, 2012, 6:05 a.m. OK Mono C# TESTS 58 1420 38502400 2200
3639834 XilinX C April 27, 2013, 8:36 a.m. OK MS C++ TESTS 58 78 5529600 2200
1320352 lllcfr C March 9, 2012, 11:35 a.m. OK MS C++ TESTS 58 80 2252800 2200
1320256 lllcfr C March 9, 2012, 11:29 a.m. OK MS C++ TESTS 58 80 2560000 2200
1107653 yudaer C Jan. 22, 2012, 8:51 a.m. OK MS C++ TESTS 58 90 1843200 2200
1110214 NuM C Jan. 22, 2012, 2:03 p.m. OK MS C++ TESTS 58 90 7065600 2200
1103754 dzhulgakov C Jan. 22, 2012, 7:31 a.m. OK MS C++ TESTS 58 90 10649600 2200
1104530 Ripatti C Jan. 22, 2012, 7:43 a.m. OK MS C++ TESTS 58 90 12697600 2200
1105762 Shef C Jan. 22, 2012, 8:06 a.m. OK MS C++ TESTS 58 90 22425600 2200
1381383 ItsNear C March 20, 2012, 6:50 a.m. OK MS C++ TESTS 58 90 34918400 2200
25365975 nihalpi1 C March 9, 2017, 5:45 p.m. OK MS C++ TESTS 58 92 11366400 2200
60234754 pajenegod C Sept. 7, 2019, 5:52 p.m. OK PyPy 2 TESTS 58 654 10137600 2200
39657574 absolutezero C June 25, 2018, 6:19 p.m. OK PyPy 2 TESTS 58 1716 93184000 2200
9972938 ItsLastDay C Feb. 23, 2015, 7:06 p.m. OK PyPy 3 TESTS 58 1278 29286400 2200
1119705 xonatius C Jan. 26, 2012, 9:58 p.m. OK Python 2 TESTS 58 910 7987200 2200
1170059 qwaker.00 C Feb. 10, 2012, 10:38 p.m. OK Python 2 TESTS 58 1360 15360000 2200
1132266 cebrusfspy C Feb. 2, 2012, 7:46 a.m. OK Python 2 TESTS 58 1420 8806400 2200
2656367 nealzane C Nov. 26, 2012, 6:49 a.m. OK Python 2 TESTS 58 1765 5427200 2200
23670646 Ali.Pi C Jan. 9, 2017, 8:23 p.m. OK Python 2 TESTS 58 1870 10444800 2200
35840014 ______u______ C March 2, 2018, 2:09 p.m. OK Python 2 TESTS 58 1934 10137600 2200
35840010 ______n______ C March 2, 2018, 2:09 p.m. OK Python 2 TESTS 58 1934 10137600 2200
35839312 _____k_____ C March 2, 2018, 1:50 p.m. OK Python 2 TESTS 58 1934 10137600 2200
35839308 _____i_____ C March 2, 2018, 1:50 p.m. OK Python 2 TESTS 58 1934 10137600 2200
35834759 ______h______ C March 2, 2018, 12:10 p.m. OK Python 2 TESTS 58 1934 10137600 2200
1152096 watashi C Feb. 6, 2012, 1:39 a.m. OK Ruby TESTS 58 1310 13926400 2200

remove filters

Back to search problems