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 a new scheme to set the password of his lock. The lock has k slots where each slot can hold integers from 1 to n . The password P is a sequence of k integers each in the range [1, n] , i -th element of which goes into the i -th slot of the lock. To set the password of his lock, Ayush comes up with an array A of n integers each in the range [1, n] (not necessarily distinct). He then picks k non-empty mutually disjoint subsets of indices S_1, S_2, ..., S_k (S_i underset{i neq j} cap S_j = emptyset) and sets his password as P_i = max limits_{j notin S_i} A[j] . In other words, the i -th integer in the password is equal to the maximum over all elements of A whose indices do not belong to S_i . You are given the subsets of indices chosen by Ayush. 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 maximum of all elements of the array with index in this subset. You can ask no more than 12 queries. The first line of the input contains a single integer t (1 <= q t <= q 10) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n and k (2 <= q n <= q 1000, 1 <= q k <= q n) -- the size of the array and the number of subsets. k lines follow. The i -th line contains an integer c (1 <= q c lt n) -- the size of subset S_i , followed by c distinct integers in the range [1, n] -- indices from the subset S_i . It is guaranteed that the intersection of any two subsets is empty. To ask a query print a single line: For each query, you will receive an integer x -- the maximum of value in the array among all the indices queried. If the subset of indices queried is invalid or you exceeded the number'... |
Tutorials
Submissions
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
82156561 |
yako |
D |
May 31, 2020, 7:26 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
72 |
249 |
10547200 |
|
2100 |
82257207 |
tulindanil |
D |
June 1, 2020, 9:59 p.m. |
OK |
Clang++17 Diagnostics |
TESTS |
76 |
327 |
17920000 |
|
2100 |
82155738 |
rainboy |
D |
May 31, 2020, 7:15 p.m. |
OK |
GNU C11 |
TESTS |
72 |
202 |
0 |
|
2100 |
82185637 |
vjudge1 |
D |
June 1, 2020, 6:45 a.m. |
OK |
GNU C++11 |
TESTS |
76 |
61 |
0 |
|
2100 |
82195487 |
mhdx_ |
D |
June 1, 2020, 8:36 a.m. |
OK |
GNU C++11 |
TESTS |
76 |
61 |
102400 |
|
2100 |
82190589 |
huangxiaohua |
D |
June 1, 2020, 7:41 a.m. |
OK |
GNU C++11 |
TESTS |
76 |
61 |
4300800 |
|
2100 |
82293518 |
wannaPP |
D |
June 2, 2020, 9:54 a.m. |
OK |
GNU C++11 |
TESTS |
77 |
62 |
0 |
|
2100 |
82160054 |
cugel |
D |
May 31, 2020, 8:26 p.m. |
OK |
GNU C++11 |
TESTS |
75 |
62 |
0 |
|
2100 |
82315038 |
Monotonic |
D |
June 2, 2020, 2:03 p.m. |
OK |
GNU C++11 |
TESTS |
77 |
62 |
102400 |
|
2100 |
82189487 |
hkxadpall |
D |
June 1, 2020, 7:29 a.m. |
OK |
GNU C++11 |
TESTS |
76 |
62 |
102400 |
|
2100 |
82167008 |
anodiebird |
D |
June 1, 2020, 12:13 a.m. |
OK |
GNU C++11 |
TESTS |
75 |
62 |
102400 |
|
2100 |
82147952 |
Ging_ |
D |
May 31, 2020, 5:51 p.m. |
OK |
GNU C++11 |
TESTS |
71 |
62 |
102400 |
|
2100 |
82371854 |
Hamsterw |
D |
June 3, 2020, 7:34 a.m. |
OK |
GNU C++11 |
TESTS |
77 |
62 |
102400 |
|
2100 |
82252577 |
starboy_jb |
D |
June 1, 2020, 7:56 p.m. |
OK |
GNU C++14 |
TESTS |
76 |
46 |
204800 |
|
2100 |
82161895 |
sharath1999 |
D |
May 31, 2020, 9:07 p.m. |
OK |
GNU C++14 |
TESTS |
75 |
61 |
204800 |
|
2100 |
82163408 |
roy3 |
D |
May 31, 2020, 9:48 p.m. |
OK |
GNU C++14 |
TESTS |
75 |
61 |
204800 |
|
2100 |
82146678 |
sievra |
D |
May 31, 2020, 5:42 p.m. |
OK |
GNU C++14 |
TESTS |
71 |
61 |
512000 |
|
2100 |
82247492 |
Pretest |
D |
June 1, 2020, 6:29 p.m. |
OK |
GNU C++14 |
TESTS |
76 |
61 |
1433600 |
|
2100 |
82167643 |
clyring |
D |
June 1, 2020, 12:37 a.m. |
OK |
GNU C++14 |
TESTS |
75 |
62 |
0 |
|
2100 |
82384658 |
zstuycz |
D |
June 3, 2020, 10:10 a.m. |
OK |
GNU C++14 |
TESTS |
77 |
62 |
204800 |
|
2100 |
82357043 |
spider_0859 |
D |
June 3, 2020, 3:35 a.m. |
OK |
GNU C++14 |
TESTS |
77 |
62 |
204800 |
|
2100 |
82316583 |
nikhil_cf |
D |
June 2, 2020, 2:20 p.m. |
OK |
GNU C++14 |
TESTS |
77 |
62 |
204800 |
|
2100 |
82477595 |
johny23 |
D |
June 4, 2020, 11:34 a.m. |
OK |
GNU C++14 |
TESTS |
77 |
62 |
204800 |
|
2100 |
82187874 |
jt_112 |
D |
June 1, 2020, 7:11 a.m. |
OK |
GNU C++17 |
TESTS |
76 |
46 |
409600 |
|
2100 |
82192615 |
Chait0482 |
D |
June 1, 2020, 8:05 a.m. |
OK |
GNU C++17 |
TESTS |
76 |
61 |
307200 |
|
2100 |
82173584 |
FengZ |
D |
June 1, 2020, 3:31 a.m. |
OK |
GNU C++17 |
TESTS |
75 |
61 |
307200 |
|
2100 |
82162824 |
pasthec |
D |
May 31, 2020, 9:31 p.m. |
OK |
GNU C++17 |
TESTS |
75 |
61 |
409600 |
|
2100 |
82300980 |
Vin__ar |
D |
June 2, 2020, 11:25 a.m. |
OK |
GNU C++17 |
TESTS |
77 |
61 |
409600 |
|
2100 |
82294320 |
aniks2645 |
D |
June 2, 2020, 10:05 a.m. |
OK |
GNU C++17 |
TESTS |
77 |
61 |
409600 |
|
2100 |
82240625 |
Rip_robot |
D |
June 1, 2020, 4:56 p.m. |
OK |
GNU C++17 |
TESTS |
76 |
61 |
409600 |
|
2100 |
82175781 |
That_Shy |
D |
June 1, 2020, 4:17 a.m. |
OK |
GNU C++17 |
TESTS |
76 |
61 |
409600 |
|
2100 |
82153915 |
GodricSalazarMerlin |
D |
May 31, 2020, 6:51 p.m. |
OK |
GNU C++17 |
TESTS |
72 |
61 |
409600 |
|
2100 |
82192866 |
vasu0403 |
D |
June 1, 2020, 8:08 a.m. |
OK |
GNU C++17 |
TESTS |
76 |
61 |
512000 |
|
2100 |
82256213 |
hltk |
D |
June 1, 2020, 9:23 p.m. |
OK |
GNU C++17 (64) |
TESTS |
76 |
61 |
0 |
|
2100 |
82290079 |
SorahISA |
D |
June 2, 2020, 9:11 a.m. |
OK |
GNU C++17 (64) |
TESTS |
77 |
61 |
102400 |
|
2100 |
82286353 |
ak532 |
D |
June 2, 2020, 8:29 a.m. |
OK |
GNU C++17 (64) |
TESTS |
77 |
61 |
102400 |
|
2100 |
82241521 |
Pandemic |
D |
June 1, 2020, 5:10 p.m. |
OK |
GNU C++17 (64) |
TESTS |
76 |
61 |
102400 |
|
2100 |
82165947 |
tyler |
D |
May 31, 2020, 11:30 p.m. |
OK |
GNU C++17 (64) |
TESTS |
75 |
61 |
102400 |
|
2100 |
82153132 |
zuhn |
D |
May 31, 2020, 6:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
72 |
61 |
102400 |
|
2100 |
82153141 |
Prateek |
D |
May 31, 2020, 6:42 p.m. |
OK |
GNU C++17 (64) |
TESTS |
72 |
61 |
102400 |
|
2100 |
82315165 |
Fortin |
D |
June 2, 2020, 2:04 p.m. |
OK |
GNU C++17 (64) |
TESTS |
77 |
61 |
102400 |
|
2100 |
82175588 |
Hasnaine_ |
D |
June 1, 2020, 4:14 a.m. |
OK |
GNU C++17 (64) |
TESTS |
76 |
61 |
204800 |
|
2100 |
82212036 |
Scissors_Ss |
D |
June 1, 2020, 11:43 a.m. |
OK |
GNU C++17 (64) |
TESTS |
76 |
61 |
204800 |
|
2100 |
82184283 |
synapse |
D |
June 1, 2020, 6:27 a.m. |
OK |
Go |
TESTS |
76 |
93 |
307200 |
|
2100 |
82185362 |
synapse |
D |
June 1, 2020, 6:41 a.m. |
OK |
Go |
TESTS |
76 |
295 |
307200 |
|
2100 |
82199661 |
synapse |
D |
June 1, 2020, 9:23 a.m. |
OK |
Go |
TESTS |
76 |
342 |
307200 |
|
2100 |
82160092 |
Laurens |
D |
May 31, 2020, 8:27 p.m. |
OK |
Haskell |
TESTS |
75 |
108 |
102400 |
|
2100 |
82175376 |
avijit_agarwal |
D |
June 1, 2020, 4:10 a.m. |
OK |
Java 11 |
TESTS |
76 |
218 |
0 |
|
2100 |
82347737 |
Anonymous |
D |
June 2, 2020, 10:06 p.m. |
OK |
Java 11 |
TESTS |
77 |
249 |
0 |
|
2100 |
82389502 |
jakejase2 |
D |
June 3, 2020, 11:11 a.m. |
OK |
Java 11 |
TESTS |
77 |
264 |
0 |
|
2100 |
82163859 |
nthistle |
D |
May 31, 2020, 10:03 p.m. |
OK |
Java 11 |
TESTS |
75 |
265 |
0 |
|
2100 |
82225485 |
idk321 |
D |
June 1, 2020, 2:15 p.m. |
OK |
Java 11 |
TESTS |
76 |
280 |
0 |
|
2100 |
82195908 |
zhupeijun |
D |
June 1, 2020, 8:41 a.m. |
OK |
Java 11 |
TESTS |
76 |
280 |
0 |
|
2100 |
82149119 |
nsmikhailov |
D |
May 31, 2020, 6 p.m. |
OK |
Java 11 |
TESTS |
71 |
280 |
0 |
|
2100 |
82148883 |
TheSawan |
D |
May 31, 2020, 5:58 p.m. |
OK |
Java 11 |
TESTS |
71 |
280 |
0 |
|
2100 |
82147941 |
Dukkha |
D |
May 31, 2020, 5:50 p.m. |
OK |
Java 11 |
TESTS |
71 |
295 |
0 |
|
2100 |
82147160 |
Hemose |
D |
May 31, 2020, 5:45 p.m. |
OK |
Java 11 |
TESTS |
71 |
295 |
102400 |
|
2100 |
82149038 |
iceburst |
D |
May 31, 2020, 5:59 p.m. |
OK |
Java 8 |
TESTS |
71 |
155 |
0 |
|
2100 |
82164135 |
derrick20 |
D |
May 31, 2020, 10:12 p.m. |
OK |
Java 8 |
TESTS |
75 |
171 |
0 |
|
2100 |
82153301 |
Java |
D |
May 31, 2020, 6:44 p.m. |
OK |
Java 8 |
TESTS |
72 |
171 |
0 |
|
2100 |
82145866 |
KharYusuf |
D |
May 31, 2020, 5:36 p.m. |
OK |
Java 8 |
TESTS |
70 |
171 |
0 |
|
2100 |
82214213 |
goyalnikhil064 |
D |
June 1, 2020, 12:08 p.m. |
OK |
Java 8 |
TESTS |
76 |
186 |
0 |
|
2100 |
82157599 |
BlackHole213 |
D |
May 31, 2020, 7:42 p.m. |
OK |
Java 8 |
TESTS |
72 |
186 |
0 |
|
2100 |
82157567 |
qlf9 |
D |
May 31, 2020, 7:42 p.m. |
OK |
Java 8 |
TESTS |
72 |
186 |
0 |
|
2100 |
82155998 |
robinz62 |
D |
May 31, 2020, 7:19 p.m. |
OK |
Java 8 |
TESTS |
72 |
186 |
0 |
|
2100 |
82446806 |
gagan_6730 |
D |
June 4, 2020, 4:20 a.m. |
OK |
Java 8 |
TESTS |
77 |
187 |
0 |
|
2100 |
82389693 |
neeraj96 |
D |
June 3, 2020, 11:13 a.m. |
OK |
Java 8 |
TESTS |
77 |
187 |
0 |
|
2100 |
82148896 |
golions |
D |
May 31, 2020, 5:58 p.m. |
OK |
Kotlin |
TESTS |
71 |
202 |
307200 |
|
2100 |
82217880 |
Spheniscine |
D |
June 1, 2020, 12:50 p.m. |
OK |
Kotlin |
TESTS |
76 |
202 |
716800 |
|
2100 |
82150894 |
songsinger |
D |
May 31, 2020, 6:18 p.m. |
OK |
Kotlin |
TESTS |
72 |
233 |
1024000 |
|
2100 |
82161337 |
jonas.havelka.42 |
D |
May 31, 2020, 8:54 p.m. |
OK |
Kotlin |
TESTS |
75 |
233 |
1843200 |
|
2100 |
82214933 |
UD_xlinsist |
D |
June 1, 2020, 12:16 p.m. |
OK |
Kotlin |
TESTS |
76 |
234 |
1433600 |
|
2100 |
82153533 |
Tlatoani |
D |
May 31, 2020, 6:47 p.m. |
OK |
Kotlin |
TESTS |
72 |
248 |
1433600 |
|
2100 |
82163616 |
speshuric |
D |
May 31, 2020, 9:55 p.m. |
OK |
Kotlin |
TESTS |
75 |
249 |
819200 |
|
2100 |
82166522 |
sergmel |
D |
May 31, 2020, 11:56 p.m. |
OK |
Kotlin |
TESTS |
75 |
249 |
921600 |
|
2100 |
82165809 |
mban259 |
D |
May 31, 2020, 11:23 p.m. |
OK |
Mono C# |
TESTS |
75 |
124 |
6860800 |
|
2100 |
82290988 |
riantkb |
D |
June 2, 2020, 9:22 a.m. |
OK |
Mono C# |
TESTS |
77 |
124 |
11161600 |
|
2100 |
82144182 |
0x24 |
D |
May 31, 2020, 5:27 p.m. |
OK |
MS C++ |
TESTS |
70 |
77 |
307200 |
|
2100 |
82163877 |
youx |
D |
May 31, 2020, 10:04 p.m. |
OK |
MS C++ 2017 |
TESTS |
75 |
77 |
307200 |
|
2100 |
82308555 |
getN1ght |
D |
June 2, 2020, 12:51 p.m. |
OK |
MS C++ 2017 |
TESTS |
77 |
93 |
0 |
|
2100 |
82276747 |
LSD |
D |
June 2, 2020, 6:34 a.m. |
OK |
MS C++ 2017 |
TESTS |
77 |
93 |
102400 |
|
2100 |
82333342 |
ningBr |
D |
June 2, 2020, 5:29 p.m. |
OK |
MS C++ 2017 |
TESTS |
77 |
93 |
102400 |
|
2100 |
82321243 |
Gravekper |
D |
June 2, 2020, 3:10 p.m. |
OK |
MS C++ 2017 |
TESTS |
77 |
93 |
307200 |
|
2100 |
82310071 |
reikiriyama |
D |
June 2, 2020, 1:07 p.m. |
OK |
MS C++ 2017 |
TESTS |
77 |
109 |
102400 |
|
2100 |
82310008 |
akai14 |
D |
June 2, 2020, 1:06 p.m. |
OK |
MS C++ 2017 |
TESTS |
77 |
109 |
102400 |
|
2100 |
82391962 |
SendThemToHell |
D |
June 3, 2020, 11:41 a.m. |
OK |
MS C++ 2017 |
TESTS |
77 |
124 |
0 |
|
2100 |
82165577 |
c1729 |
D |
May 31, 2020, 11:12 p.m. |
OK |
PyPy 2 |
TESTS |
75 |
218 |
4812800 |
|
2100 |
82379689 |
rkstalker |
D |
June 3, 2020, 9:07 a.m. |
OK |
PyPy 2 |
TESTS |
77 |
295 |
7065600 |
|
2100 |
82156122 |
realnimish |
D |
May 31, 2020, 7:21 p.m. |
OK |
PyPy 2 |
TESTS |
72 |
296 |
4608000 |
|
2100 |
82148110 |
wolffd |
D |
May 31, 2020, 5:52 p.m. |
OK |
PyPy 2 |
TESTS |
71 |
296 |
5632000 |
|
2100 |
82188953 |
anshuman16423 |
D |
June 1, 2020, 7:23 a.m. |
OK |
PyPy 2 |
TESTS |
76 |
577 |
7680000 |
|
2100 |
82315956 |
yumtam |
D |
June 2, 2020, 2:13 p.m. |
OK |
PyPy 2 |
TESTS |
77 |
592 |
4096000 |
|
2100 |
82307777 |
shehebe |
D |
June 2, 2020, 12:42 p.m. |
OK |
PyPy 2 |
TESTS |
77 |
639 |
10444800 |
|
2100 |
82170628 |
tamato |
D |
June 1, 2020, 2:21 a.m. |
OK |
PyPy 3 |
TESTS |
75 |
233 |
3174400 |
|
2100 |
82343931 |
Galkowsky |
D |
June 2, 2020, 8:19 p.m. |
OK |
PyPy 3 |
TESTS |
77 |
233 |
5324800 |
|
2100 |
82457233 |
roaris |
D |
June 4, 2020, 7:14 a.m. |
OK |
PyPy 3 |
TESTS |
77 |
234 |
5222400 |
|
2100 |
82337518 |
2019ucp1350 |
D |
June 2, 2020, 6:22 p.m. |
OK |
PyPy 3 |
TESTS |
77 |
249 |
4710400 |
|
2100 |
82260620 |
340951987 |
D |
June 2, 2020, 12:36 a.m. |
OK |
PyPy 3 |
TESTS |
76 |
249 |
5324800 |
|
2100 |
82245603 |
bhavik07 |
D |
June 1, 2020, 6:04 p.m. |
OK |
PyPy 3 |
TESTS |
76 |
249 |
5324800 |
|
2100 |
82191794 |
Munchy_1 |
D |
June 1, 2020, 7:55 a.m. |
OK |
PyPy 3 |
TESTS |
76 |
280 |
6656000 |
|
2100 |
82146150 |
titia |
D |
May 31, 2020, 5:38 p.m. |
OK |
PyPy 3 |
TESTS |
71 |
280 |
7168000 |
|
2100 |
82204692 |
manish.17 |
D |
June 1, 2020, 10:22 a.m. |
OK |
PyPy 3 |
TESTS |
76 |
280 |
8806400 |
|
2100 |
82156717 |
__eRRor__ |
D |
May 31, 2020, 7:29 p.m. |
OK |
PyPy 3 |
TESTS |
72 |
280 |
71372800 |
|
2100 |
82213284 |
nwi |
D |
June 1, 2020, 11:57 a.m. |
OK |
Python 2 |
TESTS |
76 |
233 |
409600 |
|
2100 |
82166178 |
c1729 |
D |
May 31, 2020, 11:41 p.m. |
OK |
Python 3 |
TESTS |
75 |
170 |
716800 |
|
2100 |
82238244 |
frankhannes |
D |
June 1, 2020, 4:24 p.m. |
OK |
Python 3 |
TESTS |
76 |
171 |
716800 |
|
2100 |
82166208 |
c1729 |
D |
May 31, 2020, 11:43 p.m. |
OK |
Python 3 |
TESTS |
75 |
171 |
716800 |
|
2100 |
82392037 |
rel4pss |
D |
June 3, 2020, 11:41 a.m. |
OK |
Python 3 |
TESTS |
77 |
171 |
1126400 |
|
2100 |
82156048 |
manhar |
D |
May 31, 2020, 7:20 p.m. |
OK |
Python 3 |
TESTS |
72 |
186 |
716800 |
|
2100 |
82180239 |
nebocco |
D |
June 1, 2020, 5:35 a.m. |
OK |
Python 3 |
TESTS |
76 |
187 |
716800 |
|
2100 |
82165713 |
c1729 |
D |
May 31, 2020, 11:19 p.m. |
OK |
Python 3 |
TESTS |
75 |
202 |
716800 |
|
2100 |
82165618 |
c1729 |
D |
May 31, 2020, 11:14 p.m. |
OK |
Python 3 |
TESTS |
75 |
202 |
716800 |
|
2100 |
82156279 |
aravindreddy.mokireddy |
D |
May 31, 2020, 7:23 p.m. |
OK |
Python 3 |
TESTS |
72 |
202 |
716800 |
|
2100 |
82148301 |
1194code |
D |
May 31, 2020, 5:53 p.m. |
OK |
Python 3 |
TESTS |
71 |
202 |
716800 |
|
2100 |
82175600 |
sansen |
D |
June 1, 2020, 4:14 a.m. |
OK |
Rust |
TESTS |
76 |
78 |
409600 |
|
2100 |
82320476 |
pandrei |
D |
June 2, 2020, 3:01 p.m. |
OK |
Rust |
TESTS |
77 |
92 |
307200 |
|
2100 |
remove filters
Back to search problems