question stringlengths 58 4.29k | label class label 3
classes |
|---|---|
in generation choose one she stand vampire demon force darkness she Slayer Joss Whedon | 1graph |
you give circular maze one show figure Determine solve ie path go center outside maze touch wall the maze describe n wall each wall circular straight circular wall describe radius r distance center angle theta_1 theta_2 describe begin end wall clockwise direction Notice swapping angle change wall Straight wall describe... | 1graph |
gianni swerc chief judge receive huge high quality problem judge choose problem set SWERCHe receive n problem assign beauty score difficulty the ith problem beauty score equal b_i difficulty equal d_i the beauty difficulty integer 1 10 if problem certain difficulty possible difficulty 12dots10 Gianni ask problem judges... | 1graph |
not long ago vlad birthday present package candy there n type candy a_i candy type 1 le le nVlad decide eat exactly candy time choose candy type currently frequent type choose to maximum pleasure eat Vlad want eat candy type rowhelp figure eat candy eat identical candy row | 0array |
Team Red Team Blue compete competitive FPS their match stream world they play series n matchesIn end turn Team Red win r time Team Blue win b time Team Blue skilled Team Red b strictly ryou miss stream overslept think match neck neck people watch so imagine string length n ith character denote win ith match R Team Red ... | 2string |
Marin want count number permutation beautiful a beautiful permutation length n permutation follow property gcd 1 cdot p_1 2 cdot p_2 dot n cdot p_n 1 gcd great common divisorA permutation array consist n distinct integer 1 n arbitrary order for example 23154 permutation 122 permutation 2 appear twice array 13 4 permuta... | 1graph |
in problem consider complete undirected graph consist n vertex weight edge the weight edge integer 1 kAn undirected graph consider beautiful sum weight edge incident vertex 1 equal weight mst graph mst minimum span tree tree consist n1 edge graph connect n vertex minimum sum weight tree weight MST sum weight edge itcal... | 1graph |
you give integer n b x y you build sequence a_0 a_1 a_2 dot a_n a_0 0 ge 1 choose a_i a_i 1 x a_i a_i 1 y your goal build sequence a_i le B sumlimits_i0na_i maximum possible | 2string |
there s chip point 0 0 coordinate plane in operation chip point x_1 y_1 point x_2 y_2 euclidean distance point integer ie sqrtx_1x_22y_1y_22 integerYour task determine minimum number operation require chip point 0 0 point x y | 1graph |
you give n integer a_1 a_2 ldot a_n for real number t consider complete weighted graph n vertex K_nt weight edge vertex j equal w_ijt a_i cdot a_j t cdot a_i a_j let ft cost minimum span tree K_nt Determine ft bound output maximum value attain | 1graph |
you give array a_1 a_2 ldot a_n positive integer a good pair pair index j 1 leq j leq n 1 leq k leq n follow equality hold a_i a_k a_k a_j a_i a_j x denote absolute value xFind good pair note equal j | 2string |
there n location snowy mountain range number 1 n connect n1 trail shape tree each trail length 1 some location base lodge the height h_i location equal distance near base lodge base lodge height 0there skier location skier initial kinetic energy 0 each skier want ski trail possible suppose skier skiing trail location j... | 1graph |
Alice cake going cut she perform follow operation n1 time choose piece cake initially cake piece weight wge 2 cut small piece weight lfloorfracw2rfloor lceilfracw2rceil lfloor x rfloor lceil x rceil denote floor ceiling function respectivelyafter cut cake n piece line n piece table arbitrary order let a_i weight ith pi... | 2string |
there n piece cake line the ith piece cake weight a_i 1 leq leq nThe tastiness cake maximum total weight adjacent piece cake ie maxa_1a_2 a_2a_3 ldot a_n1 a_nyou want maximize tastiness cake you allow follow operation operation ruin cake Choose contiguous subsegment al r piece cake 1 leq l leq r leq n reverse the subse... | 1graph |
let denote size maximum match graph g mathitmmgyou give bipartite graph the vertex number 1 n vertex second number n1 2n each vertexs degree 2for tuple integer l r L R 1 le l le r le n n1 le L le R le 2n let define Gl r L R graph consist vertex give graph include segment l r segment L R edge give graph endpoint belong ... | 1graph |
now Dmitry session pass n exam the session start day 1 last d day the ith exam place day a_i 1 le a_i le d a_i different Sample n3 d12 a359 Orange exam day before exam Dmitry rest 2 day second rest 1 day rest 3 day for session schedule Dmitry consider special value mu small rest time exam exam for example image mu1 in ... | 1graph |
not long ago Vlad come interesting function f_axleftlfloorfracxarightrfloor x bmod leftlfloorfracxarightrfloor fracxa rounded x bmod remainder integer division x aFor example a3 x11 value f_311 leftlfloorfrac113rightrfloor 11 bmod 3 3 2 5the number fix know Vlad Help Vlad find maximum value f_ax x integer value l r inc... | 2string |
Daniel watch football team play game training session they want improve pass skill sessionthe game involve n player make multiple pass unfortunately ball move fast session Daniel unable know ball involve game the thing know number pass deliver player sessionfind minimum possible ball involve game | 2string |
you give array n positive integer number 1 n Lets array integral necessarily different number x y array x ge y number leave lfloor fracxy right rfloor x divide y round arrayyou guarantee number exceed c your task check array integral | 1graph |
a number call powerful power factorial in word number m powerful exist nonnegative integer d m2d md d1cdot 2cdot ldot cdot d particular 0 1 for example 1 4 6 powerful number 11 422 63 7 10 18 notyou give positive integer n find minimum number k n represent sum k distinct powerful number k | 1graph |
there sheet paper represent grid size n time m n row m column cell all cell color white initiallyq operation apply sheet the ith describe follow x_i y_i choose k nonwhite color color entire row x_i entire column y_i the new color apply cell regardless cell color operation the sheet apply q operation call color two colo... | 1graph |
you give array a_1 a_2 dot a_n consist n integer you give integer value xLet fk maximum sum contiguous subarray apply follow operation add x element exactly k distinct position an subarray consider sum 0Note subarray do not include increase elementsCalculate maximum value fk k 0 n independently | 1graph |
all problem contest share statement difference test solution run for information scoring refer scoring section statementThis interactive problemimagine treasure hunter skillful one day come ancient map help rich the map show multiple forestry road junction treasure so start journey hope retrieve hide treasure do not kn... | 1graph |
you give array a_1 a_2 dot a_n you perform operation array in operation choose integer 1 le n swap element a_i a_i1 array a_i a_i1 odddetermine sort nondecrease order operation number time | 0array |
Andrew n pile stone the ith pile contain a_i stone he want table clean decide stone 1st nth pileAndrew perform follow operation number time choose 3 index 1 le j k le n jth pile contain 2 stone take 2 stone pile j put stone pile stone pile k tell Andrew minimum number operation need stone pile 1 n determine impossible | 2string |
you give array n element your perform follow operation n time Select index xyz 1 leq x y z leq n replace a_x a_y a_z after operation a_x need 1018your goal result array nondecrease if multiple solution output if impossible achieve report | 1graph |
one productive day throw away 1000 line code Ken ThompsonFibonacci addition operation array x integer parametrize indice l r Fibonacci addition increase x_l f_1 increase x_l 1 F_2 X_r increase F_r l 1f_i denote ith Fibonacci number f_1 1 f_2 1 f_i f_i 1 f_i 2 2 operation perform modulo MODYou give array a b length we a... | 1graph |
People worry computer smart world real problem they re stupid they ve take world Pedro DomingosYou work wellknown department store use lead technology employ mechanistic work robotsThe department work sell n cdot k item the item cost 1 dollar second item cost 2 dollar ith item cost dollar the item situate shelf the ite... | 2string |
Haha try solve SelectorUnlimited antontrygubo_oyour friend Alice Bob practice fortune tellingFortune tell perform follow there wellknown array n nonnegative integer index 1 n the tellee start nonnegative number d perform operation 1 2 ldot n increase order the possible operation replace current number d d a_i replace c... | 1graph |
you array integer size n Initially element array equal 1 you perform follow operation choose integer 1 le le n x x 0 increase value a_i leftlfloorfraca_ixrightrfloor ie a_i a_i leftlfloorfraca_ixrightrfloorafter perform operation receive c_i coin a_i b_iyour task determine maximum number coin receive perform k operatio... | 1graph |
this version problem differ constraint na tree connect undirected graph cycle a weight tree weight assign edge the distance vertice minimum sum weight path connect themyou give weight tree n vertex edge weight 1 Denote dv distance vertex 1 vertex vLet fx minimum possible value maxlimits_1 leq v leq n dv temporarily add... | 2string |
igor 11th grade tomorrow write informatic test strict teacher school Pavel Denisovich Igor know test conduct teacher student positive integer b b after student apply follow operation number times 1 increase 1 b b 1 increase b 1 b replace bitwise or b to mark test student tell teacher minimum require number operation b ... | 1graph |
you give array b n positive integer you apply follow operation number time Select index 1leq ileq n swap a_i b_i ie a_i b_i vice versa find minimum possible value maxa_1 a_2 ldot a_n cdot maxb_1 b_2 ldot b_n apply operation number time possibly zero | 2string |
give cyclic array size n a_i value ith position repeat value let define permutation equal permutation value position transform perform cyclic rotation let define cyclic array b number component number connect component graph vertex position b add edge pair adjacent position b equal value note cyclic array position adja... | 1graph |
you give n element number 1 n element value a_i color c_i initially c_i 0 ithe follow operation apply Select element j k 1 leq j k leq n c_i c_j c_k equal 0 a_i a_k set c_j 1 find maximum value sumlimits_i1nc_i obtain apply give operation number time | 1graph |
this hard version problem the difference constraint n m t you hack version problem solvedAlice Bob give number n m k play game followsThe game score Alice try maximize Bob tries minimize the score initially 0 the game consist n turn each turn Alice pick real number 0 k inclusive Bob add subtract score game but game Bob... | 1graph |
Mihai plan watch movie he like palindromic movie wants skip possibly zero scene remain part movie palindromicYou give list s n nonempty string length 3 represent scene Mihais movieA subsequence s call awesome nonempty concatenation string subsequence order palindromecan help Mihai check awesome subsequence sA palindrom... | 2string |
there k time k grid k the square row r column c denote rc two square r_1 c_1 r_2 c_2 consider adjacent lvert r_1 r_2 rvert lvert c_1 c_2 rvert 1an array adjacent pair square call strong possible cut grid grid line connect congruent piece pair piece two piece congruent match translation rotation reflection combination t... | 2string |
you give integer array a_0 a_1 dot a_n 1 integer k you perform follow code itlong long ans 0 create 64bit sign variable initially equal 0forint 1 k int idx rndnext0 n 1 generate random integer 0 n 1 inclusive integer 0 n 1 probability choose an aidx aidx aidx iYour task calculate expect value variable an perform codeno... | 1graph |
martian scientist explore Ganymede Jupiters numerous moon recently find ruin ancient civilization the scientist bring Mars tablet writing language unknown sciencethey find inhabitant Ganymede alphabet consist letter word exactly ell letter long so scientist decide write word language integer 0 2ell 1 inclusively the le... | 1graph |
you give array consist n positive integer you perform operation itIn operation replace element array a_i lfloor fraca_i2 rfloor integer divide a_i 2 round downsee apply operation number time possible 0 array permutation number 1 nthat contain number 1 n exactly oncefor example 1 8 25 2 n 4 answer yes you follow replace... | 1graph |
polycarp 3 positive integer b c he perform follow operation exactly choose positive integer m multiply exactly integer b c m can polycarp perform operation sequence number b c order form arithmetic progression note change order b cFormally sequence x_1 x_2 dot x_n call arithmetic progression AP exist number d call comm... | 1graph |
railway network city consist n station connect n1 road these station road form tree Station 1 city center for road know time train spend pass road you assume train do not spend time stop Lets define distv time train spend station v station 1this railway network splitte zone name k capital latin letter the zone ith stat... | 1graph |
you give integer k string s consist character lowercase latin letter asteriskeach asterisk replace 0 k inclusive lowercase Latin letter b different asterisk replace different count letter bThe result replacement call BAstringTwo string b different different length exist position a_i neq b_iA stre lexicographically smal... | 0array |
Vlad n friend want buy gift New YearThere m shop city buy gift friend if jth friend 1 le j le n receive gift buy shop number 1 le le m friend receive p_ij unit joy the rectangular table p_ij give inputvlad time visit n1 shop n number friend he choose shop visit friend buy gift themlet jth friend receive a_j unit joy Vl... | 2string |
n town arrange circle sequentially the town number 1 n clockwise order in ith town live singer repertoire a_i minute 1 nEach singer visit n town clockwise order start town life give exactly concert town in addition town ith singer got inspire come song last a_i minute the song add repertoire perform rest citieshence it... | 1graph |
Polycarp come new game play he call a miss bigramA bigram word sequence adjacent letter itFor example word abbaaba contain bigrams ab bb ba aa ab baThe game go follow First Polycarp come word consist lowercase letter b then write bigrams whiteboard order appear word after wipe whiteboardfinally Polycarp invite guess wo... | 1graph |
this interactive problem the difference easy hard version limit number questionsThere n player label 1 n it guarantee n multiple 3among k impostor nk crewmate the number impostor k give it guarantee fracn3 k frac2n3In question choose distinct integer b c 1 le b c le n ask among player label b c impostor crewmate you gi... | 2string |
this interactive problem the difference easy hard version limit number questionsThere n player label 1 n it guarantee n multiple 3among k impostor nk crewmate the number impostor k give it guarantee fracn3 k frac2n3In question choose distinct integer b c 1 le b c le n ask among player label b c impostor crewmate you gi... | 1graph |
you give array a_1 a_2 ldot a_n integer xFind number nonempty subset index array 1 leq b_1 b_2 ldots b_k leq n pair j 1 leq j leq k inequality a_b_i oplus a_b_j leq x hold here oplus denote bitwise XOR operation as answer large output modulo 998244353 | 1graph |
an array a_1 a_2 ldot a_n good subsegment 1 leq l leq r leq n follow hold a_l a_l 1 ldot a_r frac12a_l a_r cdot r l 1 you give array integer a_1 a_2 ldot a_n in operation replace element array real number find minimum number operation need array good | 2string |
you give n integer a_1 a_2 ldot a_n you choose subset give number possibly number negate number ie change x x what maximum number different value array achieve | 1graph |
two player Red Blue time they re play crayon the mischievous duo vandalizing root tree coloring node play favorite gameThe game work follow tree size n root node 1 node initially white Red Blue turn Red go in Reds turn follow operation number time Pick subtree root tree color node subtree red However game fair Red allo... | 2string |
there n candle Hanukkah menorah candle initially light we describe candle light binary string s ith candle light s_i1 initially candle light describe string in operation select candle currently light by candle select remain light candle change light unlit unlit lityou like candle look stre b your task determine possibl... | 1graph |
there n block tower row tower height a_i you re build crew want building look nice possible in single day perform follow operation Choose indice j 1 leq j leq n neq j block tower tower j this essentially decrease a_i 1 increase a_j 1 you think ugliness building height difference tall short building Formally ugliness de... | 1graph |
you give rooted tree consist n vertex number 1 n the root tree vertex 1you color vertex tree n color number 1 n exactly vertex color let c_i color vertex p_i parent vertex root tree the coloring consider beautiful vertex k k 1 c_k c_p_k 1 ie vertex color color parent exactly 1calculate number beautiful coloring print m... | 1graph |
monocarp playing computer game in game character kill dragon the battle dragon last 100500 second Monocarp attack dragon poison dagger the ith attack perform begin a_ith second battle start the dagger deal damage apply poison effect dragon deal 1 damage k second start second dragon stab dagger however dragon poison dag... | 2string |
monocarp write number whiteboard both number follow specific format positive integer x p zero append endnow Monocarp ask compare number can help | 2string |
a permutation length n array pp_1p_2dot p_n contain integer 1 n inclusive exactly for example p4 2 6 5 3 1 permutation length 6you give integer n b n number print permutation length n minimum element leave half equal maximum element right half equal b print 1 permutation exist | 1graph |
after watch new overrated series Squid Game Mashtali Soroush decide hold Squid Games Soroush agree host provide money winner prize Mashtali Front Manm player register play game win great prize Mashtali find huge winner prize going decide kill eliminate player money himselfHere evil Mashtali go eliminate playersThere un... | 1graph |
Keshi throw party want everybody party happyhe n friend his ith friend dollar if invite ith friend party happy a_i people party strictly rich b_i people strictly poor himKeshi want invite people possible find maximum number people invite party invite person happy | 1graph |
an array b_1 b_2 ldot b_m palindrome b_i b_m1i 1 m empty array palindromeAn array call kalindrome follow condition hold its possible select integer x delete element array equal x remain array glue remain part palindrome Note do not delete element equal x do not delete element equal xFor example 1 2 1 kalindrome simply ... | 1graph |
n player play game there different map game for player know strength map when player fight specific map player high strength map win no player strength map you game master want organize tournament there total n1 battle while player tournament choose map remain player fight the player lose eliminate tournament in end ex... | 1graph |
there n hero fight arena initially ith hero a_i health pointsthe fight arena take place round at begin round alive hero deal 1 damage hero hit hero occur simultaneously heroe health 1 end round consider killedIf exactly 1 hero remain alive certain round declare winner otherwise winnerYour task calculate number way choo... | 0array |
Eikooc Sushi play gamethe game play tree having n node number 1 n Recall tree having n node undirecte connect graph n1 edgesthey turn alternately move token tree Eikooc make place token node choice Sushi make follow Eikooc follow Sushi in turn player token node u u adjacent node v token currently u visit u oplus v leq ... | 2string |
it October 18 2017 Shohag melancholic soul strong determination pursue Competitive Programming seriously heart find fascinating Fast forward 4 year happy take road he create contest codeforce he find astounding problem idea solve help solve final problem roundyou give integer n k x Find number modulo 998244353 integer ... | 1graph |
for array b n integer extreme value array minimum number time possibly zero follow operation perform b nondecrease Select index 1 le le b b current length b replace b_i element x y x y positive integer x y b_i this way array b change operation perform modified array for example b 2 4 3 index 2 gets select possible arra... | 1graph |
black gift Divine array consist n 1 le n le 2000 integer each position initial value after shout curse array angry start unstoppable transformationthe transformation consist infinite step Array change ith step follow way position j a_j equal number occurrence a_j start stephere example help understand process well init... | 2string |
you give string s you need find nonempty string b follow condition satisfy Strings b subsequence s for index character s_i string s belong exactly string b String lexicographically minimum possible string b possible string give stre s print valid bReminderA string b subsequence string s b obtain s deletion possibly zer... | 1graph |
you give array integer a_1 a_2 ldot a_n b_1 b_2 ldot b_myou need insert elements b arbitrary way as result array c_1 c_2 ldot c_nm size n mNote allow change order element insert elements b arbitrary position they insert begin element end Moreover element b appear result array orderwhat minimum possible number inversion... | 1graph |
Alice Bob playing game they give array a length N the array consist integer they build sequence in begin sequence in turn player remove number leave right array append sequence the rule sequence building strictly increase the winner player make Alice play give start array assumption play optimally win game | 2string |
you give undirected graph N node M edge e_1 e_2 dot e_ma connect graph cactus edge belog simple cycle a graph desert connect component cactus find number pair L R 1 leq L leq R leq M delete edge e_l e_l1 dot e_r graph desert | 1graph |
you give integer array length N A1 A2 you give Q query 4 type 1 k l r x set Ak_iminAk_i x l leq leq r2 k l r x set ak_imaxak_i x l leq leq r3 k l r x set Ak_iAk_ix l leq leq r4 l r find sum_ilr fa1_ia2_i 1097 Fk kth Fibonacci number F00 F11 FkFk1Fk2 x y denote remainder division x yYou process query answer query fourth... | 2string |
little Johnny Bubbles enjoy spending hour computer play video game his favorite game bubble Strike fastpace bubble shoot online game playerseach game set n map have different terrain configuration first phase game decide map game play the game system randomly select map show player each player pick map discard the game... | 1graph |
you give array a length N weight mass a_1 a_2a_nno weight mass you weight balance leave rightYoudont putweightsin order a_1a_nthere astre Sconsisting character l rmeane put theithweight A_i butithweight choice leave right balance heavy Find order put weight balance rule stre S satisfy | 1graph |
monocarp playing computer game now want complete level gameA level rectangular grid 2 row n column Monocarp control character start cell 1 1 intersection 1st row 1st columnmonocarp character cell step cell adjacent andor corner formally possible cell x_1 y_1 cell x_2 y_2 step x_1 x_2 le 1 y_1 y_2 le 1 obviously prohibi... | 1graph |
it easy version problem the difference version node choose colorsTheofanis starving wants eat favorite food sheftalia however finish homework can help problemyou perfect binary tree 2k 1 node binary tree vertex 1 2k 1 1 exactly child vertex 2i 2i 1 vertex 2k 1 2k 1 do not child you want color vertex 6 Rubiks cube color... | 2string |
Theofanis string s_1 s_2 dots s_n character c he want character stre equal c minimum number operationsin operation choose number x 1 le x le n position divisible x replace s_i c find minimum number operation require character equal c xs use operation | 2string |
this problem complicate version d1 significant difference read statementpolycarp array n n integer a_1 a_2 dot a_n Polycarp conceive positive integer k after Polycarp begin perform follow operation array index 1 le le n reduce number a_i kAfter Polycarp perform possibly zero number operation turn half number array find... | 1graph |
one day Ahmed_Hossam go Hemose say Lets solve gym contest Hemose do not want play Valorant come problem tell Ahmed distract sadly Ahmed can not solve could help himThere Agent Valorant n weapon the ith weapon damage value a_i agent face enemy health value HThe Agent perform move enemy diesIn choose weapon decrease enem... | 1graph |
petya root tree integer write vertex the vertex 1 root you answer question treea tree connect graph cycle a rooted tree special vertex call root the parent node v vertex short path v rooteach question define integer v l k to answer question need perform follow step first write sequence integer write short path vertex v... | 1graph |
petya array integer a_1 a_2 ldot a_n he like sorted array unfortunately give array arbitrary Petya want sort itPetya like challenge want sort array 3cycles more formally operation pick 3 pairwise distinct index j k 1 leq j k leq n apply j k cycle array it simultaneously place a_i position j a_j position k a_k position ... | 1graph |
she utmost flawlessly carry person rite preserve world balance yin yangHu Tao little prankster try scare graph problem you give connect undirected graph n node m edge you q query each query consist node bInitially edge graph weight 0 for query choose simple path start end b then add 1 edge path determine possible proce... | 1graph |
Luntik decide try singe he oneminute song b twominute song c threeminute song he wants distribute song concert song include exactly concerthe want absolute difference duration concert small possible the duration concert sum duration song concertplease help Luntik find minimal possible difference minute concert duration | 0array |
let c_1 c_2 ldot c_n permutation integer 1 2 ldot n consider subsegment permutation contain integer x give integer m integer x good exactly m different value maximum subsegmentsCirno study mathematic teacher ask count number permutation length n exactly k good numbersunfortunately Cirno is not good mathematic can not a... | 2string |
an important meeting hold exactly n people invite at moment people step talk private the people talk want time meetingEach person limit sociability the sociability ith person nonnegative integer a_i this mean exactly a_i talk person leave meet talk anymore if a_i 0 ith person leave meet immediately startsA meeting cons... | 1graph |
Casimir string s consist capital latin letter a b c each turn choose follow action erase exactly letter a exactly letter b arbitrary place string letter do not adjacent erase exactly letter B exactly letter C arbitrary place string letter do not adjacent therefore turn length string decrease exactly 2 all turn independ... | 1graph |
the Kingdom Islands consist p island as king rule kingdom island rule jarl rule in total n jarl jurisdictionEach island kingdom strong tradition jarl rule island support conflict the downside strength cultural conflict people inhabit different island Thus jarl rule different island conflicthowever recent year bring cha... | 2string |
the Just Kingdom rule king n lord number 1 n each lord vassal overlord king different lord close king the king lord kindEach lord certain need express certain money need however lord king receive money split equally vassal unmet need only need vassal meet money fulfill need if money leave return excess overlord follow ... | 1graph |
life discover Venus what life form appear convex polygon an international consortium designing probe send Venus picture need estimate bandwidth need send pictureswhen probe take picture life form wish send Earth bandwidth require proportional area bounding box word smallest axisaligned rectangle contain lifeform the sh... | 1graph |
let consider game Sticky Tetris in game field n time m square Tiles appear field player tile each tile 4connected set 7 squareseach new tile appear position fit inside field intersect tile cell tile row field the player tile leave right moment tile entirely fit inside field intersect tile the player stop tile position ... | 2string |
Mr Chaneks city represent plane he want build housing complex citythere telephone pole plane represent grid size n 1 time m 1 there telephone pole x y a_x y 1for point x y define Sx y square Euclidean distance near pole x y Formally square euclidean distance point x_1 y_1 x_2 y_2 x_2 x_12 y_2 y_12To optimize building p... | 1graph |
Chanek Jones help longlost relative Indiana Jones find secret treasure maze bury desert illusionsthe map labyrinth form tree n room number 1 n n 1 tunnel connect possible travel pair room tunnelsthe ith room 1 leq leq n a_i illusion rate to xth room yth room exist tunnel x y take maxa_x a_y a_x a_y energy z denote abso... | 2string |
Mr chanek array n integer the prettiness value denote assum_i1n sum_j1n gcda_i a_j cdot gcdi jwhere gcdx y denote great common divisor GCD integers x yin word prettiness value array total sum gcda_i a_j cdot gcdi j pair jhelp Mr Chanek find prettiness value output result modulo 109 7 | 1graph |
there city park represent tree n attraction vertex n 1 rail edge the ith attraction happiness value a_ieach rail color it black t_i 0 white t_i 1 black train operate black rail track white train operate white rail track if previously black train want ride white train previously white train want ride black train need us... | 1graph |
Ivan play roguelike computer game he control single hero game the hero n equipment slot there list c_i item ith slot jth increase hero strength a_ij the item slot pairwise distinct list increase order strength increase so a_i1 a_i2 dot a_ic_iFor slot Ivan choose exactly item let choose item ith slot b_ith item correspo... | 1graph |
a bracket sequence string contain character a regular bracket sequence bracket sequence transform correct arithmetic expression insert character 1 original character sequence for example bracket sequence regular result expression 11 111 notyou give integer n your goal construct print exactly n different regular bracket... | 2string |
you give digital clock n digit each digit show integer 0 9 clock show integer 0 10n1 the clock lead zeroes number small 10n1You want clock 0 operation possible in operation follow decrease number clock 1 swap digit choose digit swap do not adjacent your task determine minimum number operation need clock 0 | 2string |
you give book n chapterseach chapter specify list chapter need understand order understand chapter to understand chapter read understand chapter require listcurrently do not understand chapter you going read book begin till end repeatedly understand book Note read chapter moment do not understand require chapter do not... | 1graph |
you give simple undirected graph n vertex n you go write letter vertex each letter k letter Latin alphabeta path graph call hamiltonian visit vertex exactly a string call palindromic read leave right right leave a path graph call palindromic letter vertex spell palindromic string change ordera string length n good lett... | 1graph |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.