Codeforces Round 331 (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
596 Codeforces Round 331 (Div. 2) FINISHED False 7200 328800323 Nov. 15, 2015, 4:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 424 ) E Wilbur and Strings PROGRAMMING dfs and similar dp graphs strings 2900

Wilbur the pig now wants to play with strings. He has found an n by m table consisting only of the digits from 0 to 9 where the rows are numbered 1 to n and the columns are numbered 1 to m . Wilbur starts at some square and makes certain moves. If he is at square ( x , y ) and the digit d ( 0 ≤ d ≤ 9 ) is written at position ( x , y ), then he must move to the square ( x + a d , y + b d ), if that square lies within the table, and he stays in the square ( x , y ) otherwise. Before Wilbur makes a move, he can choose whether or not to write the digit written in this square on the white board. All digits written on the whiteboard form some string. Every time a new digit is written, it goes to the end of the current string. Wilbur has q strings that he is worried about. For each string s i , Wilbur wants to know whether there exists a starting position ( x , y ) so that by making finitely many moves, Wilbur can end up with the string s i written on the white board. The first line of the input consists of three integers n , m , and q ( 1 ≤ n , m , q ≤ 200 ) — the dimensions of the table and the number of strings to process, respectively. Each of the next n lines contains m digits from 0 and 9 giving the table itself. Then follow 10 lines. The i -th of them contains the values a i - 1 and b i - 1 ( - 200 ≤ a i , b i ≤ 200 ), i.e. the vector that Wilbur uses to make a move from the square with a digit i - 1 in it. There are q lines that follow. The i -th of them will contain a string s i consisting only of digits from 0 to 9 . It is guaranteed that the total length of these q strings won't exceed 1 000 000 . For each of the q strings, print " YES " if Wilbur can choose x and y in order to finish with this string after some finite number of moves. If it's impossible, than print " NO " for the corresponding string. In the first sample, there is a 1 by 1 table consisting of the only digit 0 . The only move that can be made is staying on the square. The first string

Tutorials

Codeforces Round #331 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
36298422 njuoj E March 15, 2018, 12:08 p.m. OK GNU C++ TESTS 78 30 6963200 2900
36293515 njuoj E March 15, 2018, 8:27 a.m. OK GNU C++ TESTS 78 30 7065600 2900
14416042 yusufziya E Nov. 22, 2015, 3:34 p.m. OK GNU C++ TESTS 78 31 2355200 2900
14415876 yusufziya E Nov. 22, 2015, 3:20 p.m. OK GNU C++ TESTS 78 31 2355200 2900
16471982 sauravjha221 E March 2, 2016, 7:26 p.m. OK GNU C++ TESTS 78 31 5324800 2900
14320358 130705009 E Nov. 18, 2015, 4 a.m. OK GNU C++ TESTS 78 31 5324800 2900
14295235 cpcpc E Nov. 16, 2015, 9:17 a.m. OK GNU C++ TESTS 78 31 5324800 2900
14436690 dat131199 E Nov. 24, 2015, 8:37 a.m. OK GNU C++ TESTS 78 31 5529600 2900
14311304 boomshine E Nov. 17, 2015, 11:03 a.m. OK GNU C++ TESTS 78 31 5529600 2900
36279293 njuoj E March 14, 2018, 2:41 p.m. OK GNU C++ TESTS 78 31 5939200 2900
14407708 koushik_s E Nov. 21, 2015, 10:58 p.m. OK GNU C11 TESTS 78 31 5529600 2900
14580782 legacheek E Dec. 1, 2015, 7:37 a.m. OK GNU C++11 TESTS 78 31 3686400 2900
14630427 eggeek E Dec. 3, 2015, 7:59 a.m. OK GNU C++11 TESTS 78 31 3686400 2900
48772058 Love_mona E Jan. 23, 2019, 1:10 a.m. OK GNU C++11 TESTS 78 31 3993600 2900
14396038 leiothrix E Nov. 21, 2015, 10:06 a.m. OK GNU C++11 TESTS 78 31 4198400 2900
14356699 yzyz E Nov. 20, 2015, 9:41 a.m. OK GNU C++11 TESTS 78 31 4300800 2900
14304857 Ioana E Nov. 16, 2015, 11:37 p.m. OK GNU C++11 TESTS 78 31 4812800 2900
14314040 wyr E Nov. 17, 2015, 2:22 p.m. OK GNU C++11 TESTS 78 31 5324800 2900
18858378 nobystander E July 2, 2016, 6:41 p.m. OK GNU C++11 TESTS 78 31 5427200 2900
14286432 ztxz16 E Nov. 15, 2015, 6:31 p.m. OK GNU C++11 TESTS 78 31 6041600 2900
14326904 eddy1021 E Nov. 18, 2015, 1:36 p.m. OK GNU C++11 TESTS 78 31 6144000 2900
27949873 rawatds E June 21, 2017, 4:45 p.m. OK GNU C++14 TESTS 78 31 7168000 2900
28565051 boook E July 15, 2017, 5:57 a.m. OK GNU C++14 TESTS 78 31 10444800 2900
28563196 boook E July 15, 2017, 4:26 a.m. OK GNU C++14 TESTS 78 31 18124800 2900
33238504 consecutivelimit E Dec. 14, 2017, 11:49 a.m. OK GNU C++14 TESTS 78 46 6144000 2900
39053787 bira37 E June 8, 2018, 7:33 p.m. OK GNU C++14 TESTS 78 46 6758400 2900
44168591 w446506278 E Oct. 12, 2018, 3:56 a.m. OK GNU C++14 TESTS 78 46 8089600 2900
36316374 njuoj E March 16, 2018, 4:33 a.m. OK GNU C++14 TESTS 78 46 8294400 2900
20809903 lavin E Sept. 22, 2016, 4:13 a.m. OK GNU C++14 TESTS 78 46 9932800 2900
24426155 Kerim.K E Feb. 4, 2017, 6:38 a.m. OK GNU C++14 TESTS 78 46 10137600 2900
54780017 dbdbab E May 28, 2019, 8:43 p.m. OK GNU C++14 TESTS 78 61 9420800 2900
69754788 hjk1030 E Jan. 29, 2020, 3:17 p.m. OK GNU C++17 TESTS 78 31 5632000 2900
69275443 limabeans E Jan. 22, 2020, 1:39 a.m. OK GNU C++17 TESTS 78 46 6144000 2900
40591263 Doriath E July 20, 2018, 11:50 p.m. OK GNU C++17 TESTS 78 46 6758400 2900
67923236 ruo E Dec. 29, 2019, 4:32 p.m. OK GNU C++17 TESTS 78 61 45465600 2900
37385805 Lancern E April 17, 2018, 2:57 a.m. OK GNU C++17 TESTS 78 93 118681600 2900
47076051 luogu_bot4 E Dec. 15, 2018, 5:11 p.m. OK GNU C++17 TESTS 78 171 7270400 2900
47075961 OMG_wc E Dec. 15, 2018, 5:10 p.m. OK GNU C++17 TESTS 78 171 7270400 2900
49913923 ivan100sic E Feb. 14, 2019, 3:32 p.m. OK GNU C++17 TESTS 78 171 8704000 2900
44347461 NiceBaseballCoder E Oct. 15, 2018, 8:09 a.m. OK GNU C++17 TESTS 78 171 9011200 2900
46563664 Daring_Do E Dec. 3, 2018, 8:14 p.m. OK GNU C++17 TESTS 78 171 14438400 2900
14316478 uwi E Nov. 17, 2015, 5:20 p.m. OK Java 8 TESTS 78 155 0 2900
14321039 opticoder E Nov. 18, 2015, 5:36 a.m. OK Java 8 TESTS 78 186 2355200 2900
15332959 I_Need_Alex_R_Coleman E Jan. 13, 2016, 3:25 p.m. OK Java 8 TESTS 78 187 3584000 2900
14583043 mohamednabil00000 E Dec. 1, 2015, 11:22 a.m. OK Java 8 TESTS 78 202 13516800 2900
14293690 Ruins E Nov. 16, 2015, 6:33 a.m. OK Java 8 TESTS 78 249 7680000 2900
14296088 Ruins E Nov. 16, 2015, 10:37 a.m. OK Java 8 TESTS 78 280 7680000 2900
16640818 raggzy E March 10, 2016, 10:27 p.m. OK Java 8 TESTS 78 358 20787200 2900
14318887 mkirsche E Nov. 17, 2015, 9:56 p.m. OK Java 8 TESTS 78 1107 11161600 2900
16640700 raggzy E March 10, 2016, 10:09 p.m. OK Java 8 TESTS 78 2854 17408000 2900
17315808 linghongyi E April 14, 2016, 2:43 p.m. OK MS C++ TESTS 78 31 14540800 2900
17315434 linghongyi E April 14, 2016, 2:09 p.m. OK MS C++ TESTS 78 31 14540800 2900
17024604 LightRay E March 29, 2016, 6:47 p.m. OK MS C++ TESTS 78 46 25600000 2900
14282461 Koblyk E Nov. 15, 2015, 5:42 p.m. OK MS C++ TESTS 78 78 4915200 2900
14300320 AleksanderBalobanov E Nov. 16, 2015, 3:42 p.m. OK MS C++ TESTS 78 156 68505600 2900

remove filters

Back to search problems