Codeforces Round 265 (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
464 Codeforces Round 265 (Div. 1) FINISHED False 7200 327508204 Sept. 7, 2014, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1862 ) C Substitutes in Number PROGRAMMING dp 2200

B'Andrew and Eugene are playing a game. Initially, Andrew has string s, consisting of digits. Eugene sends Andrew multiple queries of type "di xe2 x80 x89 xe2 x86 x92 xe2 x80 x89ti", that means "replace all digits di in string s with substrings equal to ti". For example, if s xe2 x80 x89= xe2 x80 x89123123, then query "2 xe2 x80 x89 xe2 x86 x92 xe2 x80 x8900" transforms s to 10031003, and query "3 xe2 x80 x89 xe2 x86 x92 xe2 x80 x89" ("replace 3 by an empty string") transforms it to s xe2 x80 x89= xe2 x80 x891212. After all the queries Eugene asks Andrew to find the remainder after division of number with decimal representation equal to s by 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). When you represent s as a decimal number, please ignore the leading zeroes; also if s is an empty string, then it 's assumed that the number equals to zero. Andrew got tired of processing Eugene 's requests manually and he asked you to write a program for that. Help him! The first line contains string s (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|s| xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105), consisting of digits -- the string before processing all the requests. The second line contains a single integer n (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105) -- the number of queries. The next n lines contain the descriptions of the queries. The i-th query is described by string "di->ti", where di is exactly one digit (from 0 to 9), ti is a string consisting of digits (ti can be an empty string). The sum of lengths of ti for all queries doesn 't exceed 105. The queries are written in the order in which they need to be performed. Print a single integer -- remainder of division of the resulting number by 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). Note that the leading zeroes are not removed from string s after the replacement (you can see it in the third sample).'...

Tutorials

Codeforces Round #265 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
7701820 hos.lyric C Sept. 7, 2014, 3:38 p.m. OK D TESTS 50 124 34611200 2200
8023196 yosupo C Sept. 29, 2014, 9:52 a.m. OK D TESTS 39 202 50073600 2200
13968219 OriginalM C Oct. 31, 2015, 10:36 a.m. OK FPC TESTS 39 46 2560000 2200
13997704 0lkeh C Nov. 1, 2015, 1:07 a.m. OK FPC TESTS 39 46 28364800 2200
13966497 ligerre C Oct. 31, 2015, 8:38 a.m. OK FPC TESTS 39 46 28364800 2200
8397505 PhanAnhTuan C Oct. 25, 2014, 3:25 a.m. OK FPC TESTS 39 46 28364800 2200
7747862 zwindstorm C Sept. 12, 2014, 1:29 a.m. OK FPC TESTS 50 46 28364800 2200
7712768 weizhaohui C Sept. 7, 2014, 5:22 p.m. OK FPC TESTS 50 46 28364800 2200
8409292 Freedom C Oct. 25, 2014, 11:03 a.m. OK FPC TESTS 39 61 28364800 2200
7704383 Alex_2oo8 C Sept. 7, 2014, 3:51 p.m. OK FPC TESTS 50 78 28774400 2200
7725127 CpasT C Sept. 9, 2014, 2:27 a.m. OK FPC TESTS 50 296 3174400 2200
23249992 darkkcyan C Dec. 23, 2016, 2:48 p.m. OK GNU C TESTS 39 93 5427200 2200
7719005 shigule C Sept. 8, 2014, 7:35 a.m. OK GNU C++ TESTS 50 15 10240000 2200
7748710 winedia C Sept. 12, 2014, 5:40 a.m. OK GNU C++ TESTS 50 30 3174400 2200
7817894 neetenin C Sept. 17, 2014, 12:48 p.m. OK GNU C++ TESTS 39 31 1024000 2200
12475712 Trasier C Aug. 12, 2015, 7:58 a.m. OK GNU C++ TESTS 39 31 1126400 2200
18662536 SanSiroWaltz C June 23, 2016, 11:32 a.m. OK GNU C++ TESTS 39 31 1433600 2200
7727176 tutu0038 C Sept. 9, 2014, 10:12 a.m. OK GNU C++ TESTS 50 31 1433600 2200
7717994 KarlisS C Sept. 8, 2014, 4:25 a.m. OK GNU C++ TESTS 50 31 1433600 2200
13967049 Hi_im_Aki C Oct. 31, 2015, 9:16 a.m. OK GNU C++ TESTS 39 31 2969600 2200
19517063 ODT C July 30, 2016, 12:37 p.m. OK GNU C++ TESTS 39 31 3174400 2200
12715091 vjudge5 C Aug. 27, 2015, 4:19 a.m. OK GNU C++ TESTS 39 31 3481600 2200
7715882 zerokugi C Sept. 7, 2014, 8:23 p.m. OK GNU C++0x TESTS 50 31 3276800 2200
7730094 rockytheprogrammer C Sept. 9, 2014, 5:19 p.m. OK GNU C++0x TESTS 50 31 3379200 2200
7805525 qqz003 C Sept. 16, 2014, 2:30 a.m. OK GNU C++0x TESTS 50 31 3788800 2200
7817639 ehsanoo C Sept. 17, 2014, 12:19 p.m. OK GNU C++0x TESTS 39 31 3891200 2200
7733249 xtrome C Sept. 10, 2014, 7:56 a.m. OK GNU C++0x TESTS 50 31 3993600 2200
7741685 JoriQ C Sept. 11, 2014, 12:27 p.m. OK GNU C++0x TESTS 50 31 4096000 2200
7714464 mareksom C Sept. 7, 2014, 6:32 p.m. OK GNU C++0x TESTS 50 46 3276800 2200
7714655 paulwang C Sept. 7, 2014, 6:39 p.m. OK GNU C++0x TESTS 50 46 3379200 2200
7747475 k0st1a C Sept. 11, 2014, 10:42 p.m. OK GNU C++0x TESTS 50 46 3481600 2200
7774645 zetilovn C Sept. 12, 2014, 7 p.m. OK GNU C++0x TESTS 50 46 3481600 2200
54211943 about C May 15, 2019, 5:46 p.m. OK GNU C11 TESTS 39 46 2457600 2200
59861712 rainboy C Sept. 1, 2019, 3:34 p.m. OK GNU C11 TESTS 39 140 2867200 2200
20564645 Infused C Sept. 13, 2016, 10:35 a.m. OK GNU C++11 TESTS 39 31 2764800 2200
19392473 S031502603 C July 25, 2016, 2:19 a.m. OK GNU C++11 TESTS 39 31 2867200 2200
53096384 Xing_Ling C April 21, 2019, 1:46 p.m. OK GNU C++11 TESTS 39 31 3072000 2200
19392567 S031502603 C July 25, 2016, 2:25 a.m. OK GNU C++11 TESTS 39 31 3481600 2200
19137377 quake0 C July 14, 2016, 10:40 p.m. OK GNU C++11 TESTS 39 31 3686400 2200
21428936 rick_c137 C Oct. 14, 2016, 5:13 p.m. OK GNU C++11 TESTS 39 31 6348800 2200
18858127 mental.cat C July 2, 2016, 6:14 p.m. OK GNU C++11 TESTS 39 31 7577600 2200
61973164 luogu_bot3 C Oct. 6, 2019, 9:40 a.m. OK GNU C++11 TESTS 39 31 31129600 2200
14319618 filthycasual C Nov. 18, 2015, 1:03 a.m. OK GNU C++11 TESTS 39 46 2764800 2200
42305878 wonders C Aug. 31, 2018, 11:13 a.m. OK GNU C++11 TESTS 39 46 2969600 2200
27908041 Footle C June 19, 2017, 3:43 p.m. OK GNU C++14 TESTS 39 30 3379200 2200
47088922 lrvideckis C Dec. 16, 2018, 3:54 a.m. OK GNU C++14 TESTS 39 31 2662400 2200
47018823 realcomplex C Dec. 14, 2018, 9:28 p.m. OK GNU C++14 TESTS 39 31 2662400 2200
29964344 DeadPillow C Sept. 1, 2017, 5:05 a.m. OK GNU C++14 TESTS 39 31 2969600 2200
39799996 RobeZH C June 30, 2018, 1:58 p.m. OK GNU C++14 TESTS 39 31 2969600 2200
49951429 darkshadowss C Feb. 15, 2019, 2:11 p.m. OK GNU C++14 TESTS 39 31 2969600 2200
30305421 danya.smelskiy C Sept. 13, 2017, 11:30 a.m. OK GNU C++14 TESTS 39 31 3481600 2200
24740046 aadishj02 C Feb. 17, 2017, 3:13 p.m. OK GNU C++14 TESTS 39 31 4812800 2200
34279860 Jeffrey C Jan. 18, 2018, 3:30 p.m. OK GNU C++14 TESTS 39 31 4812800 2200
35397301 onevsall C Feb. 17, 2018, 10:32 a.m. OK GNU C++14 TESTS 39 31 4915200 2200
39702698 majk C June 27, 2018, 1:26 p.m. OK GNU C++17 TESTS 39 31 2662400 2200
51346959 isaf27 C March 15, 2019, 6:59 p.m. OK GNU C++17 TESTS 39 31 11468800 2200
61689823 hqm01 C Oct. 2, 2019, 5:20 a.m. OK GNU C++17 TESTS 39 46 1024000 2200
45424984 UnstoppableChillMachine C Nov. 7, 2018, 7:58 p.m. OK GNU C++17 TESTS 39 46 3481600 2200
44410791 chirs241097 RUSH_D_CAT OMRailgun C Oct. 16, 2018, 4:40 p.m. OK GNU C++17 TESTS 39 46 4505600 2200
52560340 yassin_ C April 10, 2019, 10:01 a.m. OK GNU C++17 TESTS 39 46 6656000 2200
58643416 89264270823 C Aug. 12, 2019, 4:48 a.m. OK GNU C++17 TESTS 39 46 11059200 2200
61529236 ST_C C Sept. 30, 2019, 1:42 a.m. OK GNU C++17 TESTS 39 46 11776000 2200
58075417 denis2111 C July 31, 2019, 12:12 p.m. OK GNU C++17 TESTS 39 46 21708800 2200
44425086 RUSH_D_CAT C Oct. 17, 2018, 3:33 a.m. OK GNU C++17 TESTS 39 46 39833600 2200
7716602 Rotsor C Sept. 7, 2014, 10:53 p.m. OK Haskell TESTS 50 358 82124800 2200
7708420 meijun C Sept. 7, 2014, 4:27 p.m. OK Java 6 TESTS 50 155 102400 2200
7774446 marcosarribas C Sept. 12, 2014, 6:48 p.m. OK Java 6 TESTS 50 155 14131200 2200
7799211 dheeraj1995 C Sept. 15, 2014, 7:15 a.m. OK Java 7 TESTS 50 93 0 2200
7750386 AndreiNet C Sept. 12, 2014, 10:33 a.m. OK Java 7 TESTS 50 93 0 2200
7717552 ixxa C Sept. 8, 2014, 3:05 a.m. OK Java 7 TESTS 50 93 0 2200
7714898 wistful23 C Sept. 7, 2014, 6:51 p.m. OK Java 7 TESTS 50 93 0 2200
7706423 Zyflair C Sept. 7, 2014, 4:06 p.m. OK Java 7 TESTS 50 93 0 2200
7731078 edorundo C Sept. 9, 2014, 9:01 p.m. OK Java 7 TESTS 50 109 0 2200
7733780 Azat_Yusupov C Sept. 10, 2014, 9:33 a.m. OK Java 7 TESTS 50 109 0 2200
7704327 Petr C Sept. 7, 2014, 3:51 p.m. OK Java 7 TESTS 50 109 0 2200
7707417 shilov C Sept. 7, 2014, 4:16 p.m. OK Java 7 TESTS 50 109 102400 2200
7716546 pitfall C Sept. 7, 2014, 10:34 p.m. OK Java 7 TESTS 50 109 409600 2200
14217950 Sumeet.Varma C Nov. 12, 2015, 6:05 p.m. OK Java 8 TESTS 39 124 0 2200
12419283 Bat-Orgil C Aug. 8, 2015, 10:46 p.m. OK Java 8 TESTS 39 139 0 2200
9958194 fnch C Feb. 22, 2015, 9:52 a.m. OK Java 8 TESTS 39 139 0 2200
11699501 old_arysson C June 21, 2015, 4:15 p.m. OK Java 8 TESTS 39 140 0 2200
11699493 Pimpom C June 21, 2015, 4:14 p.m. OK Java 8 TESTS 39 140 0 2200
41507521 aminul C Aug. 11, 2018, 10:03 p.m. OK Java 8 TESTS 39 155 0 2200
41507512 aminul C Aug. 11, 2018, 10:03 p.m. OK Java 8 TESTS 39 171 0 2200
24796800 Kishan_25 C Feb. 19, 2017, 7:31 a.m. OK Java 8 TESTS 39 187 20582400 2200
7775008 eescando C Sept. 12, 2014, 7:28 p.m. OK Java 8 TESTS 50 202 307200 2200
7703961 ilyakor C Sept. 7, 2014, 3:49 p.m. OK Java 8 TESTS 50 202 409600 2200
7722570 riversouther C Sept. 8, 2014, 3:42 p.m. OK JavaScript TESTS 50 124 10342400 2200
7717732 azukun C Sept. 8, 2014, 3:35 a.m. OK MS C# TESTS 50 77 8294400 2200
27176399 camypaper C May 17, 2017, 9:47 a.m. OK MS C# TESTS 39 171 36454400 2200
7717739 azukun C Sept. 8, 2014, 3:37 a.m. OK MS C# TESTS 50 202 8396800 2200
7719709 BillSu C Sept. 8, 2014, 9:21 a.m. OK MS C++ TESTS 50 31 3276800 2200
8066494 White_Bear C Oct. 3, 2014, 8:42 a.m. OK MS C++ TESTS 39 31 4403200 2200
7751005 lastseed C Sept. 12, 2014, 11:47 a.m. OK MS C++ TESTS 50 31 6348800 2200
7888295 Metamorphus C Sept. 20, 2014, 9:21 p.m. OK MS C++ TESTS 39 46 2969600 2200
7724973 nikiror C Sept. 9, 2014, 1:39 a.m. OK MS C++ TESTS 50 46 3072000 2200
7711867 bayleef C Sept. 7, 2014, 5:10 p.m. OK MS C++ TESTS 50 46 3072000 2200
7710372 NuM C Sept. 7, 2014, 4:51 p.m. OK MS C++ TESTS 50 46 3072000 2200
12077553 FISHTOBY C July 16, 2015, 3:24 a.m. OK MS C++ TESTS 39 46 3174400 2200
8553080 tangchuanxin C Nov. 5, 2014, 1:41 a.m. OK MS C++ TESTS 39 46 3481600 2200
7744779 elm C Sept. 11, 2014, 3:30 p.m. OK MS C++ TESTS 50 46 3584000 2200
61097946 pajenegod C Sept. 23, 2019, 4:52 a.m. OK PyPy 2 TESTS 39 187 9113600 2200
8559463 codetilyoudie C Nov. 5, 2014, 2:57 p.m. OK Python 2 TESTS 39 358 14438400 2200
12897582 mathpseudo C Sept. 8, 2015, 12:51 p.m. OK Python 2 TESTS 39 358 14540800 2200
8018494 vanadium C Sept. 28, 2014, 10:49 p.m. OK Python 3 TESTS 39 342 13414400 2200
7710412 jasperH C Sept. 7, 2014, 4:51 p.m. OK Python 3 TESTS 50 405 13312000 2200
10550884 Innovation C April 2, 2015, 1 p.m. OK Python 3 TESTS 39 452 12800000 2200
35874135 ______u______ C March 3, 2018, 7:45 a.m. OK Python 3 TESTS 39 467 17100800 2200
35873906 ______n______ C March 3, 2018, 7:40 a.m. OK Python 3 TESTS 39 467 17100800 2200
35873288 _____k_____ C March 3, 2018, 7:28 a.m. OK Python 3 TESTS 39 467 17100800 2200
35873209 _____i_____ C March 3, 2018, 7:27 a.m. OK Python 3 TESTS 39 467 17100800 2200
35864138 ______k______ C March 2, 2018, 11:02 p.m. OK Python 3 TESTS 39 467 17100800 2200
35864124 ______h______ C March 2, 2018, 11:02 p.m. OK Python 3 TESTS 39 467 17100800 2200
35863648 ______i______ C March 2, 2018, 10:51 p.m. OK Python 3 TESTS 39 467 17100800 2200
7722317 stoundmire C Sept. 8, 2014, 3:09 p.m. OK Scala TESTS 50 296 102400 2200

remove filters

Back to search problems