Codeforces Round 343 (Div. 2)

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
629 Codeforces Round 343 (Div. 2) FINISHED False 7200 275837099 Feb. 20, 2016, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2802 ) C Famil Door and Brackets PROGRAMMING dp strings 2000

B"As Famil Door xe2 x80 x99s birthday is coming, some of his friends (like Gabi) decided to buy a present for him. His friends are going to buy a string consisted of round brackets since Famil Door loves string of brackets of length n more than any other strings! The sequence of round brackets is called valid if and only if: Gabi bought a string s of length m (m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) and want to complete it to obtain a valid sequence of brackets of length n. He is going to pick some strings p and q consisting of round brackets and merge them in a string p xe2 x80 x89+ xe2 x80 x89s xe2 x80 x89+ xe2 x80 x89q, that is add the string p at the beginning of the string s and string q at the end of the string s. Now he wonders, how many pairs of strings p and q exists, such that the string p xe2 x80 x89+ xe2 x80 x89s xe2 x80 x89+ xe2 x80 x89q is a valid sequence of round brackets. As this number may be pretty large, he wants to calculate it modulo 109 xe2 x80 x89+ xe2 x80 x897. First line contains n and m (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89100 xe2 x80 x89000, xe2 x80 x89n xe2 x80 x89- xe2 x80 x89m xe2 x80 x89 xe2 x89 xa4 xe2 x80 x892000) -- the desired length of the string and the length of the string bought by Gabi, respectively. The second line contains string s of length m consisting of characters '(' and ')' only. Print the number of pairs of string p and q such that p xe2 x80 x89+ xe2 x80 x89s xe2 x80 x89+ xe2 x80 x89q is a valid sequence of round brackets modulo 109 xe2 x80 x89+ xe2 x80 x897. In the first sample there are four different valid pairs: In the second sample the only way to obtain a desired string is choose empty p and q. In the third sample there is no way to get a valid sequence of brackets."...

Tutorials

Editorial of Codeforces Round #343 (Div.2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
16248073 ruban C Feb. 20, 2016, 7:11 p.m. OK Delphi TESTS 60 249 74752000 2000
16436476 ez_zkj C March 1, 2016, 6:38 a.m. OK FPC TESTS 60 93 32460800 2000
17296562 jiangyx C April 13, 2016, 1:24 a.m. OK FPC TESTS 60 93 72499200 2000
58979631 chaorenhaha C Aug. 18, 2019, 3:28 a.m. OK FPC TESTS 60 139 39628800 2000
58979402 chaorenhaha C Aug. 18, 2019, 3:18 a.m. OK FPC TESTS 60 156 79872000 2000
16247498 GiannisAntetokounmpo C Feb. 20, 2016, 7:03 p.m. OK FPC TESTS 60 202 71884800 2000
31553945 Beginner_df016 C Oct. 21, 2017, 6:42 a.m. OK FPC TESTS 60 218 66048000 2000
16247646 Sonechko C Feb. 20, 2016, 7:05 p.m. OK FPC TESTS 60 249 64716800 2000
16247624 igdor99 C Feb. 20, 2016, 7:04 p.m. OK FPC TESTS 60 249 79667200 2000
16247992 EKASMA C Feb. 20, 2016, 7:10 p.m. OK GNU C TESTS 60 46 19763200 2000
21176130 CQU_ACM_CF1 C Oct. 4, 2016, 1:33 a.m. OK GNU C TESTS 60 46 33792000 2000
21176172 CQU_ACM_CF1 C Oct. 4, 2016, 1:36 a.m. OK GNU C TESTS 60 46 33792000 2000
18068212 veschii_nevstrui C May 25, 2016, 8:50 a.m. OK GNU C TESTS 60 93 66969600 2000
22701571 flying_turtle C Dec. 4, 2016, 6:42 p.m. OK GNU C TESTS 60 156 17817600 2000
21811787 zhan8855 C Oct. 27, 2016, 4:22 a.m. OK GNU C++ TESTS 60 30 16076800 2000
16294433 rainbow979 C Feb. 23, 2016, 2:49 p.m. OK GNU C++ TESTS 60 30 16179200 2000
28341821 fun_coder C July 7, 2017, 5:40 a.m. OK GNU C++ TESTS 60 31 10342400 2000
19599096 kxj C Aug. 3, 2016, 1:55 p.m. OK GNU C++ TESTS 60 31 15974400 2000
16252890 joyfun C Feb. 21, 2016, 2:07 a.m. OK GNU C++ TESTS 60 31 15974400 2000
16269974 ChoeWonHyok C Feb. 22, 2016, 1:59 a.m. OK GNU C++ TESTS 60 31 15974400 2000
16274706 Arturia C Feb. 22, 2016, 10:12 a.m. OK GNU C++ TESTS 60 31 15974400 2000
18911040 AkaneSasu C July 6, 2016, 3:53 a.m. OK GNU C++ TESTS 60 31 15974400 2000
16264690 sfiction C Feb. 21, 2016, 4:57 p.m. OK GNU C++ TESTS 60 31 16076800 2000
40985108 ReaLNero1 C July 30, 2018, 7:45 p.m. OK GNU C++ TESTS 60 31 16179200 2000
57109992 rainboy C July 15, 2019, 4:57 p.m. OK GNU C11 TESTS 60 31 16179200 2000
16296930 duckladydinh C Feb. 23, 2016, 5:33 p.m. OK GNU C++11 TESTS 60 30 16486400 2000
16276758 alibek.ronni10 C Feb. 22, 2016, 12:39 p.m. OK GNU C++11 TESTS 60 30 16486400 2000
16279813 -XraY- C Feb. 22, 2016, 3:50 p.m. OK GNU C++11 TESTS 60 31 102400 2000
16239348 Ra1nWarden C Feb. 20, 2016, 5:10 p.m. OK GNU C++11 TESTS 60 31 15974400 2000
16381250 zxcvbbvcxz C Feb. 27, 2016, 11:51 a.m. OK GNU C++11 TESTS 60 31 16076800 2000
22141790 srinu37 C Nov. 10, 2016, 4:44 a.m. OK GNU C++11 TESTS 60 31 16179200 2000
17323932 mzhq C April 15, 2016, 8:33 a.m. OK GNU C++11 TESTS 60 31 16179200 2000
16739748 _dne C March 16, 2016, 8:43 a.m. OK GNU C++11 TESTS 60 31 16179200 2000
16467811 krijgertje C March 2, 2016, 3:26 p.m. OK GNU C++11 TESTS 60 31 16179200 2000
16391900 quailty C Feb. 27, 2016, 7:43 p.m. OK GNU C++11 TESTS 60 31 16179200 2000
43722142 TheRedLegend C Oct. 3, 2018, 10:32 a.m. OK GNU C++14 TESTS 60 31 16281600 2000
30951233 Remarque C Oct. 2, 2017, 6:44 p.m. OK GNU C++14 TESTS 60 31 16588800 2000
30468849 NiroBC C Sept. 18, 2017, 1:58 p.m. OK GNU C++14 TESTS 60 31 17920000 2000
35328425 oxy_moron C Feb. 16, 2018, 6:28 a.m. OK GNU C++14 TESTS 60 31 18534400 2000
37795220 Abdelrhman_Akram C May 1, 2018, 10:30 a.m. OK GNU C++14 TESTS 60 31 19763200 2000
37313311 karanbatra C April 14, 2018, 7:44 a.m. OK GNU C++14 TESTS 60 31 19763200 2000
36344037 Lucky_Sanae C March 17, 2018, 6:22 a.m. OK GNU C++14 TESTS 60 31 19968000 2000
33584361 paperwhite C Dec. 24, 2017, 5:42 a.m. OK GNU C++14 TESTS 60 31 66560000 2000
31611751 vjudge1 C Oct. 22, 2017, 6:45 p.m. OK GNU C++14 TESTS 60 31 259584000 2000
22064799 kvk1920 C Nov. 5, 2016, 8:53 p.m. OK GNU C++14 TESTS 60 46 16076800 2000
69812142 ruo C Jan. 30, 2020, 4:49 a.m. OK GNU C++17 TESTS 60 46 16179200 2000
51327871 grshlok C March 15, 2019, 10:48 a.m. OK GNU C++17 TESTS 60 46 16281600 2000
66668169 dunko C Dec. 12, 2019, 8:06 a.m. OK GNU C++17 TESTS 60 46 16281600 2000
46535670 webeseit C Dec. 3, 2018, 8:51 a.m. OK GNU C++17 TESTS 60 46 16281600 2000
55077761 Anachor C June 4, 2019, 9:26 a.m. OK GNU C++17 TESTS 60 46 16384000 2000
45792522 wru C Nov. 16, 2018, 8:14 a.m. OK GNU C++17 TESTS 60 46 16384000 2000
55077861 Anachor C June 4, 2019, 9:28 a.m. OK GNU C++17 TESTS 60 46 16384000 2000
66089769 NiKS001 C Dec. 1, 2019, 6:50 a.m. OK GNU C++17 TESTS 60 46 16486400 2000
46181819 am.azadi C Nov. 24, 2018, 6:26 p.m. OK GNU C++17 TESTS 60 46 16486400 2000
49009844 Stroustrup C Jan. 26, 2019, 4:28 p.m. OK GNU C++17 TESTS 60 46 16588800 2000
16715452 mishagam C March 14, 2016, 2:09 p.m. OK Go TESTS 60 77 17817600 2000
21750890 meiz C Oct. 24, 2016, 3:07 p.m. OK Go TESTS 60 218 17305600 2000
16241022 Martynas C Feb. 20, 2016, 5:27 p.m. OK Go TESTS 60 296 33280000 2000
46041970 Marii C Nov. 21, 2018, 8:39 p.m. OK Go TESTS 60 483 72192000 2000
16454917 mIchanic C March 1, 2016, 10:14 p.m. OK Java 7 TESTS 60 170 14028800 2000
16674950 ppetrov C March 12, 2016, 1:52 p.m. OK Java 7 TESTS 60 186 37990400 2000
18147777 daiict C May 29, 2016, 1:53 p.m. OK Java 7 TESTS 60 186 56934400 2000
18021332 lebaur C May 21, 2016, 4:13 p.m. OK Java 7 TESTS 60 186 59904000 2000
16248927 alibaba C Feb. 20, 2016, 7:32 p.m. OK Java 7 TESTS 60 202 132300800 2000
18147884 daiict C May 29, 2016, 2:04 p.m. OK Java 7 TESTS 60 217 60313600 2000
18148984 daiict C May 29, 2016, 4:06 p.m. OK Java 7 TESTS 60 217 60416000 2000
16258530 webstorms C Feb. 21, 2016, 12:36 p.m. OK Java 7 TESTS 60 218 53657600 2000
18152863 daiict C May 30, 2016, 4:42 a.m. OK Java 7 TESTS 60 218 60416000 2000
16545242 aste C March 6, 2016, 5:37 a.m. OK Java 7 TESTS 60 233 52940800 2000
16341097 threepipes_s C Feb. 26, 2016, 6:37 a.m. OK Java 8 TESTS 60 155 12185600 2000
21665538 isomurodov C Oct. 22, 2016, 11:42 a.m. OK Java 8 TESTS 60 155 17408000 2000
59099562 hongquanntct C Aug. 19, 2019, 3:31 p.m. OK Java 8 TESTS 60 155 17817600 2000
16272545 donli C Feb. 22, 2016, 7:13 a.m. OK Java 8 TESTS 60 156 11468800 2000
16320105 vjudge5 C Feb. 25, 2016, 5:06 a.m. OK Java 8 TESTS 60 171 10547200 2000
16309098 RestlessAnchoret C Feb. 24, 2016, 1:05 p.m. OK Java 8 TESTS 60 171 11161600 2000
16248933 Sandip_Jana C Feb. 20, 2016, 7:33 p.m. OK Java 8 TESTS 60 171 11366400 2000
16257942 yfo C Feb. 21, 2016, 12:08 p.m. OK Java 8 TESTS 60 171 11468800 2000
57109875 Dukkha C July 15, 2019, 4:54 p.m. OK Java 8 TESTS 60 171 17100800 2000
16241720 harry.zhao C Feb. 20, 2016, 5:35 p.m. OK Java 8 TESTS 60 186 11366400 2000
16236934 azukun C Feb. 20, 2016, 4:56 p.m. OK MS C# TESTS 60 93 17100800 2000
16245999 og.kostya C Feb. 20, 2016, 6:25 p.m. OK MS C# TESTS 60 93 32665600 2000
16589984 OwenHong C March 7, 2016, 6:25 p.m. OK MS C# TESTS 60 109 37068800 2000
16562475 OwenHong C March 7, 2016, 9:12 a.m. OK MS C# TESTS 60 139 36761600 2000
16243110 fiver C Feb. 20, 2016, 5:51 p.m. OK MS C# TESTS 60 139 104755200 2000
16241098 mircea85 C Feb. 20, 2016, 5:28 p.m. OK MS C# TESTS 60 171 34918400 2000
16310225 Mosyagin C Feb. 24, 2016, 2:14 p.m. OK MS C++ TESTS 60 31 16486400 2000
16243864 Adhambek C Feb. 20, 2016, 6 p.m. OK MS C++ TESTS 60 31 141619200 2000
16247830 Milanin C Feb. 20, 2016, 7:07 p.m. OK MS C++ TESTS 60 46 16281600 2000
16293614 PanZverski C Feb. 23, 2016, 1:56 p.m. OK MS C++ TESTS 60 46 16896000 2000
16239999 Andrew.D.F C Feb. 20, 2016, 5:17 p.m. OK MS C++ TESTS 60 46 17100800 2000
16257879 iamexist C Feb. 21, 2016, 12:04 p.m. OK MS C++ TESTS 60 46 32460800 2000
16250760 pl0892029 C Feb. 20, 2016, 9:15 p.m. OK MS C++ TESTS 60 46 33177600 2000
23261377 Leibniz_Zhang C Dec. 24, 2016, 1:21 a.m. OK MS C++ TESTS 60 46 40960000 2000
53305729 vjudge5 C April 26, 2019, 3:02 a.m. OK MS C++ TESTS 60 46 50176000 2000
16344800 Musuccess C Feb. 26, 2016, 11:08 a.m. OK MS C++ TESTS 60 46 50176000 2000
16251993 Darooha C Feb. 20, 2016, 11:46 p.m. OK Ocaml TESTS 60 732 86528000 2000
16273341 sorry_wintermelon C Feb. 22, 2016, 8:23 a.m. OK PyPy 2 TESTS 60 218 18636800 2000
49930203 aeternalis1 C Feb. 15, 2019, 3:49 a.m. OK PyPy 2 TESTS 60 296 20480000 2000
16706571 urikz C March 14, 2016, 12:48 a.m. OK PyPy 2 TESTS 60 358 18636800 2000
17548867 tastymath75025 C April 28, 2016, 4:13 a.m. OK PyPy 2 TESTS 60 1840 209715200 2000
35887632 ______i______ C March 3, 2018, 2:07 p.m. OK PyPy 3 TESTS 60 171 30105600 2000
35885859 ______M______ C March 3, 2018, 1:37 p.m. OK PyPy 3 TESTS 60 171 30105600 2000
16250216 Vosatorp C Feb. 20, 2016, 8:35 p.m. OK PyPy 3 TESTS 60 218 10137600 2000
16267059 The_Mask C Feb. 21, 2016, 7:52 p.m. OK PyPy 3 TESTS 60 218 10137600 2000
16250282 Vosatorp C Feb. 20, 2016, 8:40 p.m. OK PyPy 3 TESTS 60 234 10137600 2000
43877806 Stephan C Oct. 6, 2018, 3:09 a.m. OK PyPy 3 TESTS 60 483 19353600 2000
16339267 ArGuTe C Feb. 26, 2016, 1:28 a.m. OK Python 2 TESTS 60 888 24576000 2000
16239447 nwi C Feb. 20, 2016, 5:11 p.m. OK Python 2 TESTS 60 966 24678400 2000
16628445 augurar C March 10, 2016, 7:03 a.m. OK Python 3 TESTS 60 592 22732800 2000

remove filters

Back to search problems