task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Score : 300 points Problem Statement Takahashi made N problems for competitive programming. The problems are numbered 1 to N , and the difficulty of Problem i is represented as an integer d_i (the higher, the harder). He is dividing the problems into two categories by choosing an integer K , as follows: A problem with ... | 37,960 |
Score: 300 points Problem Statement We have a canvas divided into a grid with H rows and W columns. The square at the i -th row from the top and the j -th column from the left is represented as (i, j) . Initially, all the squares are white. square1001 wants to draw a picture with black paint. His specific objective is ... | 37,961 |
Score : 300 points Problem Statement 2N players are running a competitive table tennis training on N tables numbered from 1 to N . The training consists of rounds . In each round, the players form N pairs, one pair per table. In each pair, competitors play a match against each other. As a result, one of them wins and t... | 37,962 |
Score : 100 points Problem Statement Takahashi is meeting up with Aoki. They have planned to meet at a place that is D meters away from Takahashi's house in T minutes from now. Takahashi will leave his house now and go straight to the place at a speed of S meters per minute. Will he arrive in time? Constraints 1 \leq D... | 37,964 |
Problem J: Cluster Network Problem ãã€ã
倧åŠã«ããå€§èŠæš¡ã¯ã©ã¹ã¿ â åã¹ãŒããŒã³ã³ãã¥ãŒã¿ïŒéç§°ãSAKURAãïŒã®ã¯ã©ã¹ã¿ã¯ã$N$å°ã®ã³ã³ãã¥ãŒã¿ïŒããŒãïŒãš$M$æ¬ã®çžäºã«éä¿¡ãå¯èœãªç©ççéä¿¡è·¯ã§æ§æãããããŸããåããŒãã«ã¯ãããã1ãã$N$ãŸã§ã®èå¥çªå·ãå²ãåœãŠãããŠããã ãã®åºŠSAKURAã®å©çšã倧åŠé¢ä¿è
ã ãã§ãªããçå
ã®äŒæ¥ã«ãèªããããšãšãªã£ããããã«äŒŽããSAKURAãæ§æããåããŒããç¹æ€ããå¿
èŠããããããããSAKURAã®å©çšã¹ã±ãžã¥ãŒã«ã¯æ°ã¶æå
ãŸã§åãŸã£ãŠããã®ã§ãç¹æ€äžãã·ã¹ãã å
šäœã忢ãããããšã¯ã§ããªããããã§ãããŒãã1æ¥ã«1å°ãã€é çªã«ç¹æ€ããã... | 37,965 |
Problem I: Shuffle 2 Problem $n$æã®ã«ãŒããããªãæããããäžãã$i$çªç®ã®ã«ãŒãã«ã¯$i$ãæžãããŠããããã®æã«å¯ŸããŠã以äžã®ããã«å®çŸ©ãããã·ã£ããã«ã$q$åè¡ãã æãäžããèŠããšãã奿°çªç®ã®ã«ãŒããäžã«éããŠãã£ãŠäœãããæ$x$ãå¶æ°çªç®ã®ã«ãŒããäžã«éããŠãã£ãŠäœãããæ$y$ãèããããã®åŸä»¥äžã®$2$ã€ã®ãã¡ã奜ããªæäœãè¡ãã æäœ $0$ïŒ æ$x$ã®äžã«æ$y$ãã®ããŠ$1$ã€ã®æã«ããã æäœ $1$ïŒ æ$y$ã®äžã«æ$x$ãã®ããŠ$1$ã€ã®æã«ããã äŸãã°ã$6$æã®ã«ãŒããããªãæ(äžãã123456)ã«å¯ŸããŠ$1$åã®ã·ã£ããã«ãè¡ãããšãèãããšããæäœ$0... | 37,966 |
æé«ã®ãã¶ (Best Pizza) åé¡ K çäºé·ã¯ïŒJOI åžã®äžå¿éšã«ãã JOI ãã¶åºã®åžžé£å®¢ã§ããïŒåœŒã¯ããäºæ
ã«ããïŒä»æããç¯çŽç掻ãå§ããããšã«ããïŒããã§åœŒã¯ïŒJOI ãã¶åºã§æ³šæã§ãããã¶ã®ãã¡ïŒ1 ãã«ãããã®ã«ããªãŒãæå€§ãšãªããããªãã¶ã泚æããããšæã£ãïŒãã®ãããªãã¶ããæé«ã®ãã¶ããšåŒã¶ããšã«ãããïŒãæé«ã®ãã¶ã㯠1 çš®é¡ãšã¯éããªãïŒ JOI ãã¶ã§ã¯ N çš®é¡ã®ãããã³ã°ããäœçš®é¡ããèªç±ã«éžã³ïŒåºæ¬ã®çå°ã®äžã«èŒãããã®ã泚æããããšãã§ããïŒåçš®ã®ãããã³ã°ã 2 ã€ä»¥äžèŒããããšã¯ã§ããªãïŒçå°ã«ãããã³ã°ã 1 çš®é¡ãèŒããªããã¶ã泚æã§ããïŒçå°ã®å€æ®µã¯ A ãã«ã§ããïŒãããã³... | 37,967 |
Score: 200 points Problem Statement Takahashi, who works at DISCO, is standing before an iron bar. The bar has N-1 notches, which divide the bar into N sections. The i -th section from the left has a length of A_i millimeters. Takahashi wanted to choose a notch and cut the bar at that point into two parts with the same... | 37,968 |
Problem F: Traveling Cube On a small planet named Bandai, a landing party of the starship Tadamigawa discovered colorful cubes traveling on flat areas of the planet surface, which the landing party named beds. A cube appears at a certain position on a bed, travels on the bed for a while, and then disappears. After a lo... | 37,969 |
Score : 500 points Problem Statement You are given a connected undirected simple graph, which has 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 . Your task is to find a path that satisfies the following conditions: The path ... | 37,970 |
Problem I: Tatami A tatami mat, a Japanese traditional floor cover, has a rectangular form with aspect ratio 1:2. When spreading tatami mats on a floor, it is prohibited to make a cross with the border of the tatami mats, because it is believed to bring bad luck. Your task is to write a program that reports how many po... | 37,971 |
Score : 200 points Problem Statement Let S(n) denote the sum of the digits in the decimal notation of n . For example, S(101) = 1 + 0 + 1 = 2 . Given an integer N , determine if S(N) divides N . Constraints 1 \leq N \leq 10^9 Input Input is given from Standard Input in the following format: N Output If S(N) divides N ,... | 37,972 |
Score: 300 points Problem Statement Takahashi has decided to hold fastest-finger-fast quiz games. Kizahashi, who is in charge of making the scoreboard, is struggling to write the program that manages the players' scores in a game, which proceeds as follows. A game is played by N players, numbered 1 to N . At the beginn... | 37,973 |
Score : 700 points Problem Statement We have a tree with N vertices. Vertex 1 is the root of the tree, and the parent of Vertex i ( 2 \leq i \leq N ) is Vertex P_i . To each vertex in the tree, Snuke will allocate a color, either black or white, and a non-negative integer weight. Snuke has a favorite integer sequence, ... | 37,974 |
Problem C: Towns along a Highway There are several towns on a highway. The highway has no forks. Given the distances between the neighboring towns, we can calculate all distances from any town to others. For example, given five towns (A, B, C, D and E) and the distances between neighboring towns like in Figure C.1, we ... | 37,975 |
Problem E Cost Performance Flow Yayoi is a professional of money saving. Yayoi does not select items just because they are cheap; her motto is "cost performance". This is one of the reasons why she is good at cooking with bean sprouts. Due to her saving skill, Yayoi often receives requests to save various costs. This t... | 37,976 |
Score : 400 points Problem Statement You are given positive integers N and M . How many sequences a of length N consisting of positive integers satisfy a_1 \times a_2 \times ... \times a_N = M ? Find the count modulo 10^9+7 . Here, two sequences a' and a'' are considered different when there exists some i such that a_i... | 37,977 |
Problem I. Sum of QQ You received a card with an integer $S$ and a multiplication table of infinite size. All the elements in the table are integers, and an integer at the $i$-th row from the top and the $j$-th column from the left is $A_{i,j} = i \times j$ ($i,j \geq 1$). The table has infinite size, i.e., the number ... | 37,978 |
ãŽãŒã«ããããäºæ³ ãŽãŒã«ããããäºæ³ãšã¯ã6 以äžã®ã©ããªå¶æ°ãã2 ã€ã®çŽ æ° (*1) ã®åãšããŠè¡šããããšãã§ããããšãããã®ã§ãã ããšãã°ãå¶æ°ã® 12 㯠12 = 5 + 7 ã18 㯠18 = 5 + 13 = 7 + 11 ãªã©ãšè¡šãããšãã§ããŸãã åã 134 ãšãªã 2 ã€ã®çŽ æ°ã®çµã¿åãããã¹ãŠæžãåºããšã以äžã®éããšãªããŸãã 134 = 3+131 = 7+127 = 31+103 = 37+97 = 61+73 = 67+67 = 131+3 = 127+7 = 103+31 = 97+37 = 73+61 äžããããæ°ã倧ãããªããšããããã§ãçŽ æ°ã®çµã¿åããèŠã€ãããããªæ°ãããŸããããããçŸä»£... | 37,979 |
Lexicographical Comparison Compare given two sequence $A = \{a_0, a_1, ..., a_{n-1}\}$ and $B = \{b_0, b_1, ..., b_{m-1}$ lexicographically. Input The input is given in the following format. $n$ $a_0 \; a_1, ..., \; a_{n-1}$ $m$ $b_0 \; b_1, ..., \; b_{m-1}$ The number of elements in $A$ and its elements $a_i$ are give... | 37,980 |
Princess, a Cryptanalyst ãå§«æ§ã®æå·è§£èª English text is not available in this practice contest. ããè²§ä¹ãªåœã®ããŠãã°ã§åæ¢ãªãå§«æ§ã¯ïŒãå¿ã³ã§åºãããçºã§ããæ¥æ¬èªã§æžããã倿æžãæã«å
¥ããïŒãå§«æ§ã¯æ¥æ¬èªãã§ããããïŒãã£ãããã®å€ææžãèªãã§ã¿ãïŒãããšïŒé©ãã¹ãäºãåãã£ãïŒãã®å€ææžã¯ïŒå€ã®ç§å®ã®åšåŠã瀺ããŠããã®ã§ããïŒãšãããïŒç§å®ã®åšåŠã¯æå·ã«ãªã£ãŠããïŒå®¹æã«ã¯åãããªãããã«ãªã£ãŠããïŒããã§ãå§«æ§ã¯ïŒåŸè
ã§ããããªãã«æå·ã®è§£èªãæäŒãããã«åœä»€ãäžããïŒ ããªãã¯ãå§«æ§ãå©ããããæŒå€ãåãã調æ»ãè¡ã£ãïŒãã®çµæïŒShor... | 37,982 |
The Enemy of My Enemy is My Friend æµã®æµã¯å³æ¹ English text is not available in this practice contest. æã¯ XXXX å¹ŽãæŠä¹±ã®äžã§ããã åå°ãè³æºãå·¡ã£ãŠãé£ãåã£ãåœå士ã®è¡çªããããããã§èµ·ãããäžã®äžã®å
è¡ãã¯éåžžã«äžéæã§ãã£ãããããªäžãšããåœããæ§ã
ãªåœãšè»äºåçãçµãã§ãã®ä¹±äžãçãå»¶ã³ãããšèãããè»äºåçã¯æ¬¡ã®æ¡ä»¶ãã¿ããããã«è¡ãããšãåºæ¥ãã èªåœã®é£åœãšã¯åçãçµã¶ããšã¯åºæ¥ãªãã åçãããåœã®é£åœãšã¯åçãçµã¶ããšã¯åºæ¥ãªãã ãã ããåœããšã«ãã®è»äºçãªåŒ·ãã¯ç°ãªã£ãŠãããè»äºçã«åŒ·ããªãè€æ°ã®åœãšåçãçµ... | 37,983 |
Reflection For given three points p1, p2, p , find the reflection point x of p onto p1p2 . Input x p1 y p1 x p2 y p2 q x p 0 y p 0 x p 1 y p 1 ... x p qâ1 y p qâ1 In the first line, integer coordinates of p1 and p2 are given. Then, q queries are given for integer coordinates of p . Output For each query, print the coor... | 37,984 |
And Then, How Many Are There? To Mr. Solitarius, who is a famous solo play game creator, a new idea occurs like every day. His new game requires discs of various colors and sizes. To start with, all the discs are randomly scattered around the center of a table. During the play, you can remove a pair of discs of the sam... | 37,985 |
Score : 500 points Problem Statement Snuke received a triangle as a birthday present. The coordinates of the three vertices were (x_1, y_1) , (x_2, y_2) , and (x_3, y_3) . He wants to draw two circles with the same radius inside the triangle such that the two circles do not overlap (but they may touch). Compute the max... | 37,986 |
F - åå°çžç¶ Problem Statement ãã $N$ 人ã®å
åŒã¯èŠªã®éºç£çžç¶ã®è©±ãåããããŠããïŒ åœŒãã®èŠªã®æ®ããè«å€§ãªéºç£ã®äžã«ã¯åºå€§ãªåå°ãå«ãŸããŠããïŒ ãã®åå°ã¯ååã« $H$ km, æ±è¥¿ã« $W$ km ã«åºããé·æ¹åœ¢ã®åœ¢ãããŠããïŒ ãã®åå°ã¯ 1 km åæ¹ã®åºç»åäœã§ç®¡çãããŠããïŒ åå°ã®å端ãã $i$ ã $i+1$ km ãã€è¥¿ç«¯ãã $j$ ã $j+1$ km ã®ç¯å²ã«ãã 1 km åæ¹ã®åºç»ãåºç» $(i, j)$ ãšåŒã¶ïŒ ïŒ$i$, $j$ 㯠$0 \leq i < H$, $0 \leq j < W$ ãæºããæŽæ°ã§ããïŒïŒ åå°ã®äŸ¡æ Œã¯åºç»ããšã«æ±ºãŸã£ãŠããïŒåºç» $(i,... | 37,987 |
ããã ãããã仿æ«ã«ãã¯ãã¶ãïŒããæã¡äžããããŸããïŒå¹Žåã«ãã¯ãã¶ãããåž°ã£ãŠãããšãã¯ãæ¥æ¬äžãçãäžãã£ãã®ãèŠããŠãã人ãå€ããšæããŸããïŒå¹Žåã«ã¯ãããããããæã¡äžããããæã®åšããåããªããããããã®é®®æãªç»åãå°çã«éã£ãŠãããŸããã äžã®å³ã¯ãå°çãåç¹ãšãã空é座æšïŒz軞ã¯çŽé¢ããåçŽã«äžããäžã«åããŠãããã®ãšããŸãïŒã«ãæã®è»éãšããã€ãã®æã®äœçœ®ãæã®åšããåããããã®è»éãæãããã®ã§ããæã®è»éã¯ãx軞ãšy軞ãéãå¹³é¢äžã«ãããåç¹ãäžå¿ãšããåãšããŸããæã®åšããåããããã®è»éã¯ãx軞ãšz軞ãéãå¹³é¢ã«å¹³è¡ãªå¹³é¢äžã«ããåãšãããã®äžå¿ã¯æã®äžå¿ãšäžèŽããŸããæã¯ããã®è»éã«æ²¿ã£ãŠæãããç¢å°... | 37,988 |
Problem I: A Piece of Cake In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty. However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredibly awful taste of its cakes, he never improved i... | 37,989 |
D: æ¥çŒã - Suntan - ç©èª ãããã«ããã¯è¥ã¶æŸé«æ ¡ã®ããã°ã©ãã³ã°ã³ã³ãã¹ãéšãéç§°ã·ãããéšã«æå±ãã2幎çã§ããã倩䜿ã®ããã«ããããã ãããã«ããã¯ä»å¹Žã®å€ãã§ã¹ã«åå ããäºå®ãªã®ã§ãèŽãã«è¡ããã³ãã®ã¹ã±ãžã¥ãŒã«ãç«ãŠãã ããã§å¿é
ãªã®ãæ¥çŒãã ã ã©ã€ãã¯ãã¹ãŠéå€ã§è¡ããããããããã«ããã¯æ¥çŒãããããäœè³ªãªã®ã§é·æééå€ã§çŽ«å€ç·ã济ã³ããããšããæ¥çŒãããŠããŸãã ã©ã€ãããªãéã¯å±å
ã«é¿é£ããããšã§ã§ããã ã玫å€ç·ãåé¿ããã€ããã ããã©ã€ãäžã¯ã©ãããŠãæ¥ã«åœãã£ãŠããŸãã ããã§ãããã«ããã¯æ¥çŒãæ¢ããå¡ãããšã§çŽ«å€ç·å¯Ÿçãããããšãèããã åé¡ æ¥çŒãæ¢ããå¡ããšãå¡ã£ãæéãã T ... | 37,990 |
å¡ãã€ã¶ãã²ãŒã æã§ç»é¢ã«ã¿ããããŠæäœããããšã®ã§ããã¿ãã¬ããã€ã³ã¿ãŒãã§ãŒã¹ã®æè¡ã¯ãã²ãŒã ã®åéã§ãå¿çšãããæ°ããæäœæãæã€æ§ã
ãªçš®é¡ã®ã²ãŒã ãäœãããŠããŸããçŸåšã瀟ãéçºããŠããã²ãŒã ããã®äžã€ã§ãã ãã®ãœãããŠã§ã¢ïŒã²ãŒã ïŒã®èŠä»¶ã¯ä»¥äžã®éãã§ãã ç»é¢ã«ã¯ X åà Y è¡ã®2次å
ã°ãªããããããŸãã ã°ãªããã®ã»ã«ã¯èµ€(R)ãç·(G)ãè¶(B)ã®3è²ã®ããããã§å¡ãããŠããŸãã ã»ã«ã®è²ã倿Žãããã¿ã³RãGãBãããããã®ãã¿ã³ãæŒäžããããšäžçªå·Šäž(0,0)ã®ã»ã«ããã®è²ã«å€æŽãããŸãã äžçªå·Šäžã®ã»ã«ã®è²ã倿Žããããšããã®ã»ã«ã®å
ã®è²ãšåãè²ã«å¡ããã飿¥ãããã¹ãŠã®ã»ã«ãæå®ãããè²ã«å€ãããŸ... | 37,991 |
Score : 200 points Problem Statement Raccoon is fighting with a monster. The health of the monster is H . Raccoon can use N kinds of special moves. Using the i -th move decreases the monster's health by A_i . There is no other way to decrease the monster's health. Raccoon wins when the monster's health becomes 0 or bel... | 37,992 |
Score : 100 points Problem Statement There are N persons, conveniently numbered 1 through N . They will take 3y3s Challenge for N-1 seconds. During the challenge, each person must look at each of the N-1 other persons for 1 seconds, in some order. If any two persons look at each other during the challenge, the challeng... | 37,993 |
Problem D: Smartphone Game Problem 人æ°ã®ã¹ããã©ã²ãŒã ã®äžæ©èœãå®è£
ããŠã¿ãããã²ãŒã ã¯ä»¥äžã®ä»æ§ã«åºã¥ãã 5*5ã®ãã¹ã«ã5çš®é¡ã®ãããã¯ãèšçœ®ãããŠããã ããããã®çš®é¡ã®ãããã¯ã«ã¯åŸç¹ãèšå®ãããŠããã åŸç¹ã«ã¯ããããã¯ã®åŸç¹ã®ä»ã«ãããŒãã¹åŸç¹ãèšå®ãããŠãããæåã®ããŒãã¹åŸç¹ã¯1ã§ããã ãããã¯ãä»»æã«1ã€ã ãæ±ºããŠãæå€§ã§ n åãŸã§äžäžå·Šå³ã«ç§»åã§ãããç§»åå
ã®ãããã¯ã¯ç§»åå
ã®ãããã¯ã®ãã£ãå Žæã«ç§»åãããã€ãŸãã飿¥ãããããã¯ã亀æããäºã«ãªãã ç§»åããåŸãåãçš®é¡ã®ãããã¯ã瞊3å以äžåã¯æšª3å以äžã«äžŠãã å Žåã䞊ãã ãããã¯ã¯å
šãŠæ¶ããã æ¶ããã¹ããããã¯ã... | 37,994 |
Problem F: ïŒïŒæ³ã®åçèšç» ããæ¥ã®å€æ¹ããã€ãã®ããã«ããªããå±
éã§ãã¬ããèŠãŠãããšãå°åŠïŒå¹Žçã®åйããçžè«ãæã¡ ãããããã話ãèããŠã¿ããšã仿¥åŠæ ¡ã§åºãããç®æ°ã®åé¡ãé£ãããŠçè§£ã§ããªãã£ãã®ã§ã ããªãã«è§£ãæ¹ãæããŠã»ããã®ã ãšããã åŠ¹ãæ©ãŸããŠããåé¡ã¯ããéãç¢ç€ç®ç¶ã«éã£ãŠããè¡ã«ãããŠãå®¶(0, 0) ããåŠæ ¡( N , M ) ãŸã§æçè·é¢ã§é²ãæ¹æ³ã¯äœéããããïŒããšãããã®ã ã£ãããã¡ãããããªãã«ãšã£ãŠã¯èµ€åã®æãã²ãããããç°¡åãªåé¡ã§ãããããã«äžã®ãããªå³ãæžããŠãå®¶(0, 0) ããé çªã«è¶³ãç®ããŠããã°è§£ãããããšæããŠãããã ãšãããããããèããŠããŸã ã効ã¯ãªã«ããäžã... | 37,995 |
Problem E : Connect r à c ã®ã°ãªãããäžããããã ã°ãªããã®ããã€ãã®ãã¹ã«ã¯1ãã8ãŸã§ã®æ°åãæžãããŠããã æ°åãæžãããŠãããã¹ãšä»ã®æ°åãæžãããŠãããã¹ãç·ã§çµã¶å¿
èŠãããã æ°åãæžãããŠãããã¹ã«ã€ããŠããã®ãã¹ã«æžãããŠããæ¬æ°ã ããä»ã®ãã¹ãšã®éã«ç·ãçµã¶å¿
èŠãããã ãã ããç·ãçµã¹ãã®ã¯äžäžå·Šå³æ¹åã ãã§ãäžã€ã®æ¹åã«ã€ããŠãæå€§ïŒæ¬ãŸã§ã§ããã ä»ã®æ°åãè·šãã§ç·ã§çµã¶ããšã¯ã§ããªãã ãŸããæ¬¡ã®ããã«äº€å·®ããŠããŸãçµã³æ¹ãããããšã¯ã§ããªãã ã°ãªãããå
¥åãšããŠäžããããã®ã§ãæ°åãæžãããŠãããã¹å
šãŠãæ£ããçµã¶æ¹æ³ããäœéãããã®ããæ°ããŠæ¬²ããã Input å
¥åã¯ä»¥äž... | 37,997 |
Problem Statement You are given a rectangular board divided into square cells. The number of rows and columns in this board are $3$ and $3 M + 1$, respectively, where $M$ is a positive integer. The rows are numbered $1$ through $3$ from top to bottom, and the columns are numbered $1$ through $3 M + 1$ from left to righ... | 37,998 |
Score : 400 points Problem Statement Takahashi has a maze, which is a grid of H \times W squares with H horizontal rows and W vertical columns. The square at the i -th row from the top and the j -th column is a "wall" square if S_{ij} is # , and a "road" square if S_{ij} is . . From a road square, you can move to a hor... | 38,000 |
Score : 100 points Problem Statement Based on some criterion, Snuke divided the integers from 1 through 12 into three groups as shown in the figure below. Given two integers x and y ( 1 †x < y †12 ), determine whether they belong to the same group. Constraints x and y are integers. 1 †x < y †12 Input Input is given... | 38,001 |
æŽæ°ã®å II 0 ãã 100 ã®æ°åããç°ãªã n åã®æ°ãåãåºããŠåèšã s ãšãªãçµã¿åããã®æ°ãåºåããããã°ã©ã ãäœæããŠãã ããã n åã®æ°ã¯ãã®ãã® 0 ãã 100 ãŸã§ãšããïŒã€ã®çµã¿åããã«åãæ°åã¯äœ¿ããŸãããããšãã°ã n ã 3 ã§ s ã6 ã®ãšãã3 åã®æ°åã®åèšã 6 ã«ãªãçµã¿åããã¯ã 1 + 2 + 3 = 6 0 + 1 + 5 = 6 0 + 2 + 4 = 6 ã® 3 éããšãªããŸãã Input è€æ°ã®ããŒã¿ã»ãããäžããããŸããåããŒã¿ã»ããã« n ( 1 †n †9 ) ãš s ( 0 †s †1000 ) ãïŒã€ã®ã¹ããŒã¹ã§åºåãããŠïŒè¡ã«äžããããŸãã n ãš s... | 38,002 |
Score : 500 points Problem Statement Let us denote by f(x, m) the remainder of the Euclidean division of x by m . Let A be the sequence that is defined by the initial value A_1=X and the recurrence relation A_{n+1} = f(A_n^2, M) . Find \displaystyle{\sum_{i=1}^N A_i} . Constraints 1 \leq N \leq 10^{10} 0 \leq X < M \le... | 38,003 |
Problem C: Factorization Problem ukuku1333ããã¯ãã£ã¡ããã¡ãããªã®ã§ã x ã®äžæ¬¡åŒã®ç©ãå±éããããå
ã®äžæ¬¡åŒãããããªããªã£ãŠããŸã£ãã x ã® n 次å€é
åŒãäžããããã®ã§ãå æ°åè§£ããŠå
ã®xã®äžæ¬¡åŒã®ç©ã®åœ¢ã«ããã x ã® n 次å€é
åŒã¯ä»¥äžã®BNFã«ãã£ãŠäžããããã <å€é
åŒ> := <é
> | <å€é
åŒ>+<é
> | <å€é
åŒ>â<é
> <é
> := x^<ææ°> | <ä¿æ°>x^<ææ°> | <ä¿æ°>x | <宿°> <ææ°> := [2-5] <ä¿æ°> := [1-9][0-9]* <宿°> := [1-9][0-9]* ææ°åã³ä¿æ°ãçç¥ãããŠããå Žåã¯1ãšã¿ãªãã I... | 38,004 |
Toggling Cases Write a program which converts uppercase/lowercase letters to lowercase/uppercase for a given string. Input A string is given in a line. Output Print the converted string in a line. Note that you do not need to convert any characters other than alphabetical letters. Constraints The length of the input st... | 38,005 |
ããåŠæ ¡ã§ä¿®åŠæ
è¡ãžè¡ãèšç»ããã.ãã®ããã«ã¢ã³ã±ãŒã調æ»ãè¡ã£ã. çåŸã¯ 1 ãã n ãŸã§ã®çåŸçªå·ãæã¡,æ
è¡åè£ã®å Žæã 1 ãã m ãŸã§ã®çªå·ã§è¡šã,è¡ãããå Žæã« â,è¡ããããªãå Žæã«Ãã®å°ãã€ããŠæåºããŠãã. ãã®ãšã, è¡ãããå Žæã®äººæ°ãå€ãé ã«,å Žæã®çªå·ãåºåããããã°ã©ã ãäœæãã.人æ°ãåããšãã¯,å Žæã®çªå·é ãšãã. å
¥åããŒã¿ ã® 1 è¡ç®ã¯çåŸã®äººæ° n ãšæ
è¡åè£ã®å Žæã®æ° m ã空çœã§åºåãã, i + 1 è¡ã«çåŸ i ã®ã¢ã³ã±ãŒãçµæã â 㯠1 ã§Ã㯠0 ã§è¡šã,空çœã§åºåããã m åã®æ°åã䞊ãã§ãã.1 †n †1000, 1 †m †100 ãšãã. å
¥åäŸïŒ ... | 38,006 |
æ¯ã®æ²Œå° ããªãã¯ã¬ãããªããŒã«ãã¬ã€ã³ã°ã²ãŒã ã§éãã§ããïŒãã®ã²ãŒã ã®ãã£ãŒã«ãã¯çžŠ 100 ãã¹ïŒæšª 100 ãã¹ã®ãã¹ç®ç¶ã§ããïŒãã®ãã£ãŒã«ãã®å·Šãã x åç®ïŒäžãã y è¡ç®ã®ãã¹ã¯ (x, y) ãšè¡šãããïŒããªããæäœãããã£ã©ã¯ã¿ãŒã¯ãã£ãŒã«ãå
ã®ããããã®ãã¹ã®äžã«ããïŒãã£ãŒã«ãå
ãäžäžå·Šå³ã« 1 ãã¹ãã€ç§»åããããšãã§ããïŒ ããªããæäœãããã£ã©ã¯ã¿ãŒã¯ã㟠(X 0 , Y 0 ) ã«ããŠïŒãããã N ç®æã®ç®çå°ãé çªã«èšªåããäºå®ã§ããïŒããããªããïŒããªãã¯ãã£ã©ã¯ã¿ãŒãæäœãããšãïŒãã£ãŒã«ãã®ãã¹ã®çš®é¡ã«æ³šæããŠãã£ã©ã¯ã¿ãŒãç§»åãããªããã°ãªããªãïŒããããã®ãã¹ã¯æ¯ã®ããæ²Œå°ãæ¯ã®ãªã... | 38,007 |
éæ¹é£ n à n ã®æ£æ¹åœ¢ã®ãã¹ç®ã®äžã«æ°åã®ïŒãã n à n ãäžã€ãã€å
¥ã£ãŠããŠã瞊ã®ã©ã®åã®ãã¹ç®ã®åããæšªã®ã©ã®åã®ãã¹ç®ã®åã察è§ç·ã®ãã¹ç®ã®åãçãããã®ãéæ¹é£ãšãããŸãã äžèŸºã®ãã¹ã®åæ°ã奿°ã®éæ¹é£ã®äœãæ¹ã«ã¯ä»¥äžã®æ¹æ³ããããŸãã äžå€®ã®ãã¹ç®ã®ã¡ããã©äžã€äžã®ãã¹ç®ã«ïŒãå
¥ããã æ¬¡ã®æ°åã峿ãäžã®ãã¹ç®ã«å
¥ããã ãã ããæ°åãå
¥ããããšãããã¹ç®ãæ£æ¹åœ¢ããã¯ã¿åºããŠããå Žåããã§ã«æ°åãåãŸã£ãŠããå Žåã¯ä»¥äžã®æ¹æ³ã«åŸã£ãŠæ°åãå
¥ãããã¹ç®ãæ¢ãã å³ã«ã¯ã¿åºããå Žåã«ã¯ãåãè¡ã®å·Šã¯ãã«ãå·Šã«ã¯ã¿åºããå Žåã«ã¯ãåãè¡ã®å³ã¯ãã«ãäžã«ã¯ã¿åºããå Žåã«ã¯ãåãåã®äžçªäžã«æ°åãå
¥ããã æ°åãå
¥ã... | 38,008 |
å±èЧäŒ(Exhibition) ããªãã¯ïŒçµµã®å±èЧäŒãéå¬ããããšããŠããïŒå±èЧäŒã§ã¯ïŒããã€ãã®çµµãé¡çžã«å
¥ãïŒå·Šããå³ã«äžåã«äžŠã¹ãŠå±ç€ºããïŒ å±èЧäŒã§å±ç€ºããåè£ãšãªãçµµã$N$ æããïŒ1 ãã$N$ ãŸã§ã®çªå·ãä»ããããŠããïŒçµµ$i$ ($1 \leq i \leq N$) ã®å€§ããã¯$S_i$ïŒäŸ¡å€ã¯$V_i$ ã§ããïŒ ãŸãïŒãããã®çµµãå
¥ããããã®é¡çžã$M$ æããïŒ1 ãã$M$ ãŸã§ã®çªå·ãä»ããããŠããïŒé¡çž$j$ ($1 \leq j \leq M$) ã®å€§ããã¯$C_j$ ã§ããïŒé¡çž$j$ ã«ã¯ïŒå€§ããã$C_j$ 以äžã®çµµã®ã¿ãå
¥ããããšãã§ããïŒ1 æã®é¡çžã«ã¯é«ã
1 æã®çµµããå
¥ããããšãã§ããª... | 38,009 |
Problem F: Connect Line Segments Your dear son Arnie is addicted to a puzzle named Connect Line Segments . In this puzzle, you are given several line segments placed on a two-dimensional area. You are allowed to add some new line segments each connecting the end points of two existing line segments. The objective is to... | 38,010 |
Score : 1200 points Problem Statement Takahashi's office has N rooms. Each room has an ID from 1 to N . There are also N-1 corridors, and the i -th corridor connects Room a_i and Room b_i . It is known that we can travel between any two rooms using only these corridors. Takahashi has got lost in one of the rooms. Let t... | 38,011 |
Score : 200 points Problem Statement There are 2000001 stones placed on a number line. The coordinates of these stones are -1000000, -999999, -999998, \ldots, 999999, 1000000 . Among them, some K consecutive stones are painted black, and the others are painted white. Additionally, we know that the stone at coordinate X... | 38,012 |
C - Iyasugigappa Problem Statement Three animals Frog, Kappa (Water Imp) and Weasel are playing a card game. In this game, players make use of three kinds of items: a guillotine, twelve noble cards and six action cards. Some integer value is written on the face of each noble card and each action card. Before stating th... | 38,013 |
Score : 1100 points Problem Statement There is a tree with N vertices, numbered 1 through N . The i -th edge in this tree connects Vertices A_i and B_i and has a length of C_i . Joisino created a complete graph with N vertices. The length of the edge connecting Vertices u and v in this graph, is equal to the shortest d... | 38,014 |
åé¡ F ããã« å顿 2 次å
å¹³é¢äžã®åç¹ã«ããŒã«ãããïŒ x è»žã®æ£æ¹åãšã®è§åºŠãåæèšåãã«èŠãŠ 0 床 180 床ãŸã§ã®éã®æ¹åã«äžæ§ãªç¢ºçã§çºå°ãããããšããŠãã (çºå°ãããæ¹åã¯æŽæ°è§ã§ãããšã¯éããªã)ïŒããŒã«ã®å€§ããã¯ååå°ããïŒå¹³é¢äžã§ã¯ç¹ã§ãããšèŠãªãããšã«ããïŒãã®åé¡ã«ãããç®çã¯ïŒãã®ããŒã«ãã§ããã ãé«ã確çã§æç²ããããšã§ããïŒ å¹³é¢äžã« N åã®å Žæ (x i , y i ) ãäžããããïŒããŒã«ãæç²ããããã«ïŒããªã㯠N åã®å Žæãã K åã®å Žæãéžãã§ïŒããããã®å Žæã«äººãé
眮ããããšãã§ããïŒäººã¯ i çªç®ã®äžããããå Žæã«å¯ŸããŠååŸ r i 以å
ã®è·é¢ãŸã§åããŠããŒã«ãåãããšãåºæ¥... | 38,015 |
倿®ã AIZU åœã®å€æ®ãæã¯ãã¹ããŒããã©ã³ã西ã®ç©ºãžæ§ããŠç«ã¡æ¢ãŸã芳å
客ã§è³ãããAIZU åœã¯ç¡æ°ã®ãã«ã建ã¡äžŠã¶å€§éœåžã§ããããã«ã®è°·éãé·ãé£ãªã西ã®ç©ºã«ã¯ããã«ã®ã·ã«ãšãããšãããããæŒãåºã倪éœã®å
ã«ããçµ¶æ¯ãåºããã AIZU 芳å
åäŒã®è¥æŸæ°ã«ãããšã倪éœã衚ãåãããã®é¢ç©ã®ã¡ããã©ååã ãé®ãããŠãããšããæ Œæ®µã®çµ¶æ¯ã«ãªããšããã å³ã®ããã«ã西ã®ç©ºããå°å¹³ç·ã x 軞ã倪éœã®äžå¿ã®è»è·¡ã y 軞ãšãããã㪠x - y å¹³é¢ã§è¡šãã倪éœãååŸ R ã®åãããããã®ãã«ã®ã·ã«ãšãããé·æ¹åœ¢ãšããã åãã«ã®ã·ã«ãšããã®åºèŸºã¯ x 軞äžã«ããã倪éœã¯ååé«ãäœçœ®ããå°å¹³ç·ã«å¯ŸããŠåçŽã«æ²ãã§ããã倪éœã¯ãã«ã®... | 38,016 |
Score : 400 points Problem Statement Given are integers A , B , and N . Find the maximum possible value of floor(Ax/B) - A à floor(x/B) for a non-negative integer x not greater than N . Here floor(t) denotes the greatest integer not greater than the real number t . Constraints 1 †A †10^{6} 1 †B †10^{12} 1 †N †10^... | 38,017 |
Score : 300 points Problem Statement Mikan's birthday is coming soon. Since Mikan likes graphs very much, Aroma decided to give her a undirected graph this year too. Aroma bought a connected undirected graph, which consists of n vertices and n edges. The vertices are numbered from 1 to n and for each i (1 \leq i \leq n... | 38,018 |
Pile Up! There are cubes of the same size and a simple robot named Masato. Initially, all cubes are on the floor. Masato can be instructed to pick up a cube and put it on another cube, to make piles of cubes. Each instruction is of the form `pick up cube A and put it on cube B (or on the floor).' When he is to pick up ... | 38,019 |
åéæ°åŒ ããæ¥å»åãæ¢æ€ããŠããããªãã¯ãåéã«é·ãæ°åŒ S ãæžãããŠããã®ãçºèŠããã倧ããªæ°ã奜ããªããªãã¯ããã§ãŒã¯ãåãåºããæ°åŒãèšç®ããçµæãã§ããã ã倧ãããªãããã« ( ãŸã㯠) ãæžãå ããããšã«ãããæžãå ããåŸãæ°åŒã«ãªã£ãŠããªããã°ãªããªããšãããšãæå€§ã§ããã€ã«ã§ãããã æåãšæåã®éã¯åååºã空ããŠããŠã ( ãŸã㯠) ã§ããã°ããã€ã§ãæžãå ããããšãã§ãããæçµçã«æ°åŒã«ãªã£ãŠããã°ãæåã®ãã£ãã®å¯Ÿå¿ã厩ããããã« ( ãŸã㯠) ãæžããŠãããïŒSample 2åç
§ïŒã ãŸããããã§ã¯ä»¥äžã®BNFã§å®çŸ©ããã<expr>ãæ°åŒãšåŒã¶ãæ°åŒäžã®æ°ã¯å
šãŠäžæ¡ã§ããã <expr> ::= "... | 38,020 |
宿¢ã 倪éåã¯ããåºå Žã«ãå®ãæ¢ãã«ãã£ãŠããŸããããã®åºå Žã«ã¯ããããã®ãå®ãåããããŠããŸããã倪éåã¯ææ°ã®æ©æ¢°ãæã£ãŠããã®ã§ãã©ãã«ãå®ãåãŸã£ãŠãããããã¹ãŠç¥ã£ãŠããŸããåºå Žã¯ãšãŠãåºãã®ã§å€ªéåã¯é åãæ±ºããŠãå®ãæ¢ãããšã«ããŸãããããå®ã¯ããããããããã©ã®ãå®ããã®é åã®äžã«ãããããã«ããããŸãããããã§å€ªéåã¯ãã®é åã®äžã«ãããå®ã®æ°ãæ°ããããšã«ããŸããã Input n m x 1 y 1 x 2 y 2 ... x n y n x 11 y 11 x 12 y 12 x 21 y 21 x 22 y 22 ... x m1 y m1 x m2 y m2 n ã¯åºå Žã«åãŸã£ãŠãããå®ã®æ°ã衚ã m ... | 38,021 |
Score : 300 points Problem Statement You are given a string S of length N consisting of A , C , G and T . Answer the following Q queries: Query i ( 1 \leq i \leq Q ): You will be given integers l_i and r_i ( 1 \leq l_i < r_i \leq N ). Consider the substring of S starting at index l_i and ending at index r_i (both inclu... | 38,022 |
Origami, or the art of folding paper Master Grus is a famous origami (paper folding) artist, who is enthusiastic about exploring the possibility of origami art. For future creation, he is now planning fundamental experiments to establish the general theory of origami. One rectangular piece of paper is used in each of h... | 38,023 |
Score : 300 points Problem Statement You are given two integer sequences of length N : a_1,a_2,..,a_N and b_1,b_2,..,b_N . Determine if we can repeat the following operation zero or more times so that the sequences a and b become equal. Operation: Choose two integers i and j (possibly the same) between 1 and N (inclusi... | 38,024 |
Problem H: Oh, My Goat! 倪éåã¯ã次éåã«å€æã®ããŒããåããã ææ¥ã®å€æã®å®¿é¡ãåãããŠãããããã ã 倪éåã¯ãçšå¿æ·±ãæ§æ ŒãããŠãããããäžãäžã®ããšãèããŠãè¿æã®ã³ã³ããã§æ¬¡éåã®ããŒãã®ã³ããŒãåã£ãŠèªå®
ãžåž°ã£ãã 倪éåã¯ãèªå®
ã§å®¿é¡ãå§ããããšãããšãã«ãæ
ãŠãã æ¬¡éåããåããããŒããéã«å
¥ã£ãŠããªãã£ãããã ã ã©ããããã³ã³ããã«å¿ããŠããŠããŸã£ãããã ã 倪éåã¯ãæ¥ãã§ã³ã³ããã«åŒãè¿ããã ã³ããŒæ©ãšãã®åšèŸºãæžåœã«æçŽ¢ããããããŒããèŠã€ããããšã¯ã§ããªãã£ãã å°ãæãŠã倪éåã¯ãã³ã³ããã®åºé·ã«å©ããæ±ããã äœè«ã ããåºé·ã¯å°çç°å¢ã«åªãã人ã§ãçœã€ã®ããã飌ã£ãŠããã... | 38,025 |
Score : 200 points Problem Statement We have a grid with N rows and M columns of squares. Initially, all the squares are white. There is a button attached to each row and each column. When a button attached to a row is pressed, the colors of all the squares in that row are inverted; that is, white squares become black ... | 38,026 |
Score : 200 points Problem Statement You are given a string S of length N consisting of lowercase English letters, and an integer K . Print the string obtained by replacing every character in S that differs from the K -th character of S , with * . Constraints 1 \leq K \leq N\leq 10 S is a string of length N consisting ... | 38,027 |
Bomb Removal Problem 瞊 H Ãæšª W ã®ã°ãªããäžã« N åã®ç¹ç«ãããå°ç«ç·ãšããããã«å¯Ÿãã1ã€ã®ç匟ãé
眮ãããŠãããããããã®å°ç«ç·ãšç匟ã¯ã L i åã®ãã¹ãããªã path i äžã«é
眮ããã path i ã® j çªç®ã®ãã¹ã( px ij , py ij )ãšãããåç匟㯠path i ã®æåŸã®ãã¹( px iL i , py iL i )ã«ååšãããå°ç«ç·ã®ç«ã¯åæç¶æ
(0ç§æç¹)ã§ãã¹( px i1 , py i1 )ã«ããã1ç§éã«1ãã¹é²ã(( px i1 , py i1 ),( px i2 , py i2 ),...,( px iL i , py iL i )ã®é ã«é²ã)ã æåã... | 38,028 |
ç§ã®ã€ã«ãããŒã·ã§ã³ åè§åœ¢ã倧奜ããªäººãå€ãäœãåè§çºã§ã¯ãåè§åœ¢ã®é»å
æ¿ãçµã¿åãããã€ã«ãããŒã·ã§ã³ã§çºäžã圩ããç¥ããéå¬ãããŸãã ãã®é»å
æ¿ã¯é»æ°ãæµããšçºå
ããçºå
ããŠããæ¿ã«æ¥ããŠããæ¿ãçºå
ããŸãããããã£ãŠãé»å
æ¿ãäœæäœ¿ã£ãŠãããã¹ãŠãã²ãšãããŸãã«æ¥ããŠããã°é»æºãã²ãšã€ã§æžããšããåªããã®ã§ãã ãç¥ãå®è¡å§å¡äŒã§ã¯ãåè§åœ¢ãçµã¿åããããã¶ã€ã³ãçºæ°ããåéã倿°ã®ã€ã«ãããŒã·ã§ã³ãäœæããŸããåã€ã«ãããŒã·ã§ã³ã¯ããã¶ã€ã³ãæ§æããåè§åœ¢ã®é
眮ã«ãã£ãŠå¿
èŠãšãªã黿ºã®åæ°ãå€ãããããå¿
èŠãªé»æºã®åæ°ãææ¡ããäœæ¥ã« 倧ããªæéãããããŸãã ããã§ã ããªãã¯åè§åœ¢ã®é
眮ã調ã¹ãå¿
èŠãªé»æºã®åæ°ãèšç®... | 38,029 |
b | 38,030 |
Dice I Write a program to simulate rolling a dice, which can be constructed by the following net. As shown in the figures, each face is identified by a different label from 1 to 6. Write a program which reads integers assigned to each face identified by the label and a sequence of commands to roll the dice, and prints ... | 38,031 |
Problem H: Winter Bells The best night ever in the world has come! It's 8 p.m. of December 24th, yes, the night of Cristmas Eve. Santa Clause comes to a silent city with ringing bells. Overtaking north wind, from a sleigh a reindeer pulls she shoot presents to soxes hanged near windows for children. The sleigh she is o... | 38,032 |
Score: 500 points Problem Statement We have caught N sardines. The deliciousness and fragrantness of the i -th sardine is A_i and B_i , respectively. We will choose one or more of these sardines and put them into a cooler. However, two sardines on bad terms cannot be chosen at the same time. The i -th and j -th sardine... | 38,033 |
Window In the building of Jewelry Art Gallery (JAG), there is a long corridor in the east-west direction. There is a window on the north side of the corridor, and $N$ windowpanes are attached to this window. The width of each windowpane is $W$, and the height is $H$. The $i$-th windowpane from the west covers the horiz... | 38,034 |
Problem F: nCm Problem æŽæ° n ãäžããããæã nCm (ç°ãªã n åã®ãã®ãã m åãéžã¶çµã¿åããã®æ°)ãå¶æ°ãšãªããããªæå°ã® m ãåºåããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã n Constraints å
¥åã¯ä»¥äžã®æ¡ä»¶ãæºããã 1 †n †10 18 Output nCm ãå¶æ°ãšãªããããªæå°ã® m ã1è¡ã«åºåããã Sample Input 1 2 Sample Output 1 1 Sample Input 2 111 Sample Output 2 16 Sample Input 3 3 Sample Output 3 4 | 38,035 |
Score : 100 points Problem Statement In the Kingdom of AtCoder, people use a language called Taknese, which uses lowercase English letters. In Taknese, the plural form of a noun is spelled based on the following rules: If a noun's singular form does not end with s , append s to the end of the singular form. If a noun's... | 38,036 |
ç·å¯Ÿç§° å¹³é¢äžã®ç°ãªã 3 ç¹ P1(x1,y1) , P2(x2,y2) , Q(xq,yq) ã®åº§æšã®çµãèªã¿èŸŒãã§ãç¹ P1 ç¹ P2 ãéãçŽç·ã察称軞ãšããŠç¹ Q ãšç·å¯Ÿç§°ã®äœçœ®ã«ããç¹ R(x,y) ãåºåããããã°ã©ã ãäœæããŠãã ããããªããç¹ Q ã¯ããã®å¯Ÿç§°è»žäžã«ãªããã®ãšããŸãã å
¥å å
¥åã¯è€æ°ã®ããŒã¿ã»ãããããªããŸããåããŒã¿ã»ããã¯ä»¥äžã®åœ¢åŒã§äžããããŸãã x1 , y1 , x2 , y2 , xq , yq x1 , y1 , x2 , y2 , xq , yq (-100 ä»¥äž 100 以äžã®å®æ°) ãã«ã³ãåºåãã§ïŒè¡ã«äžããããŸãã ããŒã¿ã»ããã®æ°ã¯ 50 ãè¶
ããªãã åºå ããŒã¿ã»ãã... | 38,037 |
Score : 700 points Problem Statement Nuske has a grid with N rows and M columns of squares. The rows are numbered 1 through N from top to bottom, and the columns are numbered 1 through M from left to right. Each square in the grid is painted in either blue or white. If S_{i,j} is 1 , the square at the i -th row and j -... | 38,038 |
Problem B: Make a Sequence Your companyâs next product will be a new game, which is a three-dimensional variant of the classic game âTic-Tac-Toeâ. Two players place balls in a three-dimensional space (board), and try to make a sequence of a certain length. People believe that it is fun to play the game, but they still ... | 38,039 |
Score : 500 points Problem Statement For two sequences S and T of length N consisting of 0 and 1 , let us define f(S, T) as follows: Consider repeating the following operation on S so that S will be equal to T . f(S, T) is the minimum possible total cost of those operations. Change S_i (from 0 to 1 or vice versa). The ... | 38,040 |
Score : 600 points Problem Statement There are 2N balls, N white and N black, arranged in a row. The integers from 1 through N are written on the white balls, one on each ball, and they are also written on the black balls, one on each ball. The integer written on the i -th ball from the left ( 1 †i †2N ) is a_i , and... | 38,041 |
D - Disciple Life is Hard / åŒåã¯ã€ããã Story Dã®ã²ãšã¯ããŒãããæããŠããŸãªããåžžã«ããŒãããæ¬²ããŠãããããããåž«å ã§ããã¶ãªãããããã«äœãéããããšãåœããããDã®ã²ãšã¯ãæåã«ããªãŒãå¶éããªããã°ãªããªããããã§Dã®ã²ãšã¯åºç€ä»£è¬ãèæ
®ãããã®æ¥ãã¬ãŒãã³ã°ã«ãã£ãŠæ¶è²»ããã«ããªãŒã®åãŸã§ããŒãããé£ã¹ãŠãããããšã«ãããDã®ã²ãšã¯ããŒãããæããŠããŸãªããšã¯ããã奜ã¿ã¯ããã®ã§ãé£ã¹ãããŒããã«ãã£ãŠåŸãããå¹žçŠæã¯å€ããããŸãããã®æ¥ã®äœåã«ãã£ãŠè¡ãããã¬ãŒãã³ã°ãå€ãã£ãŠããããããã¬ãŒãã³ã°ã®çš®é¡ãããŒããã®çš®é¡ãäœåãèæ
®ãã D æ¥éã§åŸããã幞çŠãæå€§åããããšã詊ã¿... | 38,042 |
Twin Trees Bros. To meet the demand of ICPC (International Cacao Plantation Consortium), you have to check whether two given trees are twins or not. Example of two trees in the three-dimensional space. The term tree in the graph theory means a connected graph where the number of edges is one less than the number of nod... | 38,043 |
åé¡ J : ä¹±æå¹³è¡¡åäºåæ¢çŽ¢æš ãšããã§ïŒGââgle Code Jam ã®å°åºå€§äŒã§å³ã®åžã«åº§ã£ãŠããç·ã® ID 㯠rng_58 ãšèšããããïŒ æ±äº¬å€§åп代ã®èšæ¶ã«ïŒäŒŒããã㪠ID ã®ä»²éãå±
ãèŠãããããïŒåã®ä»²éã¯äžäººæ®ããçŸå°å¥³ã ã£ãã¯ãã ïŒ åœŒå¥³ã¯ããããç¡è¡šæ
äžæè°ç³»ãã£ã©ã ã£ããããªæ°ãããïŒ ãšããããšã¯ïŒåœŒã¯ç¥ããªãç·ã ïŒrng ãšã¯äœã®ç¥ã ããïŒ ãããã Random Number Generator ã«éããªãïŒ ä¹±æã¢ã«ãŽãªãºã ãåŸæãšããã®ã ããïŒ ãšããã§ïŒä¹±æ°ãçšãã平衡äºåæ¢çŽ¢æšã§ãã Treap ã¯ïŒ 2011 幎é ã®ããã°ã©ãã³ã°ã³ã³ãã¹ãã§ã¯ãã°ãã°çšããããŠããããã ãïŒ 20XX... | 38,044 |
Score : 1200 points Problem Statement There are infinitely many cards, numbered 1 , 2 , 3 , ... Initially, Cards x_1 , x_2 , ... , x_N are face up, and the others are face down. Snuke can perform the following operation repeatedly: Select a prime p greater than or equal to 3 . Then, select p consecutive cards and flip ... | 38,045 |
Score : 600 points Problem Statement Given are a prime number p and a sequence of p integers a_0, \ldots, a_{p-1} consisting of zeros and ones. Find a polynomial of degree at most p-1 , f(x) = b_{p-1} x^{p-1} + b_{p-2} x^{p-2} + \ldots + b_0 , satisfying the following conditions: For each i (0 \leq i \leq p-1) , b_i is... | 38,046 |
Score : 300 points Problem Statement You are given an integer N . Among the integers between 1 and N (inclusive), how many Shichi-Go-San numbers (literally "Seven-Five-Three numbers") are there? Here, a Shichi-Go-San number is a positive integer that satisfies the following condition: When the number is written in base... | 38,047 |
What Color Is The Universe? On a clear night, a boy, Campanella looked up at the sky, there were many stars which have different colors such as red, yellow, green, blue, purple, etc. He was watching the stars and just lost track of time. Presently, he wondered, "There are many stars in the space. What color is the univ... | 38,048 |
B: Hokkaido University Hard 泚æ åé¡èšå®ã¯ A åé¡ãšåäžã®ãã®ã§ãããå¶çŽã®ã¿ãç°ãªããŸãã®ã§ã泚æãã ããã ç©èª åæµ·é倧åŠã«åæ Œããæ°ããªç掻ã®å§ãŸãã«å¿ãèºãããã»ããã¡ãããããã圌女ã®åã«ã¯ããšãŠã€ããªãåºããã£ã³ãã¹ãåŸ
ã¡åããŠãã...ã ãã...æ¬¡ã®ææ¥ã«éã«åããªããã ãã©...ã åé¡ åæµ·éå€§åŠæå¹ãã£ã³ãã¹ã¯ç°åžžã«åºãããšã§æåã§ããæå¹ãã£ã³ãã¹ã¯çžŠã« H ãã¹ã暪㫠W ãã¹äžŠãã é·æ¹åœ¢ã®ãã¹ç®ã§è¡šçŸãããŸããåãã i ãã¹ã西ãã j ãã¹é²ãã ãã¹ã (i,j) ã§è¡šãããšã«ããŸãããã£ã³ãã¹å
ã«ã¯ããã€ã建ç©ãããããã¹ (i,j) ã§è¡šãããäœçœ®ã«å»ºç©ãããå Ž... | 38,049 |
Print a Rectangle Draw a rectangle which has a height of H cm and a width of W cm. Draw a 1-cm square by single '#'. Input The input consists of multiple datasets. Each dataset consists of two integers H and W separated by a single space. The input ends with two 0 (when both H and W are zero). Output For each dataset, ... | 38,050 |
Folding a Ribbon Think of repetitively folding a very long and thin ribbon. First, the ribbon is spread out from left to right, then it is creased at its center, and one half of the ribbon is laid over the other. You can either fold it from the left to the right, picking up the left end of the ribbon and laying it over... | 38,051 |
Score : 800 points Problem Statement You are given a simple connected undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N , and the edges are numbered 1 to M . Edge i connects Vertex a_i and b_i bidirectionally. Determine if three circuits (see Notes) can be formed using each of the ... | 38,052 |
Convex-Cut Nåã®é ç¹ãããªãåžå€è§åœ¢ãäžãããããåé ç¹ã®åº§æšã¯åæèšåšãã«(X 1 , Y 1 ), (X 2 ,Y 2 ), âŠâŠ, (X N , Y N )ã§è¡šããããã ç¹Pãéãã©ã®ãããªçŽç·ã§åžå€è§åœ¢ãåæããŠããåæåŸã«åŸããã2ã€ã®åžå€è§åœ¢ã®é¢ç©ãçãããããªç¹Pã®åº§æšãæ±ããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã N X 1 Y 1 X 2 Y 2 âŠâŠ X N Y N Constraints å
¥åã¯å
šãп޿°ã§ãã 3 †N †50 0 †|X i |, |Y i | †1000000 å
¥åã®å€è§åœ¢ã¯åçŽãªåžå€è§åœ¢ã§ããã åºåã¯ãåºå座æšã(X, Y)ãå³å¯è§£ã(cX, cY)ãšããæ... | 38,053 |
Alternate Escape ã¢ãªã¹ããŠã¹ AliceãšBobã¯ããŒãã²ãŒã ã§éãã§ããïŒ ãã®ããŒãã²ãŒã ã¯ïŒ H è¡ W åã®ãã¹ç®ãæžãããç€é¢ãš1ã€ã®ã³ãã䜿ã£ãŠéã¶ïŒ ãã®ã²ãŒã ã§ã¯ïŒç€é¢ã®å·Šäžã®ãã¹ã1è¡1åç®ãšããŠïŒäžæ¹åã«è¡ãïŒå³æ¹åã«åãæ°ããïŒ ãã¹å士ã飿¥ãã蟺ãšïŒãã¹ãç€é¢ã®å€åŽãšæ¥ãã蟺ã«ã¯å£ã眮ããããã«ãªã£ãŠããŠïŒã²ãŒã ã®éå§æã«ã¯ããããã®èŸºã«ã€ããŠå£ã®æç¡ãæå®ãããŠããïŒãŸãïŒã²ãŒã ã®éå§æã«ã¯ïŒã³ããç€é¢ã®ãã¹ã®ãããã1ç®æã«çœ®ãããŠããïŒ AliceãšBobã¯äº€äºã«æçªãããªãããšã§ã²ãŒã ãé²ããïŒ ã²ãŒã ã¯Aliceã®æçªããå§ãŸãïŒ Aliceã®ç®çã¯ïŒã³ããç€é¢ã®å€ãŸã§åãããŠïŒ... | 38,054 |
Score : 300 points Problem Statement Snuke has a calculator. It has a display and two buttons. Initially, the display shows an integer x . Snuke wants to change this value into another integer y , by pressing the following two buttons some number of times in arbitrary order: Button A: When pressed, the value on the dis... | 38,055 |
Problem B: Polygonal Line Search Multiple polygonal lines are given on the xy -plane. Given a list of polygonal lines and a template, you must find out polygonal lines which have the same shape as the template. A polygonal line consists of several line segments parallel to x -axis or y -axis. It is defined by a list of... | 38,056 |
Score : 100 points Problem Statement This contest is CODE FESTIVAL . However, Mr. Takahashi always writes it CODEFESTIVAL , omitting the single space between CODE and FESTIVAL . So he has decided to make a program that puts the single space he omitted. You are given a string s with 12 letters. Output the string putting... | 38,057 |
Score: 600 points Problem Statement There is a grass field that stretches infinitely. In this field, there is a negligibly small cow. Let (x, y) denote the point that is x\ \mathrm{cm} south and y\ \mathrm{cm} east of the point where the cow stands now. The cow itself is standing at (0, 0) . There are also N north-sout... | 38,058 |
å¢åã®äºæ³ 信倫ãããšé倫ããã¯é·æ¹åœ¢ã®å³¶ã§é å°ãåãåãã²ãŒã ãããŠããŸããäžã®å³â ã®ããã«ãå³¶å
šäœã¯æ Œåç¶ã«åºåãããæ£æ¹åœ¢ã®åºç»ã§ã§ããŠãããåºç»ã«ã¯ããããçããæåŸãæŽæ°ã§ç€ºãããŠããŸãã ãã®ã²ãŒã ã§ã¯ïŒã€ã®é§ãåãããŠé å°ã®å¢çç·ã決ããŠãããŸããã²ãŒã éå§æãé§ã¯å³¶ã®å西端ã«ãããŸãïŒå³â ïŒããã®é§ãå³¶ã®åæ±ç«¯ãŸã§åãããŠãã£ããšãã®é§ã®è»è·¡ãé å°ã®å¢çç·ãšãªããŸããäºäººã®ãã¬ãŒã€ãŒã¯äº€äºã«é§ãåãããŸããé§ã¯åé£ã®æ Œåç¹ãæ±é£ã®æ Œåç¹ã«ã®ã¿åããããšãã§ããŸãïŒå³â¡ïŒãé§ãå³¶ã®ç«¯ã«å°éããå Žåã¯ãåãæ±ã®ãã¡åãããæ¹åã«åãããŸããé§ãåæ±ç«¯ã«å°éãããã²ãŒã çµäºã§ãã ã²ãŒã çµäºåŸã®å¢çç·ããåæ±åŽã®é åãå
æ»... | 38,059 |
CïŒ ãã£ãã²ãšã€ã®éšåå - Unique Subsequence - åé¡ ããæ¥ãã³ã¡ããã¯ãæºã®äžã«é·ã n ã®ããã¹ãæåå T ãšé·ã m ã®ãã¿ãŒã³æåå P ( m \leq n ) ã眮ãããŠããããšã«æ°ã¥ããŸããããã³ã¡ããã¯ãæååã«çŸããããã£ãã²ãšã€ã®éšååãã倧奜ãã§ããããã P ã T ã®ãã£ãã²ãšã€ã®éšååã§ãããã©ãããããã«èª¿æ»ãå§ããŸããã P ã T ã®ãã£ãã²ãšã€ã®éšååã§ãããšããæ§è³ªã¯ä»¥äžã®ããã«è¡šãããŸããããã§ãæåå X ã® i æåç®ã X_i ãšæžããŸãã é·ã m ã®æ°å S = (s_1, ..., s_m) (ãã ãã s_1 < s_2 < ... < s_m ) ã§... | 38,060 |
Problem F: Cutting a Chocolate Turtle Shi-ta and turtle Be-ko decided to divide a chocolate. The shape of the chocolate is rectangle. The corners of the chocolate are put on (0,0), ( w ,0), ( w , h ) and (0, h ). The chocolate has lines for cutting. They cut the chocolate only along some of these lines. The lines are e... | 38,061 |
Print Many Hello World Write a program which prints 1000 "Hello World". Input There is no input for this problem. Output The output consists of 1000 lines. Print "Hello World" in each line. Sample Input No input Sample Output Hello World Hello World Hello World Hello World Hello World Hello World Hello World . . . . . ... | 38,062 |
äžåžã®ããã äŒæŽ¥å€ªéããã®äŒç€Ÿã«ã¯ãå²ãåããªãäºã倧å«ããªäžåžãããŸãã倪éããããã®äžåžãšé£äºã«è¡ããšãã¯ãå²ãåã§äŒèšãããŠããã®ã§ãããæ¯æéé¡ãåå 人æ°ã§å²ãåããªããšãã¯ããã€ãäžåžãããã£ãŠãããŠããŸãã ããæ¥ã倪éããã¯é£äºäŒã®å¹¹äºã«ãªããŸããããéã®å°ãªã倪éããã¯ããã®äžåžãèªã£ãŠãªããšãããã£ãŠããããããã«åºæ¥ãªããèããŸãããããæçå±ã«æ³šæãããªããã°ãªããªãã®ã§ããããŸã äœäººåå ãããã¯åãããªãã®ã§ãã©ããªäººæ°ãåå ããŠãããã£ãŠãããããããªæ³šæãããŠããããããã§ãã倪éããã®åæã§ãåããé£äºäŒã«åå ããäºå®ã®ããªãã¯ã倪éããã«ååããŠãäºç®é¡ä»¥äžã§æå€§ã®ã©ããªäººæ°ã§ãå²ãåããªãéé¡ãç®... | 38,063 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.