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"Gregor is learning about RSA cryptography, and although he doesn't understand how RSA works, he is now fascinated with prime numbers and factoring them. Gregor's favorite prime number is P . Gregor wants to find two bases of P . Formally, Gregor is looking for two integers a and b which satisfy both of the following properties. Help Gregor find two bases of his favorite prime number! Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 1000 ). Each subsequent line contains the integer P ( 5 <= P <= {10}^9 ), with P guaranteed to be prime. Your output should consist of t lines. Each line should consist of two integers a and b ( 2 <= a < b <= P ). If there are multiple possible solutions, print any. The first query is P=17 . a=3 and b=5 are valid bases in this case, because 17 bmod 3 = 17 bmod 5 = 2 . There are other pairs which work as well. In the second query, with P=5 , the only solution is a=2 and b=4 . "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
124628902 |
fpc_coder |
A |
Aug. 2, 2021, 1:21 a.m. |
OK |
FPC |
TESTS |
20 |
31 |
3481600 |
|
|
124636744 |
some_canines |
A |
Aug. 2, 2021, 3:21 a.m. |
OK |
GNU C11 |
TESTS |
20 |
30 |
3686400 |
|
|
124597001 |
MohamedHamed123 |
A |
Aug. 1, 2021, 4:43 p.m. |
OK |
GNU C11 |
TESTS |
20 |
31 |
3686400 |
|
|
124627102 |
patil98varad |
A |
Aug. 2, 2021, 12:43 a.m. |
OK |
GNU C11 |
TESTS |
20 |
31 |
3686400 |
|
|
124634866 |
dushyantist |
A |
Aug. 2, 2021, 2:56 a.m. |
OK |
GNU C11 |
TESTS |
20 |
31 |
3686400 |
|
|
124641417 |
Rit_en_on_rock |
A |
Aug. 2, 2021, 4:24 a.m. |
OK |
GNU C11 |
TESTS |
20 |
31 |
3686400 |
|
|
124642787 |
H_a_c_kcode_gaurav |
A |
Aug. 2, 2021, 4:42 a.m. |
OK |
GNU C11 |
TESTS |
20 |
31 |
3686400 |
|
|
124647187 |
Akshat24 |
A |
Aug. 2, 2021, 5:34 a.m. |
OK |
GNU C11 |
TESTS |
20 |
31 |
3686400 |
|
|
124648453 |
gm.nayeem533 |
A |
Aug. 2, 2021, 5:49 a.m. |
OK |
GNU C11 |
TESTS |
20 |
31 |
3686400 |
|
|
124647390 |
afroja_akter |
A |
Aug. 2, 2021, 5:37 a.m. |
OK |
GNU C11 |
TESTS |
20 |
46 |
3686400 |
|
|
124644634 |
Fresca |
A |
Aug. 2, 2021, 5:07 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
15 |
3686400 |
|
|
124630384 |
sjr2008 |
A |
Aug. 2, 2021, 1:49 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
15 |
3686400 |
|
|
124628383 |
qingchan |
A |
Aug. 2, 2021, 1:10 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
15 |
3686400 |
|
|
124634777 |
KEPADEDAIDAI |
A |
Aug. 2, 2021, 2:54 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
15 |
3891200 |
|
|
124630557 |
yyz |
A |
Aug. 2, 2021, 1:52 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
15 |
3891200 |
|
|
124629065 |
chuuyasang |
A |
Aug. 2, 2021, 1:24 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
15 |
3891200 |
|
|
124626809 |
never_stop_rating |
A |
Aug. 2, 2021, 12:36 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
15 |
3891200 |
|
|
124624510 |
ruccs |
A |
Aug. 1, 2021, 11:25 p.m. |
OK |
GNU C++11 |
TESTS |
20 |
15 |
3891200 |
|
|
124647118 |
Raahaat |
A |
Aug. 2, 2021, 5:34 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
15 |
3891200 |
|
|
124637215 |
dqhl76 |
A |
Aug. 2, 2021, 3:28 a.m. |
OK |
GNU C++11 |
TESTS |
20 |
15 |
3891200 |
|
|
124640729 |
ritanarulabhatia |
A |
Aug. 2, 2021, 4:15 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
15 |
3686400 |
|
|
124643229 |
RiyaG |
A |
Aug. 2, 2021, 4:48 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
15 |
3686400 |
|
|
124615596 |
mraron |
A |
Aug. 1, 2021, 8:09 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
15 |
3686400 |
|
|
124619625 |
Coding_krni_h |
A |
Aug. 1, 2021, 9:11 p.m. |
OK |
GNU C++14 |
TESTS |
20 |
15 |
3686400 |
|
|
124628394 |
AnuragPatra |
A |
Aug. 2, 2021, 1:10 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
15 |
3686400 |
|
|
124639918 |
juan123 |
A |
Aug. 2, 2021, 4:05 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
15 |
3686400 |
|
|
124640031 |
rabby_061 |
A |
Aug. 2, 2021, 4:06 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
15 |
3788800 |
|
|
124632859 |
Froshine |
A |
Aug. 2, 2021, 2:28 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
15 |
3788800 |
|
|
124642071 |
2019eeb1184 |
A |
Aug. 2, 2021, 4:32 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
15 |
3788800 |
|
|
124633041 |
imas_713_a |
A |
Aug. 2, 2021, 2:30 a.m. |
OK |
GNU C++14 |
TESTS |
20 |
15 |
3788800 |
|
|
124622012 |
zzar |
A |
Aug. 1, 2021, 10:07 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
15 |
3686400 |
|
|
124637696 |
NeverMindVampire |
A |
Aug. 2, 2021, 3:34 a.m. |
OK |
GNU C++17 |
TESTS |
20 |
15 |
3686400 |
|
|
124637091 |
ibnmouserakib |
A |
Aug. 2, 2021, 3:26 a.m. |
OK |
GNU C++17 |
TESTS |
20 |
15 |
3686400 |
|
|
124631453 |
cslgz09419122 |
A |
Aug. 2, 2021, 2:06 a.m. |
OK |
GNU C++17 |
TESTS |
20 |
15 |
3686400 |
|
|
124626673 |
ken2k |
A |
Aug. 2, 2021, 12:33 a.m. |
OK |
GNU C++17 |
TESTS |
20 |
15 |
3686400 |
|
|
124625726 |
micticgohan |
A |
Aug. 2, 2021, 12:07 a.m. |
OK |
GNU C++17 |
TESTS |
20 |
15 |
3686400 |
|
|
124624827 |
NayemVai |
A |
Aug. 1, 2021, 11:36 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
15 |
3686400 |
|
|
124617288 |
ayerhs_7 |
A |
Aug. 1, 2021, 8:31 p.m. |
OK |
GNU C++17 |
TESTS |
20 |
15 |
3686400 |
|
|
124648524 |
suryam35 |
A |
Aug. 2, 2021, 5:50 a.m. |
OK |
GNU C++17 |
TESTS |
20 |
15 |
3788800 |
|
|
124648893 |
harishkv11 |
A |
Aug. 2, 2021, 5:54 a.m. |
OK |
GNU C++17 |
TESTS |
20 |
15 |
3788800 |
|
|
124624977 |
fr1234 |
A |
Aug. 1, 2021, 11:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
20 |
15 |
4300800 |
|
|
124621073 |
tourist_ki_ammi_meri |
A |
Aug. 1, 2021, 9:43 p.m. |
OK |
GNU C++17 (64) |
TESTS |
20 |
15 |
4300800 |
|
|
124632741 |
array_987 |
A |
Aug. 2, 2021, 2:26 a.m. |
OK |
GNU C++17 (64) |
TESTS |
20 |
15 |
4300800 |
|
|
124634613 |
Absinthium |
A |
Aug. 2, 2021, 2:52 a.m. |
OK |
GNU C++17 (64) |
TESTS |
20 |
15 |
4300800 |
|
|
124635920 |
tushar2805 |
A |
Aug. 2, 2021, 3:10 a.m. |
OK |
GNU C++17 (64) |
TESTS |
20 |
15 |
4300800 |
|
|
124638937 |
BikAsh007 |
A |
Aug. 2, 2021, 3:52 a.m. |
OK |
GNU C++17 (64) |
TESTS |
20 |
15 |
4300800 |
|
|
124640010 |
sanzen_sekai |
A |
Aug. 2, 2021, 4:06 a.m. |
OK |
GNU C++17 (64) |
TESTS |
20 |
15 |
4300800 |
|
|
124643202 |
Chet8n |
A |
Aug. 2, 2021, 4:48 a.m. |
OK |
GNU C++17 (64) |
TESTS |
20 |
15 |
4300800 |
|
|
124629975 |
Wise_4 |
A |
Aug. 2, 2021, 1:42 a.m. |
OK |
GNU C++17 (64) |
TESTS |
20 |
15 |
4300800 |
|
|
124626325 |
MazenBatrawi |
A |
Aug. 2, 2021, 12:24 a.m. |
OK |
GNU C++17 (64) |
TESTS |
20 |
15 |
4300800 |
|
|
124633607 |
huangxuepeng |
A |
Aug. 2, 2021, 2:37 a.m. |
OK |
Go |
TESTS |
20 |
61 |
10649600 |
|
|
124616194 |
artsin666 |
A |
Aug. 1, 2021, 8:18 p.m. |
OK |
Haskell |
TESTS |
20 |
30 |
11571200 |
|
|
124614647 |
artsin666 |
A |
Aug. 1, 2021, 8:02 p.m. |
OK |
Haskell |
TESTS |
20 |
31 |
11571200 |
|
|
124615435 |
Kariem.Taha |
A |
Aug. 1, 2021, 8:08 p.m. |
OK |
Haskell |
TESTS |
20 |
31 |
11673600 |
|
|
124616278 |
Kariem.Taha |
A |
Aug. 1, 2021, 8:18 p.m. |
OK |
Haskell |
TESTS |
20 |
31 |
11673600 |
|
|
124615827 |
Kariem.Taha |
A |
Aug. 1, 2021, 8:12 p.m. |
OK |
Haskell |
TESTS |
20 |
31 |
11673600 |
|
|
124614779 |
folsatraptai |
A |
Aug. 1, 2021, 8:03 p.m. |
OK |
Java 11 |
TESTS |
20 |
186 |
23961600 |
|
|
124648178 |
Sanju_250406 |
A |
Aug. 2, 2021, 5:46 a.m. |
OK |
Java 11 |
TESTS |
20 |
187 |
23961600 |
|
|
124617811 |
tushar19280 |
A |
Aug. 1, 2021, 8:39 p.m. |
OK |
Java 11 |
TESTS |
20 |
202 |
23961600 |
|
|
124644421 |
SaberXpro |
A |
Aug. 2, 2021, 5:05 a.m. |
OK |
Java 11 |
TESTS |
20 |
202 |
23961600 |
|
|
124637658 |
tridang |
A |
Aug. 2, 2021, 3:34 a.m. |
OK |
Java 11 |
TESTS |
20 |
202 |
23961600 |
|
|
124621383 |
DylanSmith |
A |
Aug. 1, 2021, 9:51 p.m. |
OK |
Java 11 |
TESTS |
20 |
202 |
23961600 |
|
|
124619730 |
dhruva.chayapathy |
A |
Aug. 1, 2021, 9:13 p.m. |
OK |
Java 11 |
TESTS |
20 |
202 |
23961600 |
|
|
124645344 |
Tharun0102 |
A |
Aug. 2, 2021, 5:16 a.m. |
OK |
Java 11 |
TESTS |
20 |
202 |
24064000 |
|
|
124649041 |
cockingdan |
A |
Aug. 2, 2021, 5:56 a.m. |
OK |
Java 11 |
TESTS |
20 |
202 |
24064000 |
|
|
124617883 |
Restricted |
A |
Aug. 1, 2021, 8:40 p.m. |
OK |
Java 11 |
TESTS |
20 |
202 |
24064000 |
|
|
124632032 |
Akshay211 |
A |
Aug. 2, 2021, 2:15 a.m. |
OK |
Java 8 |
TESTS |
20 |
108 |
20377600 |
|
|
124637666 |
TheKingInTheNorth |
A |
Aug. 2, 2021, 3:34 a.m. |
OK |
Java 8 |
TESTS |
20 |
109 |
20480000 |
|
|
124616252 |
dev_14 |
A |
Aug. 1, 2021, 8:18 p.m. |
OK |
Java 8 |
TESTS |
20 |
124 |
20480000 |
|
|
124645301 |
less_ordinary |
A |
Aug. 2, 2021, 5:16 a.m. |
OK |
Java 8 |
TESTS |
20 |
124 |
20480000 |
|
|
124634965 |
edenSpace |
A |
Aug. 2, 2021, 2:57 a.m. |
OK |
Java 8 |
TESTS |
20 |
124 |
20480000 |
|
|
124632866 |
shivamjha20332 |
A |
Aug. 2, 2021, 2:28 a.m. |
OK |
Java 8 |
TESTS |
20 |
124 |
20480000 |
|
|
124630872 |
krishnareddy.nancheri |
A |
Aug. 2, 2021, 1:57 a.m. |
OK |
Java 8 |
TESTS |
20 |
124 |
20480000 |
|
|
124622761 |
Zicko-77 |
A |
Aug. 1, 2021, 10:29 p.m. |
OK |
Java 8 |
TESTS |
20 |
124 |
20480000 |
|
|
124622042 |
RonWonWon |
A |
Aug. 1, 2021, 10:08 p.m. |
OK |
Java 8 |
TESTS |
20 |
124 |
20480000 |
|
|
124635757 |
Gurtej |
A |
Aug. 2, 2021, 3:08 a.m. |
OK |
Java 8 |
TESTS |
20 |
139 |
20480000 |
|
|
124645246 |
not_original |
A |
Aug. 2, 2021, 5:15 a.m. |
OK |
JavaScript |
TESTS |
20 |
46 |
6963200 |
|
|
124622331 |
adam.arabicbooks |
A |
Aug. 1, 2021, 10:16 p.m. |
OK |
JavaScript |
TESTS |
20 |
46 |
6963200 |
|
|
124619639 |
Anuranjan |
A |
Aug. 1, 2021, 9:12 p.m. |
OK |
Kotlin |
TESTS |
20 |
124 |
20582400 |
|
|
124634486 |
huy.caohuyhuy123 |
A |
Aug. 2, 2021, 2:50 a.m. |
OK |
Kotlin |
TESTS |
20 |
124 |
20582400 |
|
|
124615944 |
koper |
A |
Aug. 1, 2021, 8:13 p.m. |
OK |
Kotlin |
TESTS |
20 |
139 |
20992000 |
|
|
124646846 |
eurler |
A |
Aug. 2, 2021, 5:30 a.m. |
OK |
MS C++ |
TESTS |
20 |
31 |
3891200 |
|
|
124628582 |
sgly33 |
A |
Aug. 2, 2021, 1:14 a.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
30 |
3788800 |
|
|
124639951 |
Ethereal. |
A |
Aug. 2, 2021, 4:05 a.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
31 |
3686400 |
|
|
124645230 |
seuangelfish |
A |
Aug. 2, 2021, 5:15 a.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
31 |
3686400 |
|
|
124628752 |
sgly33 |
A |
Aug. 2, 2021, 1:17 a.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
31 |
3686400 |
|
|
124627613 |
zhangpangpang |
A |
Aug. 2, 2021, 12:55 a.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
31 |
3686400 |
|
|
124636192 |
_confidence |
A |
Aug. 2, 2021, 3:14 a.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
31 |
3788800 |
|
|
124635951 |
spacebytes |
A |
Aug. 2, 2021, 3:11 a.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
31 |
3788800 |
|
|
124614679 |
Amosh_ |
A |
Aug. 1, 2021, 8:03 p.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
31 |
3788800 |
|
|
124597676 |
chronos19rus |
A |
Aug. 1, 2021, 4:45 p.m. |
OK |
MS C++ 2017 |
TESTS |
20 |
31 |
3788800 |
|
|
124639063 |
fym |
A |
Aug. 2, 2021, 3:54 a.m. |
OK |
.NET Core C# |
TESTS |
20 |
108 |
11571200 |
|
|
124626787 |
henrychenOutlook |
A |
Aug. 2, 2021, 12:36 a.m. |
OK |
Node.js |
TESTS |
20 |
93 |
14848000 |
|
|
124647233 |
Keshav_Garg |
A |
Aug. 2, 2021, 5:35 a.m. |
OK |
PyPy 3 |
TESTS |
20 |
124 |
22630400 |
|
|
124646333 |
Keshav_Garg |
A |
Aug. 2, 2021, 5:24 a.m. |
OK |
PyPy 3 |
TESTS |
20 |
124 |
22630400 |
|
|
124619643 |
snip_tusher |
A |
Aug. 1, 2021, 9:12 p.m. |
OK |
PyPy 3 |
TESTS |
20 |
124 |
22630400 |
|
|
124647189 |
akanodia11 |
A |
Aug. 2, 2021, 5:34 a.m. |
OK |
PyPy 3 |
TESTS |
20 |
124 |
22937600 |
|
|
124646447 |
Keshav_Garg |
A |
Aug. 2, 2021, 5:25 a.m. |
OK |
PyPy 3 |
TESTS |
20 |
124 |
22937600 |
|
|
124638482 |
edusanketdk |
A |
Aug. 2, 2021, 3:46 a.m. |
OK |
PyPy 3 |
TESTS |
20 |
124 |
23449600 |
|
|
124616690 |
_aadiupadhyay_ |
A |
Aug. 1, 2021, 8:24 p.m. |
OK |
PyPy 3 |
TESTS |
20 |
139 |
23552000 |
|
|
124638917 |
edusanketdk |
A |
Aug. 2, 2021, 3:52 a.m. |
OK |
PyPy 3 |
TESTS |
20 |
140 |
21606400 |
|
|
124640071 |
rostoki |
A |
Aug. 2, 2021, 4:07 a.m. |
OK |
PyPy 3 |
TESTS |
20 |
140 |
22732800 |
|
|
124647555 |
thebihari |
A |
Aug. 2, 2021, 5:39 a.m. |
OK |
PyPy 3 |
TESTS |
20 |
140 |
22937600 |
|
|
124649373 |
Resul_Shamuhammedov |
A |
Aug. 2, 2021, 6 a.m. |
OK |
Python 3 |
TESTS |
20 |
61 |
6758400 |
|
|
124638477 |
rutz12 |
A |
Aug. 2, 2021, 3:46 a.m. |
OK |
Python 3 |
TESTS |
20 |
61 |
6758400 |
|
|
124640005 |
magpie_robin |
A |
Aug. 2, 2021, 4:06 a.m. |
OK |
Python 3 |
TESTS |
20 |
62 |
6758400 |
|
|
124635424 |
Block_Cipher |
A |
Aug. 2, 2021, 3:03 a.m. |
OK |
Python 3 |
TESTS |
20 |
62 |
6758400 |
|
|
124623271 |
BFR |
A |
Aug. 1, 2021, 10:43 p.m. |
OK |
Python 3 |
TESTS |
20 |
62 |
6758400 |
|
|
124619299 |
souvik03 |
A |
Aug. 1, 2021, 9:04 p.m. |
OK |
Python 3 |
TESTS |
20 |
62 |
6758400 |
|
|
124601007 |
n1kh1lrth |
A |
Aug. 1, 2021, 4:53 p.m. |
OK |
Python 3 |
TESTS |
20 |
62 |
6758400 |
|
|
124599643 |
avinash204 |
A |
Aug. 1, 2021, 4:50 p.m. |
OK |
Python 3 |
TESTS |
20 |
62 |
6758400 |
|
|
124639707 |
edusanketdk |
A |
Aug. 2, 2021, 4:02 a.m. |
OK |
Python 3 |
TESTS |
20 |
62 |
6963200 |
|
|
124648781 |
bing_007 |
A |
Aug. 2, 2021, 5:53 a.m. |
OK |
Python 3 |
TESTS |
20 |
77 |
6758400 |
|
|
124643695 |
bnurgeldiyev514 |
A |
Aug. 2, 2021, 4:55 a.m. |
OK |
Rust |
TESTS |
20 |
46 |
3788800 |
|
|
remove filters
Back to search problems