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'Theofanis has a riddle for you and if you manage to solve it, he will give you a Cypriot snack halloumi for free (Cypriot cheese). You are given an integer n . You need to find two integers l and r such that -10^{18} <= l < r <= 10^{18} and l + (l + 1) + ldots + (r - 1) + r = n . The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first and only line of each test case contains a single integer n ( 1 <= n <= 10^{18} ). For each test case, print the two integers l and r such that -10^{18} <= l < r <= 10^{18} and l + (l + 1) + ldots + (r - 1) + r = n . It can be proven that an answer always exists. If there are multiple answers, print any. In the first test case, 0 + 1 = 1 . In the second test case, (-1) + 0 + 1 + 2 = 2 . In the fourth test case, 1 + 2 + 3 = 6 . In the fifth test case, 18 + 19 + 20 + 21 + 22 = 100 . In the sixth test case, (-2) + (-1) + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 = 25 . '... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
131270896 |
Mrgglock |
A |
Oct. 9, 2021, 5:04 a.m. |
OK |
GNU C11 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131268246 |
Tanish-kumar |
A |
Oct. 9, 2021, 4:26 a.m. |
OK |
GNU C11 |
TESTS |
8 |
30 |
3686400 |
|
800 |
131262573 |
HollwoQ_Pelw |
A |
Oct. 9, 2021, 2:43 a.m. |
OK |
GNU C11 |
TESTS |
8 |
31 |
3686400 |
|
800 |
131274643 |
bnurgeldiyev514 |
A |
Oct. 9, 2021, 5:49 a.m. |
OK |
GNU C11 |
TESTS |
8 |
62 |
3686400 |
|
800 |
131251162 |
Jakon |
A |
Oct. 8, 2021, 11:29 p.m. |
OK |
GNU C11 |
TESTS |
8 |
62 |
3686400 |
|
800 |
131228778 |
nagaveena2002 |
A |
Oct. 8, 2021, 5:14 p.m. |
OK |
GNU C11 |
TESTS |
8 |
62 |
3686400 |
|
800 |
131262274 |
shashwat_nayak |
A |
Oct. 9, 2021, 2:37 a.m. |
OK |
GNU C11 |
TESTS |
8 |
62 |
3686400 |
|
800 |
131263038 |
mahin2288 |
A |
Oct. 9, 2021, 2:52 a.m. |
OK |
GNU C11 |
TESTS |
8 |
62 |
3686400 |
|
800 |
131263553 |
Charon.ym |
A |
Oct. 9, 2021, 3:02 a.m. |
OK |
GNU C11 |
TESTS |
8 |
62 |
3686400 |
|
800 |
131272449 |
H_a_c_kcode_gaurav |
A |
Oct. 9, 2021, 5:25 a.m. |
OK |
GNU C11 |
TESTS |
8 |
77 |
3686400 |
|
800 |
131257133 |
sosolikem |
A |
Oct. 9, 2021, 2:05 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
0 |
|
800 |
131265458 |
_PushkaR |
A |
Oct. 9, 2021, 3:37 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131253117 |
Chameleon216 |
A |
Oct. 9, 2021, 12:42 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131252869 |
Mr.HxinH |
A |
Oct. 9, 2021, 12:34 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131239367 |
blind_eyes |
A |
Oct. 8, 2021, 6:54 p.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131237107 |
kuldeep045 |
A |
Oct. 8, 2021, 6:32 p.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131262080 |
Aurora. |
A |
Oct. 9, 2021, 2:33 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
3788800 |
|
800 |
131263488 |
dr.stone_hack |
A |
Oct. 9, 2021, 3:01 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
3788800 |
|
800 |
131261898 |
Ko7or1 |
A |
Oct. 9, 2021, 2:28 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
3788800 |
|
800 |
131257229 |
luogu_bot3 |
A |
Oct. 9, 2021, 2:07 a.m. |
OK |
GNU C++14 |
TESTS |
8 |
15 |
3788800 |
|
800 |
131233195 |
Luqman |
A |
Oct. 8, 2021, 5:59 p.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131233641 |
kr_ankit09 |
A |
Oct. 8, 2021, 6:01 p.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131235641 |
siphen24 |
A |
Oct. 8, 2021, 6:17 p.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131236571 |
docflex |
A |
Oct. 8, 2021, 6:25 p.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131252120 |
Marceantasy |
A |
Oct. 9, 2021, 12:09 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131253380 |
NightCrawler07 |
A |
Oct. 9, 2021, 12:50 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131261633 |
9t_246174 |
A |
Oct. 9, 2021, 2:23 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131275796 |
iyua |
A |
Oct. 9, 2021, 6:02 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
3686400 |
|
800 |
131264148 |
wacyy |
A |
Oct. 9, 2021, 3:12 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
3788800 |
|
800 |
131269741 |
pranavd892 |
A |
Oct. 9, 2021, 4:47 a.m. |
OK |
GNU C++17 |
TESTS |
8 |
15 |
3788800 |
|
800 |
131252164 |
dblark |
A |
Oct. 9, 2021, 12:10 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
0 |
|
800 |
131255890 |
lev1106 |
A |
Oct. 9, 2021, 1:56 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
4300800 |
|
800 |
131255874 |
nicholask |
A |
Oct. 9, 2021, 1:55 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
4300800 |
|
800 |
131272051 |
gamefreak51 |
A |
Oct. 9, 2021, 5:20 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
4300800 |
|
800 |
131270304 |
87027722007 |
A |
Oct. 9, 2021, 4:55 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
4300800 |
|
800 |
131256886 |
froggyzhang |
A |
Oct. 9, 2021, 1:59 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
4300800 |
|
800 |
131274175 |
blago |
A |
Oct. 9, 2021, 5:44 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
4300800 |
|
800 |
131273679 |
misra_ji |
A |
Oct. 9, 2021, 5:39 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
4300800 |
|
800 |
131272697 |
s1062217 |
A |
Oct. 9, 2021, 5:28 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
4300800 |
|
800 |
131272432 |
jesse_pinkman_619 |
A |
Oct. 9, 2021, 5:25 a.m. |
OK |
GNU C++17 (64) |
TESTS |
8 |
15 |
4300800 |
|
800 |
131251250 |
huangxuepeng |
A |
Oct. 8, 2021, 11:33 p.m. |
OK |
Go |
TESTS |
8 |
608 |
10649600 |
|
800 |
131237598 |
vivekmurali2k |
A |
Oct. 8, 2021, 6:38 p.m. |
OK |
Go |
TESTS |
8 |
655 |
10649600 |
|
800 |
131250055 |
aozeritsky |
A |
Oct. 8, 2021, 10:39 p.m. |
OK |
Haskell |
TESTS |
8 |
78 |
11571200 |
|
800 |
131244958 |
Toinfinity |
A |
Oct. 8, 2021, 8:21 p.m. |
OK |
Java 11 |
TESTS |
8 |
217 |
23961600 |
|
800 |
131226801 |
Hemose |
A |
Oct. 8, 2021, 5:09 p.m. |
OK |
Java 11 |
TESTS |
8 |
217 |
24064000 |
|
800 |
131271052 |
shivam.exe |
A |
Oct. 9, 2021, 5:06 a.m. |
OK |
Java 11 |
TESTS |
8 |
218 |
23961600 |
|
800 |
131234653 |
aggkritika080700 |
A |
Oct. 8, 2021, 6:09 p.m. |
OK |
Java 11 |
TESTS |
8 |
218 |
23961600 |
|
800 |
131263128 |
mayank190801 |
A |
Oct. 9, 2021, 2:54 a.m. |
OK |
Java 11 |
TESTS |
8 |
218 |
24166400 |
|
800 |
131234449 |
ayush__1411 |
A |
Oct. 8, 2021, 6:07 p.m. |
OK |
Java 11 |
TESTS |
8 |
233 |
0 |
|
800 |
131226388 |
yogii_123 |
A |
Oct. 8, 2021, 5:08 p.m. |
OK |
Java 11 |
TESTS |
8 |
233 |
23961600 |
|
800 |
131233439 |
sarthakbhatia1061 |
A |
Oct. 8, 2021, 6 p.m. |
OK |
Java 11 |
TESTS |
8 |
233 |
24064000 |
|
800 |
131250335 |
7amasa |
A |
Oct. 8, 2021, 10:50 p.m. |
OK |
Java 11 |
TESTS |
8 |
234 |
23961600 |
|
800 |
131263542 |
DedsecKnight |
A |
Oct. 9, 2021, 3:02 a.m. |
OK |
Java 11 |
TESTS |
8 |
249 |
24268800 |
|
800 |
131233192 |
RonWonWon |
A |
Oct. 8, 2021, 5:59 p.m. |
OK |
Java 8 |
TESTS |
8 |
93 |
20480000 |
|
800 |
131242280 |
ramuked |
A |
Oct. 8, 2021, 7:37 p.m. |
OK |
Java 8 |
TESTS |
8 |
109 |
20480000 |
|
800 |
131234156 |
suyash.211.sn |
A |
Oct. 8, 2021, 6:05 p.m. |
OK |
Java 8 |
TESTS |
8 |
109 |
20480000 |
|
800 |
131234436 |
Keyur21 |
A |
Oct. 8, 2021, 6:07 p.m. |
OK |
Java 8 |
TESTS |
8 |
109 |
20480000 |
|
800 |
131241879 |
darshan287 |
A |
Oct. 8, 2021, 7:30 p.m. |
OK |
Java 8 |
TESTS |
8 |
109 |
20684800 |
|
800 |
131267885 |
aashay_03 |
A |
Oct. 9, 2021, 4:21 a.m. |
OK |
Java 8 |
TESTS |
8 |
124 |
20480000 |
|
800 |
131234153 |
gssakash |
A |
Oct. 8, 2021, 6:05 p.m. |
OK |
Java 8 |
TESTS |
8 |
124 |
20480000 |
|
800 |
131247704 |
SpargelTarzan |
A |
Oct. 8, 2021, 9:22 p.m. |
OK |
Java 8 |
TESTS |
8 |
124 |
20480000 |
|
800 |
131237469 |
omar_mohammed |
A |
Oct. 8, 2021, 6:36 p.m. |
OK |
Java 8 |
TESTS |
8 |
139 |
20480000 |
|
800 |
131273986 |
vermadv2000 |
A |
Oct. 9, 2021, 5:42 a.m. |
OK |
Java 8 |
TESTS |
8 |
139 |
20582400 |
|
800 |
131237174 |
_Astron |
A |
Oct. 8, 2021, 6:33 p.m. |
OK |
Kotlin 1.5 |
TESTS |
8 |
187 |
24985600 |
|
800 |
131234490 |
huy.caohuyhuy123 |
A |
Oct. 8, 2021, 6:08 p.m. |
OK |
Kotlin 1.5 |
TESTS |
8 |
280 |
24780800 |
|
800 |
131244017 |
paulmis |
A |
Oct. 8, 2021, 8:04 p.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
31 |
0 |
|
800 |
131253922 |
x_silter |
A |
Oct. 9, 2021, 1:06 a.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
62 |
3788800 |
|
800 |
131238821 |
Rev93 |
A |
Oct. 8, 2021, 6:46 p.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
62 |
3788800 |
|
800 |
131237684 |
F.O.X. |
A |
Oct. 8, 2021, 6:39 p.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
62 |
3891200 |
|
800 |
131241321 |
Yee87 |
A |
Oct. 8, 2021, 7:22 p.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
77 |
3686400 |
|
800 |
131269738 |
A7harva |
A |
Oct. 9, 2021, 4:47 a.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
77 |
3788800 |
|
800 |
131270667 |
hxznh |
A |
Oct. 9, 2021, 5 a.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
77 |
3788800 |
|
800 |
131256837 |
Duck7d6 |
A |
Oct. 9, 2021, 1:58 a.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
77 |
3788800 |
|
800 |
131236092 |
940720 |
A |
Oct. 8, 2021, 6:21 p.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
77 |
3788800 |
|
800 |
131234198 |
DalabayAbilay |
A |
Oct. 8, 2021, 6:06 p.m. |
OK |
MS C++ 2017 |
TESTS |
8 |
77 |
3788800 |
|
800 |
131244661 |
Forza1337 |
A |
Oct. 8, 2021, 8:15 p.m. |
OK |
.NET Core C# |
TESTS |
8 |
108 |
13209600 |
|
800 |
131238552 |
tabibi |
A |
Oct. 8, 2021, 6:43 p.m. |
OK |
.NET Core C# |
TESTS |
8 |
109 |
13209600 |
|
800 |
131275801 |
dathathreya |
A |
Oct. 9, 2021, 6:02 a.m. |
OK |
.NET Core C# |
TESTS |
8 |
124 |
12288000 |
|
800 |
131250754 |
acorn11 |
A |
Oct. 8, 2021, 11:09 p.m. |
OK |
PyPy 2 |
TESTS |
8 |
327 |
25600000 |
|
800 |
131274395 |
phantomxxx |
A |
Oct. 9, 2021, 5:46 a.m. |
OK |
PyPy 3 |
TESTS |
8 |
124 |
24780800 |
|
800 |
131248150 |
Het_Fadia |
A |
Oct. 8, 2021, 9:34 p.m. |
OK |
PyPy 3 |
TESTS |
8 |
155 |
25292800 |
|
800 |
131237546 |
jano31415 |
A |
Oct. 8, 2021, 6:38 p.m. |
OK |
PyPy 3 |
TESTS |
8 |
156 |
24371200 |
|
800 |
131230547 |
amnidersingh |
A |
Oct. 8, 2021, 5:18 p.m. |
OK |
PyPy 3 |
TESTS |
8 |
171 |
25088000 |
|
800 |
131263438 |
bsheep014 |
A |
Oct. 9, 2021, 3 a.m. |
OK |
PyPy 3 |
TESTS |
8 |
171 |
25190400 |
|
800 |
131262557 |
connertakehana |
A |
Oct. 9, 2021, 2:43 a.m. |
OK |
PyPy 3 |
TESTS |
8 |
171 |
25804800 |
|
800 |
131262526 |
connertakehana |
A |
Oct. 9, 2021, 2:42 a.m. |
OK |
PyPy 3 |
TESTS |
8 |
171 |
25804800 |
|
800 |
131239712 |
iimmortal |
A |
Oct. 8, 2021, 6:58 p.m. |
OK |
PyPy 3 |
TESTS |
8 |
171 |
26112000 |
|
800 |
131244921 |
lebron87 |
A |
Oct. 8, 2021, 8:20 p.m. |
OK |
PyPy 3 |
TESTS |
8 |
186 |
25497600 |
|
800 |
131232786 |
generic_placeholder_name |
A |
Oct. 8, 2021, 5:57 p.m. |
OK |
PyPy 3 |
TESTS |
8 |
186 |
25804800 |
|
800 |
131247221 |
mathturbator |
A |
Oct. 8, 2021, 9:10 p.m. |
OK |
Python 2 |
TESTS |
8 |
139 |
6758400 |
|
800 |
131266382 |
radeehasadream |
A |
Oct. 9, 2021, 3:54 a.m. |
OK |
Python 3 |
TESTS |
8 |
77 |
6758400 |
|
800 |
131244330 |
gabrielmdr |
A |
Oct. 8, 2021, 8:10 p.m. |
OK |
Python 3 |
TESTS |
8 |
78 |
6963200 |
|
800 |
131265024 |
sillentKiller |
A |
Oct. 9, 2021, 3:28 a.m. |
OK |
Python 3 |
TESTS |
8 |
78 |
7372800 |
|
800 |
131269524 |
rishahsir |
A |
Oct. 9, 2021, 4:44 a.m. |
OK |
Python 3 |
TESTS |
8 |
93 |
7270400 |
|
800 |
131265256 |
sillentKiller |
A |
Oct. 9, 2021, 3:33 a.m. |
OK |
Python 3 |
TESTS |
8 |
93 |
7270400 |
|
800 |
131271860 |
eugalt |
A |
Oct. 9, 2021, 5:18 a.m. |
OK |
Python 3 |
TESTS |
8 |
93 |
7372800 |
|
800 |
131263895 |
BernardHH |
A |
Oct. 9, 2021, 3:07 a.m. |
OK |
Python 3 |
TESTS |
8 |
108 |
8908800 |
|
800 |
131269445 |
aman2000jaiswal14 |
A |
Oct. 9, 2021, 4:42 a.m. |
OK |
Python 3 |
TESTS |
8 |
109 |
7680000 |
|
800 |
131264868 |
sillentKiller |
A |
Oct. 9, 2021, 3:25 a.m. |
OK |
Python 3 |
TESTS |
8 |
124 |
6758400 |
|
800 |
131263106 |
OlympiadSchool |
A |
Oct. 9, 2021, 2:53 a.m. |
OK |
Python 3 |
TESTS |
8 |
124 |
6758400 |
|
800 |
131234386 |
freshnewname |
A |
Oct. 8, 2021, 6:07 p.m. |
OK |
Rust |
TESTS |
8 |
15 |
4915200 |
|
800 |
remove filters
Back to search problems