task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Score : 200 points Problem Statement Takahashi and Aoki will have a battle using their monsters. The health and strength of Takahashi's monster are A and B , respectively, and those of Aoki's monster are C and D , respectively. The two monsters will take turns attacking, in the order Takahashi's, Aoki's, Takahashi's, A... | 38,922 |
Switching Railroad Cars This figure shows railway tracks for reshuffling cars. The rail tracks end in the bottom and the top-left rail track is used for the entrace and the top-right rail track is used for the exit. Ten cars, which have numbers from 1 to 10 respectively, use the rail tracks. We can simulate the movemen... | 38,923 |
æè»œéã®ã¢ããŒã« åé¡ ã¢ããŒã«ã¯åãèžè¡åãšããŠåºã芪ããŸããŠãã.IOI æ¥æ¬å§å¡äŒã§ã¯,JOI ãåºå ±ããããã«ã¢ããŒã«ãäœæããããšã«ãªã£ã.JOI åºå ±çšã¢ããŒã«ã¯,æ£,çŽ(ã²ã),é(ããã)ã® 3 çš®é¡ã®èŠçŽ ãçšããŠ,次ã®ããã«æ§æããã. æ£ã®äžæ¹ã®ç«¯ã¯éã«,ããäžæ¹ã®ç«¯ã¯èµ€ã«å¡ãããŠãã. æ£ã¯äž¡ç«¯ä»¥å€ã® 1 ç®æãæ¯ç¹ãšããŠçŽã§ã€ãããã. æ¯ç¹ããèµ€ã®ç«¯ãŸã§ã®é·ããæ¯ç¹ããéã®ç«¯ãŸã§ã®é·ããæ£æŽæ°ã§ãã. æ£ã®äž¡ç«¯ã«ã¯,çŽã§éãä»ã®æ£ãã€ãã. éã¯çŽãçšããŠã©ããã®æ£ã®äžç«¯ã«ã€ãããã. éã«ã¯äœãã€ãããªã. éã®éãã¯æ£æŽæ°ã§ãã. çŽã®ãã¡ 1 æ¬ã ãã¯,çæ¹ã®ç«¯ãããæ£ãã€ããããã«ãã®æ£ã®æ¯ç¹ã«çµã°... | 38,924 |
C: ã«ããµã«æå· åé¡ ãã³ã¡ããã¯ãããéè² æŽæ° D ããã«ããµã«æå·ãã§æå·åããŠåŸãããæåå C ãäžããããŸããããã®æå·ã¯ãéè² æŽæ°ã 10 鲿³ã§è¡šãããšãã®åæ°åãããïŒå
ãšç°ãªããšã¯éããªãïŒæ±ºããããæ°åã§çœ®ãæãããã®ã§ããç°ãªãæ°åãåãæ°åã«çœ®ãæããããããåãæ°åãåºçŸäœçœ®ã«ãã£ãŠç°ãªãæ°åã«æžãæããããããšã¯ãããŸããã ããšãã°ããã®æå·åæ¹åŒã«ãã£ãŠ 2646 ã 0545 ã«ãªãããšã¯ãããŸããã 3456 ã 1333 ã«ãªã£ãã 1333 ã 3456 ã«ãªãããšã¯ãããŸããã ããŸããã³ã¡ãã㯠D ã 10^9+7 ã§å²ã£ãäœãã M ã«ãªãããšãæããŠããããŸããããã®ãšãã D ... | 38,925 |
() Problem Statement æåå S ãããïŒã¯ããïŒ S ã¯ç©ºæååã§ããïŒ ä»¥äžã®åŠçã n åé çªã«è¡ãïŒ S ã®æ«å°Ÿã« p_i (="("ãŸãã¯")")ã x_i å远å ããïŒ åŠçãæœããåŸïŒ S ããã©ã³ã¹ã®ãšããæååã§ãããã©ããå€å®ããïŒ ãæååã®ãã©ã³ã¹ãåããŠããããšã¯ïŒæ¬¡ã®ããã«å®çŸ©ãããïŒ ç©ºæååã¯ãã©ã³ã¹ãåããŠããïŒ ãã©ã³ã¹ã®åããŠããæåå a ãš b ã«å¯ŸããŠïŒ a + b (+ã¯æååã®é£çµã衚ã)ã¯ãã©ã³ã¹ãåããŠããïŒ ãã©ã³ã¹ã®åããŠããæåå a ã«å¯ŸããŠïŒ"(" + a + ")"ã¯ãã©ã³ã¹ãåããŠããïŒ Input å
¥åã¯ä»¥äžã®åœ¢åŒã«åŸãïŒäžããããæ°ã¯å
šãп޿°ã§... | 38,926 |
Problem G: Let There Be Light Suppose that there are some light sources and many spherical balloons. All light sources have sizes small enough to be modeled as point light sources, and they emit light in all directions. The surfaces of the balloons absorb light and do not reflect light. Surprisingly in this world, ball... | 38,927 |
Problem C: Alice and Bob Alice and Bob are in love with each other, but they have difficulty going out on a date - Alice is a very busy graduate student at the ACM university. For this reason, Bob came to the ACM university to meet her on a day. He tried to reach the meeting spot but got lost because the campus of the ... | 38,928 |
Score : 100 points Problem Statement Snuke has a favorite restaurant. The price of any meal served at the restaurant is 800 yen (the currency of Japan), and each time a customer orders 15 meals, the restaurant pays 200 yen back to the customer. So far, Snuke has ordered N meals at the restaurant. Let the amount of mone... | 38,929 |
Score : 1000 points Problem Statement Snuke got a present from his mother on his birthday. The present was a pair of two sequences a and b , consisting of positive integers. They satisfied all of the following properties: The sum of all elements of a is N . The sum of all elements of b is N . Any string of length N tha... | 38,930 |
Score : 300 points Problem Statement There are N slimes lining up from left to right. The colors of these slimes will be given as a string S of length N consisting of lowercase English letters. The i -th slime from the left has the color that corresponds to the i -th character of S . Adjacent slimes with the same color... | 38,931 |
Score: 100 points Problem Statement There is a farm whose length and width are A yard and B yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, as shown below: (The gray part represents the roads.) What is the area of this yard excluding the roads?... | 38,932 |
ããªãåã¯ïŒ(èªå·±äº€å·®ãæããªã) n åã®é ç¹ãããªãæãç·ã®åœ¢ãããŠããïŒæåã«ïŒããªãåã® i çªç®ã®é ç¹ã¯ (x i , y i ) ã«ããïŒããªãåã¯ïŒå¹³è¡ç§»åãå転ãããŠé£ç¶çã«ç§»åããããšã¯ã§ãããïŒå€åœ¢(æãç·ã®é·ããäºã€ã®ç·åã®ãªãè§åºŠãå€ãã) ããããšã¯ã§ããªãïŒ y = 0 ã¯å£ã§ããïŒ(0, 0) ã«åŸ®å°ãªç©ŽãéããŠããïŒããªãåããã®ç©Žãéã£ãŠå
šäœã y < 0 ãã¿ããããã«ç§»åã§ãããã©ããå€å®ããïŒ Constraints 2 †n †1000 0 †x i †10 9 1 †y i †10 9 æãç·ã¯èªå·±äº€å·®ãæããªã ã©ã®äžç¹ãåäžçŽç·äžã«ãªã (x i , y i ) â (x ... | 38,933 |
Score : 600 points Problem Statement We have N points numbered 1 to N arranged in a line in this order. Takahashi decides to make an undirected graph, using these points as the vertices. In the beginning, the graph has no edge. Takahashi will do M operations to add edges in this graph. The i -th operation is as follows... | 38,934 |
Problem B: Prime Gap The sequence of n - 1 consecutive composite numbers (positive integers that are not prime and not equal to 1) lying between two successive prime numbers p and p + n is called a prime gap of length n . For example, (24, 25, 26, 27, 28) between 23 and 29 is a prime gap of length 6. Your mission is to... | 38,935 |
Problem D: Mr. Rito Post Office ããªãã¯é¢å³¶ã®éµäŸ¿å±ã«å€ããããã°ã©ãã§ããïŒããªãã®äœãã§ããå°åã¯ïŒè€æ°ã®å³¶ã
ãããªãïŒåå³¶ã«ã¯äžã€ä»¥äžã®æž¯çºãããïŒãããã«å ããŠä»ã®çºãæãããããããªãïŒããå³¶ããå¥ã®å³¶ã«åããããã«ã¯è¹ã䜿ããªããã°ãªããªãïŒäžã€ã®å³¶ã®äžãåãã«ã¯éžè·¯ã䜿ãããïŒæµ·è·¯ãå©çšããæ¹ãéãããšãããïŒ è¿å¹Žè¡ãããéµäŸ¿å±ã®æ°å¶åããã£ããã«ïŒçµè²»åæžã«åããŠéµäŸ¿é
éå¡ã®äººå¡æŽçãå
šåœçã«è¡ãããïŒé¢å³¶ã®éµäŸ¿å±ããã®äŸå€ã§ã¯ãªãïŒçµæãšããŠéµäŸ¿é
éå¡ã¯å©è€ãããã äžäººãšãªã£ãŠããŸã£ãïŒãã®éµäŸ¿å±ãéé
ãæ
åœããå°åã¯éåžžã«åºãããïŒäžäººã§éé
ããã®ã¯å€§å€ãªäœæ¥ã§ããïŒãªã®ã§ïŒã©ã®... | 38,936 |
åã®å ããŸãå¿è
ãåå€ãã倩å®é£ã«å¿ã³å
¥ãããšèšç»ãç«ãŠãŠããŸãããã®å¿è
ã¯å°é¢ãèµ°ã£ãããå ã®äžãæ³³ãã ãããããšã¯é£ãªãã§ããŸãããå ããéãäžããããšã¯ãšãŠãèŠæãªã®ã§ãå¿è
ã¯å ã«å
¥ãåæ°ãã§ããã ãå°ãªãããããšèããŠããŸãã ãåã®èŠåå³ãå
¥åãšããåå€ãã倩å®é£ã«è³ããŸã§ã«ãå ããéãäžãããªããŠã¯ãªããªãæå°åæ°ãåºåããããã°ã©ã ãäœæããŠäžããããåã®èŠåå³ã¯äºæ¬¡å
æ ŒåãšããŠäžããããŸããèŠåãå³ã«æãããèšå·ã«ã¯ã倩å®é£ã®äœçœ®ã瀺ãã&ããšå ã®äœçœ®ã瀺ãã#ãã®äœçœ®ãèšããããã®ã»ãã®å°ç¹ã«ã¯ã.ãïŒåè§ããªãªãïŒãèšãããŠããŸãããªãããåã«ã¯å€©å®é£ã¯äžã€ã ããããã®ãšããå¿è
ã¯èµ°ã£ããæ³³ãã ãããŠç§»åãããš... | 38,937 |
åé¡ ïŒ å
¥åãã¡ã€ã«ã®ïŒè¡ç®ã«æ£æŽæ° n ãæžããŠããïŒ ïŒè¡ç®ã«ã¯åè§ç©ºçœæåïŒã€ãåºåããšããŠïŒ n åã®æ£æŽæ°ãæžããŠããïŒ n 㯠2 ãŸã㯠3 ã§ããïŒ ïŒè¡ç®ã«æžãããŠããã©ã®æŽæ°ãå€ã¯ 10 8 以äžã§ããïŒ ãããïŒåãŸãã¯ïŒåã®æ°ã®å
¬çŽæ°ããã¹ãŠæ±ãïŒ å°ããæ¹ããé ã«1è¡ã«1åãã€åºåããïŒ èªæãªå
¬çŽæ°ïŒãïŒãïŒãåºåããããšïŒ åºåãã¡ã€ã«ã«ãããŠã¯ïŒ åºåã®æåŸè¡ã«ãæ¹è¡ã³ãŒããå
¥ããããšïŒ å
¥åºåäŸ å
¥åäŸïŒ 2 75 125 åºåäŸïŒ 1 5 25 å
¥åäŸïŒ 3 110 22 88 åºåäŸïŒ 1 2 11 22 å
¥åäŸïŒ 3 66 11 3 åºåäŸïŒ 1 å顿ãšèªå審å€ã«äœ¿ãããããŒã¿ã¯ã æ
å ±ãª... | 38,938 |
Score : 500 points Problem Statement You are given two integer sequences S and T of length N and M , respectively, both consisting of integers between 1 and 10^5 (inclusive). In how many pairs of a subsequence of S and a subsequence of T do the two subsequences are the same in content? Here the subsequence of A is a se... | 38,939 |
Web 0.5 In a forest, there lived a spider named Tim. Tim was so smart that he created a huge, well-structured web. Surprisingly, his web forms a set of equilateral and concentric N -sided polygons whose edge lengths form an arithmetic sequence. Figure 1: An example web of Tim Corresponding vertices of the N-sided polyg... | 38,940 |
Score : 700 points Problem Statement We have a graph with N vertices and M edges, and there are two people on the graph: Takahashi and Aoki. The i -th edge connects Vertex U_i and Vertex V_i . The time it takes to traverse this edge is D_i minutes, regardless of direction and who traverses the edge (Takahashi or Aoki).... | 38,941 |
Score : 1400 points Problem Statement Takahashi found an integer sequence (A_1,A_2,...,A_N) with N terms. Since it was too heavy to carry, he decided to compress it into a single integer. The compression takes place in N-1 steps, each of which shorten the length of the sequence by 1 . Let S be a string describing the s... | 38,942 |
Score : 100 points Problem Statement We will buy a product for N yen (the currency of Japan) at a shop. If we use only 1000 -yen bills to pay the price, how much change will we receive? Assume we use the minimum number of bills required. Constraints 1 \leq N \leq 10000 N is an integer. Input Input is given from Standar... | 38,943 |
G: DAG ããªãª / DAG Trio ãã®åé¡ã¯ D: DAG Trio (Easy) ãšå¶çŽã®ã¿ãç°ãªãåãèšå®ã®åé¡ã§ãã ããããŒã° åŒã¯æè¿ãã ããšããããæ¬²ãããšãããã«åããŠããŸãã å¿é
ã«ãªã£ãå
ã調ã¹ããšãããåŒã®ã¯ã©ã¹ã§ã¯ $k$-DAG (æåã°ã©ãã§ãã£ãŠããã $k$ åã®èŸºãåé€ãããšã蟺ã®åããç¡èŠãããšãã®é£çµæåæ°ã $k$ ã«ã§ãããã€ãããå
šãŠã DAG ã§ãã) ãæµè¡ã£ãŠããã 3-DAG ãç¹ã« DAG ããªãªãšåŒã¶ããšãçªãæ¢ããŸããã åŒã«å°æ¬ããããå
ã¯ãäžããããã°ã©ãã DAG ããªãªãã©ãããå€å¥ããããã°ã©ã ãäœæããããšã«ããŸããã å顿 $N$ é ç¹ $M$ èŸºã®æ... | 38,944 |
Problem F: Triangle Partition Suppose that a triangle and a number of points inside the triangle are given. Your job is to find a partition of the triangle so that the set of the given points are divided into three subsets of equal size. Let A, B and C denote the vertices of the triangle. There are n points, P 1 , P 2 ... | 38,945 |
Single Source Shortest Path For a given weighted graph $G = (V, E)$, find the shortest path from a source to each vertex. For each vertex $u$, print the total weight of edges on the shortest path from vertex $0$ to $u$. Input In the first line, an integer $n$ denoting the number of vertices in $G$ is given. In the foll... | 38,946 |
Score : 200 points Problem Statement Joisino is about to compete in the final round of a certain programming competition. In this contest, there are N problems, numbered 1 through N . Joisino knows that it takes her T_i seconds to solve problem i(1âŠiâŠN) . Also, there are M kinds of drinks offered to the contestants, nu... | 38,947 |
G: éåœå - Destiny Draw - åé¡ Mr. D ã¯ã«ãŒãã²ãŒã ã§åè² ãããããšã«ãªã£ãã ãã®ã«ãŒãã²ãŒã ã§ã¯ã N æã®ã«ãŒãã®å±±ãçšããã ãŸããå±±ã®ã«ãŒãã«ã¯ãäžããé ã« 1, 2, 3, ... , N ã®çªå·ãã€ããŠããã D ã§å§ãŸããã®ãã¹ãŠãèè² ãåœŒã«æåã¯èš±ãããªãããäžå¹žã«ã Mr. D ã¯ã«ãŒãã²ãŒã ãäžåŸæã§ããã ããã§ãèªåãåŒãã«ãŒããã³ã³ãããŒã«ããããšã§åå©ãæã«ããããšã«ããã Mr. D 㯠K çš®é¡ã®ã·ã£ããã«ãå¯èœã§ããã K çš®é¡ã®ãã¡ i çªç®ã®ã·ã£ããã«ã§ã¯äžãã a_i æç®ãã a_i+b_i â 1 æç®ãŸã§ã®ã¡ããã© b_i æãåŒãæããäžã«éããã i çª... | 38,948 |
Score : 500 points Problem Statement Takahashi has a string S of length N consisting of digits from 0 through 9 . He loves the prime number P . He wants to know how many non-empty (contiguous) substrings of S - there are N \times (N + 1) / 2 of them - are divisible by P when regarded as integers written in base ten. He... | 38,949 |
æ€
åã®ç·æ° éžæã®ã¿ãªãããããœã³ã³ç²ååã«ãããããããœã³ã³ç²ååã®æ¬éžã¯äŒæŽ¥å€§åŠã§è¡ãããäŒå Žå
ã§ã¯ ïŒã€ã®æºã«ïŒããŒã ãå²ãåœãŠãããŸããããœã³ã³ç²ååã¯ïŒããŒã ïŒäººãªã®ã§ãããŒã æ°ÃïŒèã®æ€
åãå¿
èŠã§ãã倧åŠã§ã¯ãä»ã«ãæ§ã
ãªã€ãã³ãã®äŒå Žèšå¶ã§æºãšæ€
åãæºåããæ©äŒããããŸãããå¿
èŠãªæºãšæ€
åã®æ°ãæ§ã
ã§ããããã§ãããã€ãã³ãã«å¯ŸããŠæºåããæºã®æ°ãšãæºïŒã€ãããã«å¿
èŠãªæ€
åã®æ°ãäžãããããšããå¿
èŠãªæ€
åã®ç·æ°ãèšç®ããããã°ã©ã ãäœæããŠãã ããã å
¥å å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã d c å
¥åã¯ïŒè¡ã§ãããå¿
èŠãªæºã®æ° d (1 †d †100) ãšæºïŒã€ãããã«å¿
èŠãªæ€
åã®æ° c (1 †c †10)... | 38,950 |
Circumscribed Circle of a Triangle Write a program which prints the central coordinate ($cx$,$cy$) and the radius $r$ of a circumscribed circle of a triangle which is constructed by three points ($x_1$, $y_1$), ($x_2$, $y_2$) and ($x_3$, $y_3$) on the plane surface. Input The input is given in the following format $x_1... | 38,951 |
Score : 200 points Problem Statement A sequence a=\{a_1,a_2,a_3,......\} is determined as follows: The first term s is given as input. Let f(n) be the following function: f(n) = n/2 if n is even, and f(n) = 3n+1 if n is odd. a_i = s when i = 1 , and a_i = f(a_{i-1}) when i > 1 . Find the minimum integer m that satisfie... | 38,952 |
Lucky Dip Time Limit: 8 sec / Memory Limit: 64 MB C: çŠè¢ çŠè¢ïŒããã¯å¹Žå§ãç¥ãåç¿æ
£ã®äžã€ã§ããïŒ äººæ°ã®çŠè¢ã«ã¯å€ãã®äººãéåºåããè¡åãäœãïŒã¿ãŒã²ããã®çŠè¢ãžããã·ã¥ããïŒ ãã®é¢šç©è©©ã«é
äºãããããªãã¯ïŒä»å¹Žããç®åœãŠã®çŠè¢ãçãïŒèšç»ãç«ãŠãŠããïŒ ãããïŒã客ãåŒã³å¯ããåŽã®æçŸè²šåºã®åºé·ã¯é ãæ©ãŸããŠããïŒ ã©ãããããã¢ã®æºåãéåºã«éã«åãããã«ãªãïŒ ããã§åºé·ã¯ããäžã€ã®ã¢ã€ãã£ã¢ãæãã€ããïŒ ããã¯éåºåŸïŒåºå
ãåŸã
ã«éæŸããã°ãªããšãå¶æ¥ã§ããã®ã§ã¯ãªãããšãããã®ã§ããïŒ ããªãã¯å»äžå»ãšå€åããåºå
ã®æ
å ±ãå
ã«ïŒãç®åœãŠã®çŠè¢ãã©ã®æé垯ããå
¥æ... | 38,953 |
Score : 1000 points Problem Statement Snuke has come up with the following problem. You are given a sequence d of length N . Find the number of the undirected graphs with N vertices labeled 1,2,...,N satisfying the following conditions, modulo 10^{9} + 7 : The graph is simple and connected. The degree of Vertex i is d_... | 38,954 |
Score : 300 points Problem Statement Given is a string S . Let T be the concatenation of K copies of S . We can repeatedly perform the following operation: choose a character in T and replace it with a different character. Find the minimum number of operations required to satisfy the following condition: any two adjace... | 38,955 |
Score : 1000 points Problem Statement AtCoDeer the deer found N rectangle lying on the table, each with height 1 . If we consider the surface of the desk as a two-dimensional plane, the i -th rectangle i(1â€iâ€N) covers the vertical range of [i-1,i] and the horizontal range of [l_i,r_i] , as shown in the following figure... | 38,956 |
Score : 900 points Problem Statement There are N robots and M exits on a number line. The N + M coordinates of these are all integers and all distinct. For each i ( 1 \leq i \leq N ), the coordinate of the i -th robot from the left is x_i . Also, for each j ( 1 \leq j \leq M ), the coordinate of the j -th exit from the... | 38,958 |
Problem B: Divisor Function Teiji is a number theory lover. All numbers are his friends - so long as they are integers. One day, while preparing for the next class as a teaching assistant, he is interested in a number-theoretical function called the divisor function . The divisor function Ï ( n ) is defined as the sum ... | 38,959 |
Problem C: One-Dimensional Cellular Automaton There is a one-dimensional cellular automaton consisting of N cells. Cells are numbered from 0 to N â 1. Each cell has a state represented as a non-negative integer less than M . The states of cells evolve through discrete time steps. We denote the state of the i-th cell at... | 38,960 |
Score : 600 points Problem Statement A subsequence of a string S is a string that can be obtained by deleting zero or more characters from S without changing the order of the remaining characters. For example, arc , artistic and (an empty string) are all subsequences of artistic ; abc and ci are not. You are given a st... | 38,961 |
B: VOCAL ANDROID ããŒã«ã«ã¢ã³ããã€ã (VOCAL ANDROID) ãšã¯ïŒã¡ããã£ãšæè©ãå
¥åããŠé³å£°ãåæããäœæ²ããŒã«ã§ããïŒ 2013幎3æ9æ¥ã«åæå±±çã§éå¬ãããïŒããŒã«ã«ã¢ã³ããã€ãã®ã©ã€ãã«è¡ã£ãããªãã¯ïŒé³æ¥œã®çŽ æŽãããã«æåããïŒ ããã§ïŒããªãã¯æ°äœããŒã«ã«ã¢ã³ããã€ããç«é³ãªãã (CV.ç«åœå€ªé)ãã賌å
¥ãïŒäœæ²ãå§ããããšã«ããïŒ ãšãããïŒã¡ããã£ã¯å®æãããã®ã®äœè©ã§è©°ãŸã£ãŠããŸã£ãïŒ äœ¿ããããã¬ãŒãºã¯ããã€ãæççã«çšæããŠããïŒããããçµã¿åãããŠåã¡ããã£ã«ããŠã¯ããïŒ åã¡ããã£ã¯ïŒé·ããæ±ºãŸã£ãŠããïŒå¿
ããã®é·ããŽã£ããã«ãªãããã«ãã¬ãŒãºãããŠã¯ããå¿
èŠãããïŒ ãŸãïŒ... | 38,962 |
K Average Ranges æ°å a_1,a_2,..,a_N ãäžããããŸãã ãã®æ°åã«å€ã®å¹³åã K 以äžã®é·ã 1 以äžã®åºéã¯ããã€ãããŸããã å
¥å N K a_1 a_2...a_N åºå çããåºåããã å¶çŽ 1 \leq N \leq 10^5 1 \leq K \leq 10^9 1 \leq a_i \leq 10^9 å
¥åäŸ 6 6 8 6 9 1 2 1 åºåäŸ 7 | 38,963 |
ã¿ã€ã ã«ãŒã åé¡ JOIåäºã§ã¯ç€Ÿå¡ã®åšç€Ÿæéãã¿ã€ã ã«ãŒãã§ç®¡çããŠããïŒç€Ÿå¡ã¯ïŒåºç€Ÿãããšå°çšã®è£
眮ã䜿ã£ãŠã¿ã€ã ã«ãŒãã«åºç€Ÿæå»ãå»å°ããïŒå€åãçµãé瀟ãããšãã«ãïŒã¿ã€ã ã«ãŒãã«é瀟æå»ãå»å°ããïŒæå»ã¯24æéå¶ã§æ±ãããïŒ é²ç¯äžã®çç±ããïŒç€Ÿå¡ã®åºç€Ÿæå»ã¯7æä»¥éã§ããïŒãŸãïŒå
šãŠã®ç€Ÿå¡ã¯23æããåã«é瀟ããïŒç€Ÿå¡ã®é瀟æå»ã¯åžžã«åºç€Ÿæå»ããåŸã§ããïŒ å
¥åãšããŠJOIåäºã®3人ã®ç€Ÿå¡AããïŒBããïŒCããã®åºç€Ÿæå»ãšé瀟æå»ãäžãããããšãïŒããããã®ç€Ÿå¡ã®åšç€Ÿæéãèšç®ããããã°ã©ã ãäœæããïŒ å
¥å å
¥åã¯3è¡ãããªãïŒ 1è¡ç®ã«ã¯Aããã®åºç€Ÿæå»ãšé瀟æå»ïŒ 2è¡ç®ã«ã¯Bããã®åºç€Ÿæå»ãšé瀟æå»ïŒ 3è¡ç®... | 38,964 |
Power For given integers m and n , compute m n (mod 1,000,000,007). Here, A (mod M ) is the remainder when A is divided by M . Input m n Two integers m and n are given in a line. Output Print m n (mod 1,000,000,007) in a line. Constraints 1 †m †100 1 †n †10 9 Sample Input 1 2 3 Sample Output 1 8 Sample Input 2 5 8 ... | 38,965 |
GCD and LCM Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given a and b . Input Input consists of several data sets. Each data set contains a and b separated by a single space in a line. The input terminates with EOF. Constraints 0 < a, b †2,000,000,000 LCM( a,... | 38,966 |
B: ãã¬ãã€ã åé¡ è¬ã®è£
眮 $M$ ããã,ãã®è£
眮㫠Tanuki ãš Fox ãå
¥ãããš, è£
眮ããäžå¹ã®åç©ãåºãŠããïŒä»¥äž, Tanuki ã $T$ ,Foxã $F$ ãšããïŒ. $M(x, y)$ ã¯,è£
眮 $M$ ã« $x, y$ ã®é ã§åç©ãå
¥ããŠåºãŠããåç©ã衚ã. è²ã
詊ããçµæ,以äžã®ããšãããã£ã. $M(T, T) = T$ $M(T, F) = F$ $M(F, T) = T$ $M(F, F) = T$ ããªãã¯,äžåã«äžŠãã§ããåç©ãã¡ $P_1, P_2, ... , P_N$ ã以äžã®ããã«è£
眮ã«å
¥ããŠãã£ã. $M(....M(M(P_1,P_2), P_3)...., P_N)$ æåŸ... | 38,967 |
åé¡ 1 n åéã«ãããïŒ ãã³ãã«ã®å
¥å£ãšåºå£ã§ïŒ 1åéã«ééããè»ã®æ°ãæ°ããããŒã¿ãããïŒ ãã®ããŒã¿ã¯ïŒ å
šéšã§ n+2 è¡ãããªãïŒ åè¡ã«ã¯æ¬¡ã®å
å®¹ãæžãããŠããïŒ ç¬¬1è¡ç®ã«ã¯ïŒæ£æŽæ° n ãæžãããŠããïŒ èª¿æ»æéã n åéã§ãã£ãããšã衚ããŠããïŒ ç¬¬2è¡ç®ã«ã¯ïŒæ£æŽæ° m ãæžãããŠããïŒ èª¿æ»éå§æã«ããããã³ãã«å
ã®è»ã®å°æ°ã m ã§ãã£ãããšã衚ããŠããïŒ ç¬¬(2+i)è¡ç®ïŒ i = 1, 2, ... , n ) ã«ã¯ïŒ 調æ»éå§åŸ (i-1) åçµéããæç¹ãã i åçµéãããŸã§ã®1åéã«ïŒ å
¥å£ãééããè»ã®å°æ°ãšåºå£ãééããè»ã®å°æ°ã ïŒã€ã®ç©ºçœã§åºåãããŠæžãããŠããïŒ èª¿æ»éå§åŸ j ... | 38,968 |
ãã¹è·¯ç· å³ 1ã®ãããªãã¹è·¯ç·ããããŸããåçæã¯ 10 ç®æã§ããããã 0ã9 ã®çªå·ãã€ããŠããŸãããã¹ã¯åçæ 0 ã§ã¯æãè¿ããŸãããå察åŽã¯åŸªç°è·¯ç·ã«ãªã£ãŠãããå³ã®ããã« 5â6â7â8â9â5 ã®é ã§åŸªç°ããŸãã ãã®ãã¹è·¯ç·ã«ã€ããŠãä¹è»ããåçæãšéè»ããåçæãå
¥åãšããä¹è»ããéè»ãŸã§ã«éãåçæã®çªå·ãåºåããããã°ã©ã ãäœæããŠãã ããã ãã ãã1ã5 ã®åçæã§ã¯ 2 æ¹åã®ãã¹ã«ä¹è»ã§ããŸãããããçãçµè·¯ã§éè»åçæã«å°çãããã¹ã«ä¹è»ããããšãšããŸããäŸãã°ãåçæ 4 ããåçæ 2 ãžè¡ãå Žåãå·Šæ¹åã«é²ããã¹ã«ä¹ãã4â3â2ãã®çµè·¯ãéããŸãããŸããäžåºŠãã¹ã«ä¹è»ãããéäžäžè»ã¯ããªã... | 38,969 |
Problem I: Crystal Jails Artistic Crystal Manufacture developed products named Crystal Jails. They are cool ornaments forming a rectangular solid. They consist of colorful crystal cubes. There are bright cores on the center of cubes, which are the origin of the name. The combination of various colored reflections shows... | 38,970 |
Problem H: Bingo A Bingo game is played by one gamemaster and several players. At the beginning of a game, each player is given a card with M Ã M numbers in a matrix (See Figure 10). As the game proceeds, the gamemaster announces a series of numbers one by one. Each player punches a hole in his card on the announced nu... | 38,971 |
A åã¯å±±æç·ã«ä¹ã£ãŠç®çå°ã«ãã©ãçãããïŒ A åã¯é»è»ã«ä¹ã£ãŠãã a åèµ·ã㊠b åå¯ãããšãç¹°ãè¿ãïŒç®çå°ãŸã§ã¯ä¹è»åŸ c åã§ããïŒãã®ãšãèµ·ããŠããã°äžè»ã§ãããïŒéã«å¯ãŠããéäžã§ããã°ä¹ãéãããŠããŸãïŒãŸãïŒA åã¯ä¹ãéãããŠããã£ãšåãé»è»ã«ä¹ãç¶ãïŒé»è»ã¯å±±æç·ãäžåšããã®ã« 60 åãããïŒãããã£ãŠïŒA åã¯ç®çå°ã« 60t + c ( t ã¯éè² æŽæ°) ååŸã«çãããšã«ãªãïŒ äœååŸã«A åã¯ç®çå°ã«å°çã§ãããïŒå°çäžå¯èœãªãšãã¯-1 ãåºåããïŒãã ãïŒç®çå°ã«å°çããæãå¯ãŠããæéãšèµ·ããŠããæéã®å¢ç®ã ã£ãå Žåã¯éããããšãã§ãããã®ãšããïŒ Input å
¥åã¯ä»¥äžã®åœ¢åŒã§1 è¡ã§äžãã... | 38,972 |
Score : 200 points Problem Statement Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000 . Takahashi has N slimes, and they are standing in a row from left to right. The color of the i -th slime from the left is a_i . If two slime... | 38,973 |
Huffman Coding We want to encode a given string $S$ to a binary string. Each alphabet character in $S$ should be mapped to a different variable-length code and the code must not be a prefix of others. Huffman coding is known as one of ways to obtain a code table for such encoding. For example, we consider that appearan... | 38,974 |
å³ç»å·¥äœ ã€ã
ã¢å€§åŠéå±å°åŠæ ¡ã¯æ¥æ¬ææ°ã®ç«¶æããã°ã©ããŒé€ææ ¡ãšããŠæåã§ãããã®åŠæ ¡ã®æå¡ã¯å¹
åºã ã¢ã«ãŽãªãºã ã®ç¥èãæã¡ãæ¥ã
ãããæŽ»çšããŠããŸããæå¡ã§ããããªãã¯ãä»å¹Žã¯å³ç»å·¥äœã®ææ¥ ãæ
åœããããšã«ãªããŸããããã®ææ¥ã§ã¯ãå
ç«¥å
šå¡ãããããïŒå¹Žéã§äžã€ã®èª²é¡ã宿ãããããšã«ãªã£ãŠããŸããææ¥ã®æŠèŠã¯ä»¥äžã®ãšããã§ãã ïŒå¹Žéã§ææ¥ã¯ D åïŒåãæ¥ã«2 åä»¥äžææ¥ã¯ãªãïŒããããã®å
šãŠã課é¡å¶äœã«å
ãŠãããã å¶äœãã課é¡ã¯ M çš®é¡çšæãããŠããã ããããã®å
ç«¥ã«ãM çš®é¡ã®äžãã課é¡ãïŒã€ãã€å²ãåœãŠãã å
童㯠N 人ã§ãããN 人ããããã«ç°ãªã課é¡ãå²ãåœãŠãããã å
ç«¥ã¯ãK çš®é¡ããéšåã®ãã¡ãã... | 38,975 |
Problem F: Heavenly Jewels There is a flat island whose shape is a perfect square. On this island, there are three habitants whose names are IC, PC, and ACM Every day, one jewel is dropped from the heaven. Just as the jewel touches the ground, IC, PC, and ACM leave their houses simultaneously, run with the same speed, ... | 38,976 |
Help the Princess! The people of a certain kingdom make a revolution against the bad government of the princess. The revolutionary army invaded the royal palace in which the princess lives. The soldiers of the army are exploring the palace to catch the princess. Your job is writing a program to decide that the princess... | 38,977 |
Score: 500 points Problem Statement New AtCoder City has an infinite grid of streets, as follows: At the center of the city stands a clock tower. Let (0, 0) be the coordinates of this point. A straight street, which we will call East-West Main Street , runs east-west and passes the clock tower. It corresponds to the x ... | 38,978 |
Problem C: Accelerated Railgun She catched the thrown coin that draws parabolic curve with her sparkling fingers. She is an ESPer. Yes, she is an electro-master who has the third strongest power among more than one million ESPers in the city. Being flicked by her thumb, the coin is accelerated by electromagnetic force ... | 38,979 |
å顿 $1,2,...,N$ ãäžŠã¹æ¿ããé åãããã2ã€ã®ç°ãªãæ°å $i$, $j$ ãéžãã§å
¥ãæ¿ããããšãç¹°ãè¿ããŠãœãŒããããç¶æ
( $1,2,...,N$ ã®é çªã«äžŠãã ç¶æ
)ã«ãããã æ°å $i$, $j$ ãå
¥ãæ¿ãã床ã«ã³ã¹ãã $c_{i,j}$ å¿
èŠã«ãªãã é å $p$ ã«å¯ŸããŠã $p$ ããœãŒãããã®ã«å¿
èŠãªæå°ã³ã¹ãã $f(p)$ ãšããã $f(p)$ ã®ãšãããæå€§å€ãæ±ããã å
¥å å
¥åã¯ä»¥äžã®ãã©ãŒãããã«åŸããäžããããæ°ã¯å
šãп޿°ã§ããã $N$ $c_{1,1}$ $c_{1,2}$ $...$ $c_{1,N}$ $c_{2,1}$ $c_{2,2}$ $...$ $c_{2,N}... | 38,981 |
Score : 2000 points Problem Statement You are given an H \times W grid. The square at the top-left corner will be represented by (0, 0) , and the square at the bottom-right corner will be represented by (H-1, W-1) . Of those squares, N squares (x_1, y_1), (x_2, y_2), ..., (x_N, y_N) are painted black, and the other squ... | 38,982 |
Problem B: Restaurant Steve runs a small restaurant in a city. Also, as he is the only cook in his restaurant, he cooks everything ordered by customers. Basically he attends to orders by first-come-first-served principle. He takes some prescribed time to prepare each dish. As a customer can order more than one dish at ... | 38,983 |
Problem A: Yu-kun Likes an Integer Background äŒæŽ¥å€§åŠä»å±å¹Œçšåã¯ããã°ã©ãã³ã°ã倧奜ããªåäŸãéãŸã幌çšåã§ãããåå
ã®äžäººã§ããããåã¯ãããã°ã©ãã³ã°ãšåããããæ°åã倧奜ãã ããããªããåã¯æè¿ã衚ã«0ãã9ãŸã§ã®ããããã®æ°åã®æžãããããã¬ãŒãã n æè³Œå
¥ã㊠n æ¡ã®æ°ãäœãéã³ã«ç±äžããŠããã 仿ãããåã¯è²°ã£ããå°é£ãã§ n æã®ãã¬ãŒããè²·ãã«è¡ãããšèããŠããã Problem ãã¬ãŒãã¯è¡šã«æžãããŠããæ°åã«ãã£ãŠå€æ®µãç°ãªãã ãããã䜿ã£ãŠäœãã n æ¡ã®æ°ãã§ããéãå°ãããããã ããåã®ææéé¡ãšåãã¬ãŒãã®å€æ®µã賌å
¥ãããã¬ãŒãã®ææ°ãäžããããã®... | 38,984 |
Score : 500 points Problem Statement You are given a positive integer L in base two. How many pairs of non-negative integers (a, b) satisfy the following conditions? a + b \leq L a + b = a \mbox{ XOR } b Since there can be extremely many such pairs, print the count modulo 10^9 + 7 . What is XOR? The XOR of integers A a... | 38,985 |
Score : 1200 points Problem Statement There are N non-negative integers written on the blackboard: A_1, ..., A_N . Snuke can perform the following two operations at most K times in total in any order: Operation A: Replace each integer X on the blackboard with X divided by 2 , rounded down to the nearest integer. Operat... | 38,986 |
Problem B: Bubble Puzzle A browser-based puzzle game called "Bubble Puzzle" is now popular on the Internet. The puzzle is played on a 4 Ã 4 grid, and initially there are several bubbles in the grid squares. Each bubble has a state expressed by a positive integer, and the state changes when the bubble gets stimulated. Y... | 38,987 |
Score : 200 points Problem Statement A string is called a KEYENCE string when it can be changed to keyence by removing its contiguous substring (possibly empty) only once. Given a string S consisting of lowercase English letters, determine if S is a KEYENCE string. Constraints The length of S is between 7 and 100 (incl... | 38,988 |
Common Tangent Find common tangent lines of two circles $c1$ and $c2$. Input Center coordinates ($cix$, $ciy$) and radii $cir$ of two circles $c1$ are $c2$ are given in the following format. $c1x \; c1y \; c1r$ $c2x \; c2y \; c2r$ All input values are given in integers. Output Print coordinates of the tangent points on... | 38,989 |
å€ä»£éºè·¡ã®è¬ å€ä»£éºè·¡ããè¶
倧åãã¿ã ãããçºèŠããããåŠè
éã¯ãããVLA(Very Long Amidakuji)ãšåœåãããåæã®çµæãVLA㯠N æ¬ã®çžŠæ£ãæã€ããã€ãã®éšåã®çµã¿åããã§æ§æãããå€ãã®å Žåç¹°ãè¿ããå«ãã§ããããšãããã£ããäŸãã°ãå³ã®VLAã¯ïŒçš®é¡ã®éšåAãšBã䜿ã£ãïŒã€ã®éšåããæ§æãããŠããã ãã®VLAã®äžç«¯ã«å·Šããé çªã« 1,2,3,4,5 ãšçªå·ãã€ããããããã®çªå·ããVLAããã©ãïŒãã¿ã ããã®ãã©ãæ¹ã«ã€ããŠã¯å顿æåŸã®è£è¶³ãåç
§ããŠãã ãã)ãäžç«¯ã«ãã©ãçããå Žæã®çžŠæ£ã«ãã®çªå·ãæ¯ãããã¹ãŠã®çªå·ã«ã€ããŠãã©ãçµããåŸã§ãäžç«¯ã«æ¯ãããçªå·ãå·Šããèªããš 4,2,5,1,3 ã«... | 38,990 |
Score : 100 points Problem Statement Print the K -th element of the following sequence of length 32 : 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 Constraints 1 \leq K \leq 32 All values in input are integers. Input Input is given from Standard Input in the following... | 38,991 |
Score : 200 points Problem Statement There is an image with a height of H pixels and a width of W pixels. Each of the pixels is represented by either . or * . The character representing the pixel at the i -th row from the top and the j -th column from the left, is denoted by C_{i,j} . Extend this image vertically so th... | 38,992 |
éä¹ II n! = n à (n â 1) à (n â 2) à ... à 3 à 2 à 1 ã n ã®éä¹ãšãããŸããäŸãã°ã12 ã®éä¹ã¯ 12! = 12 à 11 à 10 à 9 à 8 à 7 à 6 à 5 à 4 à 3 à 2 à 1 = 479001600 ãšãªããæ«å°Ÿã« 0 ã 2 ã€é£ç¶ããŠäžŠãã§ããŸãã æŽæ° n ãå
¥åããŠã n! ã®æ«å°Ÿã«é£ç¶ããŠäžŠãã§ãã 0 ã®æ°ãåºåããããã°ã©ã ãäœæããŠãã ããããã ãã n 㯠20000 以äžã®æ£ã®æŽæ°ãšããŸãã Input è€æ°ã®ããŒã¿ãäžããããŸããåããŒã¿ã« n ( n †20000) ãïŒè¡ã«äžããããŸãã n ã 0 ã®æå
¥åã®æåŸãšããŸ... | 38,993 |
Score : 200 points Problem Statement We have N points in the two-dimensional plane. The coordinates of the i -th point are (X_i,Y_i) . Among them, we are looking for the points such that the distance from the origin is at most D . How many such points are there? We remind you that the distance between the origin and th... | 38,994 |
éäŒæ ã€ã
ã¢æã®äœæ°ã¯æã«éäŒæã建ãŠãããšã«ããŸããããã®æã§ã¯æ±è¥¿ã«äžçŽç·ã«äŒžã³ãéè·¯ã«æ²¿ã£ãŠå»ºç©ã建ãŠãããå°ç¹ã決ãŸã£ãŠããŸããæã西ã®å°ç¹ãïŒçªç®ã®å°ç¹ãšããŠãããããçééã«æ±ã«åãã£ãŠïŒçªç®ãïŒçªç®ãâŠãšå°ç¹çªå·ãäžããããŠããŸããæäººã®å®¶ãšéäŒæã建ãŠãããšãã§ããã®ã¯ããããã®å°ç¹ã ãã§ããåå®¶ã«ã¯ïŒäººä»¥äžã®æäººãäœãã§ããŸããã©ã®æäººãé£ã®å°ç¹ãŸã§ïŒåéã§ç§»åã§ããŸãã éäŒãéãã®ã«äŸ¿å©ãªããã«ãããæå»ã«äžæã«å
šãŠã®æäººãèªåã®å®¶ããéäŒæã«åãã£ããšããå
šå¡ãéãŸãã®ã«å¿
èŠãªæéãæå°ã«ãªããããªå Žæã«ãéäŒæã建ãŠãããšã«ããŸããã å®¶ã®å»ºã£ãŠããå°ç¹ã®çªå·ãäžãããããšãã«ãå
šãŠã®æäººãéäŒæã«éãŸã... | 38,995 |
Problem F Three Kingdoms of Bourdelot You are an archaeologist at the Institute for Cryptic Pedigree Charts, specialized in the study of the ancient Three Kingdoms of Bourdelot. One day, you found a number of documents on the dynasties of the Three Kingdoms of Bourdelot during excavation of an ancient ruin. Since the e... | 38,996 |
Problem J: Avant-garde Art ICPC World Finals 6æ¥ç® ãã·ã¢æ§æäž»çŸ©ãšã¯ã1910幎代åã°ã«å§ãŸã£ããœé£ã«ãããèžè¡éåã§ããã Råœã«é·ãæ»åšããŠãããã£ãŒæ°ã¯ã ãã®ãããªãã®ã«æåããã ICPC World Finalsã®ãªããŒãµã«äžã«ãé¢ãããã ã¯ãŒã«ãªãã¶ã€ã³ãäœãããšã«ããã ãã£ãŒæ°ã¯èªãïŒ ãèšå·ã¯åãšç·åã ãã§å
åã ã ç·åãããã«çŸãã亀差ãããããéèŠã§ãããã åé¡ ååšã«\(n\)åã®åº§æš\( 1, 2, âŠ, n \)ãçééã«å²ãåœãŠãã å座æšããã¯ã¡ããã©1æ¬ã®ç·åãåºãŠããã 座æš\( i \)ã®ç·åã¯ç°ãªã座æš\( a_{i} \)ã«çµã°ããŠããã... | 38,997 |
Score : 900 points Problem Statement Takahashi has an ability to generate a tree using a permutation (p_1,p_2,...,p_n) of (1,2,...,n) , in the following process: First, prepare Vertex 1 , Vertex 2 , ..., Vertex N . For each i=1,2,...,n , perform the following operation: If p_i = 1 , do nothing. If p_i \neq 1 , let j' b... | 38,998 |
Problem G: Repeated Subsequences You are a treasure hunter traveling around the world. Finally, youâve got an ancient text indicating the place where the treasure was hidden. The ancient text looks like a meaningless string of characters at first glance. Actually, the secret place is embedded as the longest repeated su... | 38,999 |
Score : 100 points Problem Statement There is a hotel with the following accommodation fee: X yen (the currency of Japan) per night, for the first K nights Y yen per night, for the (K+1) -th and subsequent nights Tak is staying at this hotel for N consecutive nights. Find his total accommodation fee. Constraints 1 \leq... | 39,000 |
Problem D: Life Line Let's play a new board game ``Life Line''. The number of the players is greater than 1 and less than 10. In this game, the board is a regular triangle in which many small regular triangles are arranged (See Figure l). The edges of each small triangle are of the same length. Figure 1: The board The ... | 39,001 |
Score: 100 points Problem Statement Takahashi is solving quizzes. He has easily solved all but the last one. The last quiz has three choices: 1 , 2 , and 3 . With his supernatural power, Takahashi has found out that the choices A and B are both wrong. Print the correct choice for this problem. Constraints Each of the n... | 39,002 |
Problem Statement JAG Kingdom is a strange kingdom such that its $N$ cities are connected only by one-way roads. The $N$ cities are numbered $1$ through $N$. ICPC (International Characteristic Product Corporation) transports its products from the factory at the city $S$ to the storehouse at the city $T$ in JAG Kingdom ... | 39,003 |
Score : 300 points Problem Statement You are given two non-negative integers L and R . We will choose two integers i and j such that L \leq i < j \leq R . Find the minimum possible value of (i \times j) \mbox{ mod } 2019 . Constraints All values in input are integers. 0 \leq L < R \leq 2 \times 10^9 Input Input is give... | 39,004 |
Score : 1400 points Problem Statement There are N turkeys. We number them from 1 through N . M men will visit here one by one. The i -th man to visit will take the following action: If both turkeys x_i and y_i are alive: selects one of them with equal probability, then eats it. If either turkey x_i or y_i is alive (but... | 39,005 |
Problem H: Nearest Station ããããããé»è»ã®ãã±ããã n ææã£ãŠãã. ãã±ããã«ã¯ãããã0 ãã n â 1 ãŸã§ã®çªå·ãã€ããŠããŠ, k çªã®ãã±ããã䜿ããš, p â
a k + q â
b k é§
é²ãããšãã§ãã. ãããã¯ä»ããé§
ãã m é§
é²ãã é§
ã«ãããã³ãžã³é£ã¹æŸé¡ã®åºã«è¡ãããã, ãªãã¹ãæ©ãè·é¢ãçãããã. é§
ã¯çééã«äžŠãã§ãã. ãã±ãããé»è»ã®äžãç·ã§é²ãããšã®ã¿ã«çšãããšã, ãããã¯æå°äœé§
åã®åŸæ©ã§åºã«çããã. Input 1 †n , m , a , b , p , q †1 000 000 000 000 (æŽæ°) Output ãããã¯æå°äœé§
åã®åŸæ©... | 39,006 |
倧工ã®è€çŸ ããæ¥ãæ®¿æ§ã¯äžäººã®å€§å·¥ã«ããå°é¢šãå°éãæ¥ããšãã«çºäººãé¿é£ã§ãããé äžã§å€§ããªå»ºç©ãé ããªãããããšåœããŸããããããããã®é äžã§å€§ããªå»ºç©ã宿ãããã«ã¯ã倧ããªå€ªãæ±ãå¿
èŠã§ããçºã«ãããªå€§ããªæ±ã¯ãããŸãããããã§ã倧工ã¯é ãã®å±±éãŸã§å€§ããªæ±ã調éãã«è¡ãããšã«ãªããŸããïŒå€§å·¥ã¯çºããéå±±ã«è¡ã£ãŠãçºã«æ»ã£ãŠããå¿
èŠããããŸãïŒã 倧工ã®è€çŸã¯ã殿æ§ããåãåã£ããéããæ±ã®ä»£éãšäº€éè²»ãå·®ãåŒããäœãã§ããäžã®å°å³ã®ããã«ãå±±éã«è¡ãã«ã¯ããããããªçºãéãããããã®è¡éãããã2ã€ã®çºãã€ãªãè¡éã¯ãããã亀éè²»ãéããŸãã倧工ã®è€çŸãæå€§ã«ããã«ã¯ã©ã®ããã«è¡éããã©ã調éããã°ããã§ãããããæå€§ãšãª... | 39,007 |
C: Cyclic String å顿 æåå $S = s_0 s_1 \ldots s_{n-1}$ ãæåå $T = t_0 t_1 \ldots t_{m-1}$ ã«å·¡åçã«å«ãŸãããšã¯ã ãã $k$ ããã£ãŠãå
šãŠã® $i$ $(0 \le i \lt n)$ ã«ã€ã㊠$s_i = t_{(i+k) \bmod m}$ ãæç«ããäºãèšããŸãã $N$ åã®æåå $S_1, \dots, S_N$ ãäžããããŸãã 以äžã®æ¡ä»¶ãæºããæååã®éå $\{C_1, \dots, C_k\}$ ãèããŸãïŒ$k$ ã¯ä»»æïŒ: å$i$ $(1 \leq i \leq N)$ã«ã€ããŠã$S_i$ã¯å°ãªããšã1ã€ã®$C_... | 39,008 |
å±å° (Food stalls) åé¡ JOI åã®äœã IOI åžã¯ïŒååæ¹åã« H åºç»ïŒæ±è¥¿æ¹åã« W åºç»ã®é·æ¹åœ¢ã®åœ¢ãããŠããïŒH à W åã®åºç»ã«åºåãããŠããïŒåãã i çªç®ïŒè¥¿ãã j çªç®ã®åºç»ã (i, j) ãšè¡šãïŒçŸåšïŒIOI åžã§éå¬ãããŠããåœéçãªããã°ã©ãã³ã°ã³ã³ãã¹ããèšå¿µããŠïŒå€§èŠæš¡ãªãç¥ããéå¬ãããŠããïŒããã€ãã®åºç»ã«ã¯å±å°ãåºãŠããïŒããããéãçš®é¡ã®ãèåã販売ããŠããïŒ åºç» (1, 1), åºç» (H, W) ããã³ãããã«æ±è¥¿ååã«é£æ¥ããåºç»ã«ã¯å±å°ã¯ãªãïŒ JOI åã¯åºç» (1, 1) ããåºç» (H, W) ã«ç§»åããïŒç§»åæéãçãããããïŒJOI åã¯æ±ãããã¯åã®... | 39,009 |
Problem E: Mickle's Beam Major Mickle is commanded to protect a secret base which is being attacked by N tanks. Mickle has an ultimate laser rifle called Mickle's beam . Any object shot by this beam will be immediately destroyed, and there is no way for protection. Furthermore, the beam keeps going through even after d... | 39,010 |
Score : 200 points Problem Statement You have a digit sequence S of length 4 . You are wondering which of the following formats S is in: YYMM format: the last two digits of the year and the two-digit representation of the month (example: 01 for January), concatenated in this order MMYY format: the two-digit representat... | 39,011 |
Payroll PCK company has $N$ salaried staff and they have specific ID numbers that run from $0$ to $N-1$. The company provides $N$ types of work that are also identified by ID numbers from $0$ to $N-1$. The time required to complete work $j$ is $t_j$. To get each of the working staff to learn as many types of work as po... | 39,013 |
Score : 800 points Problem Statement Snuke has a string x of length N . Initially, every character in x is 0 . Snuke can do the following two operations any number of times in any order: Choose A consecutive characters in x and replace each of them with 0 . Choose B consecutive characters in x and replace each of them ... | 39,014 |
Score : 1400 points Problem Statement In the country there are N cities numbered 1 through N , which are connected by N-1 bidirectional roads. In terms of graph theory, there is a unique simple path connecting every pair of cities. That is, the N cities form a tree. Besides, if we view city 1 as the root of this tree, ... | 39,015 |
ç«¶ã (Auction) square1001åã¯ãšããç«¶ããéè³ããŠããŸããã ç«¶ããšã¯ãè²·ãæã倿°ã§åæ°ã«å¶éããããšããé«å€ãä»ãããã®ã«è²·ãæš©å©ãäžããä»çµã¿ã®ååŒã§ãã (æ°æè§£åœèªèŸå
žç¬¬äžçãã) ããã§ã®ç«¶ãã®ã«ãŒã«ã¯ä»¥äžã®éãã§ãã 1. 次㮠2. ïœ 6. ãåç©ãå°œãããŸã§ç¹°ãè¿ã 2. æ°ããªåç©ãåºãã客ã«èŠãã 3. 客ã®ãã¡ã® 1 人ã奜ããªå€æ®µãåç©ã«ã€ãã 4. 客ã®ãã¡ã® 1 人ãçŸåšåç©ã«ã€ããŠãã倿®µ ããã é«ã倿®µãã€ãã 5. 4. ã®è¡çºãè¡ã客ãããªããªããŸã§ 4. ãç¹°ãè¿ã 6. åç©ã«äžçªé«ã倿®µãä»ãã客ããããèœæãã square1001åã¯ãã®ç«¶ãäžã«åç©ã«ã€ãããã... | 39,016 |
Score : 600 points Problem Statement Given is an integer sequence A_1, ..., A_N of length N . We will choose exactly \left\lfloor \frac{N}{2} \right\rfloor elements from this sequence so that no two adjacent elements are chosen. Find the maximum possible sum of the chosen elements. Here \lfloor x \rfloor denotes the gr... | 39,017 |
A - é¿åœã®åŒåž Problem Statement æã¯é²ãã§ 2060 幎ïŒå
±ã« 70 æ³ãè¿ããåç°ãããšåŸè€ããã¯é·ãä»ãåãã®å人ã§ããïŒå€§åп代ã«ACM-ICPCã§å
±ã«æŠã£ã仲éã§ãããïŒ äºäººã¯ä»ã§ãããäžç·ã«ãè¶ã飲ã¿ã€ã€ïŒç«¶æããã°ã©ãã³ã°ã®è©±ã§çãäžãã£ãŠããïŒ äºäººã§äžç·ã«ãè¶ã飲ãæïŒåç°ããã 1 å A ãšèšããšïŒãã®çºèšã®åŸã«åŸè€ãããã¡ããã© 1 å Un ãšè¿äºãããç¿æ
£ããã€ã®ãŸã«ãåºæ¥ãïŒ ãããæè¿åŸè€ããã¯ç©å¿ããåéããããããšãå€ãïŒåç°ããã A ãšèšã£ãŠãïŒåŸè€ããã¯ããŸã« Un ã®è¿äºãå¿ãããïŒäœèšã«è¿äºããããããïŒ ã€ããã®éãåç°ãããšåŸè€ããã¯ãè¶ã飲ã¿ãªããïŒäºäººã®ã... | 39,018 |
Score : 200 points Problem Statement You are given an image A composed of N rows and N columns of pixels, and a template image B composed of M rows and M columns of pixels. A pixel is the smallest element of an image, and in this problem it is a square of size 1Ã1 . Also, the given images are binary images, and the col... | 39,019 |
Range Sum Query Write a program which manipulates a sequence A = { a 1 , a 2 , . . . , a n } with the following operations: add(i, x) : add x to a i . getSum(s, t) : print the sum of a s , a s+1 ,...,a t . Note that the initial values of a i ( i = 1, 2, . . . , n ) are 0. Input n q com 1 x 1 y 1 com 2 x 2 y 2 ... com q... | 39,020 |
Wall Breaker KND Problem KNDåã¯äŒæŽ¥å€§åŠã«åšç±ããåŠçããã°ã©ãã§ããã圌ã¯ããã°ã©ããŒã§ãããšãšãã«æ Œéå®¶ã§ãããããããªåœŒã¯çå
ã§ããããšã§ç¥ãããŠãããç¹ã«çã¯ãªãŒã ã倧奜ç©ã§ãããçã¯ãªãŒã ãé£ã¹ãã°ã³ã³ã¯ãªãŒãã®å£ãæ°åå£ãããšãã§ããããã«ãªãã»ã©ã§ããããã®ãã¯ãŒã«èå³ããã£ã圌ã®é£äººã¯ãçã¯ãªãŒã ãã£ã·ãã®æ°ååããããã¯ãªãŒã ããçšããŠå®éšãããããšã«ããã ãã®å®éšã¯ããŸãè¿·è·¯ãçšæãKNDåãããã«éã蟌ããããã®è¿·è·¯ã«ã¯éµãããã£ãæãæãéããããã®éµãããã¯ãªãŒã ããããã1ã€ãã€å¥ã®ãã¹ã«ååšããã圌ã¯èœã¡ãŠããéµãæŸããæã®éµãéããããšã§å€ã«è±åºããããšãå¯èœã§ãããéµã... | 39,021 |
E: åè¡¡ãªèŸºåé€ (Balanced Edge Deletion) åé¡ N é ç¹ M 蟺ã®éã¿ä»ãåçŽç¡åã°ã©ã G ãäžããããã é ç¹ã«ã¯ 1 ãã N ã 蟺ã«ã¯ 1 ãã M ã®çªå·ãã€ããããŠããã i çªç®ã®èŸºã¯é ç¹ u_i ãš v_i ãçµãã§ããããã®ã³ã¹ã㯠w_i ã§ããã ãã®ã°ã©ãã«å¯ŸããŠã以äžã®æäœã 1 床ã ãè¡ãããšãèããã G ã®èŸºéåãã蟺ã 1 ã€éžæãããã®èŸºãåé€ããã äžã®æäœã«ãã£ãŠã°ã©ããåå²ãããããšãããã®ã§ãæäœåŸã®ã°ã©ãã A , B ãšè¡šèšããããšãšããã(åå²ãããªãå Žåã B ã¯ç©ºã°ã©ãã§ãããšããã) W(X) ãã°ã©ã X å
ã«ãã蟺ã®ã³ã¹ãã®ç·å (ã°ã©ãã«èŸºã... | 39,022 |
Score : 300 points Problem Statement There are N cubes stacked vertically on a desk. You are given a string S of length N . The color of the i -th cube from the bottom is red if the i -th character in S is 0 , and blue if that character is 1 . You can perform the following operation any number of times: choose a red cu... | 39,023 |
Bridge Construction Planning There is a city consisting of many small islands, and the citizens live in these islands. Citizens feel inconvenience in requiring ferry rides between these islands. The city mayor decided to build bridges connecting all the islands. The city has two construction companies, A and B. The may... | 39,025 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.