task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Score : 700 points Problem Statement In the final of CODE FESTIVAL in some year, there are N participants. The height and power of Participant i is H_i and P_i , respectively. Ringo is hosting a game of stacking zabuton (cushions). The participants will line up in a row in some order, and they will in turn try to add z... | 37,750 |
Score : 100 points Problem Statement There are N flowers arranged in a row. For each i ( 1 \leq i \leq N ), the height and the beauty of the i -th flower from the left is h_i and a_i , respectively. Here, h_1, h_2, \ldots, h_N are all distinct. Taro is pulling out some flowers so that the following condition is met: Th... | 37,751 |
Score : 900 points Problem Statement Takahashi has an N \times N grid. The square at the i -th row and the j -th column of the grid is denoted by (i,j) . Particularly, the top-left square of the grid is (1,1) , and the bottom-right square is (N,N) . An integer, 0 or 1 , is written on M of the squares in the Takahashi's... | 37,752 |
Score : 300 points Problem Statement A game is played on a strip consisting of N cells consecutively numbered from 1 to N . Alice has her token on cell A . Borys has his token on a different cell B . Players take turns, Alice moves first. The moving player must shift his or her token from its current cell X to the neig... | 37,753 |
Score : 500 points Problem Statement There is an infinitely long street that runs west to east, which we consider as a number line. There are N roadworks scheduled on this street. The i -th roadwork blocks the point at coordinate X_i from time S_i - 0.5 to time T_i - 0.5 . Q people are standing at coordinate 0 . The i ... | 37,754 |
Score : 600 points Problem Statement Silver Fox is fighting with N monsters. The monsters are standing in a row, and we can assume them to be standing on a number line. The i -th monster, standing at the coordinate X_i , has the health of H_i . Silver Fox can use bombs to attack the monsters. Using a bomb at the coordi... | 37,755 |
Merge Sort Write a program of a Merge Sort algorithm implemented by the following pseudocode. You should also report the number of comparisons in the Merge function. Merge(A, left, mid, right) n1 = mid - left; n2 = right - mid; create array L[0...n1], R[0...n2] for i = 0 to n1-1 do L[i] = A[left + i] for i = 0 to n2-1 ... | 37,756 |
Score : 200 points Problem Statement Given are strings S and T . Consider changing S to T by repeating the operation below. Find the minimum number of operations required to do so. Operation: Choose one character of S and replace it with a different character. Constraints S and T have lengths between 1 and 2\times 10^5... | 37,757 |
Max Score: $300$ Points Problem Statement We are playing a puzzle. An upright board with $H$ rows by $W$ columns of cells, is used in this puzzle. A stone in $i$-th row and $j$-th column engraved with a digit, one of 1 through 9, is placed in each of the cells. You can erase 1 cell in the board. The game process is fol... | 37,758 |
Problem G: 倩äœèŠ³æž¬ 2012幎ã®ããæ¥ã®ããšã åã®ç°èçºã«äœãããªãã¯ãæåšãé£ããŠå±æå°ã§æèŠãããããšã«ããã ãã®çºã¯éœäŒãšéã£ãŠè¡æãããå°ãªãã空æ°ãæŸãã§ããã®ã§ãæŽããæ¥ã¯æºå€©ã®æç©ºãåºãã£ãŠããã 倩æã«ãããã詳ããããªãã¯å£ç¯ããšã®æåãªæãæåº§ãããã«ãŸã€ããç¥è©±ãããã¯ç¥ã£ãŠããã®ã ãã ãªã«ãããã¯æéãçºãååã®ããããªãæåº§ãããããèŠããŠããã ãã®åã®æèŠã®ãšãã«ãããã£ãæã
ã«é¢ããåšã®è³ªåã«çããããªãã£ãããªãã¯ã æèŠã®æå»ã«ãã£ããã©ã®æåº§ãèŠããã®ãã調ã¹ãããšæã£ãã ç¹å®ã®æ¥æã«ã©ã®æãèŠããã®ããç¥ãã«ã¯ãæåº§æ©èŠç€ãšããã¢ã€ãã ãæçšã§ããã æè¿ã§ã¯æºåž¯ç«¯æ«ã®GP... | 37,759 |
Problem B: Expected Allowance Hideyuki is allowed by his father Ujisato some 1000 yen bills every month for his pocket money. In the first day of every month, the number of bills is decided as follows. Ujisato prepares n pieces of m -sided dice and declares the cutback k . Hideyuki rolls these dice. The number of bills... | 37,760 |
Score: 900 points Problem Statement In 2937 , DISCO creates a new universe called DISCOSMOS to celebrate its 1000 -th anniversary. DISCOSMOS can be described as an H \times W grid. Let (i, j) (1 \leq i \leq H, 1 \leq j \leq W) denote the square at the i -th row from the top and the j -th column from the left. At time 0... | 37,761 |
F: Disordered Data Detection / ç°åžžæ€ç¥ ç©èª å®®å®ãããã¯æŠèµéãœãããŠã§ã¢ã«åãããšã³ãžãã¢ã§ããïŒä»æ¥ã¯é¡§å®¢ããåããäžå
·åå ±åã«é ãæ©ãŸããŠããïŒãå€ãªè©±ïŒãã®åäœã£ãŠããã£ããœããã®æåãã·ããã·ããããŠããã§ãïŒãã¡ãã§ãã§ãã¯ããŠããããŸããïŒä¿å®ããã®ãããããã®ä»äºã§ããïŒããã€ãç¡çé£é¡ã°ããæŒãä»ããŠãããã®é¡§å®¢ã ãïŒä»åã°ããã¯ãã¡ãã«éãããïŒãªããªãïŒãã€ãé©åœãªä»äºã°ããã®ãžããŒããã¹ãã«éã£ãŠããªãã³ãŒãããã®ãŸãŸæŸçœ®ããŠè£œåã«çµã¿èŸŒãã ããšãåçœããããã§ããïŒæ®éã®äººéãªããžããŒã«æ®Žãããããããªãã®ã ãïŒãã¯ããã€ãã®ããšã ïŒãããã¯æããéãè¶ãïŒãã§ã«æããéã... | 37,762 |
è²¡å® (Treasures) åé¡ çè³ã® Anna ãš Bruno ã¯å€§å¯è±ªã®éžå®
ã«å¿ã³èŸŒã¿ïŒè²¡å® 1 ããè²¡å® N ãŸã§ã® N åã®è²¡å®ãèŠã€ããïŒãããã®è²¡å®ã Anna ãš Bruno ã§åé
ããããšã«ãªã£ãïŒè²¡å®ã®ãã¡ã®ããã€ãã Anna ãåãïŒæ®ãã®è²¡å®ã®ãã¡ã®ããã€ãã Bruno ãåãïŒåã財å®ã 2 人ãåãããšã¯ã§ããªãïŒAnna ã Bruno ã¯è²¡å®ã 1 åãåããªããŠãããïŒãŸãïŒæ®ã£ã財å®ã¯éžå®
ã«æ®ããŠããã®ã§ïŒ2 人ãšãåããªã財å®ããã£ãŠãããïŒ ããããã®è²¡å®ã«ã¯ãåžå ŽäŸ¡å€ããšã貎é床ããšãã 2 ã€ã®å€ãå®ãŸã£ãŠããïŒAnna ãåã£ã財å®ã®åžå ŽäŸ¡å€ã®åèšãš Bruno ãåã£ã財å®ã®åžå Ž... | 37,763 |
å€è§åœ¢ã®é¢ç© ïŒã€ã®åã«å
æ¥ããïŒã€ã®å€è§åœ¢ã®é ç¹æ
å ±ãå
¥åãšãããããã®é¢ç©ã®å€§å°é¢ä¿ãåºåããããã°ã©ã ãäœæããŠãã ããã X è§åœ¢ã®åé ç¹ã«ã¯åæèšåãã« 1 ãã X ãŸã§çªå·ãæ¯ã£ãŠãããã®ãšããŸãïŒå³ã¯ã X = 4 ã®å Žåã®äŸã瀺ããŠããŸãïŒããã ããäžããããå€è§åœ¢ã¯åã®äžå¿ãå
éšã«å«ããã®ãšããé ç¹ i ã®äœçœ®ã«é¢ããããŒã¿ã¯ãé ç¹ i ããé ç¹ i+1 ãŸã§åæèšåãã«èšã£ãäžå¿è§ã®è§åºŠ v (1 †v < 180 ã®æŽæ°) ã§äžããããŸãããŸããåºåãã倧å°é¢ä¿ã«ã€ããŠã¯ã第ïŒã®å€è§åœ¢ã®é¢ç©ã倧ããå Žå㯠1 (åè§æ°å)ã第ïŒã®å€è§åœ¢ã®é¢ç©ã倧ããå Žå㯠2 (åè§æ°å)ãããããã®é¢ç©ãçããå Žå㯠0... | 37,764 |
ãèåã®åå² åé¡ é·ã N ããªã¡ãŒãã«ã®æ£ç¶ã®ãèåã 1 æ¬ãã(ããã§ N ã¯å¶æ°). 2 人㮠JOI é¢ä¿è
ã,ãã®ãèåãè€æ°æ¬ã«åæããŠ,åèš N/2 ããªã¡ãŒãã«ãã€ã«åããããš ã«ãã. çç±ã¯äžæã§ããã,ãã®ãèåã¯å Žæã«ãã£ãŠåæã®ãããããç°ãªã£ãŠãã. 2 人ã¯,ãèåãå·Šãã 1 ããªã¡ãŒãã«ããšã«èª¿ã¹,åå Žæã§åæã«äœç§ãããã ãå²ãåºãã.2 人ããèåãåããããã®åæã«ãããç§æ°ã®æå°å€ãæ±ããã ãã°ã©ã ãäœæãã. å
¥å å
¥åã® 1 è¡ç®ã«ã¯,æ£ã®é·ã N(2 †N †10000 ,ãã ã N ã¯å¶æ°) ãæžãããŠã ã.å
¥åã® i + 1 è¡ç® (1 †i †N â 1) ã«ã¯... | 37,765 |
䟿å©ãªçº æ¥æ¥åæ¥ããAããã¯ãå°±è·ãæ©ã«åŒè¶ããããããšã«ããŸãããå°±è·ããäŒç€Ÿã¯ããªãã£ã¹ãããã€ãã®çºã«ãã£ãŠãæ¥ã«ãã£ãŠåºå€ãããªãã£ã¹ãéããŸããããã§Aããã¯,ã©ãã®ãªãã£ã¹ã« è¡ãã«ãæéã®çãçºã«äœãããšèããŸããã ããã§ããªãã¯ãAãããå©ãããããäœãã®ã«äžçªäŸ¿å©ãªçºãæ¢ãããšã«ãªããŸããã çºã«ã¯ 0 ããå§ãŸãçªå·ãæ¯ãããŠãããçºãšçºã®éã«ã¯éããããŸããããããã®éã«å¯ŸããŠé倿éãæ±ºãŸã£ãŠããŸããAãããããçºã«äœãã§ããå Žåã«ãèªåã®çºã®ãªãã£ã¹ãŸã§ã®é倿é㯠0 ãšããŸãããã®ãšãã«å
šãŠã®çºãŸã§ã®é倿éã®ç·åãèããŸããäŸãã°ãçºãšéã®é
眮ãäžã®å³ã®ããã«ãªã£ãŠããŠãAãããçº1ã«äœãã å Žåã«... | 37,766 |
Circles Intersection You are given circle $A$ with radius $r_a$ and with central coordinate $(x_a, y_a)$ and circle $B$ with radius $r_b$ and with central coordinate $(x_b, y_b)$. Write a program which prints: "2" if $B$ is in $A$, "-2" if $A$ is in $B$, "1" if circumference of $A$ and $B$ intersect, and "0" if $A$ and... | 37,767 |
Problem C: Adaptive Time Slicing Quantization Nathan O. Davis is a student at the department of integrated systems. Today he learned digital quanti- zation in a class. It is a process that approximates analog data (e.g. electrical pressure) by a finite set of discrete values or integers. He had an assignment to write a... | 37,768 |
Problem I Midpoint One day, you found $L + M + N$ points on a 2D plane, which you named $A_1, ..., A_L, B_1, ...,B_M, C_1,...,C_N$. Note that two or more points of them can be at the same coordinate. These were named after the following properties: the points $A_1,...,A_L$ were located on a single straight line, the po... | 37,769 |
Problem G: Longest Chain Let us compare two triples a = (x a , y a , z a ) and b = (x b , y b , z b ) by a partial order â defined as follows. a â b â x a < x b and y a < y b and z a < z b Your mission is to find, in the given set of triples, the longest ascending series a 1 â a 2 â ... â a k . Input The input is a seq... | 37,770 |
Problem F: èªè»¢è» Problem Statement èå°åã¯ã倧ã®èªè»¢è»å¥œãã§ããã仿¥ã圌ã¯ããæ°ã«å
¥ãã®èªè»¢è»ã«ä¹ã£ãŠãµã€ã¯ãªã³ã°ããŒããžãšèµ°ãåºãããšããŠããã 圌ãäœãå°åã«ã¯ãNåã®çºãååšãããåçºãçº1ãçº2...ãçºNãšåŒã¶ããšãšããã圌ãäœãçºã¯ãçº1ã§ããããã®å°åã«ã¯ããµã€ã¯ãªã³ã°ãè¶£å³ãšããŠãã人ãå€ããæè¿ã§ã¯é »ç¹ã«çºãšçºãçµã¶ãµã€ã¯ãªã³ã°ããŒããäœãããŠããããµã€ã¯ãªã³ã°ããŒãã䜿ããšã2ã€ã®çºãåæ¹åã«ç§»åã§ãããå
¥åã§ã¯ãã©ã®çºãšã©ã®çºãæ°ãããµã€ã¯ãªã³ã°ããŒãã§ç¹ãããããæç³»åé ã«å
¥åãããã èå°åã¯ãæ°ãããµã€ã¯ãªã³ã°ããŒãã1ã€å®æãããšãã«ã次ã«ç€ºãæ¡ä»¶ãæºãããšãã ããµã€ã¯... | 37,771 |
Score : 1600 points Problem Statement We constructed a rectangular parallelepiped of dimensions A \times B \times C built of ABC cubic blocks of side 1 . Then, we placed the parallelepiped in xyz -space as follows: For every triple i, j, k ( 0 \leq i < A, 0 \leq j < B, 0 \leq k < C ), there exists a block that has a di... | 37,773 |
Score : 200 points Problem Statement A string S of an odd length is said to be a strong palindrome if and only if all of the following conditions are satisfied: S is a palindrome. Let N be the length of S . The string formed by the 1 -st through ((N-1)/2) -th characters of S is a palindrome. The string consisting of th... | 37,774 |
Score : 800 points Problem Statement N contestants participated in a competition. The total of N-1 matches were played in a knockout tournament. For some reasons, the tournament may not be "fair" for all the contestants. That is, the number of the matches that must be played in order to win the championship may be diff... | 37,775 |
Score : 700 points Problem Statement Aoki loves numerical sequences and trees. One day, Takahashi gave him an integer sequence of length N , a_1, a_2, ..., a_N , which made him want to construct a tree. Aoki wants to construct a tree with N vertices numbered 1 through N , such that for each i = 1,2,...,N , the distance... | 37,776 |
The Maximum Number of Overlaps Given a set of $N$ axis-aligned rectangular seals, find the number of overlapped seals on the region which has the maximum number of overlapped seals. Input The input is given in the following format. $N$ $x1_1$ $y1_1$ $x2_1$ $y2_1$ $x1_2$ $y1_2$ $x2_2$ $y2_2$ : $x1_N$ $y1_N$ $x2_N$ $y2_N... | 37,777 |
Score: 100 points Problem Statement The cat Snuke wants to play a popular Japanese game called Ã
tCoder, so Iroha has decided to teach him Japanese. When counting pencils in Japanese, the counter word "æ¬" follows the number. The pronunciation of this word varies depending on the number. Specifically, the pronunciation o... | 37,778 |
Problem B: Watchin' TVA Animation is one of methods for making movies and in Japan, it is popular to broadcast as a television program or perform as a movie. Many people, especially the young, love one. And here is an anime lover called Jack. We say he is an mysterious guy with uncertain age. He likes anime which are b... | 37,779 |
Problem description is available from here. | 37,781 |
ã¯ã©ã¹åã äŒæŽ¥é²åŠå¡Ÿã§ã¯ãçåŸã塟ã«å
¥ãéã«å®åãã¹ããè¡ã£ãŠã¯ã©ã¹åããããŸãããã¹ãã¯æ°åŠãè±èªãåœèªã® 3 ç§ç®è¡ããçåŸã A,B,C ã¯ã©ã¹ã«ã¯ã©ã¹åãããŸããA ã¯ã©ã¹ã®ã¬ãã«ãäžçªé«ããé ã«äœããªã£ãŠãããŸãã ã¯ã©ã¹åãã®å€æã¯ä»¥äžã®è¡šã«åºã¥ããŸãã æ¡ä»¶ ã¯ã©ã¹ 100 ç¹ã®ç§ç®ããã A æ°åŠãšè±èªã®å¹³åç¹ã 90 ç¹ä»¥äž A 3 ç§ç®ã®å¹³åç¹ã 80 ç¹ä»¥äž A 3 ç§ç®ã®å¹³åç¹ã 70 ç¹ä»¥äž B 3 ç§ç®ã®å¹³åç¹ã 50 ç¹ä»¥äžã§æ°åŠãè±èªã 80 ç¹ä»¥äž B äžã®æ¡ä»¶ãæºãããªã C è€æ°ã®æ¡ä»¶ãæºããå Žåã¯ãããã¬ãã«ã®é«ãã¯ã©ã¹ã«åããããŸãã çåŸã®äººæ° n (1 †n †10000)ãåçåŸ... | 37,782 |
Gossip Problem 1ãã n ãŸã§ã®çªå·ãé çªã«å²ãåœãŠãããŠãã n 人ã®ã¢ã€ãã«ã暪äžåã«äžŠãã§ããã ã¢ã€ãã« i ã¯åäœæéã§ã¢ã€ãã« i -1ãšã¢ã€ãã« i +1ã«æ
å ±ãäŒéããããšãã§ããããã ããã¢ã€ãã«1ã¯ã¢ã€ãã«2ã«ããæ
å ±ãäŒéã§ãããã¢ã€ãã« n ã¯ã¢ã€ãã« n -1ã«ããæ
å ±ãäŒéã§ããªãã æå»0ã®æç¹ã§ãçªå·ã a 1 , a 2 , ..., a m ã§ãã m 人ã®ã¢ã€ãã«ãç§å¯ã®æ
å ±ãæã£ãŠããããã¹ãŠã®ã¢ã€ãã«ãç§å¯ã®æ
å ±ãåŸãããšã®ã§ããæå°ã®æéãæ±ããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã n m a 1 a 2 ... a m 1è¡ç®ã«2ã€ã®æŽæ° n ãš m ã空çœåºå... | 37,783 |
C: Common Palindromes ICPC ã§è¯ãæçžŸãåããã«ã¯ä¿®è¡ãæ¬ ãããªãïŒããã㯠ICPC ã§åã¡ããã®ã§ïŒä»æ¥ãä¿®è¡ãããããšã«ããïŒ ä»æ¥ã®ä¿®è¡ã¯ïŒæååäžã«ããåæãæ¢ãããšã«ãã£ãŠïŒæç« ããé ããã¡ãã»ãŒãžãèªè§£ããèœåãé«ããããšãããã®ã§ããïŒåæã¯ãããããããããããªãã®ã§ïŒæ¢ãã€ãã§ã«åæ°ãæ°ããŠããŸãããïŒ 2 ã€ã®æåå S , T ãäžããããã®ã§ïŒä»¥äžãæºããæŽæ°ã®çµ ( i , j , k , l ) ã®åæ°ãæ±ãããïŒ 1 †i †j †( S ã®é·ã)ïŒ 1 †k †l †( T ã®é·ã)ïŒ S ã® i æåç®ãã j æåç®ãŸã§ãåãåºããéšåæååã¯ïŒ T ã® k... | 37,785 |
Score: 200 points Problem Statement We have N cards. A number a_i is written on the i -th card. Alice and Bob will play a game using these cards. In this game, Alice and Bob alternately take one card. Alice goes first. The game ends when all the cards are taken by the two players, and the score of each player is the su... | 37,786 |
å士ã®å
é»ç®¡ å士 : ããŒã¿ãŒåããã£ããã ããŒã¿ãŒ : ãŸãã§ãããä»åºŠã¯ã©ããªãã ããªãçºæã§ããã å士 : ãã®å¹»ã®çŽ ç²åã¢ãã·ãªã³ã®æ€åºåšãçºæãããããã ããŒã¿ãŒ : ã¢ãã·ãªã³ãšããã°ã欧å·ååååæ žç ç©¶æ©æ§ (CERN) ãã¯ãããšããç ç©¶è
ãã¡ãè¡çŒã§è¿œã£ãããŠãããšãããããã§ããããæ¬åœã§ããã? å士 : æ¬åœã ã£ãŠã°ãã现ãã説æã¯çãããéåžžã«åŒ·åãªç£å Žãå
èµããç¹æ®ãªå
é»ç®¡ãå
ãããšã«ãã£ãŠãééããã¢ãã·ãªã³ãæ€åºããã ããŒã¿ãŒ : ä» ã«å
ãããŠæ€åºããã°ãå°æŽå
çã®ãã¥ãŒããªãæ€åºã«å¹æµããããŒãã«è³çŽã®ç ç©¶ã§ããã ããã§åœ¹ç«ããã®ç ç©¶ã°ããããŠããããã¡ç 究宀ããªã©ãšããæ±åãè¿äžã§ã... | 37,787 |
Kingdom of JOIOI The Kingdom of JOIOI is a rectangular grid of $H \times W$ cells. In the Kingdom of JOIOI, in order to improve efficiency of administrative institutions, the country will be divided into two regions called "JOI" and "IOI." Since we do not want to divide it in a complicated way, the division must satisf... | 37,788 |
Problem F: Dice Puzzle Letâs try a dice puzzle. The rules of this puzzle are as follows. Dice with six faces as shown in Figure 1 are used in the puzzle. Figure 1: Faces of a die With twenty seven such dice, a 3 Ã 3 Ã 3 cube is built as shown in Figure 2. Figure 2: 3 Ã 3 Ã 3 cube When building up a cube made of dice, t... | 37,789 |
ã€ã¯ã¿åã¯ãç¡åã°ã©ãã«ã€ããŠç°åžžãªã»ã©ã®æãå
¥ããæã£ãŠãããã€ã¯ã¿åã¯ãç¡åã°ã©ã G ãšãã® 2 ç¹ s,t ã®çµ (G,s,t) ã®ãã¡ããã®ããã€ããããã倧ãããã®ã奜ãã§ããã çµ (G,s,t) ã®ããã€ãããããšã¯ã蟺 e = \{u, v\} ( u ãš v 㯠G ã®ç°ãªã 2 ç¹) ã§ã G ã«ããã s ãã t ãžã®æçè·¯ã®é·ããã G ã« e ãã€ãããããç¡åã°ã©ãã«ããã s ãã t ãžã®æçè·¯ã®é·ããã 1 ã ã倧ãããã®ã®åæ°ã§ããã ããªãã®ä»äºã¯ãçµ (G,s,t) ãäžãããããšãããã®ããã€ãããããæ±ããããã°ã©ã ãæžãããšã§ããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã N M... | 37,790 |
ãã¬ã€ãã»ãã©ãŒã¹ã»ã¹ããŒãªãŒ English text is not available in this practice contest. ãææãŠã®å°ïŒãã€ã³ã»ã¢ã€ã©ã³ãã«ã¯ç¹å¥ãªåãæã€ãã®ãçããŠããïŒ ããè
ã¯ç«ïŒããè
ã¯æ°·ïŒããè
ã¯é¢šïŒããè
ã¯åãæã®ãŸãŸã«æãããšãã§ããïŒ äººã¯ãããã®è¡è
ãããåŒãã ïŒãBrave Forceããšã»ã»ã»ïŒæã¯æŠåœæä»£ïŒæš©åè
ãã¡ã¯Brave Forceãç§æ¬²ã®ããã«äœ¿ãããšBrave Forceç©ããå§ããïŒ Brave Forceãå·¡ãæŠããä»å§ãŸãããšããŠããïŒã 以äžã¯ïŒããªããä»ã€ããããšããŠããæŠç¥ã·ãã¥ã¬ãŒã·ã§ã³ã²ãŒã ã®ããããŒã°ã§ããïŒãã®ããããŒã°ã¯æ¬åé¡ã«ã¯å
šãé¢... | 37,791 |
Problem I : RMQ n åã®æ°å a 0 , a 1 , ... , a n-1 ãš q ãäžããããã q åã®ã¯ãšãªãŒã«å¯ŸããŠé©åãªåŠçãè¡ãªã£ãŠæ¬²ããã ã¯ãšãªãŒã¯ä»¥äžã®3çš®é¡ã®æäœãååšããã å€ã®ã·ãããè¡ã l ãš r ã®ãã¢ãäžããããã( l < r ) a l ãã a r ãŸã§ã®å€ã Circular Shiftãããã 0 1 2 3 4 5 6 7 8 9 ã«å¯ŸããŠl=2,r=5ãšããã¯ãšãªãŒãäžãããããšããã ã·ãããè¡ã£ãæ°åå㯠0 1 5 2 3 4 6 7 8 9 ãšãªãã æå°å€ãæ±ãã l ãš r ã®ãã¢ãäžããããã( l †r ) a l ãã a r ãŸã§ã®å€ã®äžã§æå°ã®å€... | 37,792 |
Colorful Tree A tree structure with some colors associated with its vertices and a sequence of commands on it are given. A command is either an update operation or a query on the tree. Each of the update operations changes the color of a specified vertex, without changing the tree structure. Each of the queries asks th... | 37,793 |
Score : 200 points Problem Statement Snuke has N sticks. The length of the i -th stick is l_i . Snuke is making a snake toy by joining K of the sticks together. The length of the toy is represented by the sum of the individual sticks that compose it. Find the maximum possible length of the toy. Constraints 1 \leq K \le... | 37,794 |
J - ã¿ã€ã«çœ®ã ãµã€ãº H à W ã®ç€é¢ã«ãµã€ãº1Ã2ã®ã¿ã€ã«ããã¹ç®ã«ãã£ãŠ N åé
眮ããæ¹æ³ãäœéããããæ±ããã. ã¿ã€ã«ã¯éãªã£ãŠã¯ãããªã. ãŸã瞊暪ã©ã¡ãã®åãã«çœ®ããŠãæ§ããªã. ã¿ã€ã«ã¯å
šãŠåãèŠãç®ã§ããäºãã«åºå¥ããªããã®ãšãã. ã¿ã€ã«ã¯180床å転ããŠãåãèŠãç®ã§ãããåºå¥ããªããã®ãšãã. çãã¯å€§ãããªãå¯èœæ§ãããã®ã§1,000,000,007ã§å²ã£ãäœããçãã å
¥ååœ¢åŒ å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããïŒ H W N åºååœ¢åŒ ã¿ã€ã«ã®çœ®ãæ¹ã®ç·æ°ã 1,000,000,007 ã§å²ã£ãäœããåºåããïŒ å¶çŽ 1 †H †1,000,000,000 1 †W †1,000,000,00... | 37,795 |
Problem Statement There are N piles of candies on the table. The piles are numbered 1 through N . At first, pile i contains a_i candies. Snuke and Ciel are playing a game. They take alternating turns. Snuke goes first. In each turn, the current player must perform one of the following two operations: Choose a pile with... | 37,796 |
Score : 300 points Problem Statement In some other world, today is Christmas Eve. There are N trees planted in Mr. Takaha's garden. The height of the i -th tree (1 \leq i \leq N) is h_i meters. He decides to choose K trees from these trees and decorate them with electric lights. To make the scenery more beautiful, the ... | 37,797 |
Problem B: Electrophoretic Scientist Frank, majoring in electrochemistry, has developed line-shaped strange electrodes called F-electrodes . During being activated, each F-electrode causes a special potential on and between the two lines touching the F-electrodeâs endpoints at a right angle. Then electrically-charged p... | 37,798 |
ãããªããŒã æšæºé²ç»ã§ 120 åã®ãããªããŒãããããŸããããŒããå®å
šã«å·»ãæ»ããç¶æ
ã§ãããªãããã®ã«ãŠã³ã¿ã 00:00:00 ã«ããæšæºé²ç»ã¢ãŒãã§é²ç»ãããšãããããã«ãŠã³ã¿å€ã«ãªããŸããããã®ã«ãŠã³ã¿å€ïŒæãåãç§ïŒãå
¥åããæ®ãã®ããŒãã®é·ãïŒé²ç»å¯èœæéïŒãæ±ããæïŒåïŒç§ã®åœ¢åŒã§åºåããããã°ã©ã ãäœæããŠäžããã ãã ãã2 æéïŒ120åïŒä»¥å
ã®å
¥åãšããŸãããªããããŒãæ®éã¯æšæºé²ç»ã¢ãŒããš 3 åé²ç»ã¢ãŒãã®å Žåã®ïŒéããèšç®ããåºåäŸã®ããã«æãåãç§ãšã 2 æ¡ãã€åºåããŸãããŸã "05" ã®ããã« 10 ã®äœã 0 ã®å Žåã¯ã"0" ãã€ããŠãã ããã å
¥å è€æ°ã®ããŒã¿ã»ãããäžããããŸããåã... | 37,799 |
å
šå®å®çåœã²ãã ããŒã¿ããŒã¹ ãªã¿ãŒã³ãº 西æŠ2301幎ïŒå®å®é£éŠå
±ååœã®çåœç§åŠå±ã§ã¯ïŒå®å®çç©ã®ã²ãã é
åã®ç ç©¶ãè¡ã£ãŠããïŒè¿å¹Žã®ç ç©¶ã®çµæïŒã²ãã é
åã«ç¹å®ã®ãã¿ãŒã³ãäœåçŸããããçç©ã®æ§è³ªã«å€§ãã圱é¿ããããšãåãã£ãŠããïŒ å®å®çç©ã®ã²ãã é
åã¯è±å€§æåãããªãæååã§è¡šãããïŒç ç©¶å¡ãã¡ã¯ã²ãã é
åã®äžã«ïŒããç¹å®ã®ãã¿ãŒã³ãäœåçŸããããæ°ãäžããããšã«ããïŒããããªããïŒå®å®çç©ã®ã²ãã é
åã¯éåžžã«é·ãããïŒåŸè¿°ããæ¹æ³ã§ç¹°ãè¿ããããéšåæååãå§çž®ããŠããŒã¿ããŒã¹ã«ä¿åããŠããïŒ ããªãã®ä»äºã¯å§çž®ãããã²ãã é
å S ããæåå Q ã®åºçŸåæ°ãæ°ãäžããããã°ã©ã ãäœæããããšã§ããïŒãã ãïŒ Q ã®åºçŸ... | 37,800 |
äžããããå€æè¡šã«ããšã¥ãïŒããŒã¿ã倿ããããã°ã©ã ãäœæããªããïŒ ããŒã¿ã«äœ¿ãããŠããæåã¯è±åãæ°åã§ïŒè±åã¯å€§æåãšå°æåãåºå¥ããïŒå€æè¡šã«çŸããæåã®é åºã«èŠåæ§ã¯ãªãïŒ å€æè¡šã¯ç©ºçœãã¯ããã§åãšåŸãã® 2 ã€ã®æåããã(æååã§ã¯ãªã)ïŒå€ææ¹æ³ã¯ïŒå€æè¡šã®ããè¡ã®åã®æåãããŒã¿ã«çŸãããïŒãã®ãã³ã«ãã®æåãåŸãã®æåã«å€æãåºåããïŒå€æã¯ 1 床ã ãã§ïŒå€æããæåããŸãå€æå¯Ÿè±¡ã®æåã«ãªã£ãŠã倿ããªãïŒå€æè¡šã«çŸããªãæåã¯å€æããïŒãã®ãŸãŸåºåããïŒ å
¥åãã¡ã€ã«ã«ã¯ïŒå€æè¡šïŒæåã® n + 1 è¡ïŒã«ç¶ã倿ããããŒã¿ïŒn + 2 è¡ç®ä»¥éïŒãæžããŠããïŒ 1 è¡ç®ã«å€æè¡šã®è¡æ° nïŒç¶ã n è¡... | 37,801 |
Finding a Word Write a program which reads a word W and a text T , and prints the number of word W which appears in text T T consists of string T i separated by space characters and newlines. Count the number of T i which equals to W . The word and text are case insensitive. Constraints The length of W †10 W consists ... | 37,802 |
Maximum Flow A flow network is a directed graph which has a $source$ and a $sink$. In a flow network, each edge $(u, v)$ has a capacity $c(u, v)$. Each edge receives a flow, but the amount of flow on the edge can not exceed the corresponding capacity. Find the maximum flow from the $source$ to the $sink$. Input A flow ... | 37,803 |
Score : 100 points Problem Statement As a New Year's gift, Dolphin received a string s of length 19 . The string s has the following format: [five lowercase English letters],[seven lowercase English letters],[five lowercase English letters] . Dolphin wants to convert the comma-separated string s into a space-separated ... | 37,804 |
幟äœåé¡ãè§£ãã Aåã¯ä»æ¥ã幟äœã®åé¡ãè§£ããŠããã 幟äœã®åé¡ãè§£ãæã¯æµ®åå°æ°ç¹èª€å·®ã«æ°ãã€ããããšã倧äºã§ããã æµ®åå°æ°ç¹èª€å·®ãšã¯ã2鲿³ã®æéå°æ°ã§æ°ã衚ãéã«ãããäžžãã«ãã£ãŠèµ·ãã誀差ã§ããã äŸãã°ã10鲿³ã§ã® 0.1 ã¯2鲿³ã§ã¯ 0.00011001100110011 ... ãšããç¡éå°æ°ã«ãªããã ãããæéã®æ¡ã§äžžããéã«èª€å·®ãçºçããŠããŸãã æ£ã®æŽæ° p , q ã10鲿³ã§äžããããã æçæ° p / q ãæéæ¡æ°ã®å°æ°ã§è¡šçŸããããšãã§ãããã㪠b 鲿³ïŒ b ã¯2以äžã®æŽæ°ïŒãæ±ããã è€æ°ããå Žåã¯æãå°ãããã®ãåºåããã Constraints 0 < p < q < 10^9 In... | 37,805 |
Score : 400 points Problem Statement We have an undirected graph G with N vertices numbered 1 to N and N edges as follows: For each i=1,2,...,N-1 , there is an edge between Vertex i and Vertex i+1 . There is an edge between Vertex X and Vertex Y . For each k=1,2,...,N-1 , solve the problem below: Find the number of pai... | 37,806 |
Score : 100 points Problem Statement Snuke built an online judge to hold a programming contest. When a program is submitted to the judge, the judge returns a verdict, which is a two-character string that appears in the string S as a contiguous substring. (The judge can return any two-character substring of S .) Determi... | 37,807 |
Score : 300 points Problem Statement We will play a one-player game using a number line and N pieces. First, we place each of these pieces at some integer coordinate. Here, multiple pieces can be placed at the same coordinate. Our objective is to visit all of the M coordinates X_1, X_2, ..., X_M with these pieces, by r... | 37,808 |
Score : 900 points Problem Statement Takahashi and Aoki are playing a stone-taking game. Initially, there are N piles of stones, and the i -th pile contains A_i stones and has an associated integer K_i . Starting from Takahashi, Takahashi and Aoki take alternate turns to perform the following operation: Choose a pile. ... | 37,809 |
Score : 200 points Problem Statement A group of people played a game. All players had distinct scores, which are positive integers. Takahashi knows N facts on the players' scores. The i -th fact is as follows: the A_i -th highest score among the players is B_i . Find the maximum possible number of players in the game. ... | 37,810 |
Score : 200 points Problem Statement There are N mountains ranging from east to west, and an ocean to the west. At the top of each mountain, there is an inn. You have decided to choose where to stay from these inns. The height of the i -th mountain from the west is H_i . You can certainly see the ocean from the inn at ... | 37,811 |
Fibonacci Number Write a program which prints $n$-th fibonacci number for a given integer $n$. The $n$-th fibonacci number is defined by the following recursive formula: \begin{equation*} fib(n)= \left \{ \begin{array}{ll} 1 & (n = 0) \\ 1 & (n = 1) \\ fib(n - 1) + fib(n - 2) & \\ \end{array} \right. \end{equation*} In... | 37,812 |
A/B Problem Write a program which reads two integers a and b , and calculates the following values: a ÷ b : d (in integer) remainder of a ÷ b : r (in integer) a ÷ b : f (in real number) Input Two integers a and b are given in a line. Output Print d , r and f separated by a space in a line. For f , the output should not... | 37,813 |
Score : 200 points Problem Statement There are N participants in the CODE FESTIVAL 2016 Qualification contests. The participants are either students in Japan, students from overseas, or neither of these. Only Japanese students or overseas students can pass the Qualification contests. The students pass when they satisfy... | 37,814 |
Score : 100 points Problem Statement In this problem, we use the 24 -hour clock. Takahashi gets up exactly at the time H_1 : M_1 and goes to bed exactly at the time H_2 : M_2 . (See Sample Inputs below for clarity.) He has decided to study for K consecutive minutes while he is up. What is the length of the period in wh... | 37,815 |
Problem H: Road Construction King Mercer is the king of ACM kingdom. There are one capital and some cities in his kingdom. Amazingly, there are no roads in the kingdom now. Recently, he planned to construct roads between the capital and the cities, but it turned out that the construction cost of his plan is much higher... | 37,816 |
You and your grandma are playing with graph automata, which is generalization of cell automata. A graph automaton is expressed by a graph. The vertices of the graph have a time-dependent value, which can be either 0 or 1. There is no more than one edge between any of two vertices, but self-loops might exist. The values... | 37,817 |
Score: 300 points Problem Statement Find the minimum prime number greater than or equal to X . Notes A prime number is an integer greater than 1 that cannot be evenly divided by any positive integer except 1 and itself. For example, 2 , 3 , and 5 are prime numbers, while 4 and 6 are not. Constraints 2 \le X \le 10^5 Al... | 37,818 |
Problem F: Gap Letâs play a card game called Gap. You have 28 cards labeled with two-digit numbers. The first digit (from 1 to 4) represents the suit of the card, and the second digit (from 1 to 7) represents the value of the card. First, you shuffle the cards and lay them face up on the table in four rows of seven car... | 37,819 |
ãã«ããã¹ã¿ã³ã (Circle Cross Stamps) å顿 JOI åã¯ãã«ã¹ã¿ã³ãïŒããã¹ã¿ã³ãïŒãã«ããã¹ã¿ã³ãã®3çš®é¡ã®ã¹ã¿ã³ãããããã 0 åä»¥äžæã£ãŠããïŒãããã¯ãã«ãããã®ããŒã¯ãçŽã«å°åããããšãã§ããã¹ã¿ã³ãã§ããïŒ ãã«ã¹ã¿ã³ãã䜿ããšãã«ã 1 ã€å°åããïŒããã¹ã¿ã³ãã䜿ããšããã 1 ã€å°åãããïŒãã«ããã¹ã¿ã³ãã䜿ããšãã«ãšãããæšªäžåã« 1 ã€ãã€å°åããïŒã¹ã¿ã³ãã®åããå€ããããšã§ïŒãã«ã®å³ã«ãããæ¥ãããã«ãïŒããã®å³ã«ãã«ãæ¥ãããã«ãå°åã§ããïŒ JOI åã¯ïŒæã£ãŠããã¹ã¿ã³ããããããã¡ããã© 1 åãã€é©åœãªé çªã§äœ¿ãïŒçŽã«æšªäžåã«ãã«ãšãããå°åããïŒå°åããããã«ãšãã... | 37,820 |
ãã±ãã«æã¡ ããæ¥ããããåã¯ãæ¬æã«ã519345213244ããšããæ°åã ããæžããŠããããããªã¡ãŒã«ãåãåã ãŸããããã®ã¡ãŒã«ã¯ã10 æ³å¹Žäžã®åŸå§ããã ã£ãã®ã§é»è©±ããŠèããŠã¿ããšããããæ¥ãã§ããã ãã±ãã«æã¡ã§éã£ã¡ãã£ãã䟿å©ããããããããã£!ããšãã£ãŠåãããŠããŸããŸããããã€ã ããããªããå°ã匷åŒãªãšããã®ãããã®åŸå§ãããç¥ããããåã¯ã仿¹ãªãèªåã§ããã±ãã«æ ã¡ãã«ã€ããŠèª¿ã¹ãŠã¿ããšã10 幎ãããåã«äžäžã颚é¡ããããªå
¥åã®æ¹æ³ã ãšããããšãåãããŸã ãã ããã±ãã«æã¡ãã§ã¯ãå³ 1 ã®ãããªå€æè¡šã«åŸãâãâ㯠11ãâãâ㯠15 ãšããå
·åã«ã2 ã€ã®æ°å ã§äžã€ã®æåãå
¥åããŠãã... | 37,821 |
å¹³é¢ã«é·æ¹åœ¢ã®ã·ãŒããäœæã眮ãããŠãã. ãããã®ã·ãŒãã§èŠãããŠããéšåã®é¢ç©ãåšé·ãæ±ããããã°ã©ã ãäœæãã. ãã ã, å¹³é¢ã座æšå¹³é¢ãšã¿ãªãããšã, ã·ãŒãã®é
çœ®ã¯æ¬¡ã®æ¡ä»¶ (1), (2) ãæºãããã®ãšãã. (1) åã·ãŒãã®é·æ¹åœ¢ã® 4 é ç¹ã® x , y 座æšã¯å
šãŠ 0 ä»¥äž 10000 以äžã®æŽæ°ã§ãã, é·æ¹åœ¢ã®å蟺㯠x 軞, ãŸã㯠y 軞ã«å¹³è¡ã§ãã. (2) ã·ãŒãã®ææ°ã¯é«ã
10000 æä»¥äžã§ãã. å
¥åããŒã¿ ã® 1 è¡ç®ã«é·æ¹åœ¢ã®åæ° n ãšåé¡ã®çš®é¡ãè¡šãæŽæ° r ã空çœã§åºåã£ãŠæžãããŠãã. 2 è¡ç®ä»¥éã®åè¡ã«ã¯, åã·ãŒãã®å·Šäžé ç¹åº§æš ( x 1 , y 1 ) ãšå³äžé ç¹åº§æš... | 37,822 |
äžçªäžã®è¡ã®æ°åã¯? 次ã®ãããªæ°åã®ãã¿ãŒã³ãäœãããšãèããŸãã 4 8 2 3 1 0 8 3 7 6 2 0 5 4 1 8 1 0 3 2 5 9 5 9 9 1 3 7 4 4 4 8 0 4 1 8 8 2 8 4 9 6 0 0 2 5 6 0 2 1 6 2 7 8 5 ãã®ãã¿ãŒã³ã¯ä»¥äžã®èŠåã«åŸã£ãŠããŸãã A B C ãšããæ°åã®äžŠã³ã«ãããŠãC 㯠A + B ã® 1 ã®äœã®æ°åã§ãããããšãã°ã 9 5 4 ã§ã¯ã9 + 5 = 14 ã® 1 ã®äœã®æ°åãããªãã¡ 4 ã 9 ãš 5 ã®æãäžã«äžŠã¹ãããŸãããŸãã 2 3 5 ã§ã¯ã2 + 3 = 5 ã® 1 ã®äœã®æ°åãããªãã¡ 5 ã 2 ãš 3 ã®... | 37,823 |
Problem D: Operations with Finite Sets Let A, B, C, D, E be sets of integers and let U is a universal set that includes all sets under consideration. All elements in any set are different (no repetitions). u - union of two sets, AuB = { x â U : x â A or x â B } is the set of all elements which belong to A or B . i - in... | 37,824 |
Problem A: ãµã€ãŸãŠ ããåœã§ããµã€ãŸãŠããšãããã¬ãçªçµãæµè¡ããŠããïŒ ãã®çªçµã¯åå è
ããã£ãŒã«ãã¢ã¹ã¬ããã¯ã«ææŠãïŒ èŠäºæ»ç¥ããã°è³éããããããšãããã®ã§ããïŒ ãã£ãŒã«ãã¢ã¹ã¬ããã¯ã¯é«ããç°ãªããããã¯ãäžåã«äžŠã¹ãŠäœãããŠããŠïŒ æ»ç¥ã®ããã«ã¯ããã«ããŠæ®µå·®ãç»ãéãããããéèŠã«ãªã ïŒå³1ïŒïŒ ãã®çªçµã«åå ããããšã«ãªã£ãããªãã®å人ã¯ïŒ ãã£ãŒã«ãã¢ã¹ã¬ããã¯ã®æ§é ãäžãããããšãã«ïŒ ç»ããªããã°ãªããªãæå€§ã®æ®µå·®ãšéããªããã°ãªããªãæå€§ã®æ®µå·®ã èšç®ããããã°ã©ã ãæžããŠã»ãããšïŒ åè
ããã°ã©ããŒã§ããããªãã«äŸé ŒããŠããïŒ å³1: ã¢ã¹ã¬ããã¯ã®æ§é ã®äŸïŒå
¥åäŸã®æåã®ããŒã¿ã»ããïŒïŒ... | 37,825 |
Score : 600 points Problem Statement Snuke got an integer sequence of length N from his mother, as a birthday present. The i -th (1 ⊠i ⊠N) element of the sequence is a_i . The elements are pairwise distinct. He is sorting this sequence in increasing order. With supernatural power, he can perform the following two ope... | 37,826 |
G - Revenge of Minimum Cost Flow Problem Statement Flora is a freelance carrier pigeon. Since she is an excellent pigeon, there are too much task requests to her. It is impossible to do all tasks, so she decided to outsource some tasks to Industrial Carrier Pigeon Company. There are N cities numbered from 0 to N-1 . Th... | 37,827 |
Problem E Black or White Here lies a row of a number of bricks each painted either black or white. With a single stroke of your brush, you can overpaint a part of the row of bricks at once with either black or white paint. Using white paint, all the black bricks in the painted part become white while originally white b... | 37,828 |
åé¡ B è å顿 N åã¯æ¯æ¥åŠæ ¡ã«éã£ãŠãããïŒãã®éã®ãã¯ãšãŠãé·ãïŒããã«ä»ã¯æãå€ã§ããïŒéäžïŒèãäºæè¿ãïŒåºæ¥ãã°é¿ããããã®ã§ããïŒãšããã§æ
å ±åãçºéããçŸä»£ç€ŸäŒã«ãããŠã¯ïŒå®¶ã«å±
ãªããã«ããŠã©ãã«äœå¹ã®èãããã調ã¹ãããšãåºæ¥ãïŒãã®æ
å ±ã䜿ãïŒéäžã§åºäŒãèã®æ°ãæãå°ãªãéã§åŠæ ¡ã«è¡ãããšã«æ±ºããïŒ å®¶ãšåŠæ ¡ãæãããå°å³ã¯é·æ¹åœ¢ç¶ã«ãªã£ãŠããïŒ H à W åã®ãããã¯ã«åå²ãããïŒäžçªå·Šäžã®ãããã¯ã« N åã®å®¶ãããïŒäžçªå³äžã«åŠæ ¡ãããïŒåœŒã¯åŠæ ¡ãžãŸã£ããç»æ ¡ãããã®ã§å®¶ã®æ¹ã«éæ»ãããããšã¯ãªã (å°å³ã«ãããŠïŒå³ãäžã®ãããã¯ã«ããç§»åããªã)ïŒåãããã¯ã«ãããŠïŒããã«ããèã®æ°ã ãäžå¿«ã«ãª... | 37,829 |
Score : 100 points Problem Statement There are N stones, numbered 1, 2, \ldots, N . For each i ( 1 \leq i \leq N ), the height of Stone i is h_i . There is a frog who is initially on Stone 1 . He will repeat the following action some number of times to reach Stone N : If the frog is currently on Stone i , jump to Stone... | 37,830 |
Score : 1600 points Problem Statement In some place in the Arctic Ocean, there are H rows and W columns of ice pieces floating on the sea. We regard this area as a grid, and denote the square at the i -th row and j -th column as Square (i,j) . The ice piece floating in each square is either thin ice or an iceberg, and ... | 37,831 |
Score : 500 points Problem Statement There is a string s of length 3 or greater. No two neighboring characters in s are equal. Takahashi and Aoki will play a game against each other. The two players alternately performs the following operation, Takahashi going first: Remove one of the characters in s , excluding both e... | 37,832 |
Score: 100 points Problem Statement A triple of numbers is said to be poor when two of those numbers are equal but the other number is different from those two numbers. You will be given three integers A , B , and C . If this triple is poor, print Yes ; otherwise, print No . Constraints A , B , and C are all integers b... | 37,833 |
Huge Knapsack Problem You have N items that you want to put them into a knapsack. Item i has value v i and weight w i . You want to find a subset of items to put such that: The total value of the items is as large as possible. The items have combined weight at most W , that is capacity of the knapsack. Find the maximum... | 37,834 |
Score : 1600 points Problem Statement There are N squares in a row, numbered 1 through N from left to right. Snuke and Rng are playing a board game using these squares, described below: First, Snuke writes an integer into each square. Each of the two players possesses one piece. Snuke places his piece onto square 1 , a... | 37,835 |
Problem E: Amazing Graze In 2215 A.D., a war between two planets, ACM and ICPC, is being more and more intense. ACM introduced new combat planes. These planes have a special system that is called Graze, and fighting power of a plane increases when it is close to energy bullets that ICPC combat planes shoot. Both combat... | 37,836 |
Score : 600 points Problem Statement We have a grid with A horizontal rows and B vertical columns, with the squares painted white. On this grid, we will repeatedly apply the following operation: Assume that the grid currently has a horizontal rows and b vertical columns. Choose "vertical" or "horizontal". If we choose ... | 37,837 |
æéäœé»å 0以å€ã®ãã¹ãŠã®å®æ°ã®éæ°ã¯å®æ°ã«ãªããŸãããæŽæ°ã®éæ°ãæŽæ°ã«ãªããšã¯éããŸãããèšèªãªã©ã§ 3.0/2.0*2.0 = 3.0 ãªã®ã« 3/2*2 = 2 ã«ãªã£ãŠããŸãã®ã¯ãã®ããã§ããã§ãããçŽ æ°ã§å²ã£ãäœããçããæŽæ°ãåããã®ãšã¿ãªããšã0以å€ã®ãã¹ãŠã®æŽæ°ãéæ°ããã€ããã«ã§ããŸãã æŽæ° x ãš y ã p ã§å²ã£ãäœããçãããšããx â¡ y (mod p) ãšæžããŸããp ãçŽ æ°ã®ãšãããã®ãã㪠x ãš y ãåããã®ãšã¿ãªããªãããã¹ãŠã®æŽæ° n ã¯0ãã pâ1 ãŸã§ã®ã©ããã®æŽæ° x ã«å¯Ÿã㊠x â¡ n (mod p) ãšãªãã®ã§ããã£ããã { 0, 1, 2, ..., pâ1 } ãš... | 37,838 |
There are n processes in a queue. Each process has name i and time i . The round-robin scheduling handles the processes in order. A round-robin scheduler gives each process a quantum (a time slot) and interrupts the process if it is not completed by then. The process is resumed and moved to the end of the queue, then t... | 37,839 |
Score : 500 points Problem Statement Takahashi and Aoki will play a game. They will repeatedly play it until one of them have N wins in total. When they play the game once, Takahashi wins with probability A %, Aoki wins with probability B %, and the game ends in a draw (that is, nobody wins) with probability C %. Find ... | 37,840 |
Problem C: Warping Girl Problem äŒæŽ¥éæ³åŠæ ¡ã¯, éæ³ã䜿ããè
ãéãŸãåŠæ ¡ã§ãã. ãã®åŠæ ¡ã®çåŸã®äžäººã§ãããã«ã«ã¯, éæ³é£ã®äžã§ã¯ãŒãã®éæ³ã䜿ãäºãã§ãã. 圌女ã®å®¶ããåŠæ ¡ã«ã¯, é·ã L ã®äžçŽç·ç¶ã®éããã. ãŸã, ãã®éã«ã¯æã
éæ³é£ãæãããŠãã. åœŒå¥³ã¯æ¯æ¥ãã®éã䜿ã£ãŠåŠæ ¡ã«éã£ãŠãããã, ã§ããã ãçãæéã§åŠæ ¡ã«èŸ¿ãçããããšæã£ãŠãã. ããã§ããã°ã©ããŒã§ããããªãã¯, 圌女ã«åŠæ ¡ãŸã§è¡ããšãã«ãããæå°ã®æéãæããŠãããããšã«ãã. ãã«ã«ã¯, 1 åã§è·é¢ 1 ã ãæ©ããŠå
ã«é²ãããšãã§ãã ( ïŒæ»ãããšã¯ã§ããªã)ïŒãŸã, ã¯ãŒãã®éæ³é£ãæžããŠããäœçœ® ... | 37,841 |
Score : 300 points Problem Statement A railroad running from west to east in Atcoder Kingdom is now complete. There are N stations on the railroad, numbered 1 through N from west to east. Tomorrow, the opening ceremony of the railroad will take place. On this railroad, for each integer i such that 1â€iâ€N-1 , there will ... | 37,842 |
Problem B: åã ã¡ã®èªãæ¹ ææ¥ãããåŸ
ã¡ã«åŸ
ã£ãå€äŒã¿ãå§ãŸããŸãããªã®ã§ãããã¯ãåã ã¡ãèªã£ãŠãæµ·ã«éã³ã«è¡ãã ãšã«æ±ºããŸããã ããã©ãããããã®åã ã¡ã«ã¯ãæ¥ãããããããããå€ãã§ãããã®äººãã¡ã¯ãããŸãå€ãã®äººã ãã£ããã«æ¥ããšç¥ã£ããããã£ãšå«ããã§ãããã ã»ãã«ãããããã®åã ã¡ã«ã¯ãç®ç«ã¡ãããããããå€ãã§ãããã®äººãã¡ã¯ããã£ããã«æ¥ã人 ãããŸãå€ããªããšç¥ãã°ããã£ãšå«ããã§ãããã ãããšããããã®åã ã¡ã«ã¯ããã€ãã¯ç®ç«ã¡ãããããªã®ã«å®ã¯æ¥ãããããããããªäººãã㟠ãããã®äººãã¡ã¯ããã£ããã«æ¥ã人ãå€ãããŠãå°ãªãããŠãããã£ãšå«ããã§ãããã ããããã®ã¯ã倧å¢ã§è¡ã£ãæ¹ã楜ã... | 37,843 |
ã©ã³ã ãæŒã«é£ã¹ããåŒåœãäœãããã«ããåºã§é£ã¹ç©ãè²·ããŸããããåºã§ã¯ãé£ã¹ç©ãå
¥ããã®ã«çްé·ãè¢ããããããªãã£ãã®ã§ããã¹ãŠã®é£ã¹ç©ã瞊ã«ç©ãã§è¢ã«å
¥ããå¿
èŠããããŸããè¢ãåãã«ããããã«ãã§ããã ãéãç©ãäžã«ããŠè©°ãããã®ã§ãããé£ã¹ç©ã®äžã«ã¯ãããããç©ããã£ãŠãäžã«éãç©ãä¹ãããšã€ã¶ããŠããŸããŸãã ããã§ãé£ã¹ç©ã®æ
å ±ãå
¥åãšããå
šãŠã®é£ã¹ç©ãã€ã¶ããããã€å
šäœã®éå¿ãæãäœããªããããªç©ã¿æ¹ãåºåããããã°ã©ã ãäœæããŠãã ãããããããã®é£ã¹ç©ããšã«ãåå f ãéã w ãäžã«èŒããŠèããããéã s ãæå®ãããŸãã ãå
šãŠã®é£ã¹ç©ãã€ã¶ããªãããšããã®ã¯ãäžããé ã«ãïŒ f 1 ã f 2 ã... ... | 37,844 |
åé¡ 6: å°ç± å
(Xiao Long Bao) åé¡ JOI åã¯ãæŒãã¯ãã«ïŒäžè¯æçå±ã§å°ç± å
ãé£ã¹ãããšã«ããïŒ å°ç± å
ãšã¯ïŒå
·ãšç±ãã¹ãŒããå°éºŠç²ã®ç®ã§å
ãã æçã§ããïŒé£ã¹ããšãã«ã¹ãŒããåšå²ã«é£ã³æ£ãããšã§ç¥ãããŠããïŒ JOI åãæ³šæããå°ç± å
ã®ã»ããã¯ïŒå
·ãã¹ãŒãã®ç°ãªã N åã®å°ç± å
ãããªãïŒ N åã®å°ç± å
ã¯çééã«äžåã«äžŠãã§ããïŒé çªã« 1 ãã N ã®çªå·ãã€ããããŠããïŒ i çªç®ã®å°ç± å
ãš j çªç®ã®å°ç± å
ã®éã®è·é¢ã¯çµ¶å¯Ÿå€ |i - j| ã§ããïŒ JOI åã¯å°ç± å
ãããé çªã§é£ã¹ãŠããïŒ æåïŒãã¹ãŠã®å°ç± å
ã®ãããã㯠0 ã§ããïŒ i çªç®ã®å°ç± å
ãé£ã¹ããšïŒåšå²ã«ãã®æ±ãé£ã³æ£ãïŒãŸ... | 37,845 |
B : Books / æ¬ Problem 倧åŠçã®ãã¥ãåã¯ããªãã®èªæžå®¶ã§ãããé¢çœããã ãšæã£ãæ¬ã¯è¿·ããè²·ããããèµæžãå¢ããããŠç®¡çã§ããªããªã£ãŠããã®ãæ©ã¿ã§ãããããã§ãã¥ãåã¯ãæã£ãŠããæ¬ã®äžããç®çã®æ¬ãæ€çŽ¢ããã·ã¹ãã ãäœãããšã«ããã å
šãŠã®æ¬ã¯æ¬¡ã® 3 ã€ã®å±æ§ãæã€ã title : æ¬ã®ã¿ã€ãã«ã衚ãæååã§ããã author : æ¬ã®èè
ã衚ãæååã§ããã date : æ¬ã®åºçæ¥ã衚ã 2014/07/07 ã®ãããªåœ¢åŒãããæååã§ããã æ€çŽ¢ã®ã¯ãšãªã¯æ¬¡ã®ãããªåœ¢åŒã§äžããããã Q_title Q_author Q_date_from Q_date_to Q_title : ã¿ã€ãã«ã«æå... | 37,846 |
Problem J: Zigzag Given several points on a plane, letâs try to solve a puzzle connecting them with a zigzag line. The puzzle is to find the zigzag line that passes through all the given points with the minimum number of turns. Moreover, when there are several zigzag lines with the minimum number of turns, the shortest... | 37,847 |
Problem K: ã¯ãŒãããŒã« 20XX幎ãé ãé¢ããå Žæã«å¯Ÿããå¹ççãªç©è³ªè»¢éæ¹åŒã確ç«ããã人é¡ã®å®å®ãžã®é²åºã¯ãŸããŸãå éãããããšã«ãªã£ãããã®è»¢éæ¹åŒã¯ãããé ãã«ç©è³ªã転éããããšãããšãååçã«ãã倧ããªç©è³ªã®è»¢éãå¯èœã«ãªãç¹ã§é©æ°çã§ãã£ããè»¢éæ¹åŒã®è©³çŽ°ãæ¬¡ã«èšãã ãŸã転é察象ãšãªãç©è³ªã¯ãã¹ã¿ãŒã座æš(1, 1)ã«ãŠåäœè³ªéæ¯ã®ããŒãã£ã¯ã«ã«åå²ããããåããŒãã£ã¯ã«ã«ã¯ãåã
ç°ãªãæ³¢åãšãã«ã®ãŒãäžããããªããã°ãªããªããæ³¢åãšãã«ã®ãŒã¯ã V ãš H ãããªãä»»æã®é·ãã®æååã§è¡šçŸãããããŒãã£ã¯ã«ã®å®å®ç©ºéã«ãããæŒãæ¹ãèŠå®ããã V ã¯åº§æšäž(+1, 0)ã®ç§»åãæå³ãã H ã¯(0, +1... | 37,848 |
å°éå°çºã®ç·šéåæŠ è¿æã«äœãç§ç°å士ã¯åšéã®æŽå²ç ç©¶å®¶ã§ãã, æè¿å°éå°çºã«é¢ããæ°ããªå€ææžãçºèŠããããã . å°éå°çºã亀éãæãæ·±èå°å°ã«100倿¬ ãããéãç¶ããããšãæ¡ä»¶ã«åºãããšããäŒèª¬ã¯åºãç¥ãããŠããã, 圌ã®äž»åŒµã«ãããš, ãã®çºèŠã«ããæ°ãã«, 2äººã¯æ¯æ©ãšããã²ãŒã ãããŠããããšãããã£ããšãã. ãã®ã«ãŒã«ã¯ä»¥äžã®éãã§ãã. æåã«å¬äœ¿ãç·šéåæ°ãšæå¹ãªæ°åŒã決ãã æ·±èå°å°, å°éå°çº, æ·±èå°å°, å°éå°çº,... ãšããé ã«äº€äºã«æ°åŒãç·šéãã æ·±èå°å°ãšå°éå°çºãåãããŠå¬äœ¿ã決ããåæ°ã®ç·šéãè¡ããšã²ãŒã ã¯çµäºãã 1åã®æ°åŒã®ç·šéã«ãããŠ, æ°åŒã« 1 æå远å , ãŸãã¯æ°åŒãã 1 æåå... | 37,849 |
Score : 900 points Problem Statement In the city of Nevermore, there are 10^8 streets and 10^8 avenues, both numbered from 0 to 10^8-1 . All streets run straight from west to east, and all avenues run straight from south to north. The distance between neighboring streets and between neighboring avenues is exactly 100 m... | 37,850 |
Problem B Squeeze the Cylinders Laid on the flat ground in the stockyard are a number of heavy metal cylinders with (possibly) different diameters but with the same length. Their ends are aligned and their axes are oriented to exactly the same direction. We'd like to minimize the area occupied. The cylinders are too he... | 37,851 |
Problem B: Magic Slayer You are in a fantasy monster-ridden world. You are a slayer fighting against the monsters with magic spells. The monsters have hit points for each, which represent their vitality. You can decrease their hit points by your magic spells: each spell gives certain points of damage , by which monster... | 37,852 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.