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 |
|---|---|---|---|---|---|---|
| 264 | Codeforces Round 162 (Div. 1) | FINISHED | False | 7200 | 417718823 | Jan. 20, 2013, 1 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 451 ) | D | Colorful Stones | PROGRAMMING | dp two pointers | 2400 |
There are two sequences of colorful stones. The color of each stone is one of red, green, or blue. You are given two strings s and t . The i -th (1-based) character of s represents the color of the i -th stone of the first sequence. Similarly, the i -th (1-based) character of t represents the color of the i -th stone of the second sequence. If the character is " R ", " G ", or " B ", the color of the corresponding stone is red, green, or blue, respectively. Initially Squirrel Liss is standing on the first stone of the first sequence and Cat Vasya is standing on the first stone of the second sequence. You can perform the following instructions zero or more times. Each instruction is one of the three types: " RED ", " GREEN ", or " BLUE ". After an instruction c , the animals standing on stones whose colors are c will move one stone forward. For example, if you perform an instruction « RED », the animals standing on red stones will move one stone forward. You are not allowed to perform instructions that lead some animals out of the sequences. In other words, if some animals are standing on the last stones, you can't perform the instructions of the colors of those stones. A pair of positions (position of Liss, position of Vasya) is called a state. A state is called reachable if the state is reachable by performing instructions zero or more times from the initial state (1, 1). Calculate the number of distinct reachable states. The input contains two lines. The first line contains the string s ( 1 ≤ | s | ≤ 10 6 ). The second line contains the string t ( 1 ≤ | t | ≤ 10 6 ). The characters of each string will be one of " R ", " G ", or " B ". Print the number of distinct reachable states in a single line. Please, do not write the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin , cout streams or the %I64d specifier. In the first example, there are five reachable states: (1, 1), (2, 2), (2, 3), (3, 2), and (3, 3). For example |
| Tutorial for E |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 3917293 | vlad107 | D | June 19, 2013, 11:36 a.m. | OK | FPC | TESTS | 45 | 171 | 91750400 | 2400 | |
| 3047249 | noh4h_ss | D | Feb. 1, 2013, 3:44 p.m. | OK | GNU C++ | TESTS | 45 | 46 | 2355200 | 2400 | |
| 2977529 | yongheng5871 | D | Jan. 21, 2013, 9:35 a.m. | OK | GNU C++ | TESTS | 45 | 62 | 2048000 | 2400 | |
| 2973080 | chnlich | D | Jan. 20, 2013, 5:01 p.m. | OK | GNU C++ | TESTS | 45 | 62 | 2048000 | 2400 | |
| 3110843 | sspa | D | Feb. 13, 2013, 8:37 a.m. | OK | GNU C++ | TESTS | 45 | 62 | 6041600 | 2400 | |
| 3687414 | DebutantGY | D | May 6, 2013, 3:31 p.m. | OK | GNU C++ | TESTS | 45 | 62 | 9011200 | 2400 | |
| 3882278 | Yousef_Salama | D | June 14, 2013, 7:53 a.m. | OK | GNU C++ | TESTS | 45 | 62 | 10035200 | 2400 | |
| 3108675 | stoundmire | D | Feb. 12, 2013, 4:08 p.m. | OK | GNU C++ | TESTS | 45 | 62 | 10035200 | 2400 | |
| 3035287 | mislav_bradac | D | Jan. 29, 2013, 11:20 p.m. | OK | GNU C++ | TESTS | 45 | 62 | 10035200 | 2400 | |
| 2971572 | Copymaster | D | Jan. 20, 2013, 2:39 p.m. | OK | GNU C++ | TESTS | 45 | 62 | 10035200 | 2400 | |
| 3038640 | imbanoob | D | Jan. 30, 2013, 10:30 p.m. | OK | GNU C++ | TESTS | 45 | 62 | 14028800 | 2400 | |
| 3410145 | dc. | D | March 27, 2013, 3:21 a.m. | OK | GNU C++0x | TESTS | 45 | 62 | 10240000 | 2400 | |
| 3015899 | s-quark | D | Jan. 27, 2013, 11 a.m. | OK | GNU C++0x | TESTS | 45 | 62 | 16998400 | 2400 | |
| 2973179 | wwwwodddd | D | Jan. 20, 2013, 5:06 p.m. | OK | GNU C++0x | TESTS | 45 | 78 | 2048000 | 2400 | |
| 2975780 | roosephu | D | Jan. 21, 2013, 2 a.m. | OK | GNU C++0x | TESTS | 45 | 109 | 3174400 | 2400 | |
| 10022042 | zxc901 | D | Feb. 25, 2015, 3:55 p.m. | OK | GNU C++0x | TESTS | 45 | 124 | 46080000 | 2400 | |
| 3004551 | lcch | D | Jan. 24, 2013, 5:13 p.m. | OK | GNU C++0x | TESTS | 45 | 125 | 38092800 | 2400 | |
| 9364083 | equation314 | D | Jan. 5, 2015, 7 a.m. | OK | GNU C++0x | TESTS | 45 | 154 | 66150400 | 2400 | |
| 8427786 | equation314 | D | Oct. 27, 2014, 8:54 a.m. | OK | GNU C++0x | TESTS | 45 | 154 | 66150400 | 2400 | |
| 7683177 | yutaka1999 | D | Sept. 4, 2014, 3:48 p.m. | OK | GNU C++0x | TESTS | 45 | 156 | 30003200 | 2400 | |
| 8347616 | zshi | D | Oct. 22, 2014, 2:57 a.m. | OK | GNU C++0x | TESTS | 45 | 184 | 55296000 | 2400 | |
| 61677383 | rainboy | D | Oct. 1, 2019, 9:26 p.m. | OK | GNU C11 | TESTS | 45 | 124 | 10035200 | 2400 | |
| 15141934 | HappyNewYearMike | D | Dec. 31, 2015, 9:58 p.m. | OK | GNU C++11 | TESTS | 45 | 62 | 2048000 | 2400 | |
| 11544081 | zld3794955 | D | June 12, 2015, 1:24 p.m. | OK | GNU C++11 | TESTS | 45 | 92 | 2048000 | 2400 | |
| 16523170 | I_love_chickpea | D | March 4, 2016, 8:55 p.m. | OK | GNU C++11 | TESTS | 45 | 92 | 2048000 | 2400 | |
| 57821559 | py_ultron | D | July 26, 2019, 11:45 p.m. | OK | GNU C++11 | TESTS | 45 | 92 | 2150400 | 2400 | |
| 57897755 | lopare | D | July 28, 2019, 2:19 p.m. | OK | GNU C++11 | TESTS | 45 | 92 | 2150400 | 2400 | |
| 43482390 | Love_mona | D | Sept. 27, 2018, 8:04 a.m. | OK | GNU C++11 | TESTS | 45 | 92 | 2252800 | 2400 | |
| 21870853 | RVS | D | Oct. 29, 2016, 11:59 a.m. | OK | GNU C++11 | TESTS | 45 | 92 | 2662400 | 2400 | |
| 43482107 | Itst | D | Sept. 27, 2018, 7:51 a.m. | OK | GNU C++11 | TESTS | 45 | 92 | 4300800 | 2400 | |
| 55065217 | SoiMae | D | June 4, 2019, 3:04 a.m. | OK | GNU C++11 | TESTS | 45 | 92 | 10035200 | 2400 | |
| 63408905 | skyh | D | Oct. 25, 2019, 10:13 p.m. | OK | GNU C++11 | TESTS | 45 | 92 | 10137600 | 2400 | |
| 32084178 | LiChenKoh | D | Nov. 5, 2017, 9:34 p.m. | OK | GNU C++14 | TESTS | 45 | 92 | 2969600 | 2400 | |
| 33846323 | zhangzy | D | Jan. 1, 2018, noon | OK | GNU C++14 | TESTS | 45 | 92 | 10956800 | 2400 | |
| 23662288 | Ali.Pi | D | Jan. 9, 2017, 8:09 a.m. | OK | GNU C++14 | TESTS | 45 | 124 | 39936000 | 2400 | |
| 26761981 | SoSad | D | April 30, 2017, 6:29 a.m. | OK | GNU C++14 | TESTS | 45 | 124 | 40038400 | 2400 | |
| 51333269 | Origenes | D | March 15, 2019, 1:01 p.m. | OK | GNU C++14 | TESTS | 45 | 154 | 38297600 | 2400 | |
| 22315206 | OnionPringles | D | Nov. 18, 2016, 9:16 p.m. | OK | GNU C++14 | TESTS | 45 | 154 | 38502400 | 2400 | |
| 43684031 | Longshenhadisi | D | Oct. 2, 2018, 11:34 a.m. | OK | GNU C++14 | TESTS | 45 | 156 | 46387200 | 2400 | |
| 43683911 | Zctoylm | D | Oct. 2, 2018, 11:32 a.m. | OK | GNU C++14 | TESTS | 45 | 156 | 46387200 | 2400 | |
| 25953557 | Stalin. | D | March 30, 2017, 1:18 p.m. | OK | GNU C++14 | TESTS | 45 | 156 | 76083200 | 2400 | |
| 43480740 | SYCstudio | D | Sept. 27, 2018, 6:55 a.m. | OK | GNU C++14 | TESTS | 45 | 184 | 46899200 | 2400 | |
| 45479702 | Sieg | D | Nov. 9, 2018, 2:10 p.m. | OK | GNU C++17 | TESTS | 45 | 124 | 34304000 | 2400 | |
| 50158731 | cerberus97 | D | Feb. 19, 2019, 11:35 a.m. | OK | GNU C++17 | TESTS | 45 | 154 | 19456000 | 2400 | |
| 51601860 | ruo | D | March 21, 2019, 4:38 a.m. | OK | GNU C++17 | TESTS | 45 | 186 | 18022400 | 2400 | |
| 43521663 | Zhang_RQ | D | Sept. 28, 2018, 8:51 a.m. | OK | GNU C++17 | TESTS | 45 | 310 | 98508800 | 2400 | |
| 60732295 | Xellos | D | Sept. 17, 2019, 4:09 p.m. | OK | GNU C++17 | TESTS | 45 | 966 | 32256000 | 2400 | |
| 2974441 | Egor | D | Jan. 20, 2013, 6:53 p.m. | OK | Java 6 | TESTS | 45 | 265 | 28672000 | 2400 | |
| 2995297 | emo | D | Jan. 23, 2013, 5:11 a.m. | OK | Java 6 | TESTS | 45 | 1248 | 187289600 | 2400 | |
| 3045262 | ysyshtc | D | Feb. 1, 2013, 3:06 p.m. | OK | Java 7 | TESTS | 45 | 234 | 614400 | 2400 | |
| 2969358 | Petr | D | Jan. 20, 2013, 2:03 p.m. | OK | Java 7 | TESTS | 45 | 234 | 3993600 | 2400 | |
| 3019383 | Asien | D | Jan. 28, 2013, 12:05 p.m. | OK | Java 7 | TESTS | 45 | 265 | 4096000 | 2400 | |
| 7054289 | owenomar | D | July 9, 2014, 4:34 p.m. | OK | Java 7 | TESTS | 45 | 280 | 512000 | 2400 | |
| 3042905 | problem-solved | D | Feb. 1, 2013, 5:27 a.m. | OK | Java 7 | TESTS | 45 | 312 | 14028800 | 2400 | |
| 2971598 | ivan.metelsky | D | Jan. 20, 2013, 2:40 p.m. | OK | Java 7 | TESTS | 45 | 312 | 64307200 | 2400 | |
| 6998149 | uwi | D | July 2, 2014, 3:10 p.m. | OK | Java 7 | TESTS | 45 | 404 | 27955200 | 2400 | |
| 61677382 | Dukkha | D | Oct. 1, 2019, 9:26 p.m. | OK | Java 8 | TESTS | 45 | 592 | 7270400 | 2400 | |
| 4809656 | pps789 | D | Oct. 16, 2013, 6:44 p.m. | OK | MS C++ | TESTS | 45 | 92 | 34099200 | 2400 | |
| 4845849 | kcm1700 | D | Oct. 22, 2013, 5:52 p.m. | OK | MS C++ | TESTS | 45 | 124 | 39116800 | 2400 | |
| 4815310 | csehydrogen | D | Oct. 17, 2013, 4:33 p.m. | OK | MS C++ | TESTS | 45 | 124 | 45977600 | 2400 | |
| 2970633 | AleX | D | Jan. 20, 2013, 2:23 p.m. | OK | MS C++ | TESTS | 45 | 125 | 38092800 | 2400 | |
| 2972383 | Yevgen | D | Jan. 20, 2013, 2:53 p.m. | OK | MS C++ | TESTS | 45 | 140 | 39936000 | 2400 | |
| 41641788 | rkm0959 | D | Aug. 16, 2018, 6:07 a.m. | OK | MS C++ | TESTS | 45 | 248 | 92262400 | 2400 | |
| 2971818 | Shef | D | Jan. 20, 2013, 2:43 p.m. | OK | MS C++ | TESTS | 45 | 296 | 69324800 | 2400 | |
| 2973075 | -DMYTRO- | D | Jan. 20, 2013, 5 p.m. | OK | MS C++ | TESTS | 45 | 468 | 86220800 | 2400 |
Back to search problems