Codeforces Round 138 (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
223 Codeforces Round 138 (Div. 1) FINISHED False 7200 384013799 Sept. 16, 2012, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2540 ) A Bracket Sequence PROGRAMMING data structures expression parsing implementation 1800

B'A bracket sequence is a string, containing only characters "(", ")", "[" and "]". A correct bracket sequence is a bracket sequence that can be transformed into a correct arithmetic expression by inserting characters "1" and "+" between the original characters of the sequence. For example, bracket sequences "()[]", "([])" are correct (the resulting expressions are: "(1)+[1]", "([1+1]+1)"), and "](" and "[" are not. The empty string is a correct bracket sequence by definition. A substring s[l... r] (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89l xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89r xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89|s|) of string s xe2 x80 x89= xe2 x80 x89s1s2... s|s| (where |s| is the length of string s) is the string slsl xe2 x80 x89+ xe2 x80 x891... sr. The empty string is a substring of any string by definition. You are given a bracket sequence, not necessarily correct. Find its substring which is a correct bracket sequence and contains as many opening square brackets xc2 xab[ xc2 xbb as possible. The first and the only line contains the bracket sequence as a string, consisting only of characters "(", ")", "[" and "]". It is guaranteed that the string is non-empty and its length doesn 't exceed 105 characters. In the first line print a single integer -- the number of brackets xc2 xab[ xc2 xbb in the required bracket sequence. In the second line print the optimal sequence. If there are more than one optimal solutions print any of them.'...

Tutorials

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
5376300 PSDEV A Dec. 7, 2013, 1:45 p.m. OK Delphi TESTS 90 30 512000 1800
2199912 TarasSavitskyi A Sept. 16, 2012, 7:39 p.m. OK Delphi TESTS 90 50 10035200 1800
2192413 Depool A Sept. 16, 2012, 4:07 p.m. OK Delphi TESTS 89 50 11059200 1800
2191691 tourist A Sept. 16, 2012, 3:58 p.m. OK Delphi TESTS 89 50 12185600 1800
2209479 Saimon_Saret A Sept. 18, 2012, 2:33 p.m. OK Delphi TESTS 90 60 12083200 1800
2210466 AleksanderBalobanov A Sept. 18, 2012, 7:49 p.m. OK Delphi TESTS 90 80 11059200 1800
2203421 Misha100896 A Sept. 17, 2012, 1:14 p.m. OK Delphi TESTS 90 660 2355200 1800
4144398 huhubenho96 A July 24, 2013, 3:49 a.m. OK FPC TESTS 90 15 1331200 1800
2865131 vjudge1 A Jan. 2, 2013, 3:21 a.m. OK FPC TESTS 90 15 2048000 1800
2190219 white_cobra A Sept. 16, 2012, 3:44 p.m. OK FPC TESTS 89 30 2355200 1800
2192085 artyom.kazak A Sept. 16, 2012, 4:03 p.m. OK FPC TESTS 89 30 13516800 1800
3356103 scorpion A March 19, 2013, 11:04 a.m. OK FPC TESTS 90 31 3174400 1800
2211941 ZOTAC89 A Sept. 19, 2012, 11:20 a.m. OK FPC TESTS 90 31 3788800 1800
4098677 foreseeable A July 18, 2013, 10:53 a.m. OK FPC TESTS 90 31 4710400 1800
2211807 vlad107 A Sept. 19, 2012, 10:38 a.m. OK FPC TESTS 90 31 5427200 1800
2211993 wcmg.chen A Sept. 19, 2012, 11:35 a.m. OK FPC TESTS 90 31 5836800 1800
2210248 Electronick A Sept. 18, 2012, 5:53 p.m. OK FPC TESTS 90 31 81612800 1800
3471772 3111006139 A April 4, 2013, 6:55 a.m. OK GNU C++ TESTS 90 15 716800 1800
3876320 JuliusCanute A June 12, 2013, 7:18 p.m. OK GNU C++ TESTS 90 15 921600 1800
3013461 indiantarget A Jan. 26, 2013, 5:13 p.m. OK GNU C++ TESTS 90 15 921600 1800
2865289 95487701 A Jan. 2, 2013, 5:06 a.m. OK GNU C++ TESTS 90 15 921600 1800
2799730 indeed2008 A Dec. 20, 2012, 7:32 p.m. OK GNU C++ TESTS 90 15 921600 1800
3268280 vjudge1 A March 9, 2013, 5:23 a.m. OK GNU C++ TESTS 90 15 1126400 1800
3806078 sd0061 A May 31, 2013, 8:17 a.m. OK GNU C++ TESTS 90 15 1331200 1800
3499033 vjudge2 A April 10, 2013, 10:02 a.m. OK GNU C++ TESTS 90 15 1331200 1800
4037862 LLLLLLL_mj A July 8, 2013, 8:49 a.m. OK GNU C++ TESTS 90 15 3481600 1800
3421865 JamesQAQ A March 30, 2013, 7:59 a.m. OK GNU C++ TESTS 90 15 10035200 1800
2197319 MinakoKojima A Sept. 16, 2012, 5:18 p.m. OK GNU C++0x TESTS 89 30 2355200 1800
2191459 package.zaic A Sept. 16, 2012, 3:56 p.m. OK GNU C++0x TESTS 89 30 3072000 1800
2192606 pzzxj A Sept. 16, 2012, 4:09 p.m. OK GNU C++0x TESTS 89 30 11468800 1800
3356254 EarlOfDitches A March 19, 2013, 11:36 a.m. OK GNU C++0x TESTS 90 31 1126400 1800
2751670 000golabi A Dec. 11, 2012, 2:58 p.m. OK GNU C++0x TESTS 90 31 1331200 1800
4043459 LovelyPenguin A July 9, 2013, 4:54 p.m. OK GNU C++0x TESTS 90 31 1536000 1800
3954951 klamathix A June 24, 2013, 10:37 a.m. OK GNU C++0x TESTS 90 31 2048000 1800
2453416 nhtrnm A Oct. 27, 2012, 5:09 p.m. OK GNU C++0x TESTS 90 31 2150400 1800
2204111 MinakoKojima A Sept. 17, 2012, 3:37 p.m. OK GNU C++0x TESTS 90 31 3174400 1800
2204007 kinodjnz A Sept. 17, 2012, 3:13 p.m. OK GNU C++0x TESTS 90 31 3174400 1800
15402446 Altria-PenDragon A Jan. 16, 2016, 11:20 a.m. OK GNU C++11 TESTS 90 30 716800 1800
30764805 yefrigg A Sept. 26, 2017, 11:36 p.m. OK GNU C++11 TESTS 90 30 921600 1800
14053955 fengsuiyan A Nov. 4, 2015, 9:07 a.m. OK GNU C++11 TESTS 90 30 921600 1800
13820282 cowboy A Oct. 24, 2015, 8:15 a.m. OK GNU C++11 TESTS 90 30 921600 1800
12298942 cq_phqg A Aug. 1, 2015, 4:44 a.m. OK GNU C++11 TESTS 90 30 921600 1800
14965235 joisino A Dec. 24, 2015, 7:02 a.m. OK GNU C++11 TESTS 90 30 1433600 1800
20945875 vjudge2 A Sept. 27, 2016, 12:39 p.m. OK GNU C++11 TESTS 90 30 2150400 1800
36127268 favs-sama A March 9, 2018, 6:47 p.m. OK GNU C++11 TESTS 90 30 2662400 1800
24063697 CuSO45H2O A Jan. 23, 2017, 6:01 a.m. OK GNU C++11 TESTS 90 30 2764800 1800
17122019 freebsdx A April 2, 2016, 3:20 a.m. OK GNU C++11 TESTS 90 30 2969600 1800
31023330 vjudge5 A Oct. 5, 2017, 8:46 a.m. OK GNU C++14 TESTS 90 30 921600 1800
22290641 acka1357 A Nov. 17, 2016, 2:21 p.m. OK GNU C++14 TESTS 90 30 921600 1800
30832091 chirs241097 A Sept. 29, 2017, 2:21 p.m. OK GNU C++14 TESTS 90 30 1126400 1800
31026614 vjudge3 A Oct. 5, 2017, 9:27 a.m. OK GNU C++14 TESTS 90 30 1228800 1800
30028810 pranavanurag A Sept. 3, 2017, 10:06 a.m. OK GNU C++14 TESTS 90 30 1536000 1800
21843224 yelghareeb A Oct. 28, 2016, 9:48 a.m. OK GNU C++14 TESTS 90 30 1536000 1800
30922204 LiChenKoh A Oct. 1, 2017, 8:53 p.m. OK GNU C++14 TESTS 90 30 1638400 1800
27458073 jvj_iit A May 31, 2017, 2:25 a.m. OK GNU C++14 TESTS 90 30 1740800 1800
32031987 sandeep__ A Nov. 3, 2017, 6:07 p.m. OK GNU C++14 TESTS 90 30 1843200 1800
30620863 Dalgerok A Sept. 22, 2017, 4:47 p.m. OK GNU C++14 TESTS 90 30 1843200 1800
40681551 terminator A July 23, 2018, 8:07 p.m. OK GNU C++17 TESTS 90 62 819200 1800
55529712 ish.ranga11 A June 13, 2019, 12:57 p.m. OK GNU C++17 TESTS 90 62 921600 1800
53308396 yuhta A April 26, 2019, 4:42 a.m. OK GNU C++17 TESTS 90 62 921600 1800
61403021 sandeep_kumar_e A Sept. 28, 2019, 6:01 a.m. OK GNU C++17 TESTS 90 62 1126400 1800
56813438 mehuld A July 10, 2019, 5:38 p.m. OK GNU C++17 TESTS 90 62 1126400 1800
53584256 Ovi A April 30, 2019, 5:28 p.m. OK GNU C++17 TESTS 90 62 1126400 1800
53584206 Ovi A April 30, 2019, 5:26 p.m. OK GNU C++17 TESTS 90 62 1126400 1800
53583815 Ovi A April 30, 2019, 5:11 p.m. OK GNU C++17 TESTS 90 62 1126400 1800
51300723 adityaaaaaaaaaaaaaaa A March 14, 2019, 2:18 p.m. OK GNU C++17 TESTS 90 62 1126400 1800
51553014 KKOOPP A March 20, 2019, 2:30 a.m. OK GNU C++17 TESTS 90 62 1536000 1800
2235921 Mostafa.Ali A Sept. 23, 2012, 11:49 p.m. OK Java 6 TESTS 90 140 204800 1800
4109974 DoublePointer A July 20, 2013, 6:15 a.m. OK Java 6 TESTS 90 140 2560000 1800
2189834 Egor A Sept. 16, 2012, 3:40 p.m. OK Java 6 TESTS 89 140 43520000 1800
2190116 ivan.popelyshev A Sept. 16, 2012, 3:43 p.m. OK Java 6 TESTS 89 140 43622400 1800
2221721 hama-du A Sept. 20, 2012, 4:48 a.m. OK Java 6 TESTS 90 140 44236800 1800
2211610 mukku A Sept. 19, 2012, 9:27 a.m. OK Java 6 TESTS 90 140 44236800 1800
2211368 ArtemKadeev A Sept. 19, 2012, 8:04 a.m. OK Java 6 TESTS 90 140 44441600 1800
5333700 alibaba A Dec. 2, 2013, 2:07 p.m. OK Java 6 TESTS 90 156 204800 1800
2192461 chavit A Sept. 16, 2012, 4:07 p.m. OK Java 6 TESTS 89 160 43520000 1800
2191761 Petr A Sept. 16, 2012, 3:59 p.m. OK Java 6 TESTS 89 160 43520000 1800
3079215 gh_ost A Feb. 6, 2013, 10:25 p.m. OK Java 7 TESTS 90 109 0 1800
2199670 hydrastuff A Sept. 16, 2012, 7:04 p.m. OK Java 7 TESTS 90 140 45056000 1800
2191201 oimaster A Sept. 16, 2012, 3:53 p.m. OK Java 7 TESTS 89 140 45056000 1800
2200064 alexey.enkov A Sept. 16, 2012, 8:09 p.m. OK Java 7 TESTS 90 140 45260800 1800
2228555 Bambam A Sept. 22, 2012, 6:09 a.m. OK Java 7 TESTS 90 140 45875200 1800
2194627 mmaxio A Sept. 16, 2012, 4:37 p.m. OK Java 7 TESTS 89 160 45056000 1800
2193160 tanzaku A Sept. 16, 2012, 4:17 p.m. OK Java 7 TESTS 89 160 45056000 1800
2191744 antonkov A Sept. 16, 2012, 3:59 p.m. OK Java 7 TESTS 89 160 45056000 1800
2198107 khanhptnk A Sept. 16, 2012, 5:28 p.m. OK Java 7 TESTS 89 160 45158400 1800
2202419 jiangzhijie A Sept. 17, 2012, 9:18 a.m. OK Java 7 TESTS 90 160 45772800 1800
12067525 santa_calus A July 15, 2015, 7:30 a.m. OK Java 8 TESTS 90 248 0 1800
10183122 Dongmin A March 6, 2015, 9:01 p.m. OK Java 8 TESTS 90 248 0 1800
47822031 adityagupta1089 A Jan. 1, 2019, 6:26 p.m. OK Java 8 TESTS 90 280 0 1800
24416007 Ahmad_Elsagheer A Feb. 3, 2017, 5:01 p.m. OK Java 8 TESTS 90 280 20582400 1800
35474547 parth_15 A Feb. 19, 2018, 3:12 p.m. OK Java 8 TESTS 90 280 20787200 1800
25670358 Kammola A March 20, 2017, 3:52 p.m. OK Java 8 TESTS 90 280 20889600 1800
52752969 Verdusk A April 14, 2019, 3:07 p.m. OK Java 8 TESTS 90 310 0 1800
28300784 Ajudiya_13 A July 5, 2017, 9:50 a.m. OK Java 8 TESTS 90 310 20684800 1800
36386812 ShafinKhadem A March 18, 2018, 11:34 a.m. OK Java 8 TESTS 90 312 20787200 1800
36400942 flyman3046 A March 19, 2018, 12:28 a.m. OK Java 8 TESTS 90 342 21401600 1800
35196306 Kayaba_Akihiko A Feb. 13, 2018, 10:25 a.m. OK Mono C# TESTS 90 124 15052800 1800
35196344 Kayaba_Akihiko A Feb. 13, 2018, 10:27 a.m. OK Mono C# TESTS 90 124 15155200 1800
2228114 namaku A Sept. 22, 2012, 12:08 a.m. OK Mono C# TESTS 90 687 18022400 1800
2191496 it4.kp A Sept. 16, 2012, 3:56 p.m. OK Mono C# TESTS 89 890 16179200 1800
24575799 og.kostya A Feb. 10, 2017, 6:24 p.m. OK MS C# TESTS 90 124 13107200 1800
5356907 saba A Dec. 5, 2013, 7:58 p.m. OK MS C# TESTS 90 218 4096000 1800
4036110 tomas.svab A July 7, 2013, 7:24 p.m. OK MS C++ TESTS 90 15 2560000 1800
3690863 Barsuk_Alexey atnurgaliev Reshetnikov_Ivan A May 7, 2013, 3:05 p.m. OK MS C++ TESTS 90 15 2867200 1800
7112476 25122008 A July 16, 2014, 1:28 a.m. OK MS C++ TESTS 90 30 1228800 1800
2201323 zqhzx A Sept. 17, 2012, 4:30 a.m. OK MS C++ TESTS 90 30 2048000 1800
5454217 serglag A Dec. 17, 2013, 8:41 a.m. OK MS C++ TESTS 90 30 2355200 1800
2194162 XilinX A Sept. 16, 2012, 4:31 p.m. OK MS C++ TESTS 89 30 2764800 1800
2197838 NuM A Sept. 16, 2012, 5:25 p.m. OK MS C++ TESTS 89 30 3072000 1800
2191380 Milanin A Sept. 16, 2012, 3:55 p.m. OK MS C++ TESTS 89 30 3174400 1800
2201213 zqhzx A Sept. 17, 2012, 3:39 a.m. OK MS C++ TESTS 90 30 3174400 1800
2194718 Monyura A Sept. 16, 2012, 4:38 p.m. OK MS C++ TESTS 89 30 3686400 1800
58252618 extremum A Aug. 4, 2019, 8:33 a.m. OK MS C++ 2017 TESTS 90 92 2355200 1800
35838232 ______M______ A March 2, 2018, 1:28 p.m. OK PyPy 2 TESTS 90 248 31129600 1800
35848331 ______u______ A March 2, 2018, 4:56 p.m. OK PyPy 2 TESTS 90 248 31129600 1800
35848201 ______n______ A March 2, 2018, 4:56 p.m. OK PyPy 2 TESTS 90 248 31129600 1800
35847962 _____i_____ A March 2, 2018, 4:51 p.m. OK PyPy 2 TESTS 90 248 31129600 1800
35847890 _____k_____ A March 2, 2018, 4:51 p.m. OK PyPy 2 TESTS 90 248 31129600 1800
35841318 ______h______ A March 2, 2018, 2:32 p.m. OK PyPy 2 TESTS 90 248 31129600 1800
35841232 ______k______ A March 2, 2018, 2:32 p.m. OK PyPy 2 TESTS 90 248 31129600 1800
35840979 ______i______ A March 2, 2018, 2:27 p.m. OK PyPy 2 TESTS 90 248 31129600 1800
21828643 Yash_ A Oct. 27, 2016, 4:12 p.m. OK PyPy 2 TESTS 90 310 9420800 1800
33097516 yugle7 A Dec. 11, 2017, 8:50 a.m. OK PyPy 3 TESTS 90 342 34304000 1800
2349432 nealzane A Oct. 12, 2012, 12:17 a.m. OK Python 2 TESTS 90 187 7168000 1800
7497039 abc_1988_1106 A Aug. 18, 2014, 3:21 a.m. OK Python 2 TESTS 90 248 6451200 1800
2209002 oldsjr A Sept. 18, 2012, 12:43 p.m. OK Python 2 TESTS 90 270 14745600 1800
2197921 hirosegolf A Sept. 16, 2012, 5:26 p.m. OK Python 2 TESTS 89 280 10137600 1800
2209012 oldsjr A Sept. 18, 2012, 12:45 p.m. OK Python 2 TESTS 90 280 14745600 1800
11323386 geek_geek A May 27, 2015, 5:10 p.m. OK Python 2 TESTS 90 312 2764800 1800
15914091 not_bot_but_POT A Feb. 9, 2016, 1:38 p.m. OK Python 2 TESTS 90 372 8192000 1800
15101052 merolish A Dec. 30, 2015, 2:04 p.m. OK Python 3 TESTS 90 310 2764800 1800
13824800 step_by_step A Oct. 24, 2015, 1:11 p.m. OK Python 3 TESTS 90 342 2764800 1800
57862915 ovi_ivo A July 27, 2019, 6:53 p.m. OK Python 3 TESTS 90 374 10854400 1800
41983478 Mk_Python_v1 A Aug. 23, 2018, 3:59 a.m. OK Python 3 TESTS 90 434 2457600 1800
15405548 vinitgandhi007 A Jan. 16, 2016, 3:22 p.m. OK Python 3 TESTS 90 530 8089600 1800
23343568 HAEtaRhoEta A Dec. 26, 2016, 3:49 p.m. OK Ruby TESTS 90 1216 34099200 1800
23343496 HAEtaRhoEta A Dec. 26, 2016, 3:45 p.m. OK Ruby TESTS 90 1248 34099200 1800
23343481 HAEtaRhoEta A Dec. 26, 2016, 3:44 p.m. OK Ruby TESTS 90 1340 34099200 1800
23343468 HAEtaRhoEta A Dec. 26, 2016, 3:43 p.m. OK Ruby TESTS 90 1496 34099200 1800

remove filters

Back to search problems