task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Problem F: Old Memories In 4272 A.D., Master of Programming Literature, Dr. Isaac Cornell Panther-Carol, who has miraculously survived through the three World Computer Virus Wars and reached 90 years old this year, won a Nobel Prize for Literature. Media reported every detail of his life. However, there was one thing t... | 38,709 |
E - éžææŽ»å Problem Statement ããªãã¯æ¬¡åã®éžæã®åè£è
ã§ããXæ°ã®æ¯æŽè
ã§ããïŒ Xæ°ã¯é§
åã§ã®è¡é æŒèª¬ãäºå®ããŠããïŒã§ããã ãå€ãã®ææš©è
ã«èŠãŠããããå Žæã§æŒèª¬ããããšèããŠããïŒ é§
å㯠$N$ åã®é害ç©ãš $M$ äººã®ææš©è
ãååšããŠããäºæ¬¡å
å¹³é¢ãšããŠäžããããïŒ åé害ç©ã¯å€è§åœ¢ã§ãããããïŒãã®å€è§åœ¢ã®å
åŽã®é åãé害ç©ãšãªãïŒå€è§åœ¢ã®èŸºäžã¯é害ç©ã«å«ãŸããªãïŒ ãŸãïŒææš©è
ã¯å¹³é¢äžã®ç¹ãšããŠããããããïŒ ããææš©è
ã®äœçœ®ãšXæ°ã®äœçœ®ãçµã¶ç·åäžã«é害ç©ãååšããªããšãïŒãã®ææš©è
ã¯Xæ°ãèŠãããšãã§ããïŒ ããªãã®ä»äºã¯ïŒé§
åã®é害ç©ãšææš©è
ã®æ
å ±ãããšã«ïŒãã£ãšãå€ãã®ææš©è
ã«èŠãŠã... | 38,710 |
Distance For given two segments s1 and s2 , print the distance between them. s1 is formed by end points p0 and p1 , and s2 is formed by end points p2 and p3 . Input The entire input looks like: q (the number of queries) 1st query 2nd query ... q th query Each query consists of integer coordinates of end points of s1 an... | 38,711 |
察称ïŒé²æ° 1 ã°ã©ã ã3 ã°ã©ã ã9 ã°ã©ã ã27 ã°ã©ã ã®ããããïŒã€ãã€ããã°ã倩ã³ãã䜿ã£ãŠ 1 ã°ã©ã ãã 40ã°ã©ã ãŸã§ 1 ã°ã©ã å»ã¿ã§éããããšãç¥ãããŠããŸããããšãã°ã倩ã³ãã®äžæ¹ã®ç¿ã«éããéããããã®ãš 3 ã°ã©ã ã®ããããèŒããããäžæ¹ã®ç¿ã« 27 ã°ã©ã ãš 1 ã°ã©ã ã®ããããèŒããŠé£ãåãã°ãéããããã®ã®éã㯠27-3+1=25 ã°ã©ã ã ãšããããŸãã ããã«ã1(=3 0 )ã°ã©ã ã3 1 ã°ã©ã ã... ã3 n-1 ã°ã©ã ã3 n ã°ã©ã ãŸã§ã®ããããïŒã€ãã€ããã°ã倩ã³ãã䜿ã£ãŠ(3 n+1 -1)/2ã°ã©ã ãŸã§éããããšãç¥ãããŠããŸãããŸãã倩ã³ããé£ãåããããªãããã®çœ®ãæ¹ã¯äžéãã... | 38,712 |
Square Route ã¹ã¯ãŠã§ã¢ã»ã«ãŒã English text is not available in this practice contest. ãã®ãã³æ°ãã豪éžã建ãŠãããšã決ãã倧å¯è±ªã®åç°æ°ã¯ïŒã©ã®è¡ã«æ°éžã建ãŠããããšæ©ãã§ããïŒå®ã¯ïŒåç°æ°ã¯æ£æ¹åœ¢ããšãŠã奜ããšããå€ãã£ã人ç©ã§ããïŒãã®ããå°ãã§ãæ£æ¹åœ¢ã®å€ãè¡ã«äœã¿ãããšæã£ãŠããïŒ åç°æ°ã¯ïŒç¢ç€ç®ç¶ã«éè·¯ã®æŽåãããè¡ã®äžèЧãæã«å
¥ããŠïŒããããã®è¡ã«ã€ããŠïŒéè·¯ã«ãã圢äœãããæ£æ¹åœ¢ã®åæ°ãæ°ããããšã«ããïŒãšãããïŒéãšéã®ééã¯äžå®ãšã¯éããªãããïŒæäœæ¥ã§æ£æ¹åœ¢ãæ°ããã®ã¯å€§å€ã§ããïŒããã§ããªãã«ã¯ïŒç¢ç€ç®ç¶ã®éè·¯ã®æ
å ±ãäžãããããšãã«ïŒ... | 38,713 |
Skyland Somewhere in the sky, KM kingdom built n floating islands by their highly developed technology. The islands are numbered from 1 to n . The king of the country, Kita_masa, can choose any non-negative real number as the altitude for each island, as long as the sum of the altitudes is greater than or equals to H .... | 38,715 |
Score : 400 points Problem Statement You have N cards. On the i -th card, an integer A_i is written. For each j = 1, 2, ..., M in this order, you will perform the following operation once: Operation: Choose at most B_j cards (possibly zero). Replace the integer written on each chosen card with C_j . Find the maximum po... | 38,716 |
Problem G: The Humans Braving the Invaders Problem çŸåšãå°çã¯å®å®ããã®äŸµç¥è
ã§ããã€ã³ããŒããŒã®æ»æãåãã人é¡ã§çãæ®ã£ãè
ã¯åºå°ã«ããæã
ã ããšãªã£ãã 奎ãã«å¯Ÿæã§ããæŠåãã»ãšãã©æ®ãããŠããªãã ã ããããã§æã
ã¯è«Šãããšããããšã¯ããªãã ã€ã³ããŒããå
šæ»
ãããããšããæã
人é¡ãçãæ®ãæåŸã®ææ®µã§ããã ä»ããæåŸã«ãªãã§ãããäœæŠã®å
容ã説æããã ãŸããã€ã³ããŒããŒã®æŠåã«æ¯ã¹æã
ã®æŠåã¯ããŸãã«ãå°ãªãã®ã§ããã®åºå°ã«ç«ãŠããããç± åæŠãè¡ãã ãã®åºå°ã¯é«ãå±±ã«å²ãŸããŠããŠãã€ã³ããŒããŒã䟵æ»ããã«ã¯åºå°æ£é¢ã«ããçã£çŽããªéãéãä»ç¡ãã ãã®éããã£ãŒã«... | 38,717 |
Score : 100 points Problem Statement You are given an integer N that has exactly four digits in base ten. How many times does 2 occur in the base-ten representation of N ? Constraints 1000 \leq N \leq 9999 Input Input is given from Standard Input in the following format: N Output Print the answer. Sample Input 1 1222 S... | 38,718 |
Score : 2100 points Problem Statement You have a circle of length C , and you are placing N arcs on it. Arc i has length L_i . Every arc i is placed on the circle uniformly at random: a random real point on the circle is chosen, then an arc of length L_i centered at this point appears. Note that the arcs are placed ind... | 38,719 |
Problem I: ãããããäºééæ³ çŽæ
§æŠ2119 幎15 ã®æã宮廷éè¡å£«Sengemon Lugene ã®æã«ãã£ãŠãäžåã®éè¡æžãæžãèšãããããã®éè¡æžãIn Magirayãã¯ããã®äžçã®éè¡æ³åã®æ ¹å¹¹ã«æ·±ãé¢ãããäºééæ³ããã誰ã«ã§ãç¿åŸå¯èœãªæè¡ãšããŠäœç³»åããããšããç¹ã§é©æ°çãªæžç©ã§ãã£ãããŸãã¯ããã®æžç©ã®å
容ãèŠçŽãããã®ãèŠãŠãããã ããšã¬ã¡ã³ãã äžçäžã®ããããç©äœã¯ããæ³ãã颚ãã矜ããè±ããç ããç¯ãâŠâŠãšãã£ããæ¥µå°èŠçŽ ããšã¬ã¡ã³ããããæ§æãããŠããããšã¬ã¡ã³ãã«ã¯å€ãã®çš®é¡ãããã人éã¯ãšã¬ã¡ã³ããšå¥çŽã亀ããããšã§ãå¥çŽã亀ãããçš®é¡ã®ãšã¬ã¡ã³ããçšããäºééæ³ãçºåãããããšãã§ã... | 38,720 |
Problem J: ICPC: Ideal Coin Payment and Change Taro, a boy who hates any inefficiencies, pays coins so that the number of coins to be returned as change is minimized in order to do smoothly when he buys something. One day, however, he doubt if this way is really efficient. When he pays more number of coins, a clerk con... | 38,721 |
Score : 300 points Problem Statement 1000000000000001 dogs suddenly appeared under the roof of Roger's house, all of which he decided to keep. The dogs had been numbered 1 through 1000000000000001 , but he gave them new names, as follows: the dogs numbered 1,2,\cdots,26 were respectively given the names a , b , ..., z ... | 38,722 |
B: éãã®ç¯å² åé¡ éãã®ç°ãªã $N$ è²ã®ããŒã«ããã¥ãŒã«ããããå
¥ã£ãŠããŸãããã¥ãŒã«ã¯ãå
é ãã $1,2,3, \dots ,N-1,N,1,2,3, \dots ,N-1,N,1,2,3, \dots$ ãšãããµãã«æé ã«ããŒã«ã䞊ãã§ããŠã è² $N$ ã®ããŒã«ã®åŸãã«ã¯ãŸãè² $1$ ã®ããŒã«ããé ã«å
¥ã£ãŠããŸãã åãè²ã®ããŒã«ã¯ããããåãéãã§ãããè² $i$ ã®ããŒã«ã®éã㯠$A_i$ ã§ãã ãã®ç¶æ
ããããã¥ãŒã®å
é ããããŒã«ã $M$ ååãåºããããã 1 ã€ã®ã°ã«ãŒããšããäœæ¥ãç¹°ãè¿ããŸãã ãããŠããã¥ãŒããåãåºããåè²ã®ããŒã«ã®ç·æ°ããã¹ãŠçãããªã£ããšãã«ã°ã«ãŒããäœãäœæ¥ããããŸã... | 38,723 |
Score : 100 points Problem Statement Serval is fighting with a monster. The health of the monster is H . In one attack, Serval can decrease the monster's health by A . There is no other way to decrease the monster's health. Serval wins when the monster's health becomes 0 or below. Find the number of attacks Serval need... | 38,724 |
Score : 100 points Problem Statement A 3Ã3 grid with a integer written in each square, is called a magic square if and only if the integers in each row, the integers in each column, and the integers in each diagonal (from the top left corner to the bottom right corner, and from the top right corner to the bottom left c... | 38,725 |
æž©æ³æ
è¡ æž©æ³å¥œãã®ãããããã¯ã次ã®é·æäŒæãå©çšããŠãšããæž©æ³å°ãžã®æ
è¡ãèšç»ããŠããŸããç§»åã¯é·è·é¢ãã¹ãä¹ãç¶ãããªãã¹ããéããããã«ç®çå°ãžãã©ãçããããšæã£ãŠããŸãã貯éããããšã¯ãããè³éã«å¿èš±ãªããããããã¯ããããããã«çžè«ããããšã«ããŸãããèšç»ãèããŠæå¿ãããããããã¯ããããããã«ç¹å¥ãªåç¬Šãæž¡ããŸããã ãã®å笊ã¯ãé·è·é¢ãã¹ã®é£ç¶ãã2åºéã1åã ãç¡æã§ä¹ãããšãããã®ã§ããã䜿ãããã«ãã£ãŠã¯ããªãã®ç§»åè²»åæžãèŠèŸŒããŸããããã倧ããªå¹æãçºæ®ãããããã«ã¯ãã£ããããèšç»ãç·Žãå¿
èŠããããŸãã åºçºå°ãšç®çå°ãåã³äžç¶å°ç¹ãåãã㊠n åã2ã€ã®å°ç¹ãçµã¶è·¯ç·ã m åäžããããŸããåå°ç¹... | 38,726 |
Rooted Trees A graph G = ( V , E ) is a data structure where V is a finite set of vertices and E is a binary relation on V represented by a set of edges. Fig. 1 illustrates an example of a graph (or graphs). Fig. 1 A free tree is a connnected, acyclic, undirected graph. A rooted tree is a free tree in which one of the ... | 38,727 |
Problem D: Luigi's Tavern Luigi's Tavern is a thriving tavern in the Kingdom of Nahaila. The owner of the tavern Luigi supports to organize a party, because the main customers of the tavern are adventurers. Each adventurer has a job: hero, warrior, cleric or mage. Any party should meet the following conditions: A party... | 38,728 |
Score: 100 points Problem Statement We held two competitions: Coding Contest and Robot Maneuver. In each competition, the contestants taking the 3 -rd, 2 -nd, and 1 -st places receive 100000 , 200000 , and 300000 yen (the currency of Japan), respectively. Furthermore, a contestant taking the first place in both competi... | 38,729 |
é(Nails) JOI ããã¯æ¿ã«éãåºããŠéãã§ããïŒäžå³ã®ããã«ïŒJOI ããã¯äžèŸº N æ¬ã®æ£äžè§åœ¢ã®åœ¢ã«éã䞊ã¹ãŠåºããïŒäžãã a è¡ç®(1 †a †N ) ã«ã¯ a æ¬ã®éã䞊ãã§ããïŒãã®ãã¡å·Šãã b æ¬ç®(1 †b †a ) ã®éã( a , b ) ã§è¡šãïŒ å³1: éã®äžŠã³æ¹ïŒ N = 5 ã®å ŽåïŒ éãé ç¹ãšããæ£äžè§åœ¢ãïŒãå蟺ãå
šäœã®æ£äžè§åœ¢ã®èŸºã®ãããããšå¹³è¡ã§ïŒå
šäœã®æ£äžè§åœ¢ãšåãåããã§ãããšãïŒãã®æ£äžè§åœ¢ãã ããæ£äžè§åœ¢ ããšåŒã¶ïŒããªãã¡ïŒãããæ£äžè§åœ¢ããšã¯ïŒ3 æ¬ã®é( a , b ), ( a + x , b ), ( a + x , b + x ) ãé ç¹ãšããæ£äžè§åœ¢ã®ã... | 38,732 |
Problem B: Milk Problem ã¡ããã©$a$æ¬ã®çä¹³ã®ç©ºãç¶ãæã£ãŠãããšæ°ãã«$b$æ¬ã®çä¹³ã®å
¥ã£ãç¶ãšäº€æã§ããã æåã«$x$æ¬ã®çä¹³ã®å
¥ã£ãç¶ãæã£ãŠããå·æããã¯ãæå€§äœæ¬åã®çä¹³ã飲ããã ãããã$1000000007$ã§å²ã£ãäœããåºåããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã $a$ $b$ $x$ 3ã€ã®æŽæ°$a$, $b$, $x$ã空çœåºåãã§äžããããã Constraints å
¥åã¯ä»¥äžã®æ¡ä»¶ãæºããã $1 \leq a \leq 10^{15} $ $0 \leq b \lt a $ $0 \leq x \leq 10^{15} $ Output çãã1è¡ã«åºåããã Sam... | 38,733 |
A: ãç (Paken) ããªãã¯ãç éšå¡ã§ããããã"Paken" ãšåºåããªããã å
¥å ãã®åé¡ã«ã¯å
¥åã¯äžããããªãã åºå "Paken" ãš 1 è¡ã«åºåããŠãã ããã æåŸã®æ¹è¡ãå¿ããªãããã«ããŸãããã å¿
èŠãªç©ºçœãæ¹è¡ããªãã£ãããäœèšãªç©ºçœãæ¹è¡ãåºåãããš'Presentation Error'ãšãªãäžæ£è§£ã«ãªã£ãŠããŸããŸãã®ã§ã泚æããŠãã ããã å
¥åäŸ (No input) åºåäŸ Paken 泚æ Pã¯å€§æåããã®ããšã¯å°æåã§ããããšã«æ³šæããŠãã ããã | 38,734 |
Mode Value Your task is to write a program which reads a sequence of integers and prints mode values of the sequence. The mode value is the element which occurs most frequently. Input A sequence of integers a i (1 †a i †100). The number of integers is less than or equals to 100. Output Print the mode values. If there... | 38,735 |
Swap Write a program which reads a sequence of integers $A = \{a_0, a_1, ..., a_{n-1}\}$ and swap specified elements by a list of the following operation: swapRange($b, e, t$): For each integer $k$ ($0 \leq k < (e - b)$, swap element $(b + k)$ and element $(t + k)$. Input The input is given in the following format. $n$... | 38,736 |
æèŒª (Ring) åé¡ ããªã㯠N åã®æèŒªãæã£ãŠããïŒã©ã®æèŒªã«ãïŒã¢ã«ãã¡ãããã®å€§æå 10 æåãããªãæååãå»å°ãããŠããïŒæèŒªã«ã¯æååã®æåãšæåŸãã€ãªãã£ãåœ¢ã§æåãå»å°ãããŠããïŒæèŒªã«å»å°ãããæååãéé ã«èªãå¿é
ã¯ãªãïŒ æ¢ãããæååãäžãããããšãïŒãã®æååãå«ãæèŒªãäœåããããæ±ããããã°ã©ã ãäœæããïŒ å
¥å å
¥å㯠2+N è¡ãããªãïŒ 1 è¡ç®ã«ã¯ïŒ1 æåä»¥äž 10 æå以äžã®ã¢ã«ãã¡ãããã®å€§æåãããªãæ¢ãããæååãæžãããŠããïŒ 2 è¡ç®ã«ã¯ïŒæèŒªã®åæ° N ( 1 ⊠N ⊠100 )ãæžãããŠããïŒ 2+i è¡ç®(1 †i †N )ã«ã¯ïŒ i åç®ã®æèŒªã«å»å°ãããŠ... | 38,737 |
ããŒã«ãŒ ãããããªå®¹éã®ããŒã«ãŒãäžããããŠããŸããã¯ããã«ããã®äžã®äžçªå®¹éã®å€§ããªããŒã«ãŒãäžåéžã³ãèå£ããæ°Žããã£ã±ãã«ãªããŸã§æ³šããŸããã€ãã«ã次ã®ã«ãŒã«ã«ãããããªãããããŒã«ãŒã®æ°Žãä»ã®ããŒã«ãŒã«ç§»ãæ¿ããŠãããŸãã ããŒã«ãŒã«å
¥ã£ãŠããæ°Žã¯,æ®ããã«ãã¹ãŠä»ã®ããŒã«ãŒã«ç§»ããªããã°ãªããªãããã ããäžåã®ããŒã«ãŒã«æ°Žãå
šéšç§»ããªããšãã¯ãè€æ°ã®ããŒã«ãŒã«åããŠç§»ããŠãããã ããŒã«ãŒã«æ°Žãå
¥ãããšãããã£ã±ãã«ãªããŸã§æ°Žã泚ããªããã°ãªããªãããŸããæ°ŽãããŒããŠã¯ãªããªãã è€æ°ã®ããŒã«ãŒããåãããŒã«ãŒã«äžåºŠã«æ°Žã泚ãã§ã¯ãªããªãã åãããŒã«ãŒã«ã¯äžåºŠããæ°Žã泚ãã§ã¯ãªããªãã ãã®ã«ãŒã«ã«ãããã£ããšããããŒ... | 38,738 |
Score : 200 points Problem Statement Takahashi went to an all-you-can-eat buffet with N kinds of dishes and ate all of them (Dish 1 , Dish 2 , \ldots , Dish N ) once. The i -th dish (1 \leq i \leq N) he ate was Dish A_i . When he eats Dish i (1 \leq i \leq N) , he gains B_i satisfaction points. Additionally, when he ea... | 38,739 |
Problem F: MLE ICPC World Finals 4æ¥ç® æãåµã®å€ã ã£ãã 倢ã®äžã§ãã£ãŒæ°ã¯ã¿ã€ã ã¹ãªããããŠããã ICPCã®äŒå Žã®ããã ãäœãããããâŠã ãããâŠããã¯ãN幎åïŒNã¯èªç¶æ°ïŒã®ICPCãªã®ãâŠ? æ··ä¹±ã®å
ã«ç«¶æã¯éå§ããŠããŸã£ãã ã ãæ
ãŠãå¿
èŠã¯ãªãã ãã£ãšåé¡ãç°¡åã«éããªãã äŸãã°ãããªã©ã¯ãœãŒãããã ãã§è§£ããŠããŸãã¯ãã§ã¯ãªããã å·éã«ã³ãŒããæžãäžããéããã«Submitã ããããã®çµæã¯âŠMemory Limit ExceededâŠ?! åé¡ C++èšèªã«ã€ããŠã¯ä»¥äžã®ã³ãŒã long long int a[n]; unsigned long long int x = ... | 38,740 |
Score : 1200 points Problem Statement There are 2N balls in the xy -plane. The coordinates of the i -th of them is (x_i, y_i) . Here, x_i and y_i are integers between 1 and N (inclusive) for all i , and no two balls occupy the same coordinates. In order to collect these balls, Snuke prepared 2N robots, N of type A and ... | 38,741 |
Problem C: Brave Princess Revisited ããè²§ä¹ãªåœã®ããŠãã°ã§åæ¢ãªãå§«æ§ãïŒæ¿ç¥çµå©ã®ããå¥ã®åœã«å«ãããšã«ãªã£ãïŒãšããããå§«æ§ã亡ãè
ãšããããšããŠããæªæŒ¢ãå«ãå
ãžã®éã®éäžã§åºå®¢ãæŸã£ãŠããïŒ ãå§«æ§ãç¡äºã«çžæåœã«éãå±ããããïŒããªãã¯å®å
šãªçµè·¯ãæ¢ã«æ±ºå®ããŠããã®ã ãïŒãå§«æ§ã®ä»ãŸã§ã«éã£ãããšã®ãªãéãéã£ãŠã¿ãããšãã ãããŸãŸãª ãã£ãŠã®é¡ãã§å¥ã®éãéãããšãšãªã£ãïŒããã§ããªãã¯å°å³ãèŠãªãããå§«æ§ãéãéãæ±ºããªããããšã«ããïŒ å
šãŠã®éã¯ïŒå®¿å Žå士ãã€ãªãè¡éã§ããïŒäŸ¿å®äžïŒåºçºå°ç¹åã³ç®çå°ç¹ãå®¿å ŽãšããïŒãšãããïŒæ°ããéã¯æ²»å®ã®åé¡ãæ±ããŠããïŒçè³ããå§«æ§ã亡ã... | 38,742 |
Score : 200 points Problem Statement There are N children, numbered 1, 2, ..., N . Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i ( 1 \leq i \leq N ), Child i will be happy if he/she gets exactly a_i sweets. Snuke is t... | 38,743 |
Problem H: Twenty Questions Consider a closed world and a set of features that are defined for all the objects in the world. Each feature can be answered with "yes" or "no". Using those features, we can identify any object from the rest of the objects in the world. In other words, each object can be represented as a fi... | 38,744 |
Problem D Content Delivery You are given a computer network with n nodes. This network forms an undirected tree graph. The $i$-th edge connects the $a_i$-th node with the $b_i$-th node and its distance is $c_i$. Every node has different data and the size of the data on the $i$-th node is $s_i$. The network users can de... | 38,745 |
Problem E: Colored Octahedra A young boy John is playing with eight triangular panels. These panels are all regular triangles of the same size, each painted in a single color; John is forming various octahedra with them. While he enjoys his playing, his father is wondering how many octahedra can be made of these panels... | 38,746 |
Score : 600 points Problem Statement Takahashi is playing a board game called Sugoroku. On the board, there are N + 1 squares numbered 0 to N . Takahashi starts at Square 0 , and he has to stop exactly at Square N to win the game. The game uses a roulette with the M numbers from 1 to M . In each turn, Takahashi spins t... | 38,747 |
å€åº(Night Market) 倪éããã¯ïŒJOI ç¥ç€Ÿã§éãããå€ç¥ãã«è¡ãããšã«ããïŒ JOI ç¥ç€Ÿã«åããéã«æ²¿ã£ãŠïŒ N åã®å€åºãéãããŠããïŒããããã®å€åºã«ã¯ïŒ1 ãã N ãŸã§ã®çªå·ãé çªã«ã€ããŠããïŒéãã æã®æ¥œãããšéã¶ã®ã«ãããæéãããããæŽæ°ã§æ±ºãŸã£ãŠããïŒå€åº i ã§éãã æã®æ¥œãã㯠A i ã§ïŒå€åº i ã§éã¶ã®ã«ãããæé㯠B i ã§ããïŒ ãŸãïŒå€ç¥ãã®ã€ãã³ããšããŠè±ç«å€§äŒãããïŒæå» S ã«æã倧ããªè±ç«ãæã¡äžããããïŒå€ªéããã¯ãã®æã倧ããªè±ç«ãèŠãããšæã£ãŠããïŒ å€ªéããã¯å€åºãšè±ç«ã®äž¡æ¹ã楜ããããã«ïŒå€ç¥ãã«å°çããæå»0 ããå€ç¥ããçµããæå» T ãŸã§ã®äºå®ãç«ãŠãããšã«... | 38,750 |
Problem C: Phone Number Problem æ ªåŒäŒç€ŸãŠã¯ããã¢ã®é»è©±çªããã³ããã¯æ¯æ¥ãšãŠãé·ãé»è©±çªå·ãé»è©±ã«å
¥åããŠããŸãã ããæ¥äœãã«ãç²ãããã³ããã¯ãç²ããããé©ãã¹ãèãã«è³ããŸããã ãé»è©±ã®ãã¿ã³ã®é
眮ãäžŠã¹æ¿ãããå°ãã§ã楜ã§ããã®ã§ã¯ïŒïŒã é»è©±ã«ã¯$3 \times 3$ã§çééã«åºåãããæ£æ¹åœ¢ãããã9åã®ãã¹ã«ã¯äžŠã¹æ¿ããããšã®ã§ãã1ãã9ãŸã§ã®ãã¿ã³ããããã1ã€ãã€ã€ããŠããŸãã é»è©±çªå·ãæã€éããã³ããã¯çæã ãã䜿ã£ãŠã次ã®äºã€ã®æäœãè¡ãããšãã§ããŸãã 人差ãæãä»è§ŠããŠãããã¿ã³ã«èŸºã§é£æ¥ããããããã®ãã¿ã³ã«è§Šããããã«ç§»åãããã 人差ãæãè§ŠããŠãããã¿ã³ãæŒ... | 38,751 |
English Sentence Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. The text includes only alphabetical characters and spaces. A word is a sequence of letters w... | 38,752 |
Problem K. Rough Sorting For skilled programmers, it is very easy to implement a sorting function. Moreover, they often avoid full sorting to reduce computation time if it is not necessary. Here, we consider "rough sorting" which sorts an array except for some pairs of elements. More formally, we define an array is "$K... | 38,753 |
ã¿ã€ã« (Tile) åé¡ JOI 髿 ¡ã§ã¯ïŒ 1 à 1 ã®æ£æ¹åœ¢ã®ã¿ã€ã«ã䜿ã£ãŠ N à N ã®æ£æ¹åœ¢ã®å£ç»ãäœãïŒæåç¥ã§å±ç€ºããããšã«ãªã£ãïŒã¿ã€ã«ã®è²ã¯ïŒèµ€ïŒéïŒé»ã® 3 çš®é¡ã§ããïŒå£ç»ã®ãã¶ã€ã³ã¯æ¬¡ã®éãã§ããïŒãŸãïŒæãå€åŽã®åšã«èµ€ã®ã¿ã€ã«ã貌ãïŒãã®å
åŽã®åšã«éã®ã¿ã€ã«ã貌ãïŒããã«ãã®å
åŽã®åšã«é»è²ã®ã¿ã€ã«ã貌ãïŒããã N à N ã®æ£æ¹åœ¢ãåãå°œãããããŸã§ç¹°ãè¿ãïŒçšããã¿ã€ã«ã®è²ã¯ïŒäžçªå€åŽã®åšããé çªã«èµ€ïŒéïŒé»ïŒèµ€ïŒéïŒé»ïŒâŠã§ããïŒ æåç¥ãè¿ã¥ããŠããããæ¥ïŒå£ç»ã®ãã¡ K æã®ã¿ã€ã«ãã¯ãããŠããããšã倿ããïŒããã§ïŒæ°ããã¿ã€ã«ã賌å
¥ããŠïŒã¯ãããç®æã«æ°ããã¿ã€ã«ã貌ãããšã«ããïŒ å
¥åãš... | 38,754 |
Rotate Write a program which reads a sequence of integers $A = \{a_0, a_1, ..., a_{n-1}\}$ and rotate specified elements by a list of the following operation: rotate($b, m, e$): For each integer $k$ ($0 \leq k < (e - b)$), move element $b + k$ to the place of element $b + ((k + (e - m)) \mod (e - b))$. Input The input ... | 38,755 |
äžç®äžŠã¹ 3 à 3 ã®ç€é¢ã®äžç®äžŠã¹ãèããŸããããäžç®äžŠã¹ã¯ 2 人ã§è¡ã察æŠã²ãŒã ã§ããå
æ»åŸæ»ã決ããäžäººã¯é»ç³ãäžäººã¯çœç³ãæã¡ãŸããç€é¢ã«ç³ã亀äºã«äžã€ãã€çœ®ããŠããã瞊暪æãã®ããããã®æ¹åã«å
ã« 3 ã€èªåã®ç³ã䞊ã¹ã人ãåã¡ãšãªããŸãã ç€é¢ã®æ
å ±ãå
¥åãšããåæã®å€å®ãè¡ããé»ãåã¡ã®å Žåã¯ãbããçœãåã¡ã®å Žåã¯ãwããã©ã¡ããããã£ãŠããªãå Žåã¯ãNAããšåºåããããã°ã©ã ãäœæããŠãã ããã ç€é¢ã®æ
å ±ã¯ã3è¡3åã®æååã§æ§æãããŸãããbãã¯é»ç³ããwãã¯çœç³ãã+ã(åè§ãã© ã¹)ã¯äœã眮ãããŠããªãç¶æ³ã衚ããŸãããã ããåæã«é»ã3ã€ãçœã3ã€äžŠã¶ããšã¯ãããŸã ãã Input è€æ°ã®ããŒã¿ã»ã... | 38,756 |
Score : 300 points Problem Statement There is an integer sequence A of length N whose values are unknown. Given is an integer sequence B of length N-1 which is known to satisfy the following: B_i \geq \max(A_i, A_{i+1}) Find the maximum possible sum of the elements of A . Constraints All values in input are integers. 2... | 38,757 |
Score : 100 points Problem Statement It is September 9 in Japan now. You are given a two-digit integer N . Answer the question: Is 9 contained in the decimal notation of N ? Constraints 10â€Nâ€99 Input Input is given from Standard Input in the following format: N Output If 9 is contained in the decimal notation of N , pr... | 38,758 |
Problem E: Pie Chart is as easy as pie. ICPC World Finals 3æ¥ç® ãã®æ¥ããã£ãŒæ°ã¯ããŒã å
ã®èšèªäœ¿çšå²åã調ã¹ãŠããã çããããšã«ãæã
ã®ããŒã ã¯äœ¿çšèšèªãçµ±äžããŠããªãã 調æ»ã®çµæã2人ãC++ã1人ãJavaã䜿ã£ãŠããããšãåãã£ãã ããŠãããããã€ãã£ãŒãïŒåã°ã©ãïŒã«ããŠã¿ããã ãããJavaã®äœ¿çšå²åãå°ãªãããã«èŠãããªã ã©ãèããŠããããªã¯ãã¯ãªãã®ã§å°ã
æãå ãããã ããã¯æè¿æµè¡ãã®ãã¯ããã¯ã§ããã ããã€ãã£ãŒãã®äžå¿åº§æšããããããšãããã®ã ã ïŒçããã¯ããããŠã¯ãããŸãããïŒ ãããããã§ãã©ã³ã¹ããšããã ãšããã§é¢ç©ã¯ã©ã®ããã«... | 38,759 |
Score : 700 points Problem Statement Snuke has decided to use a robot to clean his room. There are N pieces of trash on a number line. The i -th piece from the left is at position x_i . We would like to put all of them in a trash bin at position 0 . For the positions of the pieces of trash, 0 < x_1 < x_2 < ... < x_{N} ... | 38,760 |
Problem B: Matsuzaki Number Matsuzaki ææã¯ïŒå®å®ã®ççãç ç©¶ããŠããç§åŠè
ã§ããïŒäººçïŒå®å®ïŒãã¹ãŠã®çã㯠42 ã§ãããšèšãããŠãããïŒMatsuzaki ææã¯ããã ãã§ã¯å®å®ã®ççãè§£æããã«ã¯äžååã§ãããšèããŠããïŒMatsuzaki ææã¯ïŒå®å®ã®çç㯠2 ã€ã®ãã©ã¡ãŒã¿ãããªã颿°ã§è¡šããããšèããŠããïŒ42 ã¯ãã® 1 ã€ã«éããªããšããã®ã§ããïŒ Matsuzaki ææã®å®çŸ©ãã颿° M( N , P ) ã¯ïŒ N ãã倧ããçŽ æ°ã 2 ã€éžãã§ïŒåãæ°ã 2 ã€ã§ãæ§ããªãïŒåããšãããšã§åŸãããæ°ã®å
šäœãïŒå°ããã»ãããé çªã«äžŠã¹ããšãã«ïŒ P çªç®ã«çŸããæ°ã衚ã... | 38,761 |
Problem G: Malfatti Circles The configuration of three circles packed inside a triangle such that each circle is tangent to the other two circles and to two of the edges of the triangle has been studied by many mathematicians for more than two centuries. Existence and uniqueness of such circles for an arbitrary triangl... | 38,762 |
Problem C Casino Taro, who owes a debt of $n$ dollars, decides to make money in a casino, where he can double his wager with probability $p$ percent in a single play of a game. Taro is going to play the game repetitively. He can choose the amount of the bet in each play, as long as it is a positive integer in dollars a... | 38,763 |
Problem E: The Most Powerful Spell Long long ago, there lived a wizard who invented a lot of "magical patterns." In a room where one of his magical patterns is drawn on the floor, anyone can use magic by casting magic spells! The set of spells usable in the room depends on the drawn magical pattern. Your task is to com... | 38,764 |
D - ã€ã³ããžãã« Problem Statement ããªãã¯åéãš" ã€ã³ããžãã« "ãšããã«ãŒãã²ãŒã ãéãŒããšããŠããïŒ ãã®ã«ãŒãã²ãŒã ã§ã¯ïŒ" åŸç¹ã«ãŒã "ãš" 劚害ã«ãŒã "ãšãã2çš®é¡ã®ã«ãŒãã䜿ãïŒ ããããã®åŸç¹ã«ãŒãã«ã¯ïŒæ£ã®å€ãæžãããŠããïŒãã®ã«ãŒãã²ãŒã ã®ã«ãŒã«ã¯æ¬¡ã®éãã§ããïŒ ã²ãŒã ã¯ãã¬ã€ã€ãŒ1ãšãã¬ã€ã€ãŒ2ã®2人ã®ãã¬ã€ã€ãŒã§è¡ãããïŒã²ãŒã ã¯ãã¬ã€ã€ãŒ1ã®ã¿ãŒã³ããå§ãŸãïŒ å Žã«ã¯ïŒ1ã€ã®ã¹ã¿ãã¯ãš2ã€ã®ããããããïŒã¹ã¿ãã¯ã¯ïŒ2人ã®ãã¬ã€ã€ãŒã眮ããã«ãŒããããªãïŒãŸãïŒããããã®ãã¬ã€ã€ãŒãæã€ãããã¯ãã®ãã¬ã€ã€ãŒãæã€åŸç¹ã«ãŒããšåŠšå®³ã«ãŒããããªãïŒãã¬ã€ã€ãŒã¯èªåïŒãããã¯çžæã... | 38,765 |
Area For a given polygon g , computes the area of the polygon. g is represented by a sequence of points p 1 , p 2 ,..., p n where line segments connecting p i and p i+1 (1 †i †n-1 ) are sides of g . The line segment connecting p n and p 1 is also a side of the polygon. Note that the polygon is not necessarily convex.... | 38,766 |
æçæ°ã®ãªãŒãã£ãªã«ãŒã æ°åŠè
ã§ããæçæ°ã®è¶£å³ã¯é³æ¥œéè³ã§ãå®¶ã«å¿µé¡ã®ãªãŒãã£ãªã«ãŒã ãäœããŸããã宿ãããªãŒãã£ãªã«ãŒã ã§ãå人ãæããŠãæ«é²ç®äŒãéããããšèããŠããŸããå
šå¡ã«ã§ããã ãè¯ãé³ã§èŽããŠãããããã®ã§ãéšå±ã®äžã®äœãæãã§é³ãèšæž¬ããå人ãã¡ã®äœçœ®ã§ã®é³ã®è³ªãèšç®ããã€ããã§ãã èšæž¬ç¹ã¯ãäžã®å³ã®å匧ãšç·åã®äº€ç¹ã§ãã 1 çªãã 35 çªãŸã§ã®ç¹ããéžæããŸããïŒã€ã®ç·åäžã«ããç¹ã¯ããªãŒãã£ãªã·ã¹ãã ããã®è·é¢ã 100ïœïœãã 500ïœïœãŸã§ 100ïœïœãã€é¢ããŠäžŠãã§ããŸããïŒã€ã®å匧ç¶ã«ããç¹ã¯ããã£ãšãå³ã®ãã®ïŒ1 çªãã 5 çªãŸã§ã®ç¹ïŒããåæèšåãã«ã0°ãã 180° ã®ç¯å²ã§ 30°床... | 38,767 |
Lifeguard in the Pool ããŒã«ã®ç£èŠå¡ English text is not available in this practice contest. Horton Moore ã¯ããŒã«ã®ç£èŠå¡ãšããŠåããŠããïŒåœŒãèŠåãã®ããã«ããŒã«ã®çžãæ©ããŠãããšããïŒããŒã«ã®äžã§äžäººã®å°å¥³ãããŒããŠããããšã«æ°ã¥ããïŒãã¡ããïŒåœŒã¯çŽã¡ã«æå©ã«åãããªããã°ãªããªãïŒãããïŒå°å¥³ã®èº«ã«äœããã£ãŠã¯å€§å€ã§ããããïŒå°ãã§ãæ©ãå°å¥³ã®ããšã«ãã©ãçãããïŒ ããªãã®ä»äºã¯ïŒããŒã«ã®åœ¢ç¶ïŒé ç¹æ°ã 3ã10 ã®åžå€è§åœ¢ïŒïŒå°äžããã³æ°Žäžã«ãããç£èŠå¡ã®åäœè·é¢ãããã®ç§»åæéïŒãããŠç£èŠå¡ãšå°å¥³ã®åæäœçœ®ãäžãããããšãã«ïŒç£... | 38,768 |
Score : 200 points Problem Statement You are given strings s and t , consisting of lowercase English letters. You will create a string s' by freely rearranging the characters in s . You will also create a string t' by freely rearranging the characters in t . Determine whether it is possible to satisfy s' < t' for the l... | 38,769 |
Three-way Branch There is a grid that consists of W \times H cells. The upper-left-most cell is (1, 1) . You are standing on the cell of (1,1) and you are going to move to cell of (W, H) . You can only move to adjacent lower-left, lower or lower-right cells. There are obstructions on several cells. You can not move to ... | 38,770 |
Problem F: Ballon Contest Problem ç©ºã®æ§åããã€ããšéããè²ãšãã©ãã®å€åœ©ãªç±æ°çã空ãèŠã£ãŠããã仿¥ã¯ç±æ°çã®å€§äŒã ã ç±æ°çããèœãšãããåŸç¹ä»ãããŒã«ãåå è
å
šå¡ã§åãåããããã ãã£ãããªã®ã§åªåè
ãäºæ³ããŠã¿ãããšã«ããã ã¬ã¯ãªãšãŒã·ã§ã³ã«ã¯N人åå ããã N 人ã®åå è
ã¯ããããèªåã®äœçœ®ãäžãããããè€æ°ã®åå è
ã«åãäœçœ®ãäžããããäºã¯ãªãã äžç©ºã®ç±æ°çããMåã®ããŒã«ãïŒåãã€èœäžããã åå è
ã¯å
šå¡åãã¿ã€ãã³ã°ã§èµ°ãå§ããããŒã«ã«åãã£ãŠåãé床ã§äžçŽç·ã«èµ°ãã ããŒã«ã®èœäžäœçœ®ã«äžçªæ©ã蟿ãçãã人ãããŒã«ãååŸã§ãããåæã«è€æ°äººèŸ¿ãçããå Žåã¯ãäžæ§ãªç¢ºçã§ååŸã§... | 38,771 |
Score : 500 points Problem Statement We have a grid of squares with N rows and M columns. Let (i, j) denote the square at the i -th row from the top and j -th column from the left. We will choose K of the squares and put a piece on each of them. If we place the K pieces on squares (x_1, y_1) , (x_2, y_2) , ..., and (x_... | 38,772 |
Score : 200 points Problem Statement There are N rectangular plate materials made of special metal called AtCoder Alloy. The dimensions of the i -th material are A_i \times B_i ( A_i vertically and B_i horizontally). Takahashi wants a rectangular plate made of AtCoder Alloy whose dimensions are exactly H \times W . He ... | 38,773 |
Problem H: ããéæ¹é èšç»ïŒä»®ïŒ ããªãã¯ãèªå®
ã«ããããã®ããã飌ã£ãŠããããããªããªãã®æ¥èª²ã¯ã飌ã£ãŠãããããåéã®äž ã«å
¥ã£ãŠæŒå¯ããŠããæ§åïŒéç§°ïŒããéïŒãæ®åœ±ããããšã ãäœå¹ãã®ããããéã®äžã§ãã£ãã ã«äžžããªã£ãŠç ãå§¿ã¯ãå®ã«æããããã ããããã®ããã«ã¯ããéãã m i ãšãCuteã c i ãå®çŸ©ãããŠãããCute ãšã¯ããã®ãã1 å¹ã ããèŠããšãã®ãæãããã»ãã©ããªãã»ããªãããã»ãããããã»ããããããããªã©ãç·åçã«è©äŸ¡ããæ°å€ã§ããã倧ãããã°å€§ããã»ã©ãã®ããã¯é
åçã§ããã ãŸããããéã«å¯ŸããŠã¯ãUnCuteããšããæ°å€ãå®çŸ©ããããããã¯ãããéå
šäœãšããŠã®ã¢ã³ãã© ã³ã¹ã... | 38,774 |
Score : 100 points Problem Statement On some day in January 2018 , Takaki is writing a document. The document has a column where the current date is written in yyyy/mm/dd format. For example, January 23 , 2018 should be written as 2018/01/23 . After finishing the document, she noticed that she had mistakenly wrote 2017... | 38,775 |
Score : 200 points Problem Statement A shop sells N kinds of fruits, Fruit 1, \ldots, N , at prices of p_1, \ldots, p_N yen per item, respectively. (Yen is the currency of Japan.) Here, we will choose K kinds of fruits and buy one of each chosen kind. Find the minimum possible total price of those fruits. Constraints 1... | 38,776 |
Problem A: Traffic Analysis There are two cameras which observe the up line and the down line respectively on the double lane (please see the following figure). These cameras are located on a line perpendicular to the lane, and we call the line 'monitoring line.' (the red line in the figure) Monitoring systems are conn... | 38,777 |
C: Fractal Tree åé¡ AORã€ã«ã¡ããã¯ããã©ã¯ã¿ã«ãª(èªå·±çžäŒŒçãª)æ§é ãæã€æ ¹ä»ãæšã奜ãã§ããã $N$ é ç¹ããæãéã¿ä»ãæ ¹ä»ãæš $T$ ãçšããŠã以äžã®ãããªãã©ã¯ã¿ã«æ§é ãæã€æ ¹ä»ãæš $T'$ ã衚çŸããããšãèããã $T'$ ã¯ã$T$ ã®åé ç¹ $x$ ã«å¯ŸããŠã$x$ ãæ ¹ãšã㊠$T$ ãšåæ§ã®æšæ§é (ã³ã¹ããåã) ãæã€æšãä»ãå ãããã®ã§ããã $T'$ã®æ ¹ã¯ $T$ ã®ãã®ãšåããã®ã§ããã ããããŠè¡šçŸãããæšã¯äŸãã°äžå³ã®ããã«ãªãã AOR ã€ã«ã¡ããã¯ã$T'$ ã«å¯ŸããŠæ·±ãåªå
æ¢çŽ¢ãããããšããŠããããå
šãŠã®é ç¹ã蟿ããšæéããšãŠããããããšã«æ°ã¥ããã ããã§ãæ·±ãåª... | 38,778 |
Score : 600 points Problem Statement Snuke is standing on a two-dimensional plane. In one operation, he can move by 1 in the positive x -direction, or move by 1 in the positive y -direction. Let us define a function f(r, c) as follows: f(r,c) := (The number of paths from the point (0, 0) to the point (r, c) that Snuke ... | 38,779 |
Score : 100 points Problem Statement Kode Festival is an anual contest where the hardest stone in the world is determined. (Kode is a Japanese word for "hardness".) This year, 2^N stones participated. The hardness of the i -th stone is A_i . In the contest, stones are thrown at each other in a knockout tournament. When... | 38,780 |
Minimum Cost Sort You are given $n$ integers $w_i (i = 0, 1, ..., n-1)$ to be sorted in ascending order. You can swap two integers $w_i$ and $w_j$. Each swap operation has a cost, which is the sum of the two integers $w_i + w_j$. You can perform the operations any number of times. Write a program which reports the mini... | 38,781 |
ã¿ã€ã ã»ãŒã« ããè¯ãç©ããããå®ãã仿¥ãã©ããã®ã¹ãŒããŒããŒã±ããã§è¡ãããã¿ã€ã ã»ãŒã«ã§ã¯ãæ¿ããéããç¹°ãåºããããŠããŸããããäŒæŽ¥ã«ãããLLå ãããããªã¹ãŒããŒããŒã±ããã®ã²ãšã€ã§ãä»ã®ãã§ãŒã³åºãšå¯Ÿæãã¹ããå°ãå€ãã£ãã¿ã€ã ã»ãŒã«ã宿œããŠããŸããäžè¬çãªã¿ã€ã ã»ãŒã«ã§ã¯è€æ°ã®ååãåãæéã«å®ããªããã®ã§ãããLLå ã§ã¯å¯Ÿè±¡ãšãªãååã«ãã£ãŠãã¿ã€ã ã»ãŒã«ãéå§ããæéãå¥ã
ã«èšå®ãããŠããŸãã åäºå®¶ã¯LLå ãããå©çšããå®¶åºã®äžã€ã§ãããããªåäºå®¶ã§ã¯ã奥æ§äž»å°ã®ããšãæ¬¡ã®æ¥æã«è¡ãããã¿ã€ã ã»ãŒã«ã«åããŠäœæŠäŒè°ãéããã©ã®ãããªé çªã§è²·ãç©ãããã°å€åŒããæå€§ãšãªãããåæããããšã«ãªããŸãããåºå
ãçç¥ã... | 38,782 |
Score : 500 points Problem Statement There are N points on the 2D plane, i -th of which is located on (x_i, y_i) . There can be multiple points that share the same coordinate. What is the maximum possible Manhattan distance between two distinct points? Here, the Manhattan distance between two points (x_i, y_i) and (x_j... | 38,783 |
Blur å³ 1 ã®ãã㪠10Ã10 ã®ãã¹ç®ã®ãåžãããããïŒ1ïŒ2ïŒã®ããã«X座æšã»Y座æšã®å€ã®å¯Ÿã§ãã¹ç®ã瀺ãããšã«ããŸãã座æšå€ã¯ 0 ããå§ãŸãæŽæ°ãšããŸããäŸãã°ãå³ 1 ã®âã®åº§æšã¯ (1, 2) ã§ãã ãã®ãåžãã«ææãå°ããã€ããããŠæç©ãäœããŸãããããææã®æ»Žã«ã¯ã倧ããäžããå°ãã® 3 ãµã€ãºããããææã®æ»Žã®èœã¡ããã¹ç®ãäžå¿ã«å³ 1 ã®ããã«åšå²ãè²ãã€ããŸããå³ 1 ã§âãäžå¿ãâãè²ã®ã«ããç¯å²ã§ãã ãåžãã¯ãæåã¯ããŸã£ãããã€ãŸããã©ã®ãã¹ç®ãè²ã®æ¿ãã瀺ãå€ã 0 ãšããŸããææã®æ»Žãèœã¡ãããšã«å€ã 1 ãã€å¢ããŠãããŸãããå°ããïŒ1, 2ïŒããäžããïŒ3, 2ïŒã«èœã¡ãå Žåãåãã¹ç®... | 38,784 |
Problem I: Tree-Light Problem ããªãã¯ããªãŒã©ã€ããšããããªãŒç¶ã®ç
§æåšå
·ãè²·ã£ãŠããã ãã®ç
§æåšå
·ã«ã¯ n åã®æ¥ç¹ãããããããã 0 ãã nâ1 ãŸã§ã®çªå·ãã€ããŠããã忥ç¹ã¯10段éã®æããã衚çŸã§ããé»çãšãé»çã®ç¶æ
ãåãæ¿ããããã®è£
çœ®ã§æ§æãããŠãããæåããã¹ãŠã®æ¥ç¹ã®é»çã®æãã㯠0 ã§ããã ãŸããæ¥ç¹ãšæ¥ç¹ã®éã«ã¯ã±ãŒãã«ç·ãããããã¹ãŠã®æ¥ç¹ã¯ nâ1 æ¬ã®ã±ãŒãã«ç·ã«ãã£ãŠç¹ãããŠãããæ¥ç¹ 0 ãäžã«ããŠåãäžãããããããã§ãæ¥ç¹ i ããäžæ¹åã«0æ¬ä»¥äžã®ã±ãŒãã«ç·ãä»ããŠãæ¥ç¹ i ãšç¹ããæ¥ç¹ã®éåããæ¥ç¹ i ãæ ¹ãšããéšåæšãšåŒã¶ã ããªãã¯ãã®ç
§æåšå
·... | 38,785 |
Score : 700 points Problem Statement There is a sequence X of length N , where every element is initially 0 . Let X_i denote the i -th element of X . You are given a sequence A of length N . The i -th element of A is A_i . Determine if we can make X equal to A by repeating the operation below. If we can, find the minim... | 38,786 |
Problem C : War AåœãšBåœãšããïŒã€ã®åœãæŠäºãããŠãããAåœã®è»äººã§ããããªã㯠n 人ã®å
µå£«ãçããŠãBåœã®é åãå é ããäºã«ãªã£ãã Båœã®é åã¯ïŒæ¬¡å
ã°ãªããã§è¡šãããŠãããããªããæåã«å é ããå Žæã¯äºæ¬¡å
ã°ãªããäžã®ããïŒãã¹ã§ããã ããªããçããŠããå
µå£«ãã¡ã¯ãããããh_iã®äœåãæã£ãŠããã ããããã®å
µå£«ã¯äœåã1ãæ¶è²»ããŠç§»åããããšãã§ããã çŸåšãããã¹ã(a,b)ãšãããšã(a+1,b),(a-1,b),(a,b+1),(a,b-1)ã®4æ¹åãç§»åå
ãšããŠéžã¶ããšãå¯èœã§ããã å
µå£«ã¯äœåã0ã«ãªã£ããããããåãããšãã§ããªããªãã äžäººä»¥äžã®å
µå£«ãééãããã¹ã¯ãã¹ãŠå é ããããšãã§... | 38,787 |
Problem Statement "Everlasting -One-" is an award-winning online game launched this year. This game has rapidly become famous for its large number of characters you can play. In this game, a character is characterized by attributes . There are $N$ attributes in this game, numbered $1$ through $N$. Each attribute takes ... | 38,788 |
Problem C: Colored Cubes There are several colored cubes. All of them are of the same size but they may be colored differently. Each face of these cubes has a single color. Colors of distinct faces of a cube may or may not be the same. Two cubes are said to be identically colored if some suitable rotations of one of th... | 38,789 |
Score : 600 points Problem Statement Given are N points (x_i, y_i) in a two-dimensional plane. Find the minimum radius of a circle such that all the points are inside or on it. Constraints 2 \leq N \leq 50 0 \leq x_i \leq 1000 0 \leq y_i \leq 1000 The given N points are all different. The values in input are all intege... | 38,790 |
Score : 800 points Problem Statement There are N squares arranged in a row. The squares are numbered 1 , 2 , ... , N , from left to right. Snuke is painting each square in red, green or blue. According to his aesthetic sense, the following M conditions must all be satisfied. The i -th condition is: There are exactly x_... | 38,791 |
Score : 700 points Problem Statement There are N strings arranged in a row. It is known that, for any two adjacent strings, the string to the left is lexicographically smaller than the string to the right. That is, S_1<S_2<...<S_N holds lexicographically, where S_i is the i -th string from the left. At least how many d... | 38,792 |
åé¡ H ãã°ãããªã å顿 ãã€ãã®ãããã¯ããªããé£ã¹ãã®ã奜ãã§ããïŒ 2T+1 æã®éæ¿ãé£ç¶ããŠäžŠãã§ããïŒé çªã« -T, -T+1, ..., T ã®çªå·ãä»ããŠããïŒãããã¯ãããã®éæ¿ã«ç±ãå ãïŒçããããªããçŒãããšããŠããïŒããªããçŒãæé ã¯ä»¥äžã®ãããªãã®ã§ããïŒ ãŸãïŒæå» t=-1 ã®ãšãã«åéæ¿ã«ã©ãã ãã®ãšãã«ã®ãŒãå ããããæ±ºãïŒå®éã«ãšãã«ã®ãŒãå ããïŒåéæ¿ã«å ãããšãã«ã®ãŒã®ç·å㯠E 以äžã§ãªããã°ãªããªãïŒããªãã¡ïŒ i çªã®éæ¿ã«å ãããšãã«ã®ãŒã E(i) ãšããŠïŒ E(i) ⥠0, E(-T)+...+E(T) †E ã§ãªããã°ãªããªãïŒãªãïŒãšãã«ã®ãŒã¯æŽæ°ã§ãªããŠãããïŒ ãš... | 38,793 |
Score : 800 points Problem Statement We have 3N colored balls with IDs from 1 to 3N . A string S of length 3N represents the colors of the balls. The color of Ball i is red if S_i is R , green if S_i is G , and blue if S_i is B . There are N red balls, N green balls, and N blue balls. Takahashi will distribute these 3N... | 38,794 |
Score : 700 points Problem Statement Takahashi is hosting an sports meet. There are N people who will participate. These people are conveniently numbered 1 through N . Also, there are M options of sports for this event. These sports are numbered 1 through M . Among these options, Takahashi will select one or more sport... | 38,795 |
Spreadsheet Your task is to perform a simple table calculation. Write a program which reads the number of rows r , columns c and a table of r à c elements, and prints a new table, which includes the total sum for each row and column. Input In the first line, two integers r and c are given. Next, the table is given by r... | 38,796 |
ã³ã€ã³éã(Coin Collecting) JOI æ°ã®ã³ã¬ã¯ã·ã§ã³ã«ãŒã ã«ã¯éåžžã«å€§ããªæºãããïŒãã®äžã«ã¯äœæãã®è²Žéãªã³ã€ã³ãããïŒæºã®æé€ãããããã«ïŒJOI æ°ã¯ã³ã€ã³ãæŽçããŠäžŠã¹ãããšã«ããïŒ æºã¯2 000 000 001 $\times$ 2 000 000 001 ã®ãã¹ç®ã«ãªã£ãŠããïŒåã«ã¯å·Šããé ã«-1 000 000 000 ãã1 000 000 000ãŸã§ã®çªå·ãã€ããããŠããïŒè¡ã«ã¯äžããé ã«-1 000 000 000 ãã1 000 000 000 ãŸã§ã®çªå·ãã€ããããŠããïŒåã®çªå·ã$x$ïŒè¡ã®çªå·ã$y$ ã§ãããã¹ã($x, y$) ã§è¡šãããšã«ããïŒ ã³ã€ã³ã¯$2N$ æããïŒçŸåšïŒ$... | 38,797 |
G: ã€ã«ãããŒã·ã§ã³ åé¡ $1 \leq x \leq h , 1 \leq y \leq w$ ãã¿ããæ Œåç¹ $(x,y)$ ã«é»çããã. 黿ºè£
眮ã¯åº§æš $(i+0.5,j+0.5) (1 \leq i < h,1 \leq j < w, i+j$ ã¯å¶æ°ïŒã«èšçœ®ãããŠãã(14:21ä¿®æ£). åº§æš $(i+0.5,j+0.5)$ ã«èšçœ®ãããŠãã黿ºè£
眮ããªã³ã«ãããš, åº§æš $(i,j),(i+1,j),(i,j+1),(i+1,j+1)$ ã«ååšãã $4$ ã€ã®é»çãå
ã. $(i,j)$ ã«ããé»çããªã³ã«ãªã£ãŠãã黿ºè£
眮㫠$1$ ã€ä»¥äžã€ãªãã£ãŠãããš, ãããã $B_{i,j}$ ãåŸããã. ããªã... | 38,798 |
Score : 500 points Problem Statement There are N squares numbered 1 to N from left to right. Each square has a character written on it, and Square i has a letter s_i . Besides, there is initially one golem on each square. Snuke cast Q spells to move the golems. The i -th spell consisted of two characters t_i and d_i , ... | 38,799 |
Sports Days 2.0 äŒæŽ¥å€§åŠéå±å°åŠæ ¡ïŒäŒæŽ¥å€§å°ïŒã¯æ¥æ¬ææ°ã®ç«¶æããã°ã©ããŒé€ææ ¡ãšããŠæåã§ããã ãã¡ãããéåäŒã«åå ããŠãããšãã§ããã¢ã«ãŽãªãºã ã®ä¿®è¡ãæ¬ ãããªãã ç«¶æããã°ã©ãã³ã°éšéšé·ã®ããªãã¯ãã¡ãããã®å€§äŒã§ãåå©ãããã ä»åã¯ããç«¶æã«æ³šç®ããã ããç«¶æãšã¯äŒæŽ¥å€§å°ã§è¡ãããŠããäŒçµ±çãªç«¶æã ã æ ¡åºã«ã³ãŒã³ã V å眮ããŠããã ã³ãŒã³ã®ããã€ãã®ãã¢ã¯çœç·ã§æãããç¢å°ã§çµã°ããŠããã ç¢å°ã®å
ã¯çåŽã ãã«ã€ããŠãããæŽæ°ã䜵èšãããŠããã åãã³ãŒã³ã®ãã¢ãã®è€æ°ã®ç¢å°ã«çµã°ããŠããå Žåãããã ç«¶æè
ã¯ä»»æã«ã³ãŒã³ãéžã³ãç§»åéå§ããã ç§»åã¯ç«¶æè
ãããã³ãŒã³ããç¢å°ã®äžããã®åãã«... | 38,800 |
For Programming Excellence A countless number of skills are required to be an excellent programmer. Different skills have different importance degrees, and the total programming competence is measured by the sum of products of levels and importance degrees of his/her skills. In this summer season, you are planning to a... | 38,801 |
Score : 400 points Problem Statement Give a pair of integers (A, B) such that A^5-B^5 = X . It is guaranteed that there exists such a pair for the given integer X . Constraints 1 \leq X \leq 10^9 X is an integer. There exists a pair of integers (A, B) satisfying the condition in Problem Statement. Input Input is given ... | 38,802 |
Score : 200 points Problem Statement Kyoto University decided to build a straight wall on the west side of the university to protect against gorillas that attack the university from the west every night. Since it is difficult to protect the university at some points along the wall where gorillas attack violently, reinf... | 38,803 |
Trampoline A plurality of trampolines are arranged in a line at 10 m intervals. Each trampoline has its own maximum horizontal distance within which the jumper can jump safely. Starting from the left-most trampoline, the jumper jumps to another trampoline within the allowed jumping range. The jumper wants to repeat jum... | 38,804 |
The Secret Number Your job is to find out the secret number hidden in a matrix, each of whose element is a digit ('0'-'9') or a letter ('A'-'Z'). You can see an example matrix in Figure 1. Figure 1: A Matrix The secret number and other non-secret ones are coded in a matrix as sequences of digits in a decimal format. Yo... | 38,805 |
Escape é ç¹ã«æ£ã®å€ãæã€ç¡åã°ã©ããäžããããã é ç¹ã«ã¯ 1 ãã N ã®çªå·ãã€ããŠããã i çªç®ã®é ç¹ã¯ w_i ã®å€ãæã£ãŠããã 1 çªç®ã®é ç¹ããã¹ã¿ãŒãããçŽåã«éã£ã蟺ãéãããšãã§ããªããšããå¶çŽã®ããšã§ã°ã©ãäžãç§»åããããšãã§ããã åé ç¹ã§ã¯ïŒåããŠèšªããæã«éããã®é ç¹ãæã€å€ã®ç¹æ°ãåŸãããã ååŸã§ããç¹æ°ã®ç·åã®æå€§å€ãæ±ããã Constraints 1 †N †100000 N â 1 †M †100000 1 †w_i †1000 1 †u_i, v_i †N å€é蟺ã»èªå·±èŸºã¯ååšããªã ã°ã©ãã¯é£çµã§ãã Input Format å
¥åã¯ä»¥äžã®åœ¢åŒã§æšæºå
¥åããäžãã... | 38,806 |
é«éãã¹ A åã¯é«æ ¡ã®äŒã¿ãå©çšããŠãé«éãã¹(以äžãããã¹ã )ã§äžäººæ
ãããèšç»ãç«ãŠãŠããŸãããŸããA åã¯äžçªè¡ã£ãŠã¿ããçºãéžãã§ãããç®çå°ã«ããŸãããæ¬¡ã«åºçºå°ããç®çå°ãŸã§ãã¹ãä¹ãç¶ãã§ããã«ãŒããæ±ºããªããã°ãªããŸãããä¹ãç¶ãããããšãã¯ããã¹ãéããŠããå¥ã®ãã¹ã«ä¹ãæããã®ã§ãããããã®ãã¹ã®ä¹è»åžãå¿
èŠã«ãªããŸãã A åã¯èŠªæã®ãããããããã¹ã®å²åŒåžãäœæãããããŸããã ãã®åžã 1 æäœ¿ããšä¹è»åž 1 æãåé¡ã§è³Œå
¥ã§ããŸããäŸãã°ãå³ 1 ã®åºçºå°5ããç®çå°1ãžè¡ãå Žåã«ã¯ã5â4â6â2â1ãš5â3â1ã®äºã€ã®çµè·¯ãèããããŸããå²åŒåžã 2 æãããšãããšã亀éè²»ãæãå®ãããã«ã¯5â4... | 38,808 |
Problem F: Ben Toh As usual, those who called wolves get together on 8 p.m. at the supermarket. The thing they want is only one, a box lunch that is labeled half price. Scrambling for a few discounted box lunch, they fiercely fight every day. And those who are blessed by hunger and appetite the best can acquire the box... | 38,809 |
Endless BFS Mr. Endo wanted to write the code that performs breadth-first search (BFS), which is a search algorithm to explore all vertices on an undirected graph. An example of pseudo code of BFS is as follows: 1: $current \leftarrow \{start\_vertex\}$ 2: $visited \leftarrow current$ 3: while $visited \ne $ the set of... | 38,810 |
Dice III Write a program which reads the two dices constructed in the same way as Dice I , and determines whether these two dices are identical. You can roll a dice in the same way as Dice I , and if all integers observed from the six directions are the same as that of another dice, these dices can be considered as ide... | 38,811 |
Problem F: Farey Sequence slipã¯æ°åãçºããã®ã奜ãã§ããã ãã¡ã€ã«ãããŠã³ããŒãããŠãããšãã®ãæ®ãæéãçºããŠããã ãã§ãæéãæœ°ããã»ã©ã§ããã ãããªslipãå人ããé¢çœãæ°åãæããããã ãã®æ°åã®å®çŸ©ã¯ä»¥äžã®ãšããã§ããã äžè¬é
ã F n ãšè¡šããã F n ãšã¯ã n 以äžã®åæ¯ãæã€0以äž1以äžã®ãã¹ãŠã®çŽåãããåæ°(æ¢çŽåæ°)ãå°ããªé ãã䞊ã¹ããã®ã§ããã ãã ããæŽæ°0ã1ã¯ããããåæ°0/1ã1/1ãšããŠæ±ãããã ã€ãŸã F 3 ã¯ã F 3 = (0/1, 1/3, 1/2, 2/3, 1/1) ã®ããã«è¡šãããã F 5 ã§ããã° F 5 = (0/1, 1/5,... | 38,812 |
Lucky Number Problem 0 ãã N -1 ãŸã§ã®æ°åããããŸãã M +1æ¥éã®ã©ãããŒãã³ããŒã以äžã®æ¹æ³ã§éžã³ãããšæããŸãã æåã®æ¥ã«ã©ãããŒãã³ããŒãã©ã³ãã ã«æ±ºããŸãã i æ¥åŸã®ã©ãããŒãã³ããŒã A ãïŒ i +1ïŒæ¥åŸã®ã©ãããŒãã³ããŒã B ãšãããšã B = ( A + j ) % N ïŒãã ã j 㯠0 †j < N ãã€ ïŒ j / K ïŒ ãå¶æ°ãšãªãå
šãŠã®æŽæ°ã§ãã ) ã§æ±ãããã B ã®ãã¡ã®ããããããã©ã³ãã ã«æ±ºããŸãããã ãã a / b ã®çµæã¯å°æ°ç¹ä»¥äžãåãæšãŠãæŽæ°ãšãã a % b 㯠a ã b ã§å²ã£ãäœããšããŸãã ãŸã K 㯠N / K ãå²ãåããŠ... | 38,813 |
Score : 700 points Problem Statement We have a grid with H rows and W columns of squares. We will represent the square at the i -th row from the top and j -th column from the left as (i,\ j) . Also, we will define the distance between the squares (i_1,\ j_1) and (i_2,\ j_2) as |i_1 - i_2| + |j_1 - j_2| . Snuke is paint... | 38,814 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.