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.
Problems
B'Omkar 's most recent follower, Ajit, has entered the Holy Forest. Ajit realizes that Omkar 's forest is an n by m grid ( 1 <= q n, m <= q 2000 ) of some non-negative integers. Since the forest is blessed by Omkar, it satisfies some special conditions: Unfortunately, Ajit is not fully worthy of Omkar 's powers yet. He sees each cell as a "0" or a "#". If a cell is labeled as "0", then the number in it must equal 0 . Otherwise, the number in it can be any nonnegative integer. Determine how many different assignments of elements exist such that these special conditions are satisfied. Two assignments are considered different if there exists at least one cell such that the numbers written in it in these assignments are different. Since the answer may be enormous, find the answer modulo 10^9+7 . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= q t <= q 100 ). Description of the test cases follows. The first line of each test case contains two integers n and m ( 1 <= q n, m <= q 2000, nm geq 2 ) xe2 x80 x93 the dimensions of the forest. n lines follow, each consisting of one string of m characters. Each of these characters is either a "0" or a "#". It is guaranteed that the sum of n over all test cases does not exceed 2000 and the sum of m over all test cases does not exceed 2000 . For each test case, print one integer: the number of valid configurations modulo 10^9+7 . For the first test case, the two valid assignments are 0000 0000 0000 and 0000 0010 0000 '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
118683632 |
renshubing |
E |
June 7, 2021, 4:44 a.m. |
OK |
GNU C++11 |
TESTS |
26 |
31 |
0 |
|
2300 |
118679853 |
ningBr |
E |
June 7, 2021, 3:33 a.m. |
OK |
GNU C++11 |
TESTS |
26 |
31 |
0 |
|
2300 |
118672905 |
Aestas16 |
E |
June 6, 2021, 11:34 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
31 |
512000 |
|
2300 |
118646532 |
Darko1227 |
E |
June 6, 2021, 4:18 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
31 |
3788800 |
|
2300 |
118674138 |
rui_er |
E |
June 7, 2021, 12:49 a.m. |
OK |
GNU C++11 |
TESTS |
26 |
31 |
3993600 |
|
2300 |
118652048 |
henry-tb |
E |
June 6, 2021, 4:34 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
31 |
3993600 |
|
2300 |
118646151 |
lsyyds |
E |
June 6, 2021, 4:17 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
31 |
4096000 |
|
2300 |
118671616 |
yspm |
E |
June 6, 2021, 10:18 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
46 |
0 |
|
2300 |
118671610 |
yspm |
E |
June 6, 2021, 10:18 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
46 |
0 |
|
2300 |
118654234 |
myx12345 |
E |
June 6, 2021, 5:16 p.m. |
OK |
GNU C++11 |
TESTS |
26 |
46 |
0 |
|
2300 |
118648084 |
bqq |
E |
June 6, 2021, 4:22 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
46 |
204800 |
|
2300 |
118674372 |
pratham.programming7 |
E |
June 7, 2021, 1:01 a.m. |
OK |
GNU C++14 |
TESTS |
26 |
46 |
3993600 |
|
2300 |
118671726 |
ritulaggarwal |
E |
June 6, 2021, 10:23 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
61 |
0 |
|
2300 |
118657656 |
mat_v |
E |
June 6, 2021, 5:39 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
61 |
204800 |
|
2300 |
118683553 |
123thunderbuddie |
E |
June 7, 2021, 4:43 a.m. |
OK |
GNU C++14 |
TESTS |
26 |
61 |
614400 |
|
2300 |
118668722 |
dxtdxxry |
E |
June 6, 2021, 8:32 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
62 |
0 |
|
2300 |
118659081 |
Electron |
E |
June 6, 2021, 5:53 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
62 |
0 |
|
2300 |
118655927 |
Tigamaeus_621 |
E |
June 6, 2021, 5:25 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
62 |
204800 |
|
2300 |
118649689 |
Beast_Within |
E |
June 6, 2021, 4:27 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
62 |
204800 |
|
2300 |
118653755 |
MazenBatrawi |
E |
June 6, 2021, 5:14 p.m. |
OK |
GNU C++14 |
TESTS |
26 |
62 |
7168000 |
|
2300 |
118660196 |
kushal2001 |
E |
June 6, 2021, 6:06 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
31 |
204800 |
|
2300 |
118684620 |
abhinavvv306 |
E |
June 7, 2021, 5 a.m. |
OK |
GNU C++17 |
TESTS |
26 |
46 |
0 |
|
2300 |
118670354 |
prahalad_123 |
E |
June 6, 2021, 9:22 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
46 |
0 |
|
2300 |
118658582 |
shikhar7s |
E |
June 6, 2021, 5:48 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
46 |
0 |
|
2300 |
118674007 |
archiver |
E |
June 7, 2021, 12:42 a.m. |
OK |
GNU C++17 |
TESTS |
26 |
46 |
204800 |
|
2300 |
118670411 |
Perry_Prasad_Platypus |
E |
June 6, 2021, 9:24 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
46 |
204800 |
|
2300 |
118665764 |
kevinyang |
E |
June 6, 2021, 7:25 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
46 |
204800 |
|
2300 |
118663927 |
-messi- |
E |
June 6, 2021, 6:52 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
46 |
204800 |
|
2300 |
118662486 |
abhidot |
E |
June 6, 2021, 6:30 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
46 |
204800 |
|
2300 |
118656356 |
soosoo |
E |
June 6, 2021, 5:28 p.m. |
OK |
GNU C++17 |
TESTS |
26 |
46 |
204800 |
|
2300 |
118673150 |
lunchbox |
E |
June 6, 2021, 11:50 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
46 |
0 |
|
2300 |
118668859 |
MehulJ21 |
E |
June 6, 2021, 8:37 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
46 |
0 |
|
2300 |
118666096 |
munghatekartik |
E |
June 6, 2021, 7:31 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
46 |
0 |
|
2300 |
118657352 |
saeed_odak |
E |
June 6, 2021, 5:36 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
46 |
0 |
|
2300 |
118654058 |
animesh_jha |
E |
June 6, 2021, 5:15 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
46 |
0 |
|
2300 |
118653940 |
IceKnight1093 |
E |
June 6, 2021, 5:15 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
46 |
0 |
|
2300 |
118647399 |
Narut |
E |
June 6, 2021, 4:20 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
46 |
0 |
|
2300 |
118673356 |
AutumnKite |
E |
June 7, 2021, 12:06 a.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
46 |
102400 |
|
2300 |
118665089 |
Bungmint |
E |
June 6, 2021, 7:12 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
46 |
102400 |
|
2300 |
118658292 |
AnonySharma |
E |
June 6, 2021, 5:45 p.m. |
OK |
GNU C++17 (64) |
TESTS |
26 |
46 |
102400 |
|
2300 |
118669773 |
Restricted |
E |
June 6, 2021, 9:03 p.m. |
OK |
Java 11 |
TESTS |
26 |
249 |
0 |
|
2300 |
118654883 |
bobib |
E |
June 6, 2021, 5:19 p.m. |
OK |
Java 11 |
TESTS |
26 |
280 |
0 |
|
2300 |
118678559 |
pikachu_pika_pika |
E |
June 7, 2021, 3:05 a.m. |
OK |
Java 11 |
TESTS |
26 |
280 |
8908800 |
|
2300 |
118658450 |
_merlin_ |
E |
June 6, 2021, 5:47 p.m. |
OK |
Java 11 |
TESTS |
26 |
312 |
31232000 |
|
2300 |
118650131 |
derrick20 |
E |
June 6, 2021, 4:29 p.m. |
OK |
Java 11 |
TESTS |
26 |
483 |
17100800 |
|
2300 |
118659185 |
Adi_7861 |
E |
June 6, 2021, 5:54 p.m. |
OK |
Java 8 |
TESTS |
26 |
124 |
0 |
|
2300 |
118656617 |
Adi_7861 |
E |
June 6, 2021, 5:30 p.m. |
OK |
Java 8 |
TESTS |
26 |
155 |
0 |
|
2300 |
118667433 |
Golovanov399 |
E |
June 6, 2021, 8:01 p.m. |
OK |
Kotlin |
TESTS |
26 |
249 |
0 |
|
2300 |
118653990 |
vpike |
E |
June 6, 2021, 5:15 p.m. |
OK |
MS C++ 2017 |
TESTS |
26 |
124 |
5734400 |
|
2300 |
118673922 |
Het_Fadia |
E |
June 7, 2021, 12:38 a.m. |
OK |
PyPy 3 |
TESTS |
26 |
436 |
9420800 |
|
2300 |
118670608 |
agarus |
E |
June 6, 2021, 9:33 p.m. |
OK |
PyPy 3 |
TESTS |
26 |
451 |
9420800 |
|
2300 |
118654517 |
Subarna578 |
E |
June 6, 2021, 5:17 p.m. |
OK |
PyPy 3 |
TESTS |
26 |
452 |
9420800 |
|
2300 |
118673368 |
sgtlaugh |
E |
June 7, 2021, 12:06 a.m. |
OK |
PyPy 3 |
TESTS |
26 |
452 |
9523200 |
|
2300 |
118676461 |
jasonx3 |
E |
June 7, 2021, 2:17 a.m. |
OK |
PyPy 3 |
TESTS |
26 |
452 |
16896000 |
|
2300 |
118664555 |
Apoorv_Rathore |
E |
June 6, 2021, 7:02 p.m. |
OK |
PyPy 3 |
TESTS |
26 |
467 |
9420800 |
|
2300 |
118673358 |
sgtlaugh |
E |
June 7, 2021, 12:06 a.m. |
OK |
PyPy 3 |
TESTS |
26 |
467 |
9523200 |
|
2300 |
118647272 |
fel2fram |
E |
June 6, 2021, 4:20 p.m. |
OK |
PyPy 3 |
TESTS |
26 |
467 |
9625600 |
|
2300 |
118669653 |
plevande |
E |
June 6, 2021, 8:59 p.m. |
OK |
PyPy 3 |
TESTS |
26 |
499 |
10240000 |
|
2300 |
118659444 |
augurar |
E |
June 6, 2021, 5:57 p.m. |
OK |
PyPy 3 |
TESTS |
26 |
529 |
10137600 |
|
2300 |
118684059 |
sh1194 |
E |
June 7, 2021, 4:51 a.m. |
OK |
Python 3 |
TESTS |
26 |
124 |
102400 |
|
2300 |
118682872 |
revanthbhamidipati |
E |
June 7, 2021, 4:32 a.m. |
OK |
Python 3 |
TESTS |
26 |
124 |
102400 |
|
2300 |
118673391 |
sgtlaugh |
E |
June 7, 2021, 12:08 a.m. |
OK |
Python 3 |
TESTS |
26 |
124 |
102400 |
|
2300 |
118664523 |
Apoorv_Rathore |
E |
June 6, 2021, 7:02 p.m. |
OK |
Python 3 |
TESTS |
26 |
124 |
409600 |
|
2300 |
118664571 |
Apoorv_Rathore |
E |
June 6, 2021, 7:03 p.m. |
OK |
Python 3 |
TESTS |
26 |
140 |
102400 |
|
2300 |
118664540 |
Apoorv_Rathore |
E |
June 6, 2021, 7:02 p.m. |
OK |
Python 3 |
TESTS |
26 |
187 |
409600 |
|
2300 |
118659032 |
shi9chan |
E |
June 6, 2021, 5:52 p.m. |
OK |
Python 3 |
TESTS |
26 |
1044 |
2150400 |
|
2300 |
118682839 |
revanthbhamidipati |
E |
June 7, 2021, 4:31 a.m. |
OK |
Python 3 |
TESTS |
26 |
1091 |
2048000 |
|
2300 |
118649465 |
cottoncotton |
E |
June 6, 2021, 4:26 p.m. |
OK |
Rust |
TESTS |
26 |
46 |
4608000 |
|
2300 |
remove filters
Back to search problems