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"Recently, Olya received a magical square with the size of 2^n x 2^n . It seems to her sister that one square is boring. Therefore, she asked Olya to perform exactly k splitting operations. A Splitting operation is an operation during which Olya takes a square with side a and cuts it into 4 equal squares with side dfrac{a}{2} . If the side of the square is equal to 1 , then it is impossible to apply a splitting operation to it (see examples for better understanding). Olya is happy to fulfill her sister's request, but she also wants the condition of Olya's happiness to be satisfied after all operations. The condition of Olya's happiness will be satisfied if the following statement is fulfilled: Let the length of the side of the lower left square be equal to a , then the length of the side of the right upper square should also be equal to a . There should also be a path between them that consists only of squares with the side of length a . All consecutive squares on a path should have a common side. Obviously, as long as we have one square, these conditions are met. So Olya is ready to fulfill her sister's request only under the condition that she is satisfied too. Tell her: is it possible to perform exactly k splitting operations in a certain order so that the condition of Olya's happiness is satisfied? If it is possible, tell also the size of the side of squares of which the path from the lower left square to the upper right one will consist. The first line contains one integer t ( 1 <= t <= 10^3 ) -- the number of tests. Each of the following t lines contains two integers n_i and k_i ( 1 <= n_i <= 10^9, 1 <= k_i <= 10^{18} ) -- the description of the i -th test, which means that initially Olya's square has size of 2^{n_i} x 2^{n_i} and Olya's sister asks her to do exactly k_i splitting operations. Print t lines, where in the i -th "... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
47289527 |
Khanh_Moriaty |
D |
Dec. 20, 2018, 8:20 a.m. |
OK |
FPC |
TESTS |
67 |
46 |
0 |
|
2000 |
46219720 |
AnimeshSinha1309 |
D |
Nov. 25, 2018, 5:49 p.m. |
OK |
GNU C11 |
TESTS |
67 |
31 |
0 |
|
2000 |
63903470 |
Edennn |
D |
Oct. 31, 2019, 5:43 a.m. |
OK |
GNU C++11 |
TESTS |
67 |
31 |
0 |
|
2000 |
63899108 |
luogu_bot3 |
D |
Oct. 31, 2019, 4:14 a.m. |
OK |
GNU C++11 |
TESTS |
67 |
31 |
0 |
|
2000 |
63898793 |
vjudge1 |
D |
Oct. 31, 2019, 4:02 a.m. |
OK |
GNU C++11 |
TESTS |
67 |
31 |
0 |
|
2000 |
63898776 |
Yuryyy |
D |
Oct. 31, 2019, 4:01 a.m. |
OK |
GNU C++11 |
TESTS |
67 |
31 |
0 |
|
2000 |
63898714 |
luogu_bot1 |
D |
Oct. 31, 2019, 3:58 a.m. |
OK |
GNU C++11 |
TESTS |
67 |
31 |
0 |
|
2000 |
63898337 |
vjudge4 |
D |
Oct. 31, 2019, 3:40 a.m. |
OK |
GNU C++11 |
TESTS |
67 |
31 |
0 |
|
2000 |
63897205 |
vjudge5 |
D |
Oct. 31, 2019, 2:52 a.m. |
OK |
GNU C++11 |
TESTS |
67 |
31 |
0 |
|
2000 |
63897181 |
an_interesting_name |
D |
Oct. 31, 2019, 2:51 a.m. |
OK |
GNU C++11 |
TESTS |
67 |
31 |
0 |
|
2000 |
65823487 |
Sodaine |
D |
Nov. 27, 2019, 11:36 a.m. |
OK |
GNU C++11 |
TESTS |
67 |
31 |
0 |
|
2000 |
65703690 |
run_aroud |
D |
Nov. 25, 2019, 11:47 a.m. |
OK |
GNU C++11 |
TESTS |
67 |
31 |
0 |
|
2000 |
46743165 |
Ravi1961 |
D |
Dec. 8, 2018, 5:03 a.m. |
OK |
GNU C++14 |
TESTS |
67 |
15 |
0 |
|
2000 |
46172475 |
bula |
D |
Nov. 24, 2018, 1:30 p.m. |
OK |
GNU C++14 |
TESTS |
67 |
15 |
0 |
|
2000 |
47325077 |
zjsdut |
D |
Dec. 21, 2018, 9:55 a.m. |
OK |
GNU C++14 |
TESTS |
67 |
15 |
0 |
|
2000 |
48402000 |
vjudge5 |
D |
Jan. 14, 2019, 10:18 p.m. |
OK |
GNU C++14 |
TESTS |
67 |
30 |
0 |
|
2000 |
46357454 |
swunbelievable |
D |
Nov. 29, 2018, 9:08 a.m. |
OK |
GNU C++14 |
TESTS |
67 |
30 |
0 |
|
2000 |
46304728 |
ByBornLoser |
D |
Nov. 28, 2018, 9:23 a.m. |
OK |
GNU C++14 |
TESTS |
67 |
30 |
0 |
|
2000 |
46198080 |
Kelly |
D |
Nov. 25, 2018, 9:34 a.m. |
OK |
GNU C++14 |
TESTS |
67 |
30 |
0 |
|
2000 |
46187916 |
ZhYic |
D |
Nov. 25, 2018, 1:07 a.m. |
OK |
GNU C++14 |
TESTS |
67 |
30 |
0 |
|
2000 |
46177564 |
Ace_02 |
D |
Nov. 24, 2018, 4 p.m. |
OK |
GNU C++14 |
TESTS |
67 |
30 |
0 |
|
2000 |
54838692 |
black_hole6 |
D |
May 30, 2019, 11:54 a.m. |
OK |
GNU C++14 |
TESTS |
67 |
30 |
0 |
|
2000 |
50771979 |
happy_ |
D |
March 4, 2019, 5:39 a.m. |
OK |
GNU C++17 |
TESTS |
67 |
30 |
0 |
|
2000 |
54746909 |
KalznAsawind |
D |
May 28, 2019, 11:02 a.m. |
OK |
GNU C++17 |
TESTS |
67 |
30 |
0 |
|
2000 |
46387962 |
imlk |
D |
Nov. 30, 2018, 2:08 a.m. |
OK |
GNU C++17 |
TESTS |
67 |
30 |
0 |
|
2000 |
46179605 |
mia_ortizma |
D |
Nov. 24, 2018, 5:05 p.m. |
OK |
GNU C++17 |
TESTS |
67 |
30 |
0 |
|
2000 |
46158807 |
curlink |
D |
Nov. 24, 2018, 9:05 a.m. |
OK |
GNU C++17 |
TESTS |
67 |
30 |
0 |
|
2000 |
49527889 |
Medeowex |
D |
Feb. 6, 2019, 12:24 p.m. |
OK |
GNU C++17 |
TESTS |
67 |
30 |
307200 |
|
2000 |
47330378 |
Trote_w |
D |
Dec. 21, 2018, 12:36 p.m. |
OK |
GNU C++17 |
TESTS |
67 |
30 |
2457600 |
|
2000 |
67464874 |
one2345678 |
D |
Dec. 23, 2019, 10:40 a.m. |
OK |
GNU C++17 |
TESTS |
67 |
31 |
0 |
|
2000 |
69593250 |
Doncic |
D |
Jan. 27, 2020, 2:28 a.m. |
OK |
GNU C++17 |
TESTS |
67 |
31 |
0 |
|
2000 |
68375683 |
Phortox |
D |
Jan. 7, 2020, 7:44 p.m. |
OK |
GNU C++17 |
TESTS |
67 |
31 |
0 |
|
2000 |
46184529 |
PrakharJain |
D |
Nov. 24, 2018, 8:22 p.m. |
OK |
Java 8 |
TESTS |
67 |
109 |
0 |
|
2000 |
46179174 |
beroul |
D |
Nov. 24, 2018, 4:48 p.m. |
OK |
Java 8 |
TESTS |
67 |
124 |
0 |
|
2000 |
46160532 |
Musin |
D |
Nov. 24, 2018, 9:22 a.m. |
OK |
Java 8 |
TESTS |
67 |
124 |
0 |
|
2000 |
46159538 |
fnch |
D |
Nov. 24, 2018, 9:11 a.m. |
OK |
Java 8 |
TESTS |
67 |
124 |
0 |
|
2000 |
55743991 |
tapopadma |
D |
June 19, 2019, 9:02 a.m. |
OK |
Java 8 |
TESTS |
67 |
124 |
0 |
|
2000 |
68451743 |
yaoct |
D |
Jan. 9, 2020, 2:36 p.m. |
OK |
Java 8 |
TESTS |
67 |
124 |
0 |
|
2000 |
61703050 |
apurvaj |
D |
Oct. 2, 2019, 9:10 a.m. |
OK |
Java 8 |
TESTS |
67 |
124 |
0 |
|
2000 |
48175994 |
donli |
D |
Jan. 10, 2019, 9:37 a.m. |
OK |
Java 8 |
TESTS |
67 |
124 |
0 |
|
2000 |
46548033 |
Deimos |
D |
Dec. 3, 2018, 4:18 p.m. |
OK |
Java 8 |
TESTS |
67 |
124 |
0 |
|
2000 |
46232306 |
wadissimo |
D |
Nov. 25, 2018, 9:42 p.m. |
OK |
Java 8 |
TESTS |
67 |
124 |
0 |
|
2000 |
46182464 |
Svyat |
D |
Nov. 24, 2018, 6:51 p.m. |
OK |
Kotlin |
TESTS |
67 |
187 |
204800 |
|
2000 |
46160494 |
wu_qing |
D |
Nov. 24, 2018, 9:22 a.m. |
OK |
Kotlin |
TESTS |
67 |
280 |
102400 |
|
2000 |
46168696 |
Zvigintsev |
D |
Nov. 24, 2018, 11:57 a.m. |
OK |
Mono C# |
TESTS |
67 |
62 |
204800 |
|
2000 |
46188702 |
eki |
D |
Nov. 25, 2018, 2:21 a.m. |
OK |
Mono C# |
TESTS |
67 |
62 |
409600 |
|
2000 |
56739250 |
vjudge5 |
D |
July 9, 2019, 6:54 a.m. |
OK |
MS C++ |
TESTS |
67 |
31 |
0 |
|
2000 |
46434032 |
vjudge4 |
D |
Dec. 1, 2018, 7:45 a.m. |
OK |
MS C++ |
TESTS |
67 |
31 |
0 |
|
2000 |
46433898 |
vjudge4 |
D |
Dec. 1, 2018, 7:39 a.m. |
OK |
MS C++ |
TESTS |
67 |
31 |
0 |
|
2000 |
46402197 |
vjudge1 |
D |
Nov. 30, 2018, 12:47 p.m. |
OK |
MS C++ |
TESTS |
67 |
31 |
0 |
|
2000 |
46402141 |
vjudge3 |
D |
Nov. 30, 2018, 12:46 p.m. |
OK |
MS C++ |
TESTS |
67 |
31 |
0 |
|
2000 |
46176976 |
Player1_SERG |
D |
Nov. 24, 2018, 3:42 p.m. |
OK |
MS C++ |
TESTS |
67 |
31 |
0 |
|
2000 |
46176582 |
Player1_SERG |
D |
Nov. 24, 2018, 3:29 p.m. |
OK |
MS C++ |
TESTS |
67 |
31 |
0 |
|
2000 |
46172680 |
CrashMaster |
D |
Nov. 24, 2018, 1:35 p.m. |
OK |
MS C++ |
TESTS |
67 |
31 |
0 |
|
2000 |
62987819 |
vjudge5 |
D |
Oct. 20, 2019, 9:31 a.m. |
OK |
MS C++ |
TESTS |
67 |
31 |
0 |
|
2000 |
56761527 |
vjudge1 |
D |
July 9, 2019, 4:04 p.m. |
OK |
MS C++ |
TESTS |
67 |
31 |
0 |
|
2000 |
56698954 |
fishdog |
D |
July 8, 2019, 8:18 a.m. |
OK |
MS C++ 2017 |
TESTS |
67 |
46 |
0 |
|
2000 |
46170705 |
c1729 |
D |
Nov. 24, 2018, 12:43 p.m. |
OK |
PyPy 2 |
TESTS |
67 |
187 |
2150400 |
|
2000 |
46153190 |
Lewin |
D |
Nov. 24, 2018, 8:10 a.m. |
OK |
PyPy 2 |
TESTS |
67 |
202 |
1126400 |
|
2000 |
46153826 |
ItsLastDay |
D |
Nov. 24, 2018, 8:16 a.m. |
OK |
PyPy 2 |
TESTS |
67 |
218 |
2764800 |
|
2000 |
46155547 |
SherlockyHolmes |
D |
Nov. 24, 2018, 8:32 a.m. |
OK |
PyPy 3 |
TESTS |
67 |
202 |
2048000 |
|
2000 |
46170422 |
KatsP |
D |
Nov. 24, 2018, 12:36 p.m. |
OK |
PyPy 3 |
TESTS |
67 |
202 |
2355200 |
|
2000 |
46174683 |
WNJXYK |
D |
Nov. 24, 2018, 2:32 p.m. |
OK |
PyPy 3 |
TESTS |
67 |
218 |
3276800 |
|
2000 |
57857704 |
brosucks |
D |
July 27, 2019, 3:54 p.m. |
OK |
PyPy 3 |
TESTS |
67 |
233 |
5427200 |
|
2000 |
46159847 |
meooow |
D |
Nov. 24, 2018, 9:15 a.m. |
OK |
PyPy 3 |
TESTS |
67 |
248 |
3686400 |
|
2000 |
46160895 |
aayush9 |
D |
Nov. 24, 2018, 9:25 a.m. |
OK |
PyPy 3 |
TESTS |
67 |
249 |
4403200 |
|
2000 |
46158944 |
Skybytskyi.Nikita |
D |
Nov. 24, 2018, 9:06 a.m. |
OK |
PyPy 3 |
TESTS |
67 |
295 |
2150400 |
|
2000 |
46159992 |
Jungarr1k |
D |
Nov. 24, 2018, 9:16 a.m. |
OK |
PyPy 3 |
TESTS |
67 |
358 |
4403200 |
|
2000 |
46206055 |
satyamcse |
D |
Nov. 25, 2018, 2:21 p.m. |
OK |
PyPy 3 |
TESTS |
67 |
577 |
9420800 |
|
2000 |
46189066 |
shengrang |
D |
Nov. 25, 2018, 2:48 a.m. |
OK |
Python 2 |
TESTS |
67 |
186 |
0 |
|
2000 |
46162561 |
nwi |
D |
Nov. 24, 2018, 9:41 a.m. |
OK |
Python 2 |
TESTS |
67 |
187 |
0 |
|
2000 |
46160553 |
pkwv1994 |
D |
Nov. 24, 2018, 9:22 a.m. |
OK |
Python 2 |
TESTS |
67 |
187 |
0 |
|
2000 |
46160265 |
Wielomian |
D |
Nov. 24, 2018, 9:19 a.m. |
OK |
Python 2 |
TESTS |
67 |
187 |
0 |
|
2000 |
46156383 |
VinBat |
D |
Nov. 24, 2018, 8:40 a.m. |
OK |
Python 2 |
TESTS |
67 |
202 |
0 |
|
2000 |
46186680 |
arman.t |
D |
Nov. 24, 2018, 10:50 p.m. |
OK |
Python 2 |
TESTS |
67 |
249 |
0 |
|
2000 |
46161834 |
PERNEKHAN |
D |
Nov. 24, 2018, 9:35 a.m. |
OK |
Python 2 |
TESTS |
67 |
296 |
102400 |
|
2000 |
46159263 |
ManasG |
D |
Nov. 24, 2018, 9:09 a.m. |
OK |
Python 2 |
TESTS |
67 |
342 |
5324800 |
|
2000 |
53095421 |
loyolman |
D |
April 21, 2019, 1:17 p.m. |
OK |
Python 3 |
TESTS |
67 |
109 |
102400 |
|
2000 |
53792881 |
WeZoomIn |
D |
May 5, 2019, 1:53 p.m. |
OK |
Python 3 |
TESTS |
67 |
124 |
0 |
|
2000 |
52609117 |
SamuelLH |
D |
April 11, 2019, 3:13 p.m. |
OK |
Python 3 |
TESTS |
67 |
124 |
0 |
|
2000 |
48703846 |
vjudge5 |
D |
Jan. 22, 2019, 4:48 a.m. |
OK |
Python 3 |
TESTS |
67 |
124 |
0 |
|
2000 |
48703766 |
vjudge1 |
D |
Jan. 22, 2019, 4:45 a.m. |
OK |
Python 3 |
TESTS |
67 |
124 |
0 |
|
2000 |
48703739 |
wateret |
D |
Jan. 22, 2019, 4:44 a.m. |
OK |
Python 3 |
TESTS |
67 |
124 |
0 |
|
2000 |
46248253 |
ytz123 |
D |
Nov. 26, 2018, 12:44 p.m. |
OK |
Python 3 |
TESTS |
67 |
124 |
0 |
|
2000 |
46184706 |
AlterNile |
D |
Nov. 24, 2018, 8:32 p.m. |
OK |
Python 3 |
TESTS |
67 |
124 |
0 |
|
2000 |
46176674 |
iliekcomputers |
D |
Nov. 24, 2018, 3:33 p.m. |
OK |
Python 3 |
TESTS |
67 |
124 |
0 |
|
2000 |
46175715 |
natascha.abraschitowa |
D |
Nov. 24, 2018, 3:01 p.m. |
OK |
Python 3 |
TESTS |
67 |
124 |
0 |
|
2000 |
46466752 |
kobae964 |
D |
Dec. 2, 2018, 3:58 a.m. |
OK |
Rust |
TESTS |
67 |
31 |
105164800 |
|
2000 |
46179045 |
yakamoto |
D |
Nov. 24, 2018, 4:45 p.m. |
OK |
Scala |
TESTS |
67 |
514 |
0 |
|
2000 |
remove filters
Back to search problems