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'Kuro has recently won the "Most intelligent cat ever" contest. The three friends then decided to go to Katie 's home to celebrate Kuro 's winning. After a big meal, they took a small break then started playing games. Kuro challenged Katie to create a game with only a white paper, a pencil, a pair of scissors and a lot of arrows (you can assume that the number of arrows is infinite). Immediately, Katie came up with the game called Topological Parity. The paper is divided into n pieces enumerated from 1 to n . Shiro has painted some pieces with some color. Specifically, the i -th piece has color c_{i} where c_{i} = 0 defines black color, c_{i} = 1 defines white color and c_{i} = -1 means that the piece hasn 't been colored yet. The rules of the game is simple. Players must put some arrows between some pairs of different pieces in such a way that for each arrow, the number in the piece it starts from is less than the number of the piece it ends at. Also, two different pieces can only be connected by at most one arrow. After that the players must choose the color ( 0 or 1 ) for each of the unpainted pieces. The score of a valid way of putting the arrows and coloring pieces is defined as the number of paths of pieces of alternating colors. For example, [1 to 0 to 1 to 0] , [0 to 1 to 0 to 1] , [1] , [0] are valid paths and will be counted. You can only travel from piece x to piece y if and only if there is an arrow from x to y . But Kuro is not fun yet. He loves parity. Let 's call his favorite parity p where p = 0 stands for "even" and p = 1 stands for "odd". He wants to put the arrows and choose colors in such a way that the score has the parity of p . It seems like there will be so many ways which satisfy Kuro. He wants to count the number of them but this could be a very large number. Let 's help him with his problem, but print it modu'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
38269412 |
skuecrk |
E |
May 15, 2018, 1:46 p.m. |
OK |
GNU C++ |
TESTS |
89 |
30 |
3993600 |
|
2800 |
38341483 |
long1 |
E |
May 17, 2018, 7:56 a.m. |
OK |
GNU C++ |
TESTS |
89 |
31 |
1331200 |
|
2800 |
38260819 |
Jeff_Lee |
E |
May 15, 2018, 8:10 a.m. |
OK |
GNU C++ |
TESTS |
89 |
31 |
4198400 |
|
2800 |
38251694 |
begv |
E |
May 14, 2018, 11:12 p.m. |
OK |
GNU C++ |
TESTS |
89 |
31 |
4812800 |
|
2800 |
39016975 |
Atlantis592 |
E |
June 7, 2018, 11:03 a.m. |
OK |
GNU C++ |
TESTS |
89 |
31 |
31641600 |
|
2800 |
38258006 |
malfple |
E |
May 15, 2018, 6:10 a.m. |
OK |
GNU C++ |
TESTS |
89 |
31 |
40243200 |
|
2800 |
38334415 |
guille |
E |
May 16, 2018, 10:38 p.m. |
OK |
GNU C++ |
TESTS |
89 |
31 |
57753600 |
|
2800 |
38805073 |
vjudge2 |
E |
May 31, 2018, 2:31 p.m. |
OK |
GNU C++ |
TESTS |
89 |
46 |
3584000 |
|
2800 |
40214347 |
rainy_season |
E |
July 12, 2018, 12:58 a.m. |
OK |
GNU C++ |
TESTS |
89 |
46 |
8704000 |
|
2800 |
38254082 |
rainy_season |
E |
May 15, 2018, 2:34 a.m. |
OK |
GNU C++ |
TESTS |
89 |
46 |
55500800 |
|
2800 |
38255437 |
nhho |
E |
May 15, 2018, 3:56 a.m. |
OK |
GNU C++11 |
TESTS |
89 |
30 |
6246400 |
|
2800 |
61853772 |
bigboyy |
E |
Oct. 4, 2019, 1:29 p.m. |
OK |
GNU C++11 |
TESTS |
89 |
31 |
0 |
|
2800 |
61853697 |
vjudge2 |
E |
Oct. 4, 2019, 1:28 p.m. |
OK |
GNU C++11 |
TESTS |
89 |
31 |
0 |
|
2800 |
61853676 |
bigboyy |
E |
Oct. 4, 2019, 1:27 p.m. |
OK |
GNU C++11 |
TESTS |
89 |
31 |
0 |
|
2800 |
61853656 |
bigboyy |
E |
Oct. 4, 2019, 1:27 p.m. |
OK |
GNU C++11 |
TESTS |
89 |
31 |
0 |
|
2800 |
61853038 |
vjudge2 |
E |
Oct. 4, 2019, 1:16 p.m. |
OK |
GNU C++11 |
TESTS |
89 |
31 |
0 |
|
2800 |
61852895 |
LittleGirll |
E |
Oct. 4, 2019, 1:14 p.m. |
OK |
GNU C++11 |
TESTS |
89 |
31 |
0 |
|
2800 |
61850700 |
BIU_ |
E |
Oct. 4, 2019, 12:37 p.m. |
OK |
GNU C++11 |
TESTS |
89 |
31 |
0 |
|
2800 |
61848956 |
luogu_bot1 |
E |
Oct. 4, 2019, 12:09 p.m. |
OK |
GNU C++11 |
TESTS |
89 |
31 |
0 |
|
2800 |
61846567 |
vjudge2 |
E |
Oct. 4, 2019, 11:30 a.m. |
OK |
GNU C++11 |
TESTS |
89 |
31 |
0 |
|
2800 |
38319273 |
Sherlock1997 |
E |
May 16, 2018, 11:43 a.m. |
OK |
GNU C++14 |
TESTS |
89 |
30 |
4710400 |
|
2800 |
38250055 |
Arg_007 |
E |
May 14, 2018, 8:49 p.m. |
OK |
GNU C++14 |
TESTS |
89 |
30 |
4710400 |
|
2800 |
38247864 |
Ali_Pi |
E |
May 14, 2018, 7:05 p.m. |
OK |
GNU C++14 |
TESTS |
89 |
30 |
4812800 |
|
2800 |
38236842 |
dotorya |
E |
May 14, 2018, 3:54 p.m. |
OK |
GNU C++14 |
TESTS |
89 |
30 |
6041600 |
|
2800 |
61832944 |
vjudge4 |
E |
Oct. 4, 2019, 7:06 a.m. |
OK |
GNU C++14 |
TESTS |
89 |
31 |
0 |
|
2800 |
46705735 |
PhoenixGS |
E |
Dec. 7, 2018, 6:59 a.m. |
OK |
GNU C++14 |
TESTS |
89 |
31 |
0 |
|
2800 |
38342279 |
Twishkle.Aevdark |
E |
May 17, 2018, 8:29 a.m. |
OK |
GNU C++14 |
TESTS |
89 |
31 |
307200 |
|
2800 |
38466357 |
Hiasat |
E |
May 20, 2018, 5:44 p.m. |
OK |
GNU C++14 |
TESTS |
89 |
31 |
819200 |
|
2800 |
41328348 |
iamz |
E |
Aug. 8, 2018, 7:09 a.m. |
OK |
GNU C++14 |
TESTS |
89 |
31 |
921600 |
|
2800 |
43447010 |
Shayan.P |
E |
Sept. 26, 2018, 11:50 a.m. |
OK |
GNU C++14 |
TESTS |
89 |
31 |
1228800 |
|
2800 |
38313371 |
xlk |
E |
May 16, 2018, 8:01 a.m. |
OK |
GNU C++17 |
TESTS |
89 |
30 |
4710400 |
|
2800 |
61850804 |
vjudge4 |
E |
Oct. 4, 2019, 12:39 p.m. |
OK |
GNU C++17 |
TESTS |
89 |
31 |
0 |
|
2800 |
40446348 |
zhysora |
E |
July 16, 2018, 4:45 p.m. |
OK |
GNU C++17 |
TESTS |
89 |
31 |
0 |
|
2800 |
39275743 |
Benq |
E |
June 15, 2018, 10:16 p.m. |
OK |
GNU C++17 |
TESTS |
89 |
31 |
0 |
|
2800 |
47146010 |
CMXRYNP |
E |
Dec. 17, 2018, 2:24 a.m. |
OK |
GNU C++17 |
TESTS |
89 |
31 |
204800 |
|
2800 |
46441124 |
yangjinhao |
E |
Dec. 1, 2018, noon |
OK |
GNU C++17 |
TESTS |
89 |
31 |
204800 |
|
2800 |
48867508 |
zhangqingqi |
E |
Jan. 24, 2019, 4:08 a.m. |
OK |
GNU C++17 |
TESTS |
89 |
31 |
307200 |
|
2800 |
48867414 |
zhangqingqi |
E |
Jan. 24, 2019, 4:05 a.m. |
OK |
GNU C++17 |
TESTS |
89 |
31 |
307200 |
|
2800 |
38349894 |
haleyk100198 |
E |
May 17, 2018, 1:10 p.m. |
OK |
GNU C++17 |
TESTS |
89 |
31 |
1331200 |
|
2800 |
40994239 |
cjnwq |
E |
July 31, 2018, 2:35 a.m. |
OK |
GNU C++17 |
TESTS |
89 |
31 |
1433600 |
|
2800 |
38310815 |
Darth_Jar_Jar_Binks |
E |
May 16, 2018, 6:22 a.m. |
OK |
Java 8 |
TESTS |
89 |
124 |
20684800 |
|
2800 |
67030827 |
dalt |
E |
Dec. 16, 2019, 3:48 p.m. |
OK |
Java 8 |
TESTS |
89 |
139 |
19148800 |
|
2800 |
38690190 |
donli |
E |
May 28, 2018, 9:51 a.m. |
OK |
Java 8 |
TESTS |
89 |
140 |
0 |
|
2800 |
39510648 |
Tom--CCS |
E |
June 22, 2018, 8:54 a.m. |
OK |
Java 8 |
TESTS |
89 |
171 |
0 |
|
2800 |
38488681 |
RussianBot |
E |
May 21, 2018, 2:55 p.m. |
OK |
Java 8 |
TESTS |
89 |
171 |
0 |
|
2800 |
67026610 |
dalt |
E |
Dec. 16, 2019, 2:32 p.m. |
OK |
Java 8 |
TESTS |
89 |
217 |
47104000 |
|
2800 |
39445851 |
tri |
E |
June 20, 2018, 8:38 p.m. |
OK |
Java 8 |
TESTS |
89 |
218 |
77926400 |
|
2800 |
38689060 |
donli |
E |
May 28, 2018, 8:58 a.m. |
OK |
Java 8 |
TESTS |
89 |
280 |
75980800 |
|
2800 |
45251563 |
Anastasiya_Andreevna |
E |
Nov. 3, 2018, 4:51 p.m. |
OK |
Mono C# |
TESTS |
89 |
77 |
54476800 |
|
2800 |
61849999 |
vjudge1 |
E |
Oct. 4, 2019, 12:26 p.m. |
OK |
MS C++ |
TESTS |
89 |
31 |
0 |
|
2800 |
46574041 |
vjudge4 |
E |
Dec. 4, 2018, 7:39 a.m. |
OK |
MS C++ |
TESTS |
89 |
31 |
0 |
|
2800 |
46573966 |
vjudge2 |
E |
Dec. 4, 2018, 7:37 a.m. |
OK |
MS C++ |
TESTS |
89 |
31 |
0 |
|
2800 |
remove filters
Back to search problems