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"Recently Ivan the Fool decided to become smarter and study the probability theory. He thinks that he understands the subject fairly well, and so he began to behave like he already got PhD in that area. To prove his skills, Ivan decided to demonstrate his friends a concept of random picture. A picture is a field of n rows and m columns, where each cell is either black or white. Ivan calls the picture random if for every cell it has at most one adjacent cell of the same color. Two cells are considered adjacent if they share a side. Ivan's brothers spent some time trying to explain that it's not how the randomness usually works. Trying to convince Ivan, they want to count the number of different random (according to Ivan) pictures. Two pictures are considered different if at least one cell on those two picture is colored differently. Since the number of such pictures may be quite large, print it modulo 10^9 + 7 . The only line contains two integers n and m ( 1 <= n, m <= 100 ,000 ), the number of rows and the number of columns of the field. Print one integer, the number of random pictures modulo 10^9 + 7 . The picture below shows all possible random pictures of size 2 by 3 . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
62986684 |
Gassa |
A |
Oct. 20, 2019, 9:28 a.m. |
OK |
D |
TESTS |
28 |
31 |
0 |
|
1700 |
63128425 |
luogu_bot5 |
A |
Oct. 22, 2019, 1:29 p.m. |
OK |
FPC |
TESTS |
28 |
31 |
8294400 |
|
1700 |
62995349 |
Lagoon_ |
A |
Oct. 20, 2019, 10:02 a.m. |
OK |
GNU C++11 |
TESTS |
28 |
30 |
0 |
|
1700 |
68029804 |
geneanlyz |
A |
Jan. 1, 2020, 8:32 a.m. |
OK |
GNU C++11 |
TESTS |
28 |
30 |
307200 |
|
1700 |
63121202 |
caidzh |
A |
Oct. 22, 2019, 11:18 a.m. |
OK |
GNU C++11 |
TESTS |
28 |
30 |
409600 |
|
1700 |
62982863 |
Hasan0540 |
A |
Oct. 20, 2019, 9:19 a.m. |
OK |
GNU C++11 |
TESTS |
28 |
30 |
409600 |
|
1700 |
62981340 |
ohweonfire |
A |
Oct. 20, 2019, 9:16 a.m. |
OK |
GNU C++11 |
TESTS |
28 |
30 |
409600 |
|
1700 |
62986522 |
C20193515_LYX |
A |
Oct. 20, 2019, 9:27 a.m. |
OK |
GNU C++11 |
TESTS |
28 |
30 |
614400 |
|
1700 |
63559772 |
zhuchengyang |
A |
Oct. 27, 2019, 1:55 p.m. |
OK |
GNU C++11 |
TESTS |
28 |
30 |
819200 |
|
1700 |
63108874 |
yuguotianqing |
A |
Oct. 22, 2019, 6:28 a.m. |
OK |
GNU C++11 |
TESTS |
28 |
30 |
819200 |
|
1700 |
62978838 |
HeHere |
A |
Oct. 20, 2019, 9:12 a.m. |
OK |
GNU C++11 |
TESTS |
28 |
30 |
819200 |
|
1700 |
64699722 |
wbs501 |
A |
Nov. 11, 2019, 2:27 p.m. |
OK |
GNU C++11 |
TESTS |
28 |
30 |
1228800 |
|
1700 |
63053798 |
phoenix28 |
A |
Oct. 21, 2019, 4:53 a.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
0 |
|
1700 |
68128169 |
StayAwayFromBitches |
A |
Jan. 3, 2020, 3:59 p.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
409600 |
|
1700 |
63102111 |
RsEnts |
A |
Oct. 22, 2019, 1:35 a.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
409600 |
|
1700 |
63011631 |
shdut |
A |
Oct. 20, 2019, 11:52 a.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
409600 |
|
1700 |
62988533 |
224 |
A |
Oct. 20, 2019, 9:33 a.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
409600 |
|
1700 |
65912850 |
brown_toad |
A |
Nov. 28, 2019, 1:32 p.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
819200 |
|
1700 |
65732733 |
__peossp |
A |
Nov. 26, 2019, 6:06 a.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
819200 |
|
1700 |
63230581 |
Amireza |
A |
Oct. 23, 2019, 10:50 a.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
819200 |
|
1700 |
63101444 |
jakedavis |
A |
Oct. 22, 2019, 12:57 a.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
819200 |
|
1700 |
63091516 |
Kot-Skazochnik |
A |
Oct. 21, 2019, 6:39 p.m. |
OK |
GNU C++14 |
TESTS |
28 |
15 |
819200 |
|
1700 |
69189734 |
Gratata |
A |
Jan. 20, 2020, 1:08 p.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
0 |
|
1700 |
63408361 |
leoyang |
A |
Oct. 25, 2019, 9:49 p.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
0 |
|
1700 |
63667341 |
vjudge1 |
A |
Oct. 28, 2019, 3:47 p.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
409600 |
|
1700 |
64303443 |
Lgq_3de5 |
A |
Nov. 5, 2019, 10:48 a.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
409600 |
|
1700 |
64264041 |
iamminh |
A |
Nov. 4, 2019, 5:15 p.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
409600 |
|
1700 |
63267355 |
RNS_CUS |
A |
Oct. 24, 2019, 1:19 a.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
409600 |
|
1700 |
63065182 |
pehnfhby |
A |
Oct. 21, 2019, 10:33 a.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
409600 |
|
1700 |
63039187 |
milos_milutinovic |
A |
Oct. 20, 2019, 11 p.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
409600 |
|
1700 |
63030349 |
LaGipeR |
A |
Oct. 20, 2019, 6:09 p.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
409600 |
|
1700 |
62985450 |
kefaa2 |
A |
Oct. 20, 2019, 9:25 a.m. |
OK |
GNU C++17 |
TESTS |
28 |
15 |
409600 |
|
1700 |
63117206 |
yang12138 |
A |
Oct. 22, 2019, 9:48 a.m. |
OK |
Go |
TESTS |
28 |
31 |
0 |
|
1700 |
63678123 |
MyK_00L |
A |
Oct. 28, 2019, 6:59 p.m. |
OK |
Haskell |
TESTS |
28 |
46 |
102400 |
|
1700 |
64778668 |
1NVAL1D |
A |
Nov. 13, 2019, 6:02 a.m. |
OK |
Java 11 |
TESTS |
28 |
186 |
0 |
|
1700 |
65794369 |
CheesecakeRen |
A |
Nov. 27, 2019, 2:57 a.m. |
OK |
Java 11 |
TESTS |
28 |
187 |
0 |
|
1700 |
64279526 |
Ahmad |
A |
Nov. 5, 2019, 12:34 a.m. |
OK |
Java 8 |
TESTS |
28 |
109 |
0 |
|
1700 |
63289060 |
sakt_coder |
A |
Oct. 24, 2019, 11:15 a.m. |
OK |
Java 8 |
TESTS |
28 |
109 |
0 |
|
1700 |
63084625 |
yaoct |
A |
Oct. 21, 2019, 4:12 p.m. |
OK |
Java 8 |
TESTS |
28 |
109 |
0 |
|
1700 |
63011465 |
onefineday01 |
A |
Oct. 20, 2019, 11:50 a.m. |
OK |
Java 8 |
TESTS |
28 |
109 |
0 |
|
1700 |
63082051 |
egaeus |
A |
Oct. 21, 2019, 3:25 p.m. |
OK |
Java 8 |
TESTS |
28 |
109 |
4403200 |
|
1700 |
63006307 |
fetetriste |
A |
Oct. 20, 2019, 10:55 a.m. |
OK |
Java 8 |
TESTS |
28 |
124 |
0 |
|
1700 |
63035909 |
AnandOza |
A |
Oct. 20, 2019, 8:44 p.m. |
OK |
Java 8 |
TESTS |
28 |
124 |
0 |
|
1700 |
63000601 |
SergeyMelnikov |
A |
Oct. 20, 2019, 10:28 a.m. |
OK |
Java 8 |
TESTS |
28 |
124 |
0 |
|
1700 |
62989211 |
ilyakor |
A |
Oct. 20, 2019, 9:36 a.m. |
OK |
Java 8 |
TESTS |
28 |
124 |
0 |
|
1700 |
62985913 |
DarLam |
A |
Oct. 20, 2019, 9:26 a.m. |
OK |
Java 8 |
TESTS |
28 |
124 |
0 |
|
1700 |
62979526 |
Eva |
A |
Oct. 20, 2019, 9:13 a.m. |
OK |
Kotlin |
TESTS |
28 |
124 |
0 |
|
1700 |
62980262 |
knightL |
A |
Oct. 20, 2019, 9:14 a.m. |
OK |
Kotlin |
TESTS |
28 |
155 |
614400 |
|
1700 |
63029455 |
djincs |
A |
Oct. 20, 2019, 5:45 p.m. |
OK |
Mono C# |
TESTS |
28 |
46 |
716800 |
|
1700 |
63032457 |
nastya1199 |
A |
Oct. 20, 2019, 7:03 p.m. |
OK |
Mono C# |
TESTS |
28 |
62 |
716800 |
|
1700 |
62978967 |
keymoon |
A |
Oct. 20, 2019, 9:12 a.m. |
OK |
Mono C# |
TESTS |
28 |
62 |
4403200 |
|
1700 |
63985373 |
vjudge2 |
A |
Nov. 1, 2019, 11:34 a.m. |
OK |
MS C++ |
TESTS |
28 |
30 |
409600 |
|
1700 |
69943492 |
vjudge4 |
A |
Feb. 1, 2020, 6:53 a.m. |
OK |
MS C++ |
TESTS |
28 |
31 |
819200 |
|
1700 |
69943079 |
vjudge3 |
A |
Feb. 1, 2020, 6:45 a.m. |
OK |
MS C++ |
TESTS |
28 |
31 |
819200 |
|
1700 |
65569077 |
vjudge3 |
A |
Nov. 23, 2019, 7:10 a.m. |
OK |
MS C++ |
TESTS |
28 |
31 |
819200 |
|
1700 |
65059941 |
vjudge5 |
A |
Nov. 15, 2019, 4:31 p.m. |
OK |
MS C++ |
TESTS |
28 |
31 |
819200 |
|
1700 |
65059935 |
vjudge1 |
A |
Nov. 15, 2019, 4:31 p.m. |
OK |
MS C++ |
TESTS |
28 |
31 |
819200 |
|
1700 |
63122730 |
s_y_z_r_y |
A |
Oct. 22, 2019, 11:51 a.m. |
OK |
MS C++ |
TESTS |
28 |
31 |
819200 |
|
1700 |
63112114 |
vjudge4 |
A |
Oct. 22, 2019, 7:56 a.m. |
OK |
MS C++ |
TESTS |
28 |
31 |
819200 |
|
1700 |
64519129 |
vjudge2 |
A |
Nov. 8, 2019, 11:46 a.m. |
OK |
MS C++ |
TESTS |
28 |
31 |
1638400 |
|
1700 |
69942630 |
vjudge3 |
A |
Feb. 1, 2020, 6:37 a.m. |
OK |
MS C++ |
TESTS |
28 |
31 |
1740800 |
|
1700 |
63103237 |
MIG29 |
A |
Oct. 22, 2019, 2:36 a.m. |
OK |
MS C++ 2017 |
TESTS |
28 |
31 |
307200 |
|
1700 |
67032009 |
kris_v |
A |
Dec. 16, 2019, 4:08 p.m. |
OK |
MS C++ 2017 |
TESTS |
28 |
31 |
307200 |
|
1700 |
63026647 |
OrzzrOOrzzrO |
A |
Oct. 20, 2019, 4:33 p.m. |
OK |
MS C++ 2017 |
TESTS |
28 |
31 |
409600 |
|
1700 |
69178897 |
kurs |
A |
Jan. 20, 2020, 9:14 a.m. |
OK |
MS C++ 2017 |
TESTS |
28 |
31 |
409600 |
|
1700 |
62988620 |
Kirundel |
A |
Oct. 20, 2019, 9:33 a.m. |
OK |
MS C++ 2017 |
TESTS |
28 |
31 |
512000 |
|
1700 |
63740734 |
dbelov |
A |
Oct. 29, 2019, 4:50 p.m. |
OK |
MS C++ 2017 |
TESTS |
28 |
31 |
716800 |
|
1700 |
63160044 |
vjudge2 |
A |
Oct. 22, 2019, 3:34 p.m. |
OK |
MS C++ 2017 |
TESTS |
28 |
31 |
819200 |
|
1700 |
64588452 |
tirpitz9992 |
A |
Nov. 9, 2019, 2 p.m. |
OK |
MS C++ 2017 |
TESTS |
28 |
31 |
819200 |
|
1700 |
67760810 |
CygneNoir |
A |
Dec. 27, 2019, 10:08 p.m. |
OK |
MS C++ 2017 |
TESTS |
28 |
31 |
819200 |
|
1700 |
64565744 |
vjudge4 |
A |
Nov. 9, 2019, 7:37 a.m. |
OK |
MS C++ 2017 |
TESTS |
28 |
31 |
819200 |
|
1700 |
62986400 |
kabeer27 |
A |
Oct. 20, 2019, 9:27 a.m. |
OK |
PyPy 2 |
TESTS |
28 |
140 |
1024000 |
|
1700 |
63990557 |
yumtam |
A |
Nov. 1, 2019, 1 p.m. |
OK |
PyPy 2 |
TESTS |
28 |
140 |
3379200 |
|
1700 |
62986648 |
alexwice |
A |
Oct. 20, 2019, 9:28 a.m. |
OK |
PyPy 2 |
TESTS |
28 |
155 |
5222400 |
|
1700 |
64522064 |
O_Ramanujan |
A |
Nov. 8, 2019, 12:39 p.m. |
OK |
PyPy 3 |
TESTS |
28 |
140 |
0 |
|
1700 |
64199804 |
V4V |
A |
Nov. 4, 2019, 11:06 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
140 |
1638400 |
|
1700 |
63269994 |
codershuvo |
A |
Oct. 24, 2019, 3:21 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
140 |
4505600 |
|
1700 |
62998743 |
asvasil |
A |
Oct. 20, 2019, 10:19 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
155 |
1331200 |
|
1700 |
65897770 |
ng24_7 |
A |
Nov. 28, 2019, 7:09 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
155 |
1740800 |
|
1700 |
62981466 |
_Kee |
A |
Oct. 20, 2019, 9:16 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
155 |
2048000 |
|
1700 |
63274650 |
vjudge2 |
A |
Oct. 24, 2019, 6:15 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
155 |
8396800 |
|
1700 |
63012183 |
titia |
A |
Oct. 20, 2019, 11:59 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
155 |
8601600 |
|
1700 |
63101126 |
roboanna |
A |
Oct. 22, 2019, 12:38 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
374 |
6553600 |
|
1700 |
65938869 |
mshiladityam |
A |
Nov. 29, 2019, 4:44 a.m. |
OK |
PyPy 3 |
TESTS |
28 |
592 |
8601600 |
|
1700 |
63957801 |
simanta_paul |
A |
Nov. 1, 2019, 3:10 a.m. |
OK |
Python 3 |
TESTS |
28 |
155 |
2560000 |
|
1700 |
63575735 |
POGILAYA_godzilla |
A |
Oct. 27, 2019, 3:55 p.m. |
OK |
Python 3 |
TESTS |
28 |
155 |
2969600 |
|
1700 |
63019991 |
kgalford1 |
A |
Oct. 20, 2019, 2:11 p.m. |
OK |
Python 3 |
TESTS |
28 |
155 |
2969600 |
|
1700 |
63195705 |
vishnutheerthep |
A |
Oct. 22, 2019, 6:31 p.m. |
OK |
Python 3 |
TESTS |
28 |
155 |
3481600 |
|
1700 |
62980387 |
Kiri8128 |
A |
Oct. 20, 2019, 9:15 a.m. |
OK |
Python 3 |
TESTS |
28 |
156 |
3379200 |
|
1700 |
68363984 |
Parsa84 |
A |
Jan. 7, 2020, 3:13 p.m. |
OK |
Python 3 |
TESTS |
28 |
171 |
0 |
|
1700 |
63660114 |
ElectricR |
A |
Oct. 28, 2019, 1:49 p.m. |
OK |
Python 3 |
TESTS |
28 |
171 |
0 |
|
1700 |
63238074 |
ugniusb |
A |
Oct. 23, 2019, 12:47 p.m. |
OK |
Python 3 |
TESTS |
28 |
187 |
6758400 |
|
1700 |
65695112 |
CheesecakeRen |
A |
Nov. 25, 2019, 7:35 a.m. |
OK |
Python 3 |
TESTS |
28 |
202 |
2560000 |
|
1700 |
63058543 |
ayushjhawa1999 |
A |
Oct. 21, 2019, 7:34 a.m. |
OK |
Python 3 |
TESTS |
28 |
202 |
6144000 |
|
1700 |
62979622 |
sansen |
A |
Oct. 20, 2019, 9:13 a.m. |
OK |
Rust |
TESTS |
28 |
31 |
409600 |
|
1700 |
63079278 |
limed |
A |
Oct. 21, 2019, 2:37 p.m. |
OK |
Scala |
TESTS |
28 |
390 |
0 |
|
1700 |
63015330 |
yakamoto |
A |
Oct. 20, 2019, 12:45 p.m. |
OK |
Scala |
TESTS |
28 |
404 |
0 |
|
1700 |
62992259 |
limed |
A |
Oct. 20, 2019, 9:48 a.m. |
OK |
Scala |
TESTS |
28 |
436 |
0 |
|
1700 |
remove filters
Back to search problems