task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Problem F. Nim without Zero Alice: "Hi, Bob! Let's play Nim!" Bob: "Are you serious? I don't want to play it. I know how to win the game." Alice: "Right, there is an algorithm to calculate the optimal move using XOR. How about changing the rule so that a player loses a game if he or she makes the XOR to $0$?" Bob: "It ... | 37,645 |
æ£æ© åé¡ JOI çºã«äœã倪éåã¯, ããæ¥,å¥åº·å¢é²ã®ããã«æ£æ©ãæ¥èª²ã«ããããšæãç«ã£ã. 倪éåã®äœã JOI çºã«ã¯,å³ã®ããã«,æ±è¥¿æ¹åã«èµ°ã ( H + 1) æ¬ã®éè·¯ãš,åå æ¹åã«èµ°ã ( W + 1) æ¬ã®éè·¯ãç¢ç€ç®ç¶ã«éã£ãŠãã.倪éåã®å®¶ã¯ãã£ãšãå西㮠亀差ç¹ã«ãã,ããããæ£æ©ãéå§ãã. 以é,åãã a çªç®,西ãã b çªç®ã®äº€å·®ç¹ã ( a , b ) ã§è¡šã.ããšãã°,倪éåã®å®¶ããã亀差ç¹ã¯ (1, 1) ã§ãã. å³: JOI çºã®å³ ( H = 3, W = 4 ã®å Žå).å³ã®äžãå,å·Šã西ã«å¯Ÿå¿ãã. 倪éåã¯,æ£æ©ã®ã«ãŒããæ¥ã
éã£ãã»ããé¢çœããšèããã®ã§,(1, 1) ãã ( ... | 37,646 |
Map: Search For a dictionary $M$ that stores elements formed by a pair of a string key and an integer value, perform a sequence of the following operations. Note that each key in $M$ must be unique . insert($key$, $x$): Insert an element formed by a pair of $key$ and $x$ to $M$. If there is an element with $key$, repla... | 37,647 |
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 one o... | 37,648 |
Score : 1600 points Problem Statement 2^N players competed in a tournament. Each player has a unique ID number from 1 through 2^N . When two players play a match, the player with the smaller ID always wins. This tournament was a little special, in which losers are not eliminated to fully rank all the players. We will c... | 37,649 |
Score : 300 points Problem Statement There are N boxes arranged in a row. Initially, the i -th box from the left contains a_i candies. Snuke can perform the following operation any number of times: Choose a box containing at least one candy, and eat one of the candies in the chosen box. His objective is as follows: Any... | 37,650 |
Score : 600 points Problem Statement We have a sequence of k numbers: d_0,d_1,...,d_{k - 1} . Process the following q queries in order: The i -th query contains three integers n_i , x_i , and m_i . Let a_0,a_1,...,a_{n_i - 1} be the following sequence of n_i numbers: \begin{eqnarray} a_j = \begin{cases} x_i & ( j = 0 )... | 37,651 |
Knapsack Problem with Limitations You have N items that you want to put them into a knapsack. Item i has value v i , weight w i and limitation m 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 t... | 37,652 |
Score : 1900 points Problem Statement Snuke has a grid with H rows and W columns. The square at the i -th row and j -th column contains a character S_{i,j} . He can perform the following two kinds of operation on the grid: Row-reverse: Reverse the order of the squares in a selected row. Column-reverse: Reverse the orde... | 37,653 |
Score : 800 points Problem Statement Given is a string S consisting of 0 and 1 . Find the number of strings, modulo 998244353 , that can result from applying the following operation on S between 0 and K times (inclusive): Choose a pair of integers i, j (1\leq i < j\leq |S|) such that the i -th and j -th characters of S... | 37,654 |
Problem D: Indian Puzzle In the Indian Puzzle, one is intended to fill out blanks with numbers and operators in a n by n grid in order to make equalities in the grid true (See Figure 1). Figure 1 A blank cell should be filled out with a number (from 0 to 9 inclusive) or an operator ( + , - , à , ÷ , = ), and black cell... | 37,655 |
Doubly Linked List Your task is to implement a double linked list. Write a program which performs the following operations: insert x: insert an element with key x into the front of the list. delete x: delete the first element which has the key of x from the list. If there is not such element, you need not do anything. ... | 37,656 |
ããŒãããã« é倪åã¯ãè¿æã®ã²ãŒã ã»ã³ã¿ãŒã§äººæ°ã®ã²ãŒã ãããŒãããã«ãã«ã¯ãŸã£ãŠããŸãããã®ã²ãŒã ã¯å³ã®ãããªã°ãªããç¶ã«äžŠã¹ããã 4Ã4 ã®èš16åã®ããã«åã®ãã¿ã³ãããªããŸãã å³ã®ããã«ãå·Šäžããå³äžã«ãã¿ã³1, ãã¿ã³2, âŠ, ãã¿ã³16ã®é ã«ãã¿ã³ã䞊ãã§ããŸããã²ãŒã ã§ã¯äžå®ééã§ããŒãé³ã鳎ãæåŸã«çµäºé³ã鳎ããŸããããŒãé³ã鳎ããšåæã«è€æ°ã®ãã¿ã³ãå
ããŸããïŒåãå
ããªãå ŽåããããŸãããã¬ã€ã€ãŒã¯ãããŒãé³ã鳎ã£ãçŽåŸããæ¬¡ã®é³ã鳎ããŸã§ã®éã«äž¡æã®æã䜿ã£ãŠè€æ°ã®ãã¿ã³ãïŒåºŠã ãåæã«æŒãããšãã§ããŸããäœãæŒããªããšããããšãå¯èœã§ããçµäºé³ã鳎ã£ããšåæã«ã²ãŒã ã¯çµäºããŸãã é倪å㯠c éãã®... | 37,657 |
Problem D: Cheat Case Problem ç®æ°ã®ãã¹ããåããããšã«ãªã£ã俺éã¯ãä»ããå匷ããŠãèµ€ç¹ãåã£ãŠããŸãããšã確信ããã«ã³ãã³ã°ã§ä¹ãåãããšã決æããã ç®æ°ã®ãã¹ãåé¡ãäœæããAå
çã¯ãã¹ãçšçŽãææžãã§äœãããšã§ç¥ãããŠããã圌ããã¹ãåé¡ãäœæããŠããæã®çè·¡æ
å ±ããè¿æã®å士ã«äœã£ãŠããã£ãçè·¡çèŽéçã§çã¿åãäœæŠã ãã ãèå¿ã®çè·¡æ
å ±ããåé¡ã埩å
ããããã°ã©ã ã¯åå£«ã®æè¡ã§ã¯äœãããšãã§ããªãã£ããããããããšãåé¡ã埩å
ã§ãããšããŠãã俺éã®é è³ã§ã¯åé¡ãè§£ãããšãã§ããªããã©ãããããšãã§ããªããªã£ã俺éã¯ãããã°ã©ããŒã§ããããªãã«ãçè·¡æ
å ±ããåé¡ã埩å
ãããããè§£ãããã°ã©ã ... | 37,658 |
Score : 200 points Problem Statement Takahashi is competing in a sumo tournament. The tournament lasts for 15 days, during which he performs in one match per day. If he wins 8 or more matches, he can also participate in the next tournament. The matches for the first k days have finished. You are given the results of Ta... | 37,659 |
Problem 3: æç©ºã®ã¹ãŽãã¯ã»ããŒã å
šæç©ºçµ±äžãã£ã¡ã³ã·ã§ã³ã»ã¹ãŽãã¯ã»ããŒãã¡ã³ãã500 å
人ãè¶
ããåå è
ã®äžããããã ïŒäºº ã®ã¹ãŽãã¯çµ¶å¯Ÿçè
ãæ±ºå®ãããã®å€§äŒã«ãããªãã¯ïŒïŒäžçŽã®å°ç代衚ãšããŠåå ããŠããã ä»ããªããææŠããŠãã課é¡ã¯ãèªåèªèº«ãã³ããšããïŒæ¬¡å
ã¹ãŽãã¯ã端ã®ã¹ã¿ãŒããã¹ããåºçº ããŠãïŒããïŒãŸã§ã®ç®ãäžã€ãã€æžããã巚倧ãªïŒé¢ãã€ã¹ãæ¯ã£ãŠåºãç®ã®æ°ã ãé²ãããšãç¹° ãè¿ããããªããããç¥ã£ãŠãã圢åŒã®ã¹ãŽãã¯ã ãã¹ã¿ãŒããã¹ãšã¯å察ã®ç«¯ã«ãããŽãŒã«ãã¹ã« æ¢ãŸããšãŽãŒã«ãšãªãããã¡ããããŽãŒã«ãããŸã§ã«ãµã€ã³ããæ¯ã£ãåæ°ãå°ãªããã°å°ãªãã»ã© è¯ãæçžŸãšãªãã ãã¹ã®äžã«ã¯ç¹æ®ãªå¹æã... | 37,660 |
Score : 200 points Problem Statement The postal code in Atcoder Kingdom is A+B+1 characters long, its (A+1) -th character is a hyphen - , and the other characters are digits from 0 through 9 . You are given a string S . Determine whether it follows the postal code format in Atcoder Kingdom. Constraints 1â€A,Bâ€5 |S|=A+B+... | 37,661 |
Problem I: Operator The customer telephone support center of the computer sales company called JAG is now in- credibly confused. There are too many customers who request the support, and they call the support center all the time. So, the company wants to figure out how many operators needed to handle this situation. Fo... | 37,662 |
Ciel, an idol whose appearance and behavior are similar to a fox, is participating in a rehearsal for the live concert which takes place in a few days. To become a top idol, a large amount of effort is required! The live stage can be expressed as a two-dimensional surface. The live stage has N spotlights to illuminate ... | 37,663 |
Problem G: Concert Hall Scheduling You are appointed director of a famous concert hall, to save it from bankruptcy. The hall is very popular, and receives many requests to use its two fine rooms, but unfortunately the previous director was not very efficient, and it has been losing money for many years. The two rooms a... | 37,664 |
Score : 200 points Problem Statement Takahashi has A cookies, and Aoki has B cookies. Takahashi will do the following action K times: If Takahashi has one or more cookies, eat one of his cookies. Otherwise, if Aoki has one or more cookies, eat one of Aoki's cookies. If they both have no cookies, do nothing. In the end,... | 37,665 |
ãããããšé§ (Sugoroku and Pieces) å顿 JOI åã¯ãããããæã£ãŠããïŒãã®ãããã㯠2019 åã®ãã¹ã暪äžåã«äžŠãã 圢ãããŠããïŒãããã®ãã¹ã«ã¯ïŒå·Šç«¯ã®ã¹ã¿ãŒããã¹ããå³ç«¯ã®ãŽãŒã«ãã¹ãžãšé ã« 1 ãã 2019 ãŸã§ã®çªå·ãã€ããŠããïŒ çŸåšãã®ããããã®äžã«ã¯ïŒ N åã®é§ã眮ãããŠããïŒãããã®é§ã«ã¯ïŒã¹ã¿ãŒãã«è¿ãé ã« 1 ãã N ãŸã§ã®çªå·ãã€ããŠããïŒé§ i ( 1 ⊠i ⊠N ) ã¯ïŒãã¹ X_i ã«çœ®ãããŠããïŒãã¹ãŠã®é§ã¯ç°ãªããã¹ã«çœ®ãããŠããïŒ JOI åã¯ãããã M åã®æäœãè¡ãïŒ j åç® ( 1 ⊠j ⊠M ) ã®æäœã§ã¯ïŒé§ A_j ã 1 ãã¹å
ãžé²ã... | 37,666 |
ããºã« ãããå㯠9 à 9 ã®ãã¹ç®ã« 1ã9 ã®æ°åãé
眮ããããºã«ã§éãã§ããŸãããã®ããºã«ã§ã¯ä»¥äžã®èŠåã§æ°åãé
眮ããªããã°ãããŸããã åãåã« 1 ã€ã®æ°åã¯ã¡ããã© 1 åã ãçŸããã åãè¡ã« 1 ã€ã®æ°åã¯ã¡ããã© 1 åã ãçŸããã äºéç·ã§åºåããã 3 à 3 ã®åç¯å²ã«ã¯ã1 ã€ã®æ°åã¯ã¡ããã© 1 åã ãçŸããã äŸãã°ãäžã®å³ 1 ã¯ãã®ãããªèŠåãæºãããé
眮ã®äžã€ã§ããããããããåã¯ãå³ 2 ã®ããã«ããèŠåã«åããé
眮ãäœã£ãŠããŸããŸãã巊端ã®åã«ã2ãã 2 åçŸãããŠãã1ãã 1 åãçŸããããå·Šãã2 çªç®ã®åã«ã1ãã 2 åçŸãããŠãã2ãã 1 åãçŸãããŠããŸããã å³ 1 ... | 37,667 |
åŸç¹ åé¡ JOI髿 ¡ã®2人ã®çåŸ A ãããš B ããã¯ïŒæ
å ±ïŒæ°åŠïŒçç§ïŒè±èªã®4æç§ã®è©ŠéšãåããïŒ A ãããš B ããã®ããã4æç§ã®åŸç¹ãäžãããããšïŒ Aããã®åèšç¹ S ãš Bããã®åèšç¹ T ã®ãã¡å€§ããªæ¹ãåºåããããã°ã©ã ãäœæããïŒãã ãïŒåç¹ã®å Žå㯠S (= T) ãåºåããïŒ å
¥å å
¥åã¯2è¡ãããªãïŒ 1è¡ç®ã¯4ã€ã®æŽæ°ã1ã€ã®ç©ºçœãåºåããšããŠæžãããŠããïŒããããé ã«ïŒ A ããã®æ
å ±ã®åŸç¹ïŒæ°åŠã®åŸç¹ïŒçç§ã®åŸç¹ïŒè±èªã®åŸç¹ã衚ããŠããïŒ 2è¡ç®ã¯4ã€ã®æŽæ°ã1ã€ã®ç©ºçœãåºåããšããŠæžãããŠããïŒããããé ã«ïŒ B ããã®æ
å ±ã®åŸç¹ïŒæ°åŠã®åŸç¹ïŒçç§ã®åŸç¹ïŒè±èªã®åŸç¹ã衚ããŠããïŒ ã©ã®æç§ã®åŸ... | 37,668 |
åæ åè§ã¢ã«ãã¡ãããæååãããªãã1 è¡ããã 100 æå以å
ã®ããŒã¿ããããŸããããã€ãã®è¡ã¯å¯Ÿç§°ïŒå·Šç«¯ããèªãã§ãå³ç«¯ããèªãã§ãåãïŒã§ãããã®ããŒã¿ãèªã¿èŸŒãã§ããã®äžã®å¯Ÿç§°ãªæååã®æ°ãåºåããããã°ã©ã ãäœæããŠãã ããããªããïŒæåã ããããªãè¡ã¯å¯Ÿç§°ã§ãããšããŸãã Input è€æ°ã®æååãè€æ°è¡ã«ããã£ãŠäžããããŸããåè¡ã«ïŒã€ã®æååãäžããããŸããæååã®æ°ã¯ 50 ãè¶
ããŸããã Output å¯Ÿç§°ãªæååã®æ°ãïŒè¡ã«åºåããŸãã Sample Input abcba sx abcddcba rttrd Output for the Sample Input 2 | 37,669 |
Problem E: Combinatorial Topology It was long believed that a 2-dimensional place can not be filled with a finite set of polygons in aperiodic way. British mathematician, Sir Roger Penrose, developed an aperiodic tiling over the years and established a theory of what is known today as quasicrystals. The classic Penrose... | 37,670 |
Problem G: Walk under a Scorching Sun Edward R. Nelson is visiting a strange town for some task today. This city is built on a two-dimensional flat ground with several vertical buildings each of which forms a convex polygon when seen from above on it (that is to say, the buidlings are convex polygon columns). Edward ne... | 37,671 |
Score : 400 points Problem Statement Snuke has a large collection of cards. Each card has an integer between 1 and N , inclusive, written on it. He has A_i cards with an integer i . Two cards can form a pair if the absolute value of the difference of the integers written on them is at most 1 . Snuke wants to create the... | 37,672 |
F - Point Distance Problem Statement You work for invention center as a part time programmer. This center researches movement of protein molecules. It needs how molecules make clusters, so it will calculate distance of all pair molecules and will make a histogram. Moleculesâ positions are given by a N x N grid map. Val... | 37,673 |
Problem D Making Perimeter of the Convex Hull Shortest The convex hull of a set of three or more planar points is, when not all of them are on one line, the convex polygon with the smallest area that has all the points of the set on its boundary or in its inside. Your task is, given positions of the points of a set, to... | 37,674 |
åé¡ A KUPC å顿 ãšããåŠçãïŒKyoto University Programming Contest (KUPC) ãéãããšèããïŒããã§åœŒã¯ïŒçæ¿ãäœã£ãŠçã«å®£äŒããããšã«ããïŒä»ïŒæå
ã«ã¯ã¢ã«ãã¡ããã 1 æåã®æžãããæ¿ãããã€ãããïŒãããã®æ¿ãã 'K' ïŒ 'U' ïŒ 'P' ïŒ 'C' ãšããæåã®æžããã 4 æã®æ¿ãéžã¶ããšã§çæ¿ã 1 ã€äœæã§ããïŒãã®äœæ¥ãç¹°ãè¿ãããšã§ïŒæ²¢å±±ã®çæ¿ãäœæã§ããã¯ãã§ããïŒããŠïŒäžããããæ¿ã䜿ã£ãŠïŒæçµçã«äœæã® KUPC ãšæžãããçæ¿ãåŸãããã ãããïŒ å
¥ååœ¢åŒ æååã 1 è¡ã§äžããããïŒæååã®åæåã¯ïŒåæ¿ã«æžãããŠããæåã衚ãïŒ åºååœ¢åŒ ... | 37,675 |
Minimum Cost Flow Find the minimum cost to send a certain amount of flow through a flow network. The flow network is a directed graph where each edge $e$ has capacity $c(e)$ and cost $d(e)$. Each edge $e$ can send an amount of flow $f(e)$ where $f(e) \leq c(e)$. Find the minimum value of $\sum_{e} (f(e) \times d(e))$ t... | 37,676 |
Kuru Kuru Door ããããã㢠ACM (Automatic Cleaning Machine) 瀟ã2011幎ã«éçºããå
šèªåå圢æé€æ© ICPC (Intelligent Circular Perfect Cleaner) ã¯ïŒ æ¥äžã«èªåã§åãåºãïŒèªåãéãéããå Žæã®ãŽããæé€ããæ©èœãåããŠããïŒ å ããŠïŒãã® ICPC ã¯ïŒããããªãŒæ®éãäœäžããå Žåã«èªåçã«é»æºã®äœçœ®ãŸã§æ»ãæ©èœãåããŠããïŒ ãã®åºŠïŒJAG (Japan Alumni Group) ãšåä¹ãè¬ã®çµç¹ããïŒ ACM 瀟ã«å¯Ÿã倧éã® ICPC ã®çºæ³šããã£ãïŒ ãããïŒãã®çºæ³šã«ã¯æ¡ä»¶ãä»ããŠããïŒ ããã¯ïŒåœŒããæ¬æ å°ãšããŠãããã«ã®å
... | 37,677 |
Score : 200 points Problem Statement You are given two integers K and S . Three variable X, Y and Z takes integer values satisfying 0â€X,Y,Zâ€K . How many different assignments of values to X, Y and Z are there such that X + Y + Z = S ? Constraints 2â€Kâ€2500 0â€Sâ€3K K and S are integers. Input The input is given from Stand... | 37,678 |
Score : 500 points Problem Statement You are going to eat X red apples and Y green apples. You have A red apples of deliciousness p_1,p_2, \dots, p_A , B green apples of deliciousness q_1,q_2, \dots, q_B , and C colorless apples of deliciousness r_1,r_2, \dots, r_C . Before eating a colorless apple, you can paint it re... | 37,679 |
Score : 400 points Problem Statement In the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called AtCoder Express . In the plan developed by the president Takahashi, the trains will run as follows: A train will run for (t_1 + t_2 + t_3 + ... + t_N) seconds. In the f... | 37,680 |
Score : 200 points Problem Statement Determine if an N -sided polygon (not necessarily convex) with sides of length L_1, L_2, ..., L_N can be drawn in a two-dimensional plane. You can use the following theorem: Theorem : an N -sided polygon satisfying the condition can be drawn if and only if the longest side is strict... | 37,681 |
Score : 100 points Problem Statement There are N students in a school. We will divide these students into some groups, and in each group they will discuss some themes. You think that groups consisting of two or less students cannot have an effective discussion, so you want to have as many groups consisting of three or ... | 37,682 |
Score : 300 points Problem Statement You are given an integer N . Find a triple of positive integers h , n and w such that 4/N = 1/h + 1/n + 1/w . If there are multiple solutions, any of them will be accepted. Constraints It is guaranteed that, for the given integer N , there exists a solution such that h,n,w \leq 3500... | 37,683 |
Score : 300 points Problem Statement N tiles are arranged in a row from left to right. The initial color of each tile is represented by a string S of length N . The i -th tile from the left is painted black if the i -th character of S is 0 , and painted white if that character is 1 . You want to repaint some of the til... | 37,684 |
Problem is available from here. | 37,685 |
How Many Divisors? Write a program which reads three integers a , b and c , and prints the number of divisors of c between a and b . Input Three integers a , b and c are given in a line separated by a single space. Output Print the number of divisors in a line. Constraints 1 †a , b , c †10000 a †b Sample Input 1 5 1... | 37,686 |
Score : 100 points Problem Statement CODE FESTIVAL 2016 is going to be held. For the occasion, Mr. Takahashi decided to make a signboard. He intended to write CODEFESTIVAL2016 on it, but he mistakenly wrote a different string S . Fortunately, the string he wrote was the correct length. So Mr. Takahashi decided to perfo... | 37,687 |
Score : 600 points Problem Statement Given are a sequence of N positive integers A_1 , A_2 , \ldots , A_N and another positive integer S . For a non-empty subset T of the set \{1, 2, \ldots , N \} , let us define f(T) as follows: f(T) is the number of different non-empty subsets \{x_1, x_2, \ldots , x_k \} of T such th... | 37,688 |
åè» 26 䞡以äžã®ç·šæã®åè»ããããŸããããããã®è»äž¡ã«ã¯ãè±å°æåã® a ãã z ãŸã§ã®èå¥èšå·ãä»ããŠããŸããåãèšå·ãä»ããŠããè»äž¡ã¯ãããŸããããã ããè»äž¡ãé£çµããé çªã¯èªç±ãšããŸããåè»ã®äžãè»æãå·¡åããŸããè»æã¯ãåè»ã®äžãè¡ã£ããæ¥ããããŠå·¡åããã®ã§ãåãè»äž¡ãäœåºŠãéãããšããããŸãããã ãããã¹ãŠã®è»äž¡ãæäœäžåã¯å·¡åãããã®ãšããŸãããŸããå·¡åãã¯ãããè»äž¡ãå·¡åãçµããè»äž¡ãåè»ã®äžçªç«¯ã®è»äž¡ãšã¯éããŸããã ããè»æãä¹ã£ããã¹ãŠã®åè»ã®å·¡åèšé²ããããŸããããããåããååè»ã®ç·šæãå
é è»äž¡ããåºåããããã°ã©ã ãäœæããŠãã ãããå·¡åèšé²ã¯ 1 è¡ã 1 ã€ã®åè»ã«å¯Ÿå¿ããŸããåè¡ã¯ãè±å°æåã... | 37,689 |
Semiexpress The JOI Railways is the only railway company in the Kingdom of JOI. There are $N$ stations numbered from $1$ to $N$ along a railway. Currently, two kinds of trains are operated; one is express and the other one is local. A local train stops at every station. For each $i$ ($1 \leq i < N$), by a local train, ... | 37,690 |
Problem G: Color the Map You were lucky enough to get a map just before entering the legendary magical mystery world. The map shows the whole area of your planned exploration, including several countries with complicated borders. The map is clearly drawn, but in sepia ink only; it is hard to recognize at a glance which... | 37,691 |
åçææ¢ãªã€ã¯ã¿åã¯ã€ãã«æªåé«ãããã°ããªããžäŒ¯çµã远ãè©°ããïŒ ä»ãããã°ããªããžäŒ¯çµã¯å¹
w ã¡ãŒãã«ã奥è¡ã h ã¡ãŒãã«ã®é·æ¹åœ¢ã®éšå±ã«éã蟌ããããŠãããææãåŸ
ã€ã°ãããšãªã£ãŠããã éšå±ã®ããè§ãéžã³ãå¹
æ¹åã x 軞ã奥è¡ãæ¹åã y 軞ã«ãããããéšå±ã®å
éšãæ£ã®æ¹åã«ãªãããã«åº§æšç³»ããšããšãããã°ããªããžäŒ¯çµã¯ç¹ (p, q) ã«ãããç¹ (x, y) ã«ã€ã¯ã¿åã®æçµå
µåšã§ããè¡ææ³¢çºå°è£
眮ããããããããç§é v ã¡ãŒãã«ã®è¡ææ³¢ãå
šæ¹åã«åºãããã®è¡ææ³¢ã¯ t ç§éæå¹ã§ãããéšå±ã®å£é¢ã§åå°ããã éšå±ã®å€ã«ããã€ã¯ã¿åã¯ããã°ããªããžäŒ¯çµãã©ãã ãèŠãããç¥ãããã£ãŠããã®ã§ãããã°ããªããžäŒ¯çµã«è¡... | 37,692 |
æçã«ãŒã English text is not available in this practice contest. ããªãã®æå±ããç¥çããã°ã©ãã³ã°ãµãŒã¯ã« (éç§° Intelligent Clever Programming Circle, ICPC)ã§ã¯ïŒä»å€§æé€ã®æäžã§ããïŒ éšå®€ã«ã¯ïŒæŽä»£ã®å
茩ãã¡ã®æ®ããŠãã£ãããŸããŸãªã¢ã€ãã ãæçããšæŸçœ®ãããŠããïŒ ããªããæ£ãæŽçããŠãããšïŒå¥¥ã«å€§éã®ã¬ããã²ãŒã ãå°å°ãããŠããã®ãçºèŠããïŒ ãã®äžã®ããã€ãã«èŠèŠãããã£ãããªãã¯ïŒä¹
ã
ã«ãã®ã²ãŒã ãéãã§ã¿ãããšã«ããïŒ èŠã€ããã²ãŒã ã®è©³çŽ°ã¯æ¬¡ã®éãã§ããïŒ ãã®ã²ãŒã ã«ã¯1çªãã N çªãŸã§ã® N åã®ã¹ããŒãžã... | 37,693 |
Problem A: Rental DVD Shop NEO Problem åã¯ã¬ã³ã¿ã«DVDã·ã§ããããNEOãã§ã¢ã«ãã€ããå§ããããŸãã¯ãã®åºã®æéã·ã¹ãã ãå匷ããããšã«ãªã£ãã ã¬ã³ã¿ã«DVDã¯æ§äœãæºæ°äœãæ°äœã®3çš®é¡ååšãã1æ¬ã®ã¬ã³ã¿ã«æéããããã a åã b åã c åã§ããã äŒèšã®éã«ä»¥äžã«ç€ºãã»ããã¬ã³ã¿ã«ãè€æ°åé©çšããããšãã§ããã ãŸã ã»ããã¬ã³ã¿ã«ãé©çšããŠããªãDVDãæ°æ¬éžã¶ã éžãã DVDã®æ¬æ°ã d æ¬ä»¥äžã®å Žåãéžãã DVDã®åèšéé¡ãã (éžãã DVDã®æ¬æ°) * e åãè¶
ããå Žåã¯ããããã (éžãã DVDã®æ¬æ°) * e åã§ã¬ã³ã¿ã«åºæ¥ãã éžãã DVDã®æ¬æ°ã d æ¬æªæº... | 37,694 |
Ranks A finite field F 2 consists of two elements: 0 and 1. Addition and multiplication on F 2 are those on integers modulo two, as defined below. + 0 1 0 0 1 1 1 0 $\times$ 0 1 0 0 0 1 0 1 A set of vectors $v_1, ... , v_k$ over F 2 with the same dimension is said to be linearly independent when, for $c_1, ... , c_k \i... | 37,695 |
I - Ï å€§ãã N ã®é åãšã¯ïŒæ°å (1, 2, 3, âŠ, N) ã®åèŠçŽ ãäžŠã¹æ¿ãããã®ã§ããïŒ äŸãã° (5, 2, 1, 4, 3) ã¯å€§ãã 5 ã®é åã ãïŒäžæ¹ã§ (1, 5, 1, 2, 3) ã¯ããã§ã¯ãªãïŒ ãã®åé¡ã¯ãªã¢ã¯ãã£ãæ¹åŒã®ã¿ã¹ã¯ã§ããïŒããªãã¯å¿çããã°ã©ã ãšãé ååœãŠã²ãŒã ããè¡ãïŒ ãŸãæåã«ïŒå¿çããã°ã©ã ã¯é å Ï ã1ã€å
éšã§æ±ºããïŒ æ¬¡ã«ïŒããªãã«ã¯ãã®é åã®å€§ãã N ãäŒããããïŒ ãã®åŸïŒããªãã¯å¿çããã°ã©ã ã«äœåã 質å ãããïŒ ãããŠïŒå¿çããã°ã©ã ã®æã£ãŠããé åãç¹å®ããããšãããªãã®ç®çã§ããïŒ è³ªåã¯æ¬¡ã®ãããªãã®ã§ããïŒ å€§ãã N ã®é å Ï ã1ã€æ±ºãïŒã... | 37,696 |
Problem Statement We have an undirected graph with N vertices and M edges. The vertices are numbered 1 through N , and the edges are numbered 1 through M . Edge i connects vertices a_i and b_i . The graph is connected. On this graph, Q pairs of brothers are participating in an activity called Stamp Rally . The Stamp Ra... | 37,698 |
Problem A: Defend the Nation Two nations Drone and Moonlamb have been engaged in a war. You have been called up for service as a talented programmer in Drone. Recently, the army of Moonlamb has set up a new cannon on the field. The army of Drone knows exactly where it has been placed, but not how it can be destroyed; d... | 37,699 |
Score : 400 points Problem Statement In some other world, today is Christmas. Mr. Takaha decides to make a multi-dimensional burger in his party. A level- L burger ( L is an integer greater than or equal to 0 ) is the following thing: A level- 0 burger is a patty. A level- L burger (L \geq 1) is a bun, a level- (L-1) b... | 37,700 |
æçžŸäžæå€§äœæŠ åéšçã®å€ªéå㯠N æ¥éã®å匷å宿ã«åå ããïŒ ãã®å宿ã§ã¯æ¯æ¥ M ç§ç®ã®ãã¹ããè¡ãïŒ å宿ã®çµäºåŸã«ã¯ãã¹ãŠã®ãã¹ãã®ç¹æ°ãæžãããæçžŸè¡šãé
ãããïŒ æçžŸè¡šã¯ N æã®çŽãããªã£ãŠããïŒ i æç®ã®çŽã«ã¯ i æ¥ç®ã®å
š M ç§ç®ã®ãã¹ãã®ç§ç®åãšç¹æ°ã®ã¿ãå°å·ãããŠããïŒ æçžŸè¡šã«æ¥ä»ãæžãããŠããªãããšã«æ°ä»ãã倪éåã¯ïŒãæ¯ããã«æçžŸè¡šãæž¡ãåã«çް工ãå ããããšã«ããïŒ æçžŸè¡šã®çŽã®é çªãäžŠã¹æ¿ãïŒããã«1æç®ããé çªã«ããŒãžçªå·ãæžã蟌ãã§ååã«ããããšã«ãã£ãŠãåœãã®æçžŸè¡šããäœã£ãã®ã ïŒ å€ªéåã®ç®çã¯ïŒãåœãã®æçžŸè¡šãã§ãã¹ãã®ç¹æ°ãããŒãžçªå·ã«å¯ŸããŠåºçŸ©å調å¢å ããŠããç§ç®ã®åæ°ãæå€§åããã... | 37,701 |
BMI è¥æºã¯å€ãã®æäººç
ã®åå ãšããŠæããããŠããŸããéå»ã«ãããŠã¯ãäžéšã®äŸå€ãé€ãã°ã髿 ¡çã«ã¯ç¡çžãªãã®ã§ãããããããé床ã®åéšå匷çã®ããã«éåäžè¶³ãšãªãããããã¯ã¹ãã¬ã¹ã«ããéé£çãšãªãããšããéçŸå®çãªããšãšã¯ãããªããªã£ãŠããŸãã髿 ¡çã«ãšã£ãŠãååé¢å¿ãæããã°ãªããªãåé¡ã«ãªããããããŸããã ããã§ãããªãã¯ãä¿å¥å®€ã®å
çã®å©æãšãªã£ãŠãçåŸã®ããŒã¿ããè¥æºã®çãã®ããçåŸãæ¢ãåºãããã°ã©ã ãäœæããããšã«ãªããŸããã æ¹æ³ã¯ BMI (Body Mass Index) ãšããæ°å€ãç®åºããæ¹æ³ã§ããBMIã¯æ¬¡ã®åŒã§äžããããŸãã BMI = 22 ãæšæºçã§ã25 以äžã ãšè¥æºã®çãããããŸãã åã
ã®... | 37,702 |
Ring Write a program which finds a pattern $p$ in a ring shaped text $s$. Input In the first line, the text $s$ is given. In the second line, the pattern $p$ is given. Output If $p$ is in $s$, print Yes in a line, otherwise No . Constraints $1 \leq $ length of $p \leq $ length of $s \leq 100$ $s$ and $p$ consists of lo... | 37,703 |
ãµã€ã³ãã以äžã®å³ã®ãããªåãã§çœ®ãããŠããïŒ ããã§äœ¿çšãããµã€ã³ãã¯ïŒãã®å³ã®ããã«ïŒäžåŽã« 1ïŒååŽã« 2 ããããšãã¯ïŒæ±åŽã« 3 ããããã®ãšããïŒãµã€ã³ãã®åããããé¢ã®åã¯å¿
ã 7 ãªã®ã§ïŒèŠããªãé¢ã¯ããããååŽ 5ïŒè¥¿åŽ 4ïŒäžåŽ 6 ã«ãªã£ãŠããïŒ ãã®åæé
眮ã®ç¶æ
ããæç€ºã«åŸã£ãŠãµã€ã³ããåãããŠããïŒãã ãïŒæç€ºã¯ä»¥äžã® 6 éãã®æäœãäœåãè¡ããã®ã§ããïŒ NorthïŒEastïŒSouthïŒWest ã®åæäœã¯æç€ºãããæ¹åãžãµã€ã³ãã 90 床å転ãããïŒ RightïŒLeft ã® 2 ã€ã®æäœã¯äžäžã®é¢ã¯ãã®ãŸãŸã§æ°Žå¹³æ¹åã« 90 床å転ãããïŒïŒå転ãããåãã«èŠæ³šæïŒïŒ åæé
眮ã§äžã®é¢ã«åºãŠã... | 37,704 |
Score : 700 points Problem Statement We have a string s consisting of lowercase English letters. Snuke is partitioning s into some number of non-empty substrings. Let the subtrings obtained be s_1 , s_2 , ... , s_N from left to right. (Here, s = s_1 + s_2 + ... + s_N holds.) Snuke wants to satisfy the following conditi... | 37,706 |
Score : 300 points Problem Statement Given is a positive integer L . Find the maximum possible volume of a rectangular cuboid whose sum of the dimensions (not necessarily integers) is L . Constraints 1 †L †1000 L is an integer. Input Input is given from Standard Input in the following format: L Output Print the maxim... | 37,707 |
Score : 1100 points Problem Statement There is a set consisting of N distinct integers. The i -th smallest element in this set is S_i . We want to divide this set into two sets, X and Y , such that: The absolute difference of any two distinct elements in X is A or greater. The absolute difference of any two distinct el... | 37,708 |
Score : 900 points Problem Statement Snuke loves permutations. He is making a permutation of length N . Since he hates the integer K , his permutation will satisfy the following: Let the permutation be a_1, a_2, ..., a_N . For each i = 1,2,...,N , |a_i - i| \neq K . Among the N! permutations of length N , how many sati... | 37,709 |
Single Source Shortest Path For a given weighted graph G(V, E) and a source r , find the source shortest path to each vertex from the source (SSSP: Single Source Shortest Path). Input An edge-weighted graph G ( V , E ) and the source r . | V | | E | r s 0 t 0 d 0 s 1 t 1 d 1 : s |E|-1 t |E|-1 d |E|-1 |V| is the number ... | 37,710 |
Problem C: Yanagi's Comic Yanagi is a high school student, and she is called "Hime" by her boyfriend who is a ninja fanboy. She likes picture books very much, so she often writes picture books by herself. She always asks you to make her picture book as an assistant. Today, you got asked to help her with making a comic.... | 37,711 |
Score : 2400 points Problem Statement There are N people (with different names) and K clubs. For each club you know the list of members (so you have K unordered lists). Each person can be a member of many clubs (and also 0 clubs) and two different clubs might have exactly the same members. The value of the number K is ... | 37,712 |
ãã¹ãã°ã©ã ãã³ã¢ã€ã¹ã¯ãªãŒã ãšããååã®ã¢ã€ã¹ã¯ãªãŒã å±ããããããŸãããã®ãåºã§ã¯åžžã« 10 çš®é¡ã®ã¢ã€ã¹ã¯ãªãŒã ãåºé ã«äžŠã¶ããã«ããŠããŸãããåºã®åºé·ã¯ååéçºã®åèã«ããããã«ãã¢ã€ã¹ã¯ãªãŒã ã®å£²ãå
·åã衚ãã°ã©ããæ¯æ¥äœæããŠããŸãã ãããªåºé·ã®ããã«ãããªãã¯åã¢ã€ã¹ã¯ãªãŒã ã®è²©å£²æ°ãã°ã©ãã§è¡šç€ºããããã°ã©ã ãäœæããããšã«ãªããŸããã äžæ¥ã«è²©å£²ãããã¢ã€ã¹ã¯ãªãŒã ã®ç·æ°ãšå£²ããã¢ã€ã¹ã¯ãªãŒã ã®çªå·ãå
¥åãšããã¢ã€ã¹ã¯ãªãŒã ã®çš®é¡ããšã«è²©å£²ããæ°ã ã * (åè§ã¢ã¹ã¿ãªã¹ã¯) ãåºåããããã°ã©ã ãäœæããŠãã ããããã ããã¢ã€ã¹ã¯ãªãŒã ã®çš®é¡ã 0 ãã 9 ãŸã§ã®æŽæ°ã§è¡šãããŸãããŸããè²©å£²åæ°ããŒãã®ã¢ã€... | 37,714 |
N: 3人ååã²ãŒã ãªã¢ã¯ãã£ãåé¡ã§ãã å顿 $1000$ ãããã®éè² æŽæ°ã $200$ åããã$a_1, \ldots, a_{100}, b_1, \ldots, b_{100}$ ãšããŸãã ã¢ãªã¹ã¯ $a_1, \ldots, a_{100}$ ã確èªãã$3000$ ãããã®ã¡ã¢ $X$ ããã£ãŒãªãŒã®ããã«æ®ããŸãã ãã㯠$b_1, \ldots, b_{100}$ ã確èªãã$3000$ ãããã®ã¡ã¢ $Y$ ããã£ãŒãªãŒã®ããã«æ®ããŸãã ãã£ãŒãªãŒã¯ã¡ã¢ $X, Y$ ã®æ
å ±ãããšã«ã$100$ åã®è³ªåã«çããŸãã $i$ çªç®ã®è³ªå㯠$1000$ ãããã®éè² æŽæ° $c_i$ ã§è¡šããããã£ãŒ... | 37,715 |
Score : 800 points Problem Statement You are given a polynomial of degree N with integer coefficients: f(x)=a_Nx^N+a_{N-1}x^{N-1}+...+a_0 . Find all prime numbers p that divide f(x) for every integer x . Constraints 0 \leq N \leq 10^4 |a_i| \leq 10^9(0\leq i\leq N) a_N \neq 0 All values in input are integers. Input Inp... | 37,716 |
Point in The Triangle Problem ç¹(0,0),( n -1,0),(0, m -1),( n -1, m -1)ã«å²ãŸããé·æ¹åœ¢ã®éåºéå
ããæ Œåç¹ã3ç¹éžã³ãäžè§åœ¢ãäœãã ãã®ãšããç¹( x 1 , y 1 )ãå«ããç¹( x 2 , y 2 )ãå«ãŸãªãäžè§åœ¢ã®æ°ãšç¹( x 2 , y 2 )ãå«ããç¹( x 1 , y 1 )ãå«ãŸãªãäžè§åœ¢ã®æ°ã®å·®ã®çµ¶å¯Ÿå€ãæ±ããã ç¹ãå¢çç·äžã«ãããã®ã¯äžè§åœ¢ã«å«ãŸããŠãããšã¿ãªãã ãã ãã3ç¹ãäžçŽç·äžã«äžŠãã§ãããã®ã¯äžè§åœ¢ãšã¯ã¿ãªããªãã Input n m x 1 y 1 x 2 y 2 å
¥åã¯å
šãп޿°ã§äžããããã 1è¡ã« n , m , x 1... | 37,717 |
Score: 300 points Problem Statement We have a 3 \times 3 grid. A number c_{i, j} is written in the square (i, j) , where (i, j) denotes the square at the i -th row from the top and the j -th column from the left. According to Takahashi, there are six integers a_1, a_2, a_3, b_1, b_2, b_3 whose values are fixed, and the... | 37,718 |
B: Brilliant Stars ICPC ã§è¯ãæçžŸãåããã«ã¯ä¿®è¡ãæ¬ ãããªãïŒããã㯠ICPC ã§åã¡ããã®ã§ïŒä»æ¥ãä¿®è¡ãããããšã«ããïŒ ä»æ¥ã®ä¿®è¡ã¯ïŒå€ç©ºã«èŒãããããã®æãã¡ã芳枬ããŠïŒèŠåãšéäžåãéããããšãããã®ã§ããïŒãããã¯ç¬èªã®ã»ã³ã¹ã§æã®ç¹åŸŽãèšé²ããŠããããšãã§ããïŒ ãããã¯ãæã®èŠ³æž¬æ¥èšããšããŠèšé²ããæã®ç¹åŸŽãããŒãã«ã€ããŠããããšã«ããïŒããã§ïŒã䌌ãŠããã 2 ã€ã®æããšãã«èšé²ããããšã¯é¿ãããïŒ2 ã€ã®æãã䌌ãŠããããã©ããã¯ïŒãã¹ãŠãããã®å€æã§æ±ºãŸã£ãŠããïŒã䌌ãŠããããã©ããã®é¢ä¿ã¯ããŸãè€éã§ã¯ãªãïŒä»¥äžã®æ¡ä»¶ãæºããïŒ æ¡ä»¶ïŒ ç°ãªã 4 ã€ã®æ A, B, C, D ã... | 37,719 |
Problem F: UTF-8 UTF-8ã¯ãã«ããã€ãæåã笊å·åããææ³ã®äžã€ã§ããã æåã¯èšç®æ©äžã§ã¯ãã€ãåãšããŠæ±ããããè±èªã ãã§ããã°ã©ãã³ã¢ã«ãã¡ãããããã³æ°åãèšå·ãåãããŠã 1byteã§è¡šçŸã§ããããæ®å¿µãªããäžçäžã§å©çšãããŠããæåã1byteã§è¡šçŸããããšã¯ã§ããªããããè€æ°ã®ãã€ããçšããŠæåã衚ãå¿
èŠãããã ããã§äŸãã°"ã"ãšããæåã«12354(0x3042)ãšãã2ãã€ãåãå²ãåœãŠããšãããã®ãŸãŸãã€ãåã䞊ã¹ããš0x30,0x42ãš2æåãªã®ã0x3042ã§1æåãªã®ããåºå¥ãã€ããªãã ãã®ããããã«ããã€ãæå笊å·åæ¹åŒã®UTF-8ã§ã¯å§ãã®1ãã€ãç®ã§ç¶ããã€ãåã®é·ããåãã... | 37,720 |
Score : 100 points Problem Statement Given is an integer r . How many times is the area of a circle of radius r larger than the area of a circle of radius 1 ? It can be proved that the answer is always an integer under the constraints given. Constraints 1 \leq r \leq 100 All values in input are integers. Input Input is... | 37,721 |
Problem A: Grey Area Dr. Grey is a data analyst, who visualizes various aspects of data received from all over the world everyday. He is extremely good at sophisticated visualization tools, but yet his favorite is a simple self-made histogram generator. Figure 1 is an example of histogram automatically produced by his ... | 37,722 |
E: Do You Divide It? / åãå»ãæ°ãïŒ ç©èª Tåã¯éå»ã«åºå Žããããã°ã©ãã³ã°ã³ã³ãã¹ãã§å¹³é¢å³åœ¢ã®åé¡ã«ã²ã©ãæãããããïŒãã以æ¥ïŒå¹³é¢å³åœ¢ã«åŒ·ãæšã¿ãæ±ããŠããïŒ äžã§ãïŒç¹ã«äºæ¬¡å
å¹³é¢äžã«æãããå€è§åœ¢ã«å¯ŸããŠè€éãªææ
ãæ±ããŠããããïŒå€è§åœ¢ãèŠããããšåãå»ãŸãã«ã¯ããããªãïŒ Tåãå€è§åœ¢ãåãå»ããšãã«ã¯ïŒy軞ã«å¹³è¡ã«å¹
0.5 ã®ééã§ã¹ãªããã®å
¥ã£ãæ¿ã§å€è§åœ¢ãèŠãïŒã¹ãªããã§èŠããªãéšåãåãå»ãã§æšãŠãŠããŸãïŒ ããããªããïŒTåã¯äžæ¹çãªæ®ºæ®ã奜ãŸãªãããïŒå€è§åœ¢ã«åèµ·ã®èœãæ®ãã¹ãïŒåãå»ãã åŸã«æ®ãå³åœ¢ã®åèšé¢ç©ãã§ããã ã倧ãããªãããã«é
æ
®ããïŒ Tåãåãå»ãã åŸã«æ®ãå³åœ¢... | 37,723 |
ééæ
è¡ (Railroad Trip) JOI åœã«ã¯ N åã®éœåžãããïŒãããã 1, 2, . . . , N ã®çªå·ãä»ããããŠããïŒãŸãïŒééã N â 1 æ¬ããïŒãããã 1, 2, . . . , N â 1 ã®çªå·ãä»ããããŠããïŒéé i (1 †i †N â 1) ã¯ïŒéœåž i ãšéœåž i + 1 ãåæ¹åã«çµãã§ããïŒ JOI åœã®ééã«ä¹è»ããæ¹æ³ãšããŠïŒçŽã®å笊ã§ä¹è»ããæ¹æ³ãšïŒIC ã«ãŒãã§ä¹è»ããæ¹æ³ãããïŒ éé i ã«çŽã®å笊ã§ä¹è»ããå Žåã®éè³ã¯ A i åã§ããïŒ éé i ã« IC ã«ãŒãã§ä¹è»ããå Žåã®éè³ã¯ B i åã§ããïŒãã ãïŒIC ã«ãŒãã§éé i ã«ä¹è»ããã«ã¯ïŒéé i... | 37,724 |
ããã«ãœãŒã ããŒã¿ãäžŠã¹æ¿ããããã®æŽåïŒãœãŒãïŒã¢ã«ãŽãªãºã ã¯ã³ã³ãã¥ãŒã¿ç§åŠã«ã¯æ¬ ãããªãåºæ¬çãªã¢ã«ãŽãªãºã ã§ããäŸãã°ãäžå³ã®ããã«ãæŽæ°å€ã®é
åã®èŠçŽ ãæé ã«äžŠã¹æ¿ããããšããæäœãæŽåã§ãã å€ãã®æŽåã¢ã«ãŽãªãºã ãèæ¡ãããŠããŸãããããã®äžã§ãåºæ¬çãªã¢ã«ãŽãªãºã ã®ïŒã€ãããã«ãœãŒãã§ããäŸãšããŠãäžããããæŽæ°å€ã®é
åãããã«ãœãŒãã§æé ã«äžŠã¹ãŠã¿ãŸãã ããã«ãœãŒãã§ã¯ãåèšç®ã¹ãããã«ãããŠãé
åãããœãŒããããéšåããšããœãŒããããŠããªãéšåãã«åããŠèããŸããæåã¯é
åå
šäœããœãŒããããŠããªãéšåã«ãªããŸãã ãœãŒããããŠããªãéšåã®å
é ãããé£å士ã®èŠçŽ ãæ¯èŒããŠïŒå³ã§ã¯ç·è²ã®èŠçŽ ïŒã倧ããå€ãå³ã«ãã... | 37,725 |
æ
人 åé¡ ããªã㯠JOI è¡éãæ
ããæ
人ã§ãã.JOI è¡éã¯æ±è¥¿ã«ãŸã£ããã«å»¶ã³ãéè·¯ã§,JOI è¡éäžã«ã¯ n åã®å®¿å Žçºããã.å®¿å Žçºã«ã¯è¥¿ããæ±ã®é ã« 1 ãã n ãŸã§ã®çªå·ãä»ããããŠãã.JOI è¡éäžã®æã西ã®å®¿å Žçºãå®¿å Žçº 1 ã§ãã,æãæ±ã®å®¿å Žçºãå®¿å Žçº n ã§ãã. ããªãã¯,å®¿å Žçº 1 ããåºçºã㊠m æ¥éã®æ
ã«åºãããšã«ãªã£ã.ããªãã®æ
çšã¯æ°å a1 , a2 , . . . , am ã«åŸã,次ã®ããã«æ±ºããããŠãã.ai 㯠i æ¥ç®ã®ç§»åæ¹æ³ã衚ã 0 ã§ã¯ãªãæŽæ°ã§ãã.i æ¥ç®ã«ããªããåºçºããå®¿å Žçºãå®¿å Žçº k ãšãããš,i æ¥ç®ã«ããªãã¯å®¿å Žçº k ããå®¿å Žçº k + ai ãŸã§ãŸ... | 37,726 |
æ¢çŽ¢ ãæ¢çŽ¢ããšã¯ãããããã®æ
å ±ã®äžããæã¿ã®æ
å ±ãåŸãæäœã®ããšã§ãã身è¿ãªäŸã§ã¯ãåæ Œçºè¡šã®æã®ãããããã®åéšçªå·ããèªåã®åéšçªå·ãèŠã€ãããããšããé»è©±åž³ãããäŒæŽ¥å€ªéããã®é»è©±çªå·ãèŠã€ããããšããªã©ããããŸãããã®æ¢çŽ¢ãšããæäœã¯ã³ã³ãã¥ãŒã¿ã®åéã§ãåºãçšããããŠããŸãã æ¢çŽ¢ã®æ¹æ³ã¯æ²¢å±±ãããŸããæ¢çŽ¢ã®å¯Ÿè±¡ãšãªãããŒã¿ããå°ããé (ãŸãã¯å€§ããé )ã«äžŠã¹ãããŠããå Žåã«äœ¿ãããšãã§ããæ¢çŽ¢ã®æ¹æ³ãèããŸãã å°ããé (ãŸãã¯å€§ããé )ã«äžŠã¹ãããŠããããŒã¿åã®äžå€®ã«äœçœ®ããå€ãšç®çã®å€ãšã®å€§å°é¢ä¿ãçšããŠãäžå€®ã«äœçœ®ããå€ããååéšåãæ¢çŽ¢ç¯å²ã«ãããåŸåéšåãæ¢çŽ¢ç¯å²ã«ããããæ±ºããããšã§ãæ¢çŽ¢ã®ç¯å²ãçµã£ãŠã... | 37,727 |
Maximum Sum Sequence Given a sequence of numbers a 1 , a 2 , a 3 , ..., a n , find the maximum sum of a contiguous subsequence of those numbers. Note that, a subsequence of one element is also a contiquous subsequence. Input The input consists of multiple datasets. Each data set consists of: n a 1 a 2 . . a n You can a... | 37,728 |
Problem D: Reaction You are a hero of a role playing game, asked by the king to defeat monsters threating peopleâs life. You have been making a long journey with your colleagues, and you are now in the town closest to the final dungeon where the head of monsters dwells. You have heard from people that the head monster ... | 37,729 |
Problem J New Game AI Aoba is a beginner programmer who works for a game company. She was appointed to develop a battle strategy for the enemy AI (Artificial Intelligence) in a new game. In this game, each character has two parameters, hit point ($hp$) and defence point ($dp$). No two characters have the same $hp$ and ... | 37,730 |
Problem H: Don't Burst the Balloon An open-top box having a square bottom is placed on the floor. You see a number of needles vertically planted on its bottom. You want to place a largest possible spheric balloon touching the box bottom, interfering with none of the side walls nor the needles. Java Specific: Submitted ... | 37,731 |
Problem G: 穎æã£ãŠåãŸã£ãŠãŸã Problem Statement éæ³äœ¿ãã®è©åããã¯ãéåžžã«ãã¬ãã£ããªæ§æ Œã§ããã圌女ã¯ãäœãèœã¡èŸŒããããªããšããããšã穎æãã®éæ³ã䜿ã£ãŠç©Žãäœããæ³£ããªããåãŸã£ãŠããŸãã穎æãã®éæ³ãšã¯ã次ã®ãããªãã®ã§ããã 圌女ã¯ããŸãNæ¬ã®ç·åãå°é¢ã«æãããããŠã圌女ãåªæãå±ãããšãç·ã§å²ãŸããç¯å²ã«ç©Žãåºæ¥äžããã亀差ã»å
å
ã®é¢ä¿ã«ãã2ã€ã®ç©Žã¯ã1ã€ã®ç©ŽãšããŠæ°ããããã ããé ç¹ã®ã¿ã§æ¥ããŠãã2ã€ã®ç©Žã¯ãå¥ã
ã®ç©ŽãšããŠæ°ããã å³1ãšå³2ã«ãSample Input 1ãš2ã®å³ã瀺ãããŸããå³1ã«ãããŠãAã®äžè§åœ¢ãšBã®äžè§åœ¢ã¯ãé ç¹ã®ã¿ã§æ¥ããŠãããããå¥ã
ã®ç©Žãšæ°ãããB... | 37,732 |
Balls and Boxes 6 Balls Boxes Any way At most one ball At least one ball Distinguishable Distinguishable 1 2 3 Indistinguishable Distinguishable 4 5 6 Distinguishable Indistinguishable 7 8 9 Indistinguishable Indistinguishable 10 11 12 Problem You have $n$ balls and $k$ boxes. You want to put these balls into the boxes... | 37,733 |
Score : 200 points Problem Statement Given is an integer N . Find the number of digits that N has in base K . Notes For information on base- K representation, see Positional notation - Wikipedia . Constraints All values in input are integers. 1 \leq N \leq 10^9 2 \leq K \leq 10 Input Input is given from Standard Input ... | 37,734 |
ãŒãã®ããããããããããã®ããµãšã ããªãã¯æ°ç掻ã«åãïŒããµãšãã N æè²·ã£ãïŒ i çªç®ã®ããµãšã㯠s i ã®ã¬ãããäŸçµŠåããã€ïŒ ãããã M æ¥éã®æ°æž©ã®äºæž¬ããïŒ j æ¥ç®ã«ã¯ d j ã®ã¬ãããéèŠãäºæ³ãããïŒ ã¬ããããè¶³ããªããŠãå€ãããŠãå¿«é©ããæãªãããã®ã§ïŒ j æ¥ç®ã«æããŠããããµãšãã®ã¬ãããäŸçµŠåã®ç·åãš d j ã®å·®ã®çµ¶å¯Ÿå€ã j æ¥ç®ã®äžå¿«åºŠãšåŒã¶ããšã«ããïŒ ãã® M æ¥åã®äžå¿«åºŠã®åèšãã§ããã ãå°ãªããªãããã«ãããïŒ ãšããã§ïŒããªãã®éšå±ã¯æ®å¿µãªãããšãŠãçãïŒããããšæŒå
¥ããããªãïŒ ãã®ããïŒãããã«ããµãšãã 1 æå¢ããã«ã¯ïŒãã®ãšãæŒå
¥ãã®äžçªäžã«ããããµãšãããããã®äž... | 37,736 |
Score : 1000 points Problem Statement Ringo has a string S . He can perform the following N kinds of operations any number of times in any order. Operation i : For each of the characters from the L_i -th through the R_i -th characters in S , replace it with its succeeding letter in the English alphabet. (That is, repla... | 37,737 |
Score : 100 points Problem Statement There is a simple directed graph G with N vertices, numbered 1, 2, \ldots, N . For each i and j ( 1 \leq i, j \leq N ), you are given an integer a_{i, j} that represents whether there is a directed edge from Vertex i to j . If a_{i, j} = 1 , there is a directed edge from Vertex i to... | 37,738 |
Score : 800 points Problem Statement There are N positive integers A_1, A_2, ..., A_N . Takahashi can perform the following operation on these integers any number of times: Choose 1 \leq i \leq N and multiply the value of A_i by -2 . Notice that he multiplies it by minus two. He would like to make A_1 \leq A_2 \leq ...... | 37,739 |
Score : 1100 points Problem Statement There are N white balls arranged in a row, numbered 1,2,..,N from left to right. AtCoDeer the deer is thinking of painting some of these balls red and blue, while leaving some of them white. You are given a string s of length K . AtCoDeer performs the following operation for each i... | 37,740 |
Score : 400 points Problem Statement Your friend gave you a dequeue D as a birthday present. D is a horizontal cylinder that contains a row of N jewels. The values of the jewels are V_1, V_2, ..., V_N from left to right. There may be jewels with negative values. In the beginning, you have no jewel in your hands. You ca... | 37,741 |
Score : 100 points Problem Statement Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A. The problem has N test cases, all of which must be passed to get an AC verdict. Takahashi's submission has passed M cases out of the N test cases. Determine whether Takahashi's ... | 37,742 |
Koch Curve Write a program which reads an integer n and draws a Koch curve based on recursive calles of depth n . The Koch curve is well known as a kind of fractals . You can draw a Koch curve in the following algorithm: Divide a given segment (p1, p2) into three equal segments. Replace the middle segment by the two si... | 37,743 |
Score : 300 points Problem Statement We have two desks: A and B. Desk A has a vertical stack of N books on it, and Desk B similarly has M books on it. It takes us A_i minutes to read the i -th book from the top on Desk A (1 \leq i \leq N) , and B_i minutes to read the i -th book from the top on Desk B (1 \leq i \leq M)... | 37,744 |
Max Score: $400$ Points Problem Statement Sample testcase 3 has a mistake, so we erased this case and rejudged all solutions of this problem. (21:01) Snuke got a sequence $a$ of length $n$ from AtCoder company. All elements in $a$ are distinct. He made a sequence $b$, but actually, he is not remembered it. However, he ... | 37,745 |
Balls and Boxes 7 Balls Boxes Any way At most one ball At least one ball Distinguishable Distinguishable 1 2 3 Indistinguishable Distinguishable 4 5 6 Distinguishable Indistinguishable 7 8 9 Indistinguishable Indistinguishable 10 11 12 Problem You have $n$ balls and $k$ boxes. You want to put these balls into the boxes... | 37,746 |
Score : 300 points Problem Statement There are N people living on a number line. The i -th person lives at coordinate X_i . You are going to hold a meeting that all N people have to attend. The meeting can be held at any integer coordinate . If you choose to hold the meeting at coordinate P , the i -th person will spen... | 37,747 |
å€åå®¿ã®æã¯æ©ã JAGå€åå®¿ã®æã¯æ©ãïŒ æ£ç¢ºã«ã¯ãããŸã§æ©ããªããïŒæ©ããšæããåå è
ãå€ããšããïŒ äŸå¹Žå宿ã®äŒå Žãšãªãæœèšã§ã¯ïŒé廿ã«åå è
ãã·ãŒãã®ååãæé€ãããªããã°ãªããªãïŒ 1 ã€ã®éšå±ã§ãéå»ãé
ãããšïŒæ¥å¹Žä»¥éã®æœèšã®å©çšã«é¢ããããïŒåå è
ã¯äžäººãããšãå¯åããŠã¯ãªããªãïŒ ããã¯èšã£ãŠãç人éïŒå¯åããããšãããïŒ ãããïŒèµ·ãã人ãé£çµ¡å
ãç¥ã£ãŠãã人ã«ã¢ãŒãã³ã°ã³ãŒã«ãããããšã§ïŒäžäººãå¯åããªãããåªããããšãã§ããã¯ãã ïŒ JAGå€å宿ã®éå¶ãä»»ãããããªãã¯ïŒå¯åã絶察ã«é²ãæãæã€ããã®åæºåãšããŠïŒã©ã®ãããã®ç¢ºçã§å
šå¡ããã¡ããšèµ·ããããã®ãã調ã¹ãããšã«ããïŒ æºåãšããŠãŸãïŒååå è
ã®... | 37,748 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.