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'Andrew, Fedor and Alex are inventive guys. Now they invent the game with strings for two players. Given a group of n non-empty strings. During the game two players build the word together, initially the word is empty. The players move in turns. On his step player must add a single letter in the end of the word, the resulting word must be prefix of at least one string from the group. A player loses if he cannot move. Andrew and Alex decided to play this game k times. The player who is the loser of the i-th game makes the first move in the (i xe2 x80 x89+ xe2 x80 x891)-th game. Guys decided that the winner of all games is the player who wins the last (k-th) game. Andrew and Alex already started the game. Fedor wants to know who wins the game if both players will play optimally. Help him. The first line contains two integers, n and k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105; 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109). Each of the next n lines contains a single non-empty string from the given group. The total length of all strings from the group doesn 't exceed 105. Each string of the group consists only of lowercase English letters. If the player who moves first wins, print "First", otherwise print "Second" (without the quotes).'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
42153964 |
Ocelot_666 |
B |
Aug. 27, 2018, 1:39 p.m. |
OK |
FPC |
TESTS |
75 |
78 |
2662400 |
|
2100 |
40187050 |
vjudge3 |
B |
July 11, 2018, 2:40 a.m. |
OK |
FPC |
TESTS |
75 |
78 |
2662400 |
|
2100 |
40187021 |
Ocelot_666 |
B |
July 11, 2018, 2:38 a.m. |
OK |
FPC |
TESTS |
75 |
78 |
2662400 |
|
2100 |
35768196 |
rainboy |
B |
Feb. 27, 2018, 3:59 p.m. |
OK |
GNU C |
TESTS |
75 |
31 |
13619200 |
|
2100 |
35768087 |
rainboy |
B |
Feb. 27, 2018, 3:55 p.m. |
OK |
GNU C |
TESTS |
75 |
31 |
13619200 |
|
2100 |
40084834 |
vjudge1 |
B |
July 8, 2018, 12:16 p.m. |
OK |
GNU C++ |
TESTS |
75 |
31 |
10342400 |
|
2100 |
38992839 |
616156 |
B |
June 6, 2018, 11:18 a.m. |
OK |
GNU C++ |
TESTS |
75 |
31 |
12390400 |
|
2100 |
33897829 |
yyxzhj |
B |
Jan. 4, 2018, 7:30 a.m. |
OK |
GNU C++ |
TESTS |
75 |
31 |
12595200 |
|
2100 |
33895844 |
lijiamu |
B |
Jan. 4, 2018, 3:58 a.m. |
OK |
GNU C++ |
TESTS |
75 |
31 |
12595200 |
|
2100 |
41128490 |
1729618548 |
B |
Aug. 2, 2018, 3:40 p.m. |
OK |
GNU C++ |
TESTS |
75 |
31 |
12902400 |
|
2100 |
34553380 |
vjudge4 |
B |
Jan. 25, 2018, 5:14 p.m. |
OK |
GNU C++ |
TESTS |
75 |
31 |
13721600 |
|
2100 |
38910410 |
vjudge3 |
B |
June 3, 2018, 5:41 a.m. |
OK |
GNU C++ |
TESTS |
75 |
31 |
14233600 |
|
2100 |
41559575 |
luogu_bot5 |
B |
Aug. 13, 2018, 1:27 p.m. |
OK |
GNU C++ |
TESTS |
75 |
31 |
23347200 |
|
2100 |
35614250 |
liuyuzhe |
B |
Feb. 24, 2018, 3:36 a.m. |
OK |
GNU C++ |
TESTS |
75 |
31 |
23859200 |
|
2100 |
35613886 |
liuyuzhe |
B |
Feb. 24, 2018, 3:05 a.m. |
OK |
GNU C++ |
TESTS |
75 |
31 |
23859200 |
|
2100 |
62593808 |
CMZ |
B |
Oct. 14, 2019, 11:40 p.m. |
OK |
GNU C++11 |
TESTS |
75 |
31 |
10547200 |
|
2100 |
66312320 |
shuashuawan |
B |
Dec. 5, 2019, 11:52 a.m. |
OK |
GNU C++11 |
TESTS |
75 |
31 |
10752000 |
|
2100 |
66005159 |
vjudge3 |
B |
Nov. 29, 2019, 9:07 p.m. |
OK |
GNU C++11 |
TESTS |
75 |
31 |
10854400 |
|
2100 |
67956154 |
YHHxBULIATANIA |
B |
Dec. 30, 2019, 9:44 a.m. |
OK |
GNU C++11 |
TESTS |
75 |
31 |
10956800 |
|
2100 |
40988156 |
ReaLNero1 |
B |
July 30, 2018, 9:46 p.m. |
OK |
GNU C++11 |
TESTS |
75 |
31 |
11366400 |
|
2100 |
38625853 |
vjudge3 |
B |
May 26, 2018, 6:48 a.m. |
OK |
GNU C++11 |
TESTS |
75 |
31 |
11366400 |
|
2100 |
62597605 |
luogu_bot2 |
B |
Oct. 15, 2019, 3:06 a.m. |
OK |
GNU C++11 |
TESTS |
75 |
31 |
12083200 |
|
2100 |
35504329 |
leaomatheus |
B |
Feb. 19, 2018, 8:13 p.m. |
OK |
GNU C++11 |
TESTS |
75 |
31 |
12595200 |
|
2100 |
35774552 |
Dr.Dendro |
B |
Feb. 27, 2018, 8:30 p.m. |
OK |
GNU C++11 |
TESTS |
75 |
31 |
12697600 |
|
2100 |
34519638 |
mjguru |
B |
Jan. 24, 2018, 2:18 p.m. |
OK |
GNU C++11 |
TESTS |
75 |
31 |
12697600 |
|
2100 |
35877292 |
indroneal |
B |
March 3, 2018, 9:48 a.m. |
OK |
GNU C++14 |
TESTS |
75 |
30 |
14540800 |
|
2100 |
52807613 |
Thanhxuanlahoitiec |
B |
April 16, 2019, 6:16 a.m. |
OK |
GNU C++14 |
TESTS |
75 |
31 |
10444800 |
|
2100 |
57830952 |
Atlas17 |
B |
July 27, 2019, 6 a.m. |
OK |
GNU C++14 |
TESTS |
75 |
31 |
10752000 |
|
2100 |
57471773 |
EL_3AQ-Why_not |
B |
July 21, 2019, 6:35 p.m. |
OK |
GNU C++14 |
TESTS |
75 |
31 |
10854400 |
|
2100 |
39001233 |
sggutier |
B |
June 6, 2018, 5:52 p.m. |
OK |
GNU C++14 |
TESTS |
75 |
31 |
10956800 |
|
2100 |
69970391 |
thantrongtri3 |
B |
Feb. 1, 2020, 1:42 p.m. |
OK |
GNU C++14 |
TESTS |
75 |
31 |
11366400 |
|
2100 |
55218166 |
linhdara |
B |
June 6, 2019, 5:55 p.m. |
OK |
GNU C++14 |
TESTS |
75 |
31 |
11673600 |
|
2100 |
39974371 |
vjudge1 |
B |
July 5, 2018, 5:56 a.m. |
OK |
GNU C++14 |
TESTS |
75 |
31 |
12083200 |
|
2100 |
42276361 |
LODB---D |
B |
Aug. 30, 2018, 11:45 a.m. |
OK |
GNU C++14 |
TESTS |
75 |
31 |
12288000 |
|
2100 |
38678146 |
Spiritum |
B |
May 27, 2018, 7:28 p.m. |
OK |
GNU C++14 |
TESTS |
75 |
31 |
12492800 |
|
2100 |
68363202 |
kostia244 |
B |
Jan. 7, 2020, 2:54 p.m. |
OK |
GNU C++17 |
TESTS |
75 |
31 |
10444800 |
|
2100 |
53816730 |
luogu_bot2 |
B |
May 6, 2019, 11 a.m. |
OK |
GNU C++17 |
TESTS |
75 |
31 |
10547200 |
|
2100 |
69001001 |
anupamshah_ |
B |
Jan. 17, 2020, 7:36 p.m. |
OK |
GNU C++17 |
TESTS |
75 |
31 |
11673600 |
|
2100 |
55470757 |
dmkozyrev |
B |
June 11, 2019, 6:40 p.m. |
OK |
GNU C++17 |
TESTS |
75 |
31 |
11673600 |
|
2100 |
38435767 |
aspirations |
B |
May 19, 2018, 3:41 p.m. |
OK |
GNU C++17 |
TESTS |
75 |
31 |
12697600 |
|
2100 |
57287816 |
Phortox |
B |
July 18, 2019, 3:20 p.m. |
OK |
GNU C++17 |
TESTS |
75 |
31 |
13619200 |
|
2100 |
37633412 |
Simon7426 |
B |
April 26, 2018, 11:21 a.m. |
OK |
GNU C++17 |
TESTS |
75 |
31 |
14950400 |
|
2100 |
46297345 |
rareone0602 |
B |
Nov. 28, 2018, 4:26 a.m. |
OK |
GNU C++17 |
TESTS |
75 |
46 |
2764800 |
|
2100 |
41194938 |
.__. |
B |
Aug. 3, 2018, 11:22 p.m. |
OK |
GNU C++17 |
TESTS |
75 |
46 |
2969600 |
|
2100 |
68283288 |
paimon |
B |
Jan. 5, 2020, 5:37 p.m. |
OK |
GNU C++17 |
TESTS |
75 |
46 |
5734400 |
|
2100 |
67079923 |
pikapika00 |
B |
Dec. 17, 2019, 3:13 p.m. |
OK |
Java 11 |
TESTS |
75 |
248 |
18022400 |
|
2100 |
46632691 |
I_love_Harpae |
B |
Dec. 5, 2018, 4:33 a.m. |
OK |
Java 8 |
TESTS |
75 |
124 |
4096000 |
|
2100 |
69073004 |
fetetriste |
B |
Jan. 19, 2020, 12:09 a.m. |
OK |
Java 8 |
TESTS |
75 |
140 |
5632000 |
|
2100 |
47817697 |
xodiac |
B |
Jan. 1, 2019, 3:32 p.m. |
OK |
Java 8 |
TESTS |
75 |
155 |
15052800 |
|
2100 |
69983526 |
adarsh000321 |
B |
Feb. 1, 2020, 5:08 p.m. |
OK |
Java 8 |
TESTS |
75 |
156 |
4505600 |
|
2100 |
52741210 |
avijit_agarwal |
B |
April 14, 2019, 9:08 a.m. |
OK |
Java 8 |
TESTS |
75 |
156 |
15462400 |
|
2100 |
44712655 |
Ahmed.Shawky |
B |
Oct. 22, 2018, 7:37 p.m. |
OK |
Java 8 |
TESTS |
75 |
171 |
4505600 |
|
2100 |
34989682 |
donli |
B |
Feb. 7, 2018, 6:11 a.m. |
OK |
Java 8 |
TESTS |
75 |
171 |
38092800 |
|
2100 |
33434885 |
pranavps |
B |
Dec. 19, 2017, 5:31 p.m. |
OK |
Java 8 |
TESTS |
75 |
171 |
38400000 |
|
2100 |
45265232 |
Srinivasa_Ramanujan |
B |
Nov. 4, 2018, 5:28 a.m. |
OK |
Java 8 |
TESTS |
75 |
171 |
39833600 |
|
2100 |
45051889 |
guptautkarsh028 |
B |
Oct. 29, 2018, 11:06 a.m. |
OK |
Java 8 |
TESTS |
75 |
186 |
15462400 |
|
2100 |
58112947 |
vjudge1 |
B |
Aug. 1, 2019, 7:54 a.m. |
OK |
MS C++ |
TESTS |
75 |
46 |
10444800 |
|
2100 |
57916793 |
vjudge3 |
B |
July 29, 2019, 1:57 a.m. |
OK |
MS C++ |
TESTS |
75 |
46 |
11366400 |
|
2100 |
69013370 |
vjudge2 |
B |
Jan. 18, 2020, 4:31 a.m. |
OK |
MS C++ |
TESTS |
75 |
46 |
11571200 |
|
2100 |
57878906 |
vjudge1 |
B |
July 28, 2019, 6:50 a.m. |
OK |
MS C++ |
TESTS |
75 |
46 |
11571200 |
|
2100 |
57878636 |
vjudge5 |
B |
July 28, 2019, 6:44 a.m. |
OK |
MS C++ |
TESTS |
75 |
46 |
11571200 |
|
2100 |
57877502 |
vjudge5 |
B |
July 28, 2019, 6:12 a.m. |
OK |
MS C++ |
TESTS |
75 |
46 |
11571200 |
|
2100 |
57796035 |
vjudge5 |
B |
July 26, 2019, 11:26 a.m. |
OK |
MS C++ |
TESTS |
75 |
46 |
11571200 |
|
2100 |
57021608 |
vjudge1 |
B |
July 14, 2019, 2:21 p.m. |
OK |
MS C++ |
TESTS |
75 |
46 |
12288000 |
|
2100 |
47602736 |
vjudge1 |
B |
Dec. 28, 2018, 1:20 a.m. |
OK |
MS C++ |
TESTS |
75 |
46 |
22835200 |
|
2100 |
62374440 |
vjudge5 |
B |
Oct. 11, 2019, 4:47 p.m. |
OK |
MS C++ |
TESTS |
75 |
46 |
109260800 |
|
2100 |
57928044 |
vjudge3 |
B |
July 29, 2019, 7:47 a.m. |
OK |
MS C++ 2017 |
TESTS |
75 |
46 |
11366400 |
|
2100 |
57925278 |
vjudge1 |
B |
July 29, 2019, 6:52 a.m. |
OK |
MS C++ 2017 |
TESTS |
75 |
46 |
11366400 |
|
2100 |
54510967 |
llmxby |
B |
May 23, 2019, 7:05 a.m. |
OK |
MS C++ 2017 |
TESTS |
75 |
46 |
54272000 |
|
2100 |
62320024 |
chinhhhh |
B |
Oct. 10, 2019, 4:26 p.m. |
OK |
MS C++ 2017 |
TESTS |
75 |
62 |
11571200 |
|
2100 |
54699556 |
pajenegod |
B |
May 26, 2019, 9:37 p.m. |
OK |
PyPy 2 |
TESTS |
75 |
187 |
11366400 |
|
2100 |
39957606 |
pavankatta |
B |
July 4, 2018, 1:58 p.m. |
OK |
PyPy 2 |
TESTS |
75 |
529 |
20275200 |
|
2100 |
67180673 |
iori_oikawa |
B |
Dec. 18, 2019, 10:44 p.m. |
OK |
Python 3 |
TESTS |
75 |
763 |
22528000 |
|
2100 |
remove filters
Back to search problems