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'As behooves any intelligent schoolboy, Kevin Sun is studying psycowlogy, cowculus, and cryptcowgraphy at the Bovinia State University (BGU) under Farmer Ivan. During his Mathematics of Olympiads (MoO) class, Kevin was confronted with a weird functional equation and needs your help. For two fixed integers k and p, where p is an odd prime number, the functional equation states that for some function . (This equation should hold for any integer x in the range 0 to p xe2 x80 x89- xe2 x80 x891, inclusive.) It turns out that f can actually be many different functions. Instead of finding a solution, Kevin wants you to count the number of distinct functions f that satisfy this equation. Since the answer may be very large, you should print your result modulo 109 xe2 x80 x89+ xe2 x80 x897. The input consists of two space-separated integers p and k (3 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89p xe2 x80 x89 xe2 x89 xa4 xe2 x80 x891 xe2 x80 x89000 xe2 x80 x89000, 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89p xe2 x80 x89- xe2 x80 x891) on a single line. It is guaranteed that p is an odd prime number. Print a single integer, the number of distinct functions f modulo 109 xe2 x80 x89+ xe2 x80 x897. In the first sample, p xe2 x80 x89= xe2 x80 x893 and k xe2 x80 x89= xe2 x80 x892. The following functions work: '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
14608224 |
Gassa |
B |
Dec. 1, 2015, 9:02 p.m. |
OK |
D |
TESTS |
54 |
30 |
0 |
|
2000 |
14597739 |
Gassa |
B |
Dec. 1, 2015, 4:48 p.m. |
OK |
D |
TESTS |
54 |
30 |
0 |
|
2000 |
14618864 |
ruban |
B |
Dec. 2, 2015, 12:30 p.m. |
OK |
Delphi |
TESTS |
54 |
156 |
0 |
|
2000 |
14607138 |
TheHedgehog |
B |
Dec. 1, 2015, 7:41 p.m. |
OK |
Delphi |
TESTS |
54 |
390 |
19148800 |
|
2000 |
14619299 |
ez_zkj |
B |
Dec. 2, 2015, 12:54 p.m. |
OK |
FPC |
TESTS |
54 |
46 |
14028800 |
|
2000 |
15819526 |
quangminhhlrv |
B |
Feb. 5, 2016, 6:25 a.m. |
OK |
FPC |
TESTS |
54 |
46 |
14233600 |
|
2000 |
14743396 |
FrostStar |
B |
Dec. 10, 2015, 12:27 p.m. |
OK |
FPC |
TESTS |
54 |
93 |
20582400 |
|
2000 |
15325402 |
ghostriderhp99 |
B |
Jan. 13, 2016, 3:21 a.m. |
OK |
FPC |
TESTS |
54 |
561 |
31539200 |
|
2000 |
14604025 |
hashlife |
B |
Dec. 1, 2015, 5:49 p.m. |
OK |
GNU C |
TESTS |
54 |
31 |
1024000 |
|
2000 |
20186506 |
Who1 |
B |
Aug. 27, 2016, 2:55 a.m. |
OK |
GNU C |
TESTS |
54 |
31 |
2867200 |
|
2000 |
15898791 |
rchehab |
B |
Feb. 8, 2016, 4:17 p.m. |
OK |
GNU C |
TESTS |
54 |
31 |
3993600 |
|
2000 |
14608009 |
sgtlaugh |
B |
Dec. 1, 2015, 8:43 p.m. |
OK |
GNU C |
TESTS |
54 |
31 |
3993600 |
|
2000 |
19434426 |
vjudge3 |
B |
July 27, 2016, 6:10 a.m. |
OK |
GNU C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
19281133 |
SoiMae |
B |
July 20, 2016, 1:10 p.m. |
OK |
GNU C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
18567684 |
abcdeedcba |
B |
June 17, 2016, 11:17 p.m. |
OK |
GNU C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
16561196 |
Ioser |
B |
March 7, 2016, 6:59 a.m. |
OK |
GNU C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
16229342 |
yang12138 |
B |
Feb. 20, 2016, 1:13 p.m. |
OK |
GNU C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
15625627 |
RNS3 |
B |
Jan. 28, 2016, 8:55 a.m. |
OK |
GNU C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
15625623 |
RNS3 |
B |
Jan. 28, 2016, 8:55 a.m. |
OK |
GNU C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
18755732 |
CAEASAR |
B |
June 27, 2016, 5 p.m. |
OK |
GNU C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
20757850 |
AkaneSasu |
B |
Sept. 19, 2016, 2:23 p.m. |
OK |
GNU C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
20420876 |
hanjitao |
B |
Sept. 6, 2016, 3:07 p.m. |
OK |
GNU C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
57115567 |
rainboy |
B |
July 15, 2019, 7:52 p.m. |
OK |
GNU C11 |
TESTS |
54 |
31 |
31948800 |
|
2000 |
19208867 |
_h_ |
B |
July 18, 2016, 9:47 a.m. |
OK |
GNU C++11 |
TESTS |
54 |
15 |
0 |
|
2000 |
20255821 |
D_xcj |
B |
Aug. 29, 2016, 3:10 p.m. |
OK |
GNU C++11 |
TESTS |
54 |
15 |
0 |
|
2000 |
19434813 |
vjudge5 |
B |
July 27, 2016, 6:36 a.m. |
OK |
GNU C++11 |
TESTS |
54 |
15 |
0 |
|
2000 |
19391893 |
pwild |
B |
July 25, 2016, 1:29 a.m. |
OK |
GNU C++11 |
TESTS |
54 |
15 |
0 |
|
2000 |
19256743 |
Seiche |
B |
July 19, 2016, 3:40 p.m. |
OK |
GNU C++11 |
TESTS |
54 |
15 |
0 |
|
2000 |
18979802 |
semiexp |
B |
July 9, 2016, 5:44 a.m. |
OK |
GNU C++11 |
TESTS |
54 |
15 |
0 |
|
2000 |
16272211 |
TylerX |
B |
Feb. 22, 2016, 6:39 a.m. |
OK |
GNU C++11 |
TESTS |
54 |
15 |
0 |
|
2000 |
16134430 |
imrusty |
B |
Feb. 18, 2016, 12:55 a.m. |
OK |
GNU C++11 |
TESTS |
54 |
15 |
0 |
|
2000 |
16020778 |
ko_osaga |
B |
Feb. 14, 2016, 4:29 p.m. |
OK |
GNU C++11 |
TESTS |
54 |
15 |
0 |
|
2000 |
15956782 |
konstantin_013 |
B |
Feb. 11, 2016, 1:34 p.m. |
OK |
GNU C++11 |
TESTS |
54 |
15 |
0 |
|
2000 |
22212756 |
msmlkm |
B |
Nov. 14, 2016, 7:09 p.m. |
OK |
GNU C++14 |
TESTS |
54 |
15 |
0 |
|
2000 |
52252502 |
vjudge2 |
B |
April 3, 2019, 2:15 a.m. |
OK |
GNU C++14 |
TESTS |
54 |
15 |
0 |
|
2000 |
27484681 |
Tooc0ld |
B |
June 1, 2017, 12:37 p.m. |
OK |
GNU C++14 |
TESTS |
54 |
15 |
1024000 |
|
2000 |
33664119 |
adityakumar3811 |
B |
Dec. 27, 2017, 8:31 a.m. |
OK |
GNU C++14 |
TESTS |
54 |
15 |
1945600 |
|
2000 |
32990860 |
Jeffrey |
B |
Dec. 7, 2017, 2:54 a.m. |
OK |
GNU C++14 |
TESTS |
54 |
15 |
1945600 |
|
2000 |
28820032 |
fengye1998 |
B |
July 24, 2017, 9:03 a.m. |
OK |
GNU C++14 |
TESTS |
54 |
15 |
1945600 |
|
2000 |
22788134 |
N00 |
B |
Dec. 7, 2016, 2:02 p.m. |
OK |
GNU C++14 |
TESTS |
54 |
15 |
1945600 |
|
2000 |
34923475 |
Genlian |
B |
Feb. 4, 2018, 12:55 p.m. |
OK |
GNU C++14 |
TESTS |
54 |
15 |
1945600 |
|
2000 |
35736852 |
Hiren.Vaghela |
B |
Feb. 26, 2018, 3:27 p.m. |
OK |
GNU C++14 |
TESTS |
54 |
15 |
2048000 |
|
2000 |
26706962 |
mavd09 |
B |
April 27, 2017, 4:52 p.m. |
OK |
GNU C++14 |
TESTS |
54 |
15 |
3891200 |
|
2000 |
67483168 |
AM. |
B |
Dec. 23, 2019, 4:36 p.m. |
OK |
GNU C++17 |
TESTS |
54 |
31 |
0 |
|
2000 |
67245094 |
squarepants |
B |
Dec. 19, 2019, 5:03 p.m. |
OK |
GNU C++17 |
TESTS |
54 |
31 |
0 |
|
2000 |
66171193 |
tinca_matei |
B |
Dec. 2, 2019, 10:28 a.m. |
OK |
GNU C++17 |
TESTS |
54 |
31 |
0 |
|
2000 |
64070446 |
zeus_orz |
B |
Nov. 2, 2019, 7:13 a.m. |
OK |
GNU C++17 |
TESTS |
54 |
31 |
0 |
|
2000 |
61513236 |
ACraider |
B |
Sept. 29, 2019, 4:38 p.m. |
OK |
GNU C++17 |
TESTS |
54 |
31 |
0 |
|
2000 |
60906558 |
Anaya99 |
B |
Sept. 20, 2019, 2:58 a.m. |
OK |
GNU C++17 |
TESTS |
54 |
31 |
0 |
|
2000 |
57821463 |
jt_112 |
B |
July 26, 2019, 11:40 p.m. |
OK |
GNU C++17 |
TESTS |
54 |
31 |
0 |
|
2000 |
56044017 |
khaled.farouk_2 |
B |
June 25, 2019, 3:41 p.m. |
OK |
GNU C++17 |
TESTS |
54 |
31 |
0 |
|
2000 |
54992179 |
kiowords |
B |
June 2, 2019, 7:36 p.m. |
OK |
GNU C++17 |
TESTS |
54 |
31 |
0 |
|
2000 |
67984229 |
Jester |
B |
Dec. 30, 2019, 9:09 p.m. |
OK |
GNU C++17 |
TESTS |
54 |
31 |
0 |
|
2000 |
15177572 |
exentropy |
B |
Jan. 4, 2016, 5:43 a.m. |
OK |
Haskell |
TESTS |
54 |
171 |
21196800 |
|
2000 |
14587753 |
Petr |
B |
Dec. 1, 2015, 3:46 p.m. |
OK |
Java 7 |
TESTS |
54 |
109 |
0 |
|
2000 |
15989038 |
lucasr |
B |
Feb. 13, 2016, 2:55 p.m. |
OK |
Java 7 |
TESTS |
54 |
124 |
0 |
|
2000 |
15339423 |
riversouther |
B |
Jan. 14, 2016, 3:17 a.m. |
OK |
Java 7 |
TESTS |
54 |
124 |
0 |
|
2000 |
14933959 |
thisisausername11235 |
B |
Dec. 23, 2015, 6:25 a.m. |
OK |
Java 7 |
TESTS |
54 |
124 |
0 |
|
2000 |
14593025 |
fromWork |
B |
Dec. 1, 2015, 4:14 p.m. |
OK |
Java 7 |
TESTS |
54 |
124 |
0 |
|
2000 |
14601108 |
tehqin |
B |
Dec. 1, 2015, 5:16 p.m. |
OK |
Java 7 |
TESTS |
54 |
139 |
0 |
|
2000 |
14705384 |
thangminh.le208 |
B |
Dec. 9, 2015, 1:02 a.m. |
OK |
Java 7 |
TESTS |
54 |
140 |
0 |
|
2000 |
14677176 |
partizan22 |
B |
Dec. 6, 2015, 3:01 p.m. |
OK |
Java 7 |
TESTS |
54 |
140 |
0 |
|
2000 |
14961903 |
xiaowuc1 |
B |
Dec. 24, 2015, 12:37 a.m. |
OK |
Java 7 |
TESTS |
54 |
156 |
0 |
|
2000 |
14617015 |
EdithMeh |
B |
Dec. 2, 2015, 10:37 a.m. |
OK |
Java 7 |
TESTS |
54 |
187 |
0 |
|
2000 |
14608702 |
AlexFetisov |
B |
Dec. 1, 2015, 9:56 p.m. |
OK |
Java 8 |
TESTS |
54 |
108 |
0 |
|
2000 |
15508695 |
Empress |
B |
Jan. 23, 2016, 6:14 a.m. |
OK |
Java 8 |
TESTS |
54 |
109 |
0 |
|
2000 |
15194865 |
ahmetyalp |
B |
Jan. 5, 2016, 6:58 p.m. |
OK |
Java 8 |
TESTS |
54 |
109 |
0 |
|
2000 |
61593114 |
Nutella3000 |
B |
Oct. 1, 2019, 7:45 a.m. |
OK |
Java 8 |
TESTS |
54 |
124 |
0 |
|
2000 |
14639952 |
mkirsche |
B |
Dec. 3, 2015, 9:03 p.m. |
OK |
Java 8 |
TESTS |
54 |
124 |
0 |
|
2000 |
14608868 |
ahmetyalp |
B |
Dec. 1, 2015, 10:19 p.m. |
OK |
Java 8 |
TESTS |
54 |
124 |
0 |
|
2000 |
14603862 |
yarrr |
B |
Dec. 1, 2015, 5:46 p.m. |
OK |
Java 8 |
TESTS |
54 |
124 |
0 |
|
2000 |
14592013 |
Lewin |
B |
Dec. 1, 2015, 4:08 p.m. |
OK |
Java 8 |
TESTS |
54 |
124 |
0 |
|
2000 |
14591544 |
Sergey.Bankevich |
B |
Dec. 1, 2015, 4:05 p.m. |
OK |
Java 8 |
TESTS |
54 |
124 |
0 |
|
2000 |
19918573 |
hama-du |
B |
Aug. 17, 2016, 2:59 a.m. |
OK |
Java 8 |
TESTS |
54 |
124 |
20172800 |
|
2000 |
14604263 |
azukun |
B |
Dec. 1, 2015, 6:01 p.m. |
OK |
MS C# |
TESTS |
54 |
77 |
1228800 |
|
2000 |
15748599 |
Maks_DP |
B |
Feb. 2, 2016, 11:13 a.m. |
OK |
MS C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
14859806 |
Xhark |
B |
Dec. 18, 2015, 11:28 a.m. |
OK |
MS C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
14757410 |
fA1sEr |
B |
Dec. 11, 2015, 12:21 p.m. |
OK |
MS C++ |
TESTS |
54 |
15 |
0 |
|
2000 |
15161979 |
kinol |
B |
Jan. 2, 2016, 7:12 p.m. |
OK |
MS C++ |
TESTS |
54 |
30 |
0 |
|
2000 |
14832865 |
Musuccess |
B |
Dec. 16, 2015, 10:49 a.m. |
OK |
MS C++ |
TESTS |
54 |
30 |
0 |
|
2000 |
15212980 |
Sandmann |
B |
Jan. 6, 2016, 5:59 p.m. |
OK |
MS C++ |
TESTS |
54 |
31 |
1024000 |
|
2000 |
14695637 |
sereja589 |
B |
Dec. 8, 2015, 9:04 a.m. |
OK |
MS C++ |
TESTS |
54 |
31 |
1024000 |
|
2000 |
14618050 |
izban |
B |
Dec. 2, 2015, 11:42 a.m. |
OK |
MS C++ |
TESTS |
54 |
31 |
1024000 |
|
2000 |
14596837 |
TonySnark |
B |
Dec. 1, 2015, 4:41 p.m. |
OK |
MS C++ |
TESTS |
54 |
31 |
1024000 |
|
2000 |
14615061 |
arkahjp |
B |
Dec. 2, 2015, 8:39 a.m. |
OK |
MS C++ |
TESTS |
54 |
31 |
7372800 |
|
2000 |
17376454 |
TokuchiToa |
B |
April 18, 2016, 1:18 p.m. |
OK |
PyPy 2 |
TESTS |
54 |
108 |
44748800 |
|
2000 |
50641633 |
YESMAths |
B |
March 1, 2019, 2:10 p.m. |
OK |
PyPy 2 |
TESTS |
54 |
171 |
4812800 |
|
2000 |
50641321 |
YESMAths |
B |
March 1, 2019, 2:03 p.m. |
OK |
PyPy 2 |
TESTS |
54 |
187 |
4300800 |
|
2000 |
35895952 |
_____k_____ |
B |
March 3, 2018, 4:57 p.m. |
OK |
PyPy 3 |
TESTS |
54 |
78 |
19968000 |
|
2000 |
35895359 |
______n______ |
B |
March 3, 2018, 4:41 p.m. |
OK |
PyPy 3 |
TESTS |
54 |
78 |
19968000 |
|
2000 |
35895103 |
______u______ |
B |
March 3, 2018, 4:35 p.m. |
OK |
PyPy 3 |
TESTS |
54 |
78 |
19968000 |
|
2000 |
35894866 |
_____i_____ |
B |
March 3, 2018, 4:30 p.m. |
OK |
PyPy 3 |
TESTS |
54 |
78 |
19968000 |
|
2000 |
35886704 |
______h______ |
B |
March 3, 2018, 1:51 p.m. |
OK |
PyPy 3 |
TESTS |
54 |
78 |
19968000 |
|
2000 |
35886257 |
______k______ |
B |
March 3, 2018, 1:43 p.m. |
OK |
PyPy 3 |
TESTS |
54 |
78 |
19968000 |
|
2000 |
35885431 |
______i______ |
B |
March 3, 2018, 1:28 p.m. |
OK |
PyPy 3 |
TESTS |
54 |
78 |
19968000 |
|
2000 |
35883500 |
______M______ |
B |
March 3, 2018, 12:56 p.m. |
OK |
PyPy 3 |
TESTS |
54 |
78 |
19968000 |
|
2000 |
23026922 |
cugel |
B |
Dec. 16, 2016, 10:35 a.m. |
OK |
PyPy 3 |
TESTS |
54 |
139 |
307200 |
|
2000 |
22947877 |
Yash_ |
B |
Dec. 14, 2016, 12:07 p.m. |
OK |
PyPy 3 |
TESTS |
54 |
139 |
307200 |
|
2000 |
14942509 |
lemur |
B |
Dec. 23, 2015, 4:42 p.m. |
OK |
Python 2 |
TESTS |
54 |
61 |
0 |
|
2000 |
19175694 |
jtnydv25 |
B |
July 16, 2016, 3:16 p.m. |
OK |
Python 2 |
TESTS |
54 |
280 |
0 |
|
2000 |
14706493 |
fanlove |
B |
Dec. 9, 2015, 5:24 a.m. |
OK |
Python 2 |
TESTS |
54 |
312 |
0 |
|
2000 |
14590964 |
nwi |
B |
Dec. 1, 2015, 4:02 p.m. |
OK |
Python 2 |
TESTS |
54 |
327 |
0 |
|
2000 |
15230329 |
Cozma_Tudor |
B |
Jan. 7, 2016, 9:22 p.m. |
OK |
Python 2 |
TESTS |
54 |
343 |
16384000 |
|
2000 |
14930542 |
Ljubitel |
B |
Dec. 22, 2015, 8:44 p.m. |
OK |
Python 2 |
TESTS |
54 |
748 |
3993600 |
|
2000 |
15159473 |
aboura |
B |
Jan. 2, 2016, 2:33 p.m. |
OK |
Python 3 |
TESTS |
54 |
265 |
0 |
|
2000 |
42128199 |
Mk_Python_v1 |
B |
Aug. 26, 2018, 4:39 p.m. |
OK |
Python 3 |
TESTS |
54 |
327 |
0 |
|
2000 |
25778302 |
platypus179 |
B |
March 24, 2017, 4:23 p.m. |
OK |
Python 3 |
TESTS |
54 |
701 |
44032000 |
|
2000 |
remove filters
Back to search problems