#include "avoid.h"
#include <bits/stdc++.h>
using namespace std;
vector<long long> arr={100964614,73936648,204507731,87169288,14885515,96600140,71304591,47199512,10818706,51841664,8442354,134365930,35933746,36537354,160040216,77891980,13780740,236093904,17113844,22077560,55317524,138068036,45630520,92881568,145526976,147590250,100891649,46875659,113510456,67554720,53023811,131091504,18553865,134775323,24266789,15362065,233046021,137560604,85996700,64880672,140652997,19443092,19452620,204473516,8446382,68913476,140756736,8549672,61907348,34243262,69766275,17154067,109218480,211618208,69869881,100723968,51499395,140785186,36714524,136130120,84597392,106456077,1772330,76096565,151667269,9202800,1353261,219546635,102466632,553626,143986208,23730848,6754355,49381419,37753139,64280,185901066,80776265,25723233,42508377,31771,172316960,235999385,169485368,101733320,18944428,222302088,151588675,69370569,206203160,169060640,839950,8179840,205654100,211124748,31730182,69554342,61741060,4734604,75603232,42330240,51992720,40370576,175329284,134362467,19163331,160195106,109208356,232398984,12635220,36460820,159415552,78946984,36292681,210035717,73590082,254820549,18235527,26241444,52175367,70029840,78944321,165231,130023783,18465180,76161235,34247444,168331421,143561984,52527399,209864713,163858443,109250629,41697315,134658118,52519691,151276152,36738824,79711056,186789984,170965057,134833287,19695792,74647081,103792640,68049932,986146,34747908,241223698,179580945,180359308,16922392,20977814,192983332,101777822,3836528,39726,77732736,15500066,2695414,2299649,140054806,4982230,22121316,86045728,190059584,67194502,201339625,159484044,80224853,7408849,26756422,23462465,1262993,8933487,87035457,22352177,134619298,203114544,70283376,9128225,152318168,30941443,146911297,151569281,110131780,2762437,201860588,140739105,17322360,87490836,88117333,104153424,119935361,69861834,136751888,125851665,17077545,100692313,154486805,50907944,125872397,227561604,151697416,148046090,205542624,212214858,58927617,42080625,46339456,53559458,144974692,113812576,155531488,13438089,70526258,147034976,134710977,59932724,85102726,2423844,202944521,40376970,73685258,136069481,179074048,243412488,72201344,152065564,26608658,13108529,146317379,205560881,51548755,13834259,245825540,18909009,169928716,83525792,147346946,5258065,43309072,41959936,184828134,25838162,72401202,227053571,18782467,118161468,44084738,84018042,43323523,148982664,212150289,101539916,26498433,74744097,14766138,51125514,220735296,251967752,22119439,67179641,142087616,58810405,101204750,94412965,144848013,37397505,21922117,188060160,80041736,143474840,52461979,181690408,21152405,88247648,219303104,189431810,85164208,32874560,3157774,134676947,21089338,46268875,234896260,228606008,138515602,6399393,172116357,28729345,136972589,154683561,173015957,22548691,8662661,11919649,71049410,204161065,67389550,189008690,13810180,152095057,99755520,72398888,236102790,39109314,26769936,42607495,872688,40455173,209783578,117834852,36219139,243537164,63525124,143667922,209720630,134628107,92475426,92410596,8652726,167813174,39940227,65044557,16788641,2474700,168863361,140649242,135053868,4873350,234934352,139464296,138463076,8513344,1453956,38251537,22021829,54839333,189336100,134827344,210764270,37953645,42375208,104950592,105132565,75942464,17181484,2484769,68813483,147409415,15226953,215748624,153519656,176691764,184681683,77926923,92276624,54592451,147890597,33669204,201850886,164759683,12071460,83952422,67282457,10751572,208535912,135365802,25965619,188774916,135565937,38407616,19051178,235766144,4207806,149033006,228101124,138149920,23699473,214189,12730931,77271440,20750365,1533034,101713218,51907628,73303618,67545242,88154299,42029770,155275303,135136049,251863204,110791176,76477442,172992520,151057012,238093896,181027078,247464010,105661001,26478800,6539968,262160899,218415528,169355714,1713392,50824710,92750928,134942796,134452536,67478693,12622147,59621488,183068928,67352972,18919876,142726150,80103430,33046549,106053829,89407578,4998387,176215617,70263463,138817928,92562761,147000482,11305304,5720133,15476248,23164993,27313732,28445844,168579211,45205508,67838849,239280674,13895136,104973192,102449417,177537106,77208594,77660494,223380074,68424041,8979161,5317222,147008016,158413440,36049935,206979108,134632993,157352260,68358753,143174337,184649092,17360926,222561825,84042177,251659790,25594057,203858020,49479765,74588233,37979044,27269397,33568368,42307081,60047941,194585920,162480200,182720515,109840736,4860003,21119292,34016082,71665159,74007622,34807092,51011168,27544480,112724108,68487906,136401475,34964696,206324160,18121586,10000517,26214937,97616144,20647200,76198433,80254160,68772385,96799074,155701264,116262016,226558725,137400330,136462152,158078984,158378016,137413539,139528365,38142126,204106,151717030,1306644,134750112,5693960,29603968,4253967,75673646,40408199,438609,34680907,203566086,202395974,177366112,52549634,38561810,55586051,70518295,149180748,77898007,207766673,25493703,63094825,212025482,61130818,181420425,699685,135309846,69752500,237113365,176697627,151292802,109450009,34639515,72460496,55068322,78130496,63733889,1680076,53618818,1341570,173287588,33894963,77071489,113639507,7373575,35391857,118596138,242549792,12583864,44045556,155476656,73532540,167879011,104911912,17116178,67125010,105972556,71108645,206084772,199788808,247730784,5071505,33647505,154239122,111706258,52630084,14321344,18384518,25473554,140087811,33574524,18367883,4432966,135660104,176325922,170403410,63480388,144732578,123733592,182192704,224919948,10669066,149948608,152768680,35289122,2114463,170476566,186974504,93849722,139101236,33836233,69808642,201798672,145769731,36202724,184615697,159462945,137789829,168734864,27886087,16948274,55714838,5638800,76121700,220596384,15274913,11536487,80974984,4329099,100677733,16388160,167971374,2887967,4674050,109200643,54821844,8603221,46760211,175374620,97542952,136601488,218589184,5346852,42337953,1582880,235225187,21431948,19935489,5392846,201870931,82905120,72353561,193725570,135960674,236046849,20978765,184559016,5091650,54559609,74386944,121116288,147394784,52314648,18614342,136877240,80322568,160180,113299908,173736288,149624324,137438538,84312841,452242,81010780,27918646,145866857,36459736,17695380,70530372,88866981,144886292,1418818,47498246,151394405,51513421,21908354,37825712,144147480,31856905,48390320,168663076,50598494,25401624,256389282,59344938,21610697,204852226,8022276,37326944,144214329,104221188,72488197,236717572,75707976,142827587,67900938,67636830,152070435,2239153,1908752,25762436,255894025,6591557,156790850,53021120,117474984,154165769,76049955,243400890,140779843,3688994,40957072,193097740,34199168,9098757,170926867,39326249,168870244,139083897,43582086,24382756,153497876,48317408,13984017,10977730,235594240,73057304,2332754,17123652,228659361,210765665,242495498,38805737,144574484,17315298,54190120,136610282,3842634,44368412,36078640,115409048,171116944,3449972,8537548,119194628,146875730,106076674,68339810,37111912,28968481,17832625,202836038,34088796,103047584,47321253,249561904,3218966,186653002,171328642,235230257,2115522,171543568,3163757,68427341,84871185,90858528,69376052,118715136,180412546,203511080,162664532,192948240,134532373,140535333,3297305,39954530,226499722,2394853,80320518,11633601,25441388,235143213,1209545,168221185,6188546,145302056,29362987,194155521,33887116,6597009,88155459,1260161,120692804,44143633,138732552,526843,185156236,24696850,117709000,4481814,83980301,211616775,67502519,21311516,103830697,151062133,25641128,2871588,240339080,1397844,169904768,31532322,83374344,73406619,42998977,16857449,252321859,71332486,143403276,76234782,100732199,34216519,154797130,94521734,9528366,168133274,31720211,154026256,16911608,201737798,88777296,120263201,68569425,97003714,153201730,125895906,78401537,76073289,92603704,155356740,152502565,174066252,37950097,15778914,171984154,33858821,13382020,17085589,172122705,84477380,114837604,48769573,118237193,27372288,40633095,144249097,170002913,69945104,15016037,50881345,139335974,2963840,123343170,205556165,2689555,210887170,8426969,81834560,18071882,70830976,67275989,6065411,137627265,135409715,128196690,40276576,201910440,485901,39452702,118540,43158852,219220224,31460396,203520520,83893954,796892,24412206,206113680,210772756,44061774,42099741,71763240,17997965,654408,15811716,100749876,94444624,7674118,231084320,8444459,256170112,76727446,153836048,4742673,86065872,17625155,142758672,68702628,201617712,113583424,76071093,60375113,219194673,218638449,9123978,19361924,178832768,4282652,9340466,72651907,4461193,23659120,151045323,17961837,34926690,42651810,85569152,203428937,44893792,39422146,1676826,1740936,41304320,85019156,16919382,51385383,226894480,97022224,3121191,38347176,101142570,129378560,128713985,105321746,58859394,223908128,105433620,58892610,91562113,19150962,205832278,84249144,134584649,6391448,69330008,179044406,218178776,61522084,123535496,13338408,182470865,237011558,778802,184902240,76568226,34640376,235111555,17143982,139989592,206595284,144069808,25896512,89137820,140254866,12601574,155419080,138780693,58992281,173409315,84033758,253493538,8852540,155765026,16028544,78154792,173097522,69235502,72176452,214073874,54658849,236329040,137987340,239665301,204759308,245969088,75766807,9214688,105216066,134587312,134322896,254306308,83888813};
unordered_map<long long,pair<int,int> > um;
pair<int, int> scout(int R, int H) {
int n=1000;
for(int i=0; i<n; i++){
for(int j=i+1; j<n; j++){
um[arr[i]|arr[j]]={i+1,j+1};
}
}
for(int i=0; i<29; i++){
vector<int> qry;
for(int j=0; j<n; j++){
if(arr[j]&(1<<i)) qry.push_back(j+1);
}
send(qry);
}
auto ret=wait();
long long o=0;
for(int i=0; i<29; i++) if(ret[i]) o|=(1<<i);
return um[o];
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |