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'This is an interactive problem. Ayush devised yet another scheme to set the password of his lock. The lock has n slots where each slot can hold any non-negative integer. The password P is a sequence of n integers, i -th element of which goes into the i -th slot of the lock. To set the password, Ayush comes up with an array A of n integers each in the range [0, 2^{63}-1] . He then sets the i -th element of P as the bitwise OR of all integers in the array except A_i . You need to guess the password. To make a query, you can choose a non-empty subset of indices of the array and ask the bitwise OR all elements of the array with index in this subset. You can ask no more than 13 queries. The first line of input contains one integer n (2 <= n <= 1000) -- the number of slots in the lock. To ask a query print a single line: For each query, you will receive an integer x -- the bitwise OR of values in the array among all the indices queried. If the subset of indices queried is invalid or you exceeded the number of queries then you will get x = -1 . In this case, you should terminate the program immediately. When you have guessed the password, print a single line "! " (without quotes), followed by n space-separated integers -- the password sequence. Guessing the password does not count towards the number of queries asked. The interactor is not adaptive. The array A does not change with queries. After printing a query do not forget to output the end of the line and flush the output. Otherwise, you will get Idleness limit exceeded. To do this, use: Hacks To hack the solution, use the following test format: On the first line print a single integer n (2 <= n <= 1000) -- the number of slots in the lock. The next line should contain n space-separated integers in the range [0, 2^{63} - 1] -- the array A . The array A in the exampl'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
82887356 |
_sponge_bob_ |
G |
June 7, 2020, 8:12 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
140 |
92 |
7372800 |
|
2800 |
82881113 |
rainboy |
G |
June 7, 2020, 6:53 p.m. |
OK |
GNU C11 |
TESTS |
140 |
77 |
307200 |
|
2800 |
83210537 |
xay5421 |
G |
June 9, 2020, 10:46 a.m. |
OK |
GNU C++11 |
TESTS |
140 |
46 |
0 |
|
2800 |
83189130 |
huanggs |
G |
June 9, 2020, 5:56 a.m. |
OK |
GNU C++11 |
TESTS |
140 |
46 |
0 |
|
2800 |
83171208 |
ulvi000 |
G |
June 8, 2020, 8:44 p.m. |
OK |
GNU C++11 |
TESTS |
140 |
46 |
0 |
|
2800 |
83163300 |
DostoChele |
G |
June 8, 2020, 6:14 p.m. |
OK |
GNU C++11 |
TESTS |
140 |
46 |
0 |
|
2800 |
83149463 |
anodiebird |
G |
June 8, 2020, 3:20 p.m. |
OK |
GNU C++11 |
TESTS |
140 |
46 |
0 |
|
2800 |
83145605 |
LJC00118 |
G |
June 8, 2020, 2:41 p.m. |
OK |
GNU C++11 |
TESTS |
140 |
46 |
0 |
|
2800 |
83136820 |
Frame233 |
G |
June 8, 2020, 12:57 p.m. |
OK |
GNU C++11 |
TESTS |
140 |
46 |
0 |
|
2800 |
83247804 |
MJason |
G |
June 9, 2020, 6:39 p.m. |
OK |
GNU C++11 |
TESTS |
140 |
46 |
0 |
|
2800 |
83226689 |
cugel |
G |
June 9, 2020, 2:15 p.m. |
OK |
GNU C++11 |
TESTS |
140 |
46 |
0 |
|
2800 |
83456101 |
oshebasystems |
G |
June 11, 2020, 4:28 p.m. |
OK |
GNU C++11 |
TESTS |
140 |
46 |
0 |
|
2800 |
83127252 |
dyxg |
G |
June 8, 2020, 11:01 a.m. |
OK |
GNU C++14 |
TESTS |
140 |
31 |
204800 |
|
2800 |
82899645 |
KisekiPurin2019 |
G |
June 8, 2020, 2:35 a.m. |
OK |
GNU C++14 |
TESTS |
140 |
46 |
0 |
|
2800 |
82897548 |
datou2333 |
G |
June 8, 2020, 1:37 a.m. |
OK |
GNU C++14 |
TESTS |
140 |
46 |
0 |
|
2800 |
82885957 |
clyring |
G |
June 7, 2020, 7:51 p.m. |
OK |
GNU C++14 |
TESTS |
140 |
46 |
0 |
|
2800 |
83163282 |
pikmike |
G |
June 8, 2020, 6:13 p.m. |
OK |
GNU C++14 |
TESTS |
140 |
46 |
0 |
|
2800 |
83514096 |
wanghaoze |
G |
June 12, 2020, 8:58 a.m. |
OK |
GNU C++14 |
TESTS |
140 |
46 |
102400 |
|
2800 |
83489434 |
Ramu |
G |
June 12, 2020, 1:35 a.m. |
OK |
GNU C++14 |
TESTS |
140 |
46 |
204800 |
|
2800 |
83306292 |
Nero |
G |
June 10, 2020, 2:05 p.m. |
OK |
GNU C++14 |
TESTS |
140 |
46 |
204800 |
|
2800 |
83289552 |
Sad_reacts_only |
G |
June 10, 2020, 10:15 a.m. |
OK |
GNU C++14 |
TESTS |
140 |
46 |
204800 |
|
2800 |
83490951 |
m4_wal3a |
G |
June 12, 2020, 2:25 a.m. |
OK |
GNU C++14 |
TESTS |
140 |
46 |
204800 |
|
2800 |
82889401 |
karanagarwalla |
G |
June 7, 2020, 8:53 p.m. |
OK |
GNU C++17 |
TESTS |
140 |
31 |
204800 |
|
2800 |
83341715 |
tokusakurai |
G |
June 11, 2020, 1:29 a.m. |
OK |
GNU C++17 |
TESTS |
140 |
31 |
614400 |
|
2800 |
82887416 |
Fly_37 |
G |
June 7, 2020, 8:13 p.m. |
OK |
GNU C++17 |
TESTS |
140 |
31 |
8192000 |
|
2800 |
82954680 |
Blerargh |
G |
June 8, 2020, 4:53 a.m. |
OK |
GNU C++17 |
TESTS |
140 |
46 |
0 |
|
2800 |
83115014 |
peti1234 |
G |
June 8, 2020, 8:30 a.m. |
OK |
GNU C++17 |
TESTS |
140 |
46 |
0 |
|
2800 |
83149557 |
Pozhiloy_Vityok |
G |
June 8, 2020, 3:21 p.m. |
OK |
GNU C++17 |
TESTS |
140 |
46 |
102400 |
|
2800 |
83336894 |
jayant_ism |
G |
June 10, 2020, 9:51 p.m. |
OK |
GNU C++17 |
TESTS |
140 |
46 |
204800 |
|
2800 |
83174130 |
atulyakv |
G |
June 8, 2020, 10:23 p.m. |
OK |
GNU C++17 |
TESTS |
140 |
46 |
204800 |
|
2800 |
83173084 |
igba |
G |
June 8, 2020, 9:41 p.m. |
OK |
GNU C++17 |
TESTS |
140 |
46 |
204800 |
|
2800 |
83172507 |
aditya_arj |
G |
June 8, 2020, 9:20 p.m. |
OK |
GNU C++17 |
TESTS |
140 |
46 |
204800 |
|
2800 |
82892707 |
MZuenni |
G |
June 7, 2020, 10:27 p.m. |
OK |
GNU C++17 (64) |
TESTS |
140 |
31 |
0 |
|
2800 |
83223662 |
Koo_ |
G |
June 9, 2020, 1:39 p.m. |
OK |
GNU C++17 (64) |
TESTS |
140 |
31 |
0 |
|
2800 |
83187720 |
RiverHamster |
G |
June 9, 2020, 5:34 a.m. |
OK |
GNU C++17 (64) |
TESTS |
140 |
31 |
0 |
|
2800 |
83156821 |
Phortox |
G |
June 8, 2020, 4:43 p.m. |
OK |
GNU C++17 (64) |
TESTS |
140 |
31 |
0 |
|
2800 |
83122434 |
zjsdut |
G |
June 8, 2020, 10:02 a.m. |
OK |
GNU C++17 (64) |
TESTS |
140 |
31 |
0 |
|
2800 |
82899908 |
Marckess |
G |
June 8, 2020, 2:41 a.m. |
OK |
GNU C++17 (64) |
TESTS |
140 |
31 |
0 |
|
2800 |
82882019 |
zeus_orz |
G |
June 7, 2020, 7:02 p.m. |
OK |
GNU C++17 (64) |
TESTS |
140 |
31 |
0 |
|
2800 |
83379596 |
kort0n |
G |
June 11, 2020, 12:21 p.m. |
OK |
GNU C++17 (64) |
TESTS |
140 |
31 |
102400 |
|
2800 |
83184363 |
Chgtaxihe |
G |
June 9, 2020, 4:26 a.m. |
OK |
GNU C++17 (64) |
TESTS |
140 |
31 |
102400 |
|
2800 |
83568726 |
saketh |
G |
June 13, 2020, 12:10 a.m. |
OK |
GNU C++17 (64) |
TESTS |
140 |
31 |
102400 |
|
2800 |
83177758 |
synapse |
G |
June 9, 2020, 1:10 a.m. |
OK |
Go |
TESTS |
140 |
46 |
102400 |
|
2800 |
83177685 |
synapse |
G |
June 9, 2020, 1:07 a.m. |
OK |
Go |
TESTS |
140 |
62 |
102400 |
|
2800 |
83177554 |
synapse |
G |
June 9, 2020, 1:04 a.m. |
OK |
Go |
TESTS |
140 |
93 |
102400 |
|
2800 |
83110043 |
PizzaLovers007 |
G |
June 8, 2020, 7:27 a.m. |
OK |
Java 11 |
TESTS |
140 |
218 |
0 |
|
2800 |
83089217 |
Hemose |
G |
June 8, 2020, 6:27 a.m. |
OK |
Java 11 |
TESTS |
140 |
218 |
0 |
|
2800 |
83175583 |
TheSawan |
G |
June 8, 2020, 11:38 p.m. |
OK |
Java 11 |
TESTS |
140 |
234 |
0 |
|
2800 |
83376682 |
slinSSS |
G |
June 11, 2020, 11:42 a.m. |
OK |
Java 11 |
TESTS |
140 |
311 |
0 |
|
2800 |
83466602 |
KharYusuf |
G |
June 11, 2020, 5:10 p.m. |
OK |
Java 8 |
TESTS |
140 |
124 |
0 |
|
2800 |
83363568 |
bluesky111 |
G |
June 11, 2020, 8:40 a.m. |
OK |
Java 8 |
TESTS |
140 |
124 |
0 |
|
2800 |
82900226 |
dg2004 |
G |
June 8, 2020, 2:48 a.m. |
OK |
Java 8 |
TESTS |
140 |
124 |
0 |
|
2800 |
83342877 |
4qqqqzzz |
G |
June 11, 2020, 2:12 a.m. |
OK |
Java 8 |
TESTS |
140 |
140 |
0 |
|
2800 |
83228954 |
polyakoff |
G |
June 9, 2020, 2:40 p.m. |
OK |
Java 8 |
TESTS |
140 |
140 |
0 |
|
2800 |
82880520 |
Hakiobo |
G |
June 7, 2020, 6:48 p.m. |
OK |
Kotlin |
TESTS |
140 |
187 |
1228800 |
|
2800 |
83489586 |
JulesIMF |
G |
June 12, 2020, 1:40 a.m. |
OK |
MS C++ 2017 |
TESTS |
140 |
46 |
0 |
|
2800 |
83260367 |
Shify |
G |
June 10, 2020, 1:18 a.m. |
OK |
MS C++ 2017 |
TESTS |
140 |
46 |
102400 |
|
2800 |
82887381 |
_sponge_bob_ |
G |
June 7, 2020, 8:13 p.m. |
OK |
MS C++ 2017 |
TESTS |
140 |
46 |
819200 |
|
2800 |
83214753 |
pikachan14 |
G |
June 9, 2020, 11:40 a.m. |
OK |
MS C++ 2017 |
TESTS |
140 |
78 |
0 |
|
2800 |
83565724 |
Bruteforceman |
G |
June 12, 2020, 9:59 p.m. |
OK |
PyPy 3 |
TESTS |
140 |
187 |
2355200 |
|
2800 |
83512138 |
AdibHada |
G |
June 12, 2020, 8:29 a.m. |
OK |
PyPy 3 |
TESTS |
140 |
202 |
3891200 |
|
2800 |
83283442 |
codechef_succccc |
G |
June 10, 2020, 8:47 a.m. |
OK |
PyPy 3 |
TESTS |
140 |
202 |
3891200 |
|
2800 |
83105303 |
mkawa2 |
G |
June 8, 2020, 6:28 a.m. |
OK |
Python 3 |
TESTS |
140 |
124 |
307200 |
|
2800 |
83292743 |
reddyjaideep17 |
G |
June 10, 2020, 11:03 a.m. |
OK |
Python 3 |
TESTS |
140 |
139 |
307200 |
|
2800 |
83152382 |
D_Jahnvai |
G |
June 8, 2020, 3:51 p.m. |
OK |
Python 3 |
TESTS |
140 |
139 |
307200 |
|
2800 |
83108293 |
sh1194 |
G |
June 8, 2020, 7:05 a.m. |
OK |
Python 3 |
TESTS |
140 |
139 |
307200 |
|
2800 |
83107760 |
sh1194 |
G |
June 8, 2020, 6:57 a.m. |
OK |
Python 3 |
TESTS |
140 |
139 |
307200 |
|
2800 |
83107420 |
sh1194 |
G |
June 8, 2020, 6:53 a.m. |
OK |
Python 3 |
TESTS |
140 |
139 |
307200 |
|
2800 |
83303054 |
nimsara66 |
G |
June 10, 2020, 1:22 p.m. |
OK |
Python 3 |
TESTS |
140 |
140 |
307200 |
|
2800 |
83108454 |
sh1194 |
G |
June 8, 2020, 7:07 a.m. |
OK |
Python 3 |
TESTS |
140 |
140 |
307200 |
|
2800 |
83107312 |
sh1194 |
G |
June 8, 2020, 6:52 a.m. |
OK |
Python 3 |
TESTS |
140 |
140 |
307200 |
|
2800 |
83107527 |
sh1194 |
G |
June 8, 2020, 6:54 a.m. |
OK |
Python 3 |
TESTS |
140 |
140 |
409600 |
|
2800 |
83178210 |
kobae964 |
G |
June 9, 2020, 1:27 a.m. |
OK |
Rust |
TESTS |
140 |
46 |
409600 |
|
2800 |
remove filters
Back to search problems