task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Problem G: Yu-kun Likes a Treasure Background äŒæŽ¥å€§åŠä»å±å¹Œçšåã¯ããã°ã©ãã³ã°ã倧奜ããªåäŸãéãŸã幌çšåã§ãããåå
ã®äžäººã§ããããåã¯ãããã°ã©ãã³ã°ãšåãããã財å®ã倧奜ãã ãããåã¯ä»æ¥ã財å®ãæ¢ãããæŽçªãæ¢çŽ¢ããäºå®ã ãããã§ããåã¯æŽçªã®å°å³ãããæŽçªãå
šãŠèŠãŠåãéã«æ©ãè·é¢ãæ±ããããã°ã©ã ãæžãããšã«ããã Problem æŽçªã®æ
å ±ãšããåã®åæäœçœ®ãäžãããããFig.1ã®ããã«ã æŽçªã¯2次å
å¹³é¢äžã®å€è§åœ¢ã§è¡šãããéšå±ããïŒã€ä»¥äžç¹ãã£ãéåã§æ§æããããéšå±ãå¥ã®éšå±ãšæ¥ããå Žåã¯å¿
ãç¹ã§æ¥ãããã®æ¥ç¹ãæŽçªã®éãšãªããæ¥ç¹ã«èšªãããšãã®éãéã£ãããšã«ãª... | 38,064 |
G: Quest of Merchant ICPC ã§è¯ãæçžŸãåããã«ã¯ä¿®è¡ãæ¬ ãããªãïŒããã㯠ICPC ã§åã¡ããã®ã§ïŒä»æ¥ãä¿®è¡ãããããšã«ããïŒ ä»æ¥ã®ä¿®è¡ã¯ïŒè¡ãé§ãåã亀æãè¡ãããšã§ïŒå売ã®åãæã«ããããšãããã®ã§ããïŒ ä»åŸã®ä¿®è¡ã®ããã«ãïŒã§ããã ãå€ãã®è³éã皌ãããïŒ ãã®äžçã¯ïŒæ±è¥¿ååæ¹åã®éè·¯ãçééã«äžŠãã§ããŠïŒç¢ç€ç¶ã«ãªã£ãŠããïŒå¯äžååšããåžå Žã®äœçœ®ã (0, 0)ïŒè¡ã«ã¯ x 座æšïŒ y 座æšãå®ãŸã£ãŠãã (座æšãæŽæ°å€ã®ç¹ã亀差ç¹ã«å¯Ÿå¿ãã)ïŒãããã¯éè·¯ã«æ²¿ã£ãŠã®ã¿ç§»åããããšãã§ãïŒé£æ¥ãã亀差ç¹éãç§»åããã®ã« 1 åãèŠããïŒããã€ãã®äº€å·®ç¹ã«ã¯è¡ãããïŒäº€æã§ã¯ïŒè¡ã§ååãè²·ã... | 38,066 |
Score : 1600 points Problem Statement You are given a string S of length 2N , containing N occurrences of a and N occurrences of b . You will choose some of the characters in S . Here, for each i = 1,2,...,N , it is not allowed to choose exactly one of the following two: the i -th occurrence of a and the i -th occurren... | 38,067 |
Problem E: Safe Area Nathan O. Davis is challenging a kind of shooter game. In this game, enemies emit laser beams from outside of the screen. A laser beam is a straight line with a certain thickness. Nathan moves a circular-shaped machine within the screen, in such a way it does not overlap a laser beam. As in many sh... | 38,068 |
Score : 2000 points Problem Statement There are N cards. The two sides of each of these cards are distinguishable. The i -th of these cards has an integer A_i printed on the front side, and another integer B_i printed on the back side. We will call the deck of these cards X . There are also N+1 cards of another kind. T... | 38,069 |
Score: 200 points Problem Statement Takahashi bought a piece of apple pie at ABC Confiserie. According to his memory, he paid N yen (the currency of Japan) for it. The consumption tax rate for foods in this shop is 8 percent. That is, to buy an apple pie priced at X yen before tax, you have to pay X \times 1.08 yen (ro... | 38,070 |
æ©ããµã³ã¿ã¯ããŒã¹(Walking Santa) æšå¹Žæ«ïŒãµã³ã¿ã¯ããŒã¹ã¯JOI æã®åäŸãã¡ã«ã¯ãªã¹ãã¹ãã¬ãŒã³ããæž¡ãã®ãå¿ããŠããŸã£ãïŒããã§ïŒãè©«ã³ã®æ°æã¡ãšããŠåäŸãã¡ã«ãã§ã³ã¬ãŒãã±ãŒããå±ããããšã«ããïŒå±ããã¹ãæ¥ã¯ææ¥ã«è¿«ã£ãŠããã®ã§ïŒããããç§»åèšç»ãèããªããã°ãªããªãïŒ JOI æã¯ïŒååæ¹åã«ãŸã£ããã«äŒžã³ã W æ¬ã®éè·¯ãšïŒæ±è¥¿æ¹åã«ãŸã£ããã«äŒžã³ã H æ¬ã®éè·¯ã«ããïŒç¢ç€ã®ç®ã®åœ¢ã«åºåããããŠãã. ååæ¹åã® W æ¬ã®éè·¯ã«ã¯ïŒè¥¿ããé ã«1, 2, ... , W ã®çªå·ãä»ããããŠããïŒæ±è¥¿æ¹åã® H æ¬ã®éè·¯ã«ã¯ïŒåããé ã«1, 2, ... , H ã®çªå·ãä»ããããŠãã. 西ãã x çªç®ã®... | 38,071 |
Problem E: Donut Hole Problem ããªãã¯ACPCã®ããã«æšª$W$瞊$H$ã®é·æ¹åœ¢ã§å¹³ã¹ã£ããã穎ã®ãªãããŒãããæåããŸããã ãã®ããŒããã$2$次å
å¹³é¢äžã®åº§æš$(0,0)$ã«ããŒããã®äžå¿ãéããé·ããHã®èŸºãš$y$軞ãå¹³è¡ã«ãªãããã«çœ®ããŸãã ACPC$1$æ¥ç®ã«ããªãã¯åº§æš($x$,$y$)ãäžå¿ã«æšª$w$瞊$h$ã®ç¯å²ã«ååšããããŒãããé£ã¹ãŸããã $2$æ¥ç®ãš$3$æ¥ç®ã«é£ã¹ãéãçãããããããªãã¯ã座æš$(0,0)$ãéãçŽç·ã§ããŒãããåå²ããçŽç·ã®çåŽã®é åã«ããããŒããã®é¢ç©ã®ç·åãããçåŽã®é åã«ããããŒããã®é¢ç©ã®ç·åãšçãããªã£ãŠããããã«ããããšèããŠããŸãã ãã®ãã... | 38,072 |
ã«ãŒã䞊㹠åé¡ è±åãã㯠n æïŒ4 †n †10ïŒã®ã«ãŒãã䞊ã¹ãŠéãã§ããïŒ ããããã®ã«ãŒãã«ã¯ 1 ä»¥äž 99 以äžã®æŽæ°ã 1 ã€ãã€æžãããŠããïŒ è±åããã¯ïŒãããã®ã«ãŒãã®äžãã k æïŒ2 †k †4ïŒãéžã³ïŒ 暪äžåã«äžŠã¹ãп޿°ãäœãããšã«ããïŒ è±åããã¯å
šéšã§äœçš®é¡ã®æŽæ°ãäœãããšãã§ããã ãããïŒ äŸãã°ïŒ1, 2, 3, 13, 21 ã® 5 æã®ã«ãŒããäžãããïŒãããã 3 æãéžã³æŽæ°ãäœãããšãèããïŒ 2, 1, 13 ããã®é ã«äžŠã¹ããšïŒæŽæ° 2113 ãäœãããšãã§ããïŒ ãŸãïŒ21, 1, 3 ããã®é ã«äžŠã¹ãŠãïŒåãæŽæ° 2113 ãäœãããšãã§ããïŒ ãã®ããã«ïŒç°ãªãã«ãŒ... | 38,073 |
Equal Range For a given sequence $A = \{a_0, a_1, ..., a_{n-1}\}$ which is sorted by ascending order, print a pair of the lower bound and the upper bound for a specific value $k$ given as a query. lower bound: the place pointing to the first element greater than or equal to a specific value, or $n$ if there is no such ... | 38,074 |
ã³ã³ãã ã³ã³ãããšã³ã¹ã¹ãã¢ã»ããã³ã€ã¬ãã³ã¯äºæ¥ãåºããããè¥æŸåžã«äžåºèç®ããªãŒãã³ããããšèããŠããŸããè¥æŸåžã«ã¯æ¢ã«ä»ã®ããããã®ã³ã³ãããšã³ã¹ã¹ãã¢ãããã®ã§ãæ°åºèããªãŒãã³ããå Žæãæåã®éµãæ¡ãããšã«ãªãããã§ããããã³ã€ã¬ãã³ã¯ãã客ããã¯èªåã®äœãã§ããå°åããæãè¿ãã³ã³ãããå©çšããããšããåæã®äžããå€ãã®ã客ãããå©çšããã§ãããå°ç¹ãã«åºåºããããšã«ããŠããŸãã ããã³ã€ã¬ãã³ã¯ãæ¢èšã®åã³ã³ãããã«ããŒããŠããç¯å²ãææ¡ãããããè¥æŸåžã®å°å³ãååãªæ£å
è§åœ¢(以åŸããããã¯ã)ãçšããŠåºåããŸããããã®ãšããåãããã¯ã«ã¯æ¢èšã®ã³ã³ãããå€ããšãäžã€ã ãå
¥ãããã«åºåããŸããããã®å°å³äžã§ãåããã... | 38,075 |
ããŒãæ°å å€ä»£ããŒãã§ã¯æ°ãæ°ããããšã¯é£ããä»äºã§ãããã¢ã©ãã¢æ°åã® 0,1,2,3,âŠ, 9 ã¯ãŸã æµåžããŠããŸããã§ããããã®ä»£ããæ¬¡ã®ãããªèšå·ã䜿ãããŠããŸããã ã¢ã©ãã¢æ°å ããŒãæ°å ã¢ã©ãã¢æ°å ããŒãæ°å ã¢ã©ãã¢æ°å ããŒãæ°å 1 I 11 XI 30 XXX 2 II 12 XII 40 XL 3 III 13 XIII 50 L 4 IV 14 XIV 60 LX 5 V 15 XV 70 LXX 6 VI 16 XVI 80 LXXX 7 VII 17 XVII 90 XC 8 VIII 18 XVIII 100 C 9 IX 19 XIX 500 D 10 X 20 XX 1000 M I 㯠1... | 38,076 |
Problem A. GuruGuru You are playing a game called Guru Guru Gururin . In this game, you can move with the vehicle called Gururin. There are two commands you can give to Gururin: ' R ' and ' L '. When ' R ' is sent, Gururin rotates clockwise by 90 degrees. Otherwise, when ' L ' is sent, Gururin rotates counterclockwise ... | 38,077 |
Problem F: Voronoi Island Some of you know an old story of Voronoi Island. There were N liege lords and they are always involved in territorial disputes. The residents of the island were despaired of the disputes. One day, a clever lord proposed to stop the disputes and divide the island fairly. His idea was to divide ... | 38,079 |
C - Decoding Ancient Messages Problem Statement Professor Y's work is to dig up ancient artifacts. Recently, he found a lot of strange stone plates, each of which has $N^2$ characters arranged in an $N \times N$ matrix. Further research revealed that each plate represents a message of length $N$. Also, the procedure to... | 38,080 |
Problem G: Test Case Tweaking You are a judge of a programming contest. You are preparing a dataset for a graph problem to seek for the cost of the minimum cost path. You've generated some random cases, but they are not interesting. You want to produce a dataset whose answer is a desired value such as the number repres... | 38,081 |
Score : 700 points Problem Statement You are given N points (x_i,y_i) located on a two-dimensional plane. Consider a subset S of the N points that forms a convex polygon. Here, we say a set of points S forms a convex polygon when there exists a convex polygon with a positive area that has the same set of vertices as S ... | 38,082 |
Problem B: ãã¿ã ãã Problem Statement äŒæŽ¥å宿ã«åå äºå®ã®é«æ§»ããã¯ãå®¶ãè²§ä¹ã§ããããã€ãçŽããªãã¹ãç¯çŽããŠäœ¿ãããã«ããŠããã圌女ã¯ãäŒæŽ¥å宿ã®ããŒã 決ãã®ããã«ãä»ã®åå è
ã®äººéãšãã¿ã ãããããããšã«ãªã£ãã ãã®å宿ã®ãã¿ã ããã®äœãæ¹ã¯æ¬¡ã®ãããªãã®ã§ããããŸããçŽã«Næ¬ã®çžŠæ£ãå¹³è¡ã«æžãããããŠãMæ¬ã®æšªæ£ãäžããé çªã«ã瞊æ£ãšåçŽã«ãªãããã«ããã€æšªæ£ã®é«ããå
šãŠç°ãªãããã«æžããŠãããäŸãã°ãSample Input 1ã®ãã¿ã ã¯ãå³1ã®ããã«ãªãã ããã§ã髿§»ãããã¡ãã£ãšäžæºããªè¡šæ
ããããªã«çžŠé·ã«ãã¿ã ãããæžããŠãããšçŽããã£ãããªãããã£ãšãé«ããå§çž®ã§ããã¯ãããšãã... | 38,083 |
Score : 1600 points Problem Statement Snuke found a random number generator. It generates an integer between 0 and N-1 (inclusive). An integer sequence A_0, A_1, \cdots, A_{N-1} represents the probability that each of these integers is generated. The integer i ( 0 \leq i \leq N-1 ) is generated with probability A_i / S... | 38,084 |
åå è
æ° éžæã®ã¿ãªãããããœã³ã³ç²ååã«ãããããããœã³ã³ç²ååã§ã¯ãçŸåšãããã°ã©ãã³ã°éšéãã¢ãã€ã«éšéããããŠããã¡ãŸãã®çµµïŒ£ïŒ§éšéãèšïŒéšéã®ç«¶æãéå¬ãããŠããŸãã åéšéã®åå è
æ°ãäžãããããšããåå è
ã®ç·æ°ãèšç®ããããã°ã©ã ãäœæããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã p m c å
¥åã¯ïŒè¡ã§ãããããã°ã©ãã³ã°éšéã®åå è
æ° p (0 †p †10000)ãã¢ãã€ã«éšéã®åå è
æ° m (0 †m †10000)ããã¡ãŸãã®çµµïŒ£ïŒ§éšéã®åå è
æ° c (0 †c †10000) ãäžããããã Output åå è
ã®ç·æ°ãïŒè¡ã«åºåããã Sample Input 1 10 10 20 Sa... | 38,085 |
A : ææãæ°ã㊠/ Finger Counting å顿 è西ããã¯æã®æ°ãå¢ããããæžããããã§ããïŒ è西ããã®åã«ã¯ n åã®ãŸããã
ããããïŒ è西ããã¯æãæã£ãŠãŸããã
ãã®åæ°ãæ°ããããšããŠããïŒ è西ããã®æãåããåœ¢ã¯æããŠãããæããŠããªããã® 2 ã€ããç¡ãïŒ è西ãã㯠2 鲿° ãçè§£ããŠããïŒ è西ããã¯åæã« 2 鲿°ã®æ¡ã察å¿ãããŠæ°ãæ°ããããšãåºæ¥ãïŒ è西ããã¯å¯Ÿæ°ãçè§£ããŠããªãïŒ è西ããã®ãããã«ãŸããã
ããæ°ãäžããã®ã«å¿
èŠãªæã®æ¬æ°ã®æå°å€ãæ±ããïŒ å
¥å n å¶çŽ æŽæ°ã§ãã 0 †n †10 18 åºå çãã 1 è¡ã«åºåãïŒæåŸã«æ¹è¡ãåºåããïŒ ãµã³ãã« ãµã³ãã«... | 38,086 |
Problem A: Next Mayor One of the oddest traditions of the town of Gameston may be that even the town mayor of the next term is chosen according to the result of a game. When the expiration of the term of the mayor approaches, at least three candidates, including the mayor of the time, play a game of pebbles, and the wi... | 38,087 |
Complete Binary Tree A complete binary tree is a binary tree in which every internal node has two children and all leaves have the same depth. A binary tree in which if last level is not completely filled but all nodes (leaves) are pushed across to the left, is also (nearly) a complete binary tree. A binary heap data s... | 38,088 |
Problem G: Shelter Taro lives in a town with N shelters. The shape of the town is a convex polygon. He'll escape to the nearest shelter in case of emergency. Given the current location, the cost of escape is defined as the square of the distance to the nearest shelter. Because emergency occurs unpredictably, Taro can b... | 38,089 |
Problem D: Divisor is the Conqueror Divisor is the Conquerer is a solitaire card game. Although this simple game itself is a great way to pass oneâs time, you, a programmer, always kill your time by programming. Your task is to write a computer program that automatically solves Divisor is the Conquerer games. Here is t... | 38,090 |
Score : 100 points Problem Statement There are N blocks, numbered 1, 2, \ldots, N . For each i ( 1 \leq i \leq N ), Block i has a weight of w_i , a solidness of s_i and a value of v_i . Taro has decided to build a tower by choosing some of the N blocks and stacking them vertically in some order. Here, the tower must sa... | 38,092 |
Problem H: Sky Jump Dr. Kay Em, a genius scientist, developed a new missile named "Ikan-no-i." This missile has N jet engines. When the i -th engine is ignited, the missile's velocity changes to ( vx i , vy i ) immediately. Your task is to determine whether the missile can reach the given target point ( X , Y ). The mi... | 38,093 |
Problem I: Rolling Block Problem Rolling Blockã¯çŽæ¹äœã®éå±äœãå転ããã€ã€ç§»åããããŽãŒã«ã®ç©Žã«èœãšãã²ãŒã ã§ããã ãã®ã²ãŒã ã®ã¯ãªã¢æ¡ä»¶ã¯éå±äœããŽãŒã«ã«èœãšãããšã§ããã ãããã¯ã«ã€ã㊠äžã®å³ã®(1)ããããããã¯ã¯1Ã1à L ã®çŽæ¹äœã§ããã ãããã¯ã¯æ±è¥¿ååã®ã©ããã®æ¹åã«å転ããªããç§»åããããšãã§ããã ãããããããã¯ã¯ã¹ããŒãžããã¯ã¿åºããããªåãããšãããšã¯åºæ¥ãªãã äžã®å³ã®(2)ããããããã¯ã暪ã«åããŠããå Žåã¯ç§»åæ¹åã«å¯ŸããŠãã®ãããªå転ããã€ã€ç§»åããã äžã®å³ã®(3)ããããããã¯ãçŽç«ããŠããå Žåã¯ç§»åæ¹åã«å¯ŸããŠãã®ãããªå転ããã€ã€ç§»åã... | 38,095 |
Score : 100 points Problem Statement We have A apples and P pieces of apple. We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan. Find the maximum number of apple pies we can make with what we have now. Constraints All values in input are integers. 0 \leq A, ... | 38,096 |
Score : 400 points Problem Statement Given is a positive integer N . Find the number of pairs (A, B) of positive integers not greater than N that satisfy the following condition: When A and B are written in base ten without leading zeros, the last digit of A is equal to the first digit of B , and the first digit of A i... | 38,098 |
Search II You are given a sequence of n integers S and a sequence of different q integers T. Write a program which outputs C, the number of integers in T which are also in the set S. Input In the first line n is given. In the second line, n integers are given. In the third line q is given. Then, in the fourth line, q i... | 38,099 |
ãã€ãã€ãªãè·äººã®çµŠæ ãŒãã¯ãã€ãã€ãªãè·äººã§ãããã€ããã€ãªããžã§ã€ã³ããšãã€ãããããããã°ãã©ããªãã€ãã ã£ãŠã€ãªãã§ã¿ããŸãããŒãã¯æ¯æ¥ã芪æ¹ãããã€ããšãžã§ã€ã³ããæž¡ãããŠããããã€ãªãã§èŠªæ¹ã«æž¡ããŸããã§ãããã€ãã®æ°ãå€ããããšãã¯ãïŒæ¥ã§ãããå
šéšã€ãªããããšã¯ã§ããŸããããããªãšãã§ã芪æ¹ã¯ã«ã£ããç¬ã£ãŠããŒãã«çµŠæãæž¡ããŠãããŸãã ãšããã§ããããšãå€ãªããšã«æ°ãã€ããŸãããå
šéšã®ãã€ããã€ãªãããããšããããã€ãªããããªãã£ããšãã®æ¹ã絊æãå€ãããšãããã£ã¡ã
ããããã§ãããããŸãå€ãªã®ã§ãããæ¥ã芪æ¹ãæ¥ããšãã«ã絊æã®èšç®æ¹æ³ãæžããŠããã¡ã¢ããã£ããèŠã¡ãããŸãããããããããªããš "絊æã¯ããã€ã... | 38,100 |
B: ã ãããªãwww - Dance Now! - ç©èª ååã®ã©ãã©ã€ãïŒãã€ã¬ã¯ã€ã³ïŒïŒ ãã¹ã¿ãŒã¢ã€ãã«ãã¡ãç«¶ãæå€§ã®å€§äŒãã©ãã©ã€ããã®ååšæŠãšããããã€ãã³ãããã¹ã¿ãŒã¢ã€ãã«ã¯ãŒã«ããã§9äœãåã£ãŠããŸã£ãããµã³ã³ã¹ããŒã ãã¬ã®ãããã³ã¹ã¯ã9äœã®èããæžŸèº«ã®æ±ºãããŒãºãã9äœã®æ§ãããªã©ãšå·ãããããŠããŸããå¿ã«æ·±ãå·ãè² ã£ãŠããŸãã æ¥ããã©ãã©ã€ãäºåäºéžã§ã¯çµ¶å¯Ÿã«9äœããšãããã«ã¯ãããªãâŠâŠ æ±ºæãæ°ãã«ããããµã³ã³ã¹ããŒã¯ãèªåãã¡ã®ç¹æãã»ã«ãã³ã³ãããŒã«ãã«ç£šãããããæ±ºæŠã®å°ãžãšåããã®ã ã£ãã åé¡ N çµã®ãŠããããç«¶ã倧äŒãã©ãã©ã€ãããéãããã ãã®å€§äŒã§ã¯ãã¹ãã€ã«ã»ãã¥ã¢ã»ã¯ãŒã«ã®3... | 38,101 |
Score : 2000 points Problem Statement Given are integers N and K , and a prime number P . Find the number, modulo P , of directed graphs G with N vertices that satisfy below. Here, the vertices are distinguishable from each other. G is a tournament, that is, G contains no duplicated edges or self-loops, and exactly one... | 38,102 |
Problem A: Vampirish Night There is a vampire family of N members. Vampires are also known as extreme gourmets. Of course vampires' foods are human blood. However, not all kinds of blood is acceptable for them. Vampires drink blood that K blood types of ones are mixed, and each vampire has his/her favorite amount for e... | 38,103 |
ã¬ãœãªã³ã¹ã¿ã³ã çœèãµãŒãã¹ãšãªã¢ã®ã¬ãœãªã³ã¹ã¿ã³ãã«ã¯ã$1$ãã$N$ã®çªå·ãå²ãåœãŠããã$N$åã®ã¬ãŒã³ããããŸããåã¬ãŒã³ã®å
é ã®è»ã絊油ãè¡ãããšãã§ããŸãã ã¬ãœãªã³ã¹ã¿ã³ãã«å
¥å Žããè»ã¯ã䞊ãã§ããè»ãæãå°ãªãã¬ãŒã³ãéžã³åã®æ«å°Ÿã«äžŠã³ãŸãããã®ãããªã¬ãŒã³ãè€æ°ããå Žåã¯ãçªå·ãæãå°ããã¬ãŒã³ãéžã³ãŸãã絊油ãçµãããšãã®è»ã¯ã¬ãŒã³ããåºãŠããããã®åŸãã®è»ã絊油ãè¡ããŸããäžåºŠã¬ãŒã³ãéžãã ããä»ã®ã¬ãŒã³ã«ç§»ãããšã¯ã§ããŸããããŸããã¬ãŒã³ã«äžŠãã§ããè»ã®é çªãå€ããããšã¯ãããŸããã ã¬ãŒã³ã®æ°ãå
¥å Žããè»ãšçµŠæ²¹ãçµäºããã¬ãŒã³ã®æ
å ±ãäžãããããšãã絊油ãçµäºããè»ã®ãã³ããŒãé çªã«åºåããããã°ã©ã ã... | 38,104 |
æ³¥æ£ å®ç©ãããããåèµãããŠããåç©é€šã«ãæ³¥æ£ã倧ããªé¢šåæ·ãäžã€ã ãæã£ãŠå¿ã³èŸŒã¿ãŸãããçã¿åºããããã®ã¯ãããããããŸãããé¢šåæ·ãèããããéããéãããŠããããããè¶
ãããšé¢šåæ·ãç ŽããŠããŸããŸããããã§æ³¥æ£ã¯ãçšæããé¢šåæ·ãç Žããäžã€æã䟡å€ãé«ããªããããªãå®ã®çµã¿åãããèããªããŠã¯ãªããŸããã é¢šåæ·ãèããããéã W ãããã³åç©é€šã«ããåã
ã®ãå®ã®äŸ¡å€ãšéããèªã¿èŸŒãã§ãéãã®ç·åã W ãè¶
ããªãç¯å²ã§äŸ¡å€ã®ç·åãæå€§ã«ãªããšãã®ããå®ã®äŸ¡å€ç·åãšéãã®ç·åãåºåããããã°ã©ã ãäœæããŠãã ããããã ãã䟡å€ã®ç·åãæå€§ã«ãªãçµã¿åãããè€æ°ãããšãã¯ãéãã®ç·åãå°ãããã®ãåºåããããšãšããŸãã I... | 38,105 |
Score : 400 points Problem Statement Takahashi will play a game using a piece on an array of squares numbered 1, 2, \cdots, N . Square i has an integer C_i written on it. Also, he is given a permutation of 1, 2, \cdots, N : P_1, P_2, \cdots, P_N . Now, he will choose one square and place the piece on that square. Then,... | 38,106 |
Problem B: Compress Files Your computer is a little old-fashioned. Its CPU is slow, its memory is not enough, and its hard drive is near to running out of space. It is natural for you to hunger for a new computer, but sadly you are not so rich. You have to live with the aged computer for a while. At present, you have a... | 38,107 |
Score : 300 points Problem Statement You are given a string S consisting of digits between 1 and 9 , inclusive. You can insert the letter + into some of the positions (possibly none) between two letters in this string. Here, + must not occur consecutively after insertion. All strings that can be obtained in this way ca... | 38,108 |
Problem Statement A magician lives in a country which consists of N islands and M bridges. Some of the bridges are magical bridges, which are created by the magician. Her magic can change all the lengths of the magical bridges to the same non-negative integer simultaneously. This country has a famous 2-player race game... | 38,109 |
Problem G Do Geese See God? A palindrome is a sequence of characters which reads the same backward or forward. Famous ones include "dogeeseseegod" ("Do geese see God?"), "amoreroma" ("Amore, Roma.") and "risetovotesir" ("Rise to vote, sir."). An ancient sutra has been handed down through generations at a temple on Tsuk... | 38,110 |
Score : 600 points Problem Statement Nagase is a top student in high school. One day, she's analyzing some properties of special sets of positive integers. She thinks that a set S = \{a_{1}, a_{2}, ..., a_{N}\} of distinct positive integers is called special if for all 1 \leq i \leq N , the gcd (greatest common divisor... | 38,111 |
Score : 100 points Problem Statement The door of Snuke's laboratory is locked with a security code. The security code is a 4 -digit number. We say the security code is hard to enter when it contains two consecutive digits that are the same. You are given the current security code S . If S is hard to enter, print Bad ; ... | 38,113 |
Problem H: Ropeway On a small island, there are two towns Darkside and Sunnyside, with steep mountains between them. Thereâs a company Intertown Company of Package Conveyance; they own a ropeway car between Darkside and Sunnyside and are running a transportation business. They want maximize the revenue by loading as mu... | 38,114 |
åé¡ E : Pattern Language å顿 m åã®çžç°ãªãã¢ã«ãã¡ããã var_0, var_1, ⊠, var_{m-1} ãããïŒ 0, 1, ⊠, 9, var_0, var_1, ⊠, var_{m-1} ã® 10+m çš®é¡ã®æåãããªãïŒé·ã N ã®æåå s_0s_1s_2âŠs_{N-1} ãäžããããïŒ ãã®æååã«ãããåã¢ã«ãã¡ããããæ°åã§çœ®ãæããŠåæã«ãªãããã«ãããïŒ(åæãšã¯ïŒåããèªãã§ãåŸãããèªãã§ãåãæååãããããïŒ) ããã§ïŒåãã¢ã«ãã¡ãããã¯åãæ°åã§çœ®ãæããªããã°ãªããªãïŒãŸãäžãããããã¹ãŠã®ã¢ã«ãã¡ããã var_i ã¯å°ãªããšãïŒäžåºŠã¯æåå s_0s_1... | 38,115 |
Problem B: e-Market The city of Hakodate recently established a commodity exchange market. To participate in the market, each dealer transmits through the Internet an order consisting of his or her name, the type of the order (buy or sell), the name of the commodity, and the quoted price. In this market a deal can be m... | 38,116 |
Score : 500 points Problem Statement We have a grid with H horizontal rows and W vertical columns. Let (i,j) denote the square at the i -th row from the top and the j -th column from the left. The square (i, j) has two numbers A_{ij} and B_{ij} written on it. First, for each square, Takahashi paints one of the written ... | 38,117 |
C: Shuttle Run Story University H has a unique physical fitness test program, aiming to grow the mindset of students. Among the items in the program, shuttle run is well-known as especially eccentric one. Surprisingly, there are yokans (sweet beans jellies) on a route of the shuttle run. Greedy Homura-chan would like t... | 38,118 |
å°Ÿæ ¹ (Ridge) åé¡ JOI ã«ã«ãã©ã¯æ¯èгã®è¯ããå€ãã®ç»å±±å®¶ã«æãããçŸããå°åœ¢ã§ããïŒ ç¹ã«ïŒå°Ÿæ ¹ãšåŒã°ããå Žæããã®æ¯èгã¯çµ¶æ¯ã§ããïŒ JOI ã«ã«ãã©ã®åå°ã¯åå H ããã¡ãŒãã«ïŒæ±è¥¿ W ããã¡ãŒãã«ã®é·æ¹åœ¢ã§ããïŒ ååïŒæ±è¥¿ã« 1 ããã¡ãŒãã«ããšã« JOI ã«ã«ãã©ã®åå°ãåãïŒããã HÃW åã®é åãåºåãšåŒã¶ïŒ ãã¹ãŠã®åºåã«ãããŠïŒãã®äžã§ã¯æšé«ã¯çããïŒãŸãïŒç°ãªãåºåã®æšé«ã¯ç°ãªãïŒ ããåºåã«éšãéããšïŒéšæ°Žã¯ãã®åºåã«æ±è¥¿ååã«é£ãåãæå€§ã§ 4 ã€ã®åºåã®ãã¡ïŒ æšé«ããã®åºåããäœããããªåºåã®ãã¹ãŠã«æµããïŒãã®ãããªåºåããªãå ŽåïŒéšæ°Žã¯ãã®åºåã«æºãŸãïŒ ä»ã®åºåããæµããŠããéšæ°Ž... | 38,119 |
Carry a Cheese Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size A Ã B Ã C . It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each entrance is a rounded hole having its own radius... | 38,120 |
Score : 500 points Problem Statement You are given two integers A and B . Print a grid where each square is painted white or black that satisfies the following conditions, in the format specified in Output section: Let the size of the grid be h \times w ( h vertical, w horizontal). Both h and w are at most 100 . The se... | 38,121 |
Problem E: Laser Puzzle An explorer John is now at a crisis! He is entrapped in a W times H rectangular room with a embrasure of laser beam. The embrasure is shooting a deadly dangerous laser beam so that he cannot cross or touch the laser beam. On the wall of this room, there are statues and a locked door. The door lo... | 38,122 |
Score : 1200 points Problem Statement You are given a simple connected undirected graph G 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. It is guaranteed that the subgraph consisting of Vertex 1,2,\ldots,N ... | 38,123 |
B: ãµã€ã³ãã転ãããªãã§ å顿 $H$ è¡ $W$ åãããªãã°ãªããããããŸãã以éãã°ãªããäžã® $i$ è¡ç® $j$ åç®ã®ãã¹ã $(i, j)$ ã®ãã¹ãšæžããŸãã ã°ãªããã®åãã¹ã«ã¯ã$1$ ä»¥äž $6$ 以äžã®æ°åããããã㯠# ã®æåã $1$ ã€ãã€æžãããŠããŸãã ãã ãã$i$ ãš $j$ ããšãã«å¶æ°ã§ãããã㪠$(i, j)$ ã®ãã¹ã«ã¯å¿
ã # ãæžãããŠããŸãã ããªãã¯ä»¥äžã®å³ã§è¡šããããããªãµã€ã³ãã $1$ ã€æã£ãŠããŸãã æåãããªãã¯ãã®ãµã€ã³ããåºé¢ã $6$, åé¢ã $2$, å³é¢ã $3$ ãšãªãããã« $(1, 1)$ ã®ãã¹ã«çœ®ããŸãã ããã§ãåé¢ã¯ $(i, j)... | 38,124 |
Dungeon 2 Bob is playing a game called "Dungeon 2" which is the sequel to the popular "Dungeon" released last year. The game is played on a map consisting of $N$ rooms and $N-1$ roads connecting them. The roads allow bidirectional traffic and the player can start his tour from any room and reach any other room by way o... | 38,125 |
Score : 200 points Problem Statement Snuke is interested in strings that satisfy the following conditions: The length of the string is at least N . The first N characters equal to the string s . The last N characters equal to the string t . Find the length of the shortest string that satisfies the conditions. Constrain... | 38,126 |
Score : 500 points Problem Statement There are N infants registered in AtCoder, numbered 1 to N , and 2\times 10^5 kindergartens, numbered 1 to 2\times 10^5 . Infant i has a rating of A_i and initially belongs to Kindergarten B_i . From now on, Q transfers will happen. After the j -th transfer, Infant C_j will belong t... | 38,127 |
The Number of Windows For a given array $a_1, a_2, a_3, ... , a_N$ of $N$ elements and $Q$ integers $x_i$ as queries, for each query, print the number of combinations of two integers $(l, r)$ which satisfies the condition: $1 \leq l \leq r \leq N$ and $a_l + a_{l+1} + ... + a_{r-1} + a_r \leq x_i$. Constraints $1 \leq ... | 38,128 |
ç¥èã®èšŒæ ããªããäœãã§ããéåäœå®
ã®å
¥å£ã®ãã¢ã«ã¯ïŒãã¹ã¯ãŒãåŒã®ããã¯ããããããŠããïŒãã®ãã¹ã¯ãŒãã¯ã¡ããã© 4 æ¡ã® 0 ãã 9 ã®ç¯å²ã®æ°åã§æ§æãããŠããïŒããªãã¯ãã€ãïŒéåäœå®
ã®ç®¡ç人ããäŒãããããã¹ã¯ãŒã P ã䜿ã£ãŠïŒãã®ãã¢ã®ããã¯ãè§£é€ããŠããïŒ ããæ¥ïŒããªãã¯éåäœå®
ã®äœæ°å
šå¡ãïŒèªåãšåããã¹ã¯ãŒã P ã䜿ã£ãŠããã®ãã©ããæ°ã«ãªãïŒåãéåäœå®
ã«äœãå人ã«å°ããããšã«ããïŒããªããšããªãã®å人ã¯ïŒèªåã®ãã¹ã¯ãŒããäºãã«äŒãããããšã§ïŒåããã¹ã¯ãŒãã䜿ã£ãŠããã®ãã©ãã確ããåãããšãã§ããïŒããããªããïŒãã¹ã¯ãŒããããããã®äœæ°ã«åå¥ã«å²ãåœãŠãããŠããå¯èœæ§ãèãããšïŒãã®æ¹æ³ã¯å¥œãŸ... | 38,129 |
Fermat's Last Theorem In the 17th century, Fermat wrote that he proved for any integer $n \geq 3$, there exist no positive integers $x$, $y$, $z$ such that $x^n + y^n = z^n$. However he never disclosed the proof. Later, this claim was named Fermat's Last Theorem or Fermat's Conjecture. If Fermat's Last Theorem holds in... | 38,130 |
Change a Password Password authentication is used in a lot of facilities. The office of JAG also uses password authentication. A password is required to enter their office. A password is a string of $N$ digits '0'-'9'. This password is changed on a regular basis. Taro, a staff of the security division of JAG, decided t... | 38,131 |
Score : 200 points Problem Statement Snuke has decided to construct a string that starts with A and ends with Z , by taking out a substring of a string s (that is, a consecutive part of s ). Find the greatest length of the string Snuke can construct. Here, the test set guarantees that there always exists a substring of... | 38,132 |
Score : 200 points Problem Statement Takahashi has N days of summer vacation. His teacher gave him M summer assignments. It will take A_i days for him to do the i -th assignment. He cannot do multiple assignments on the same day, or hang out on a day he does an assignment. What is the maximum number of days Takahashi c... | 38,133 |
Score : 100 points Problem Statement In programming, hexadecimal notation is often used. In hexadecimal notation, besides the ten digits 0, 1, ..., 9 , the six letters A , B , C , D , E and F are used to represent the values 10, 11, 12, 13, 14 and 15 , respectively. In this problem, you are given two letters X and Y . ... | 38,134 |
Problem I: Traffic Tree Problem ãããã1ãã N ãŸã§ã®çªå·ãä»ãã N åã®é ç¹ãã N -1æ¬ã®ç¡å蟺ã«ãã£ãŠç¹ãããã°ã©ããäžãããããåé ç¹ã«ã€ããŠããã®é ç¹ããã¹ã¿ãŒãããŠãã¹ãŠã®é ç¹ã蚪ããããã®æçã®ã¹ãããæ°ãåºåããã ãã ããããé ç¹ãã1æ¬ã®èŸºããã©ã£ãŠå¥ã®é ç¹ã«ç§»åããããšã1ã¹ããããšããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã N u 1 v 1 . . . u Nâ1 v Nâ1 1è¡ç®ã«ã1ã€ã®æŽæ° N ãäžããããã ç¶ã N -1è¡ã®ãã¡ i è¡ç®ã«ã¯ i çªç®ã®èŸºã®äž¡ç«¯ã®é ç¹çªå·ãè¡šãæŽæ° u i , v i ã空çœåºåãã§äžããããã Constrain... | 38,135 |
goto busters Problem Statement ããªãã¯è¬ã®ããã°ã©ã ã®ãœãŒã¹ã³ãŒããèŠã€ããïŒ ãã£ããã³ã³ãã€ã«ããŠå®è¡ããŠã¿ããïŒãã€ãŸã§åŸ
ã£ãŠãåŠçãçµãããªãïŒ ã©ãããïŒããã°ã©ã ãç¡éã«ãŒãããŠããŸã£ãŠããããã§ããïŒ ãœãŒã¹ã³ãŒãã詳ããèŠãŠã¿ããšããïŒä»¥äžã®ãããªããšãããã£ãïŒ ãœãŒã¹ã³ãŒã㯠N è¡ãããªãïŒåè¡ã¯ã©ãã«æã goto æã®ããããã§ããïŒ ã©ãã«æãš goto æã¯ããããæ¬¡ã®ãããªãã©ãŒãããã«åŸã£ãŠããïŒ LABEL: goto LABEL; ããã§ïŒLABEL ã¯ã©ãã«ã衚ãæååã§ããïŒ ããã°ã©ã ã¯å
é ã®è¡ããé çªã« 1 è¡ãã€åŠçãããïŒ ã©ãã«æãš goto æãåŠ... | 38,138 |
Problem C: Count the Regions There are a number of rectangles on the x-y plane. The four sides of the rectangles are parallel to either the x -axis or the y -axis, and all of the rectangles reside within a range specified later. There are no other constraints on the coordinates of the rectangles. The plane is partition... | 38,139 |
Score : 1300 points Problem Statement You are developing a robot that processes strings. When the robot is given a string t consisting of lowercase English letters, it processes the string by following the procedure below: Let i be the smallest index such that t_i = t_{i + 1} . If such an index does not exist, terminat... | 38,140 |
Score : 300 points Problem Statement Takahashi is standing on a multiplication table with infinitely many rows and columns. The square (i,j) contains the integer i \times j . Initially, Takahashi is standing at (1,1) . In one move, he can move from (i,j) to either (i+1,j) or (i,j+1) . Given an integer N , find the mini... | 38,141 |
Problem E: Reverse a Road Andrew R. Klein resides in the city of Yanwoe, and goes to his working place in this city every weekday. He has been totally annoyed with the road traffic of this city. All the roads in this city are one-way, so he has to drive a longer way than he thinks he need. One day, the following though... | 38,143 |
National Budget A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647. Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers. If given... | 38,144 |
N: é販 (Mail Order) è¡æ¡æ²¢ããã¯ãéçé販ã§ç©ã¿æšã®ããã¡ããè²·ã£ãã ç©ã¿æšã¯äžèŸºã®é·ãã1ã®ç«æ¹äœã®åœ¢ãããŠããã瞊㫠$H$ åãæšªã« $W$ åã«åå²ããããã¹ç®ã®äžã«ç©ãŸããŠããã çæšªããèŠããšãå·Šããé ã«ã$A_1, A_2, A_3, \dots, A_H$ åã®ãããã¯ãç©ãŸããŠèŠããã æ£é¢ããèŠããšãå·Šããé ã«ã$B_1, B_2, B_3, \dots, B_W$ åã®ãããã¯ãç©ãŸããŠèŠããã è¡æ¡æ²¢ããã¯å倧ãªã®ã§ããããã®æ
å ±ã ããããããã¯ã®ç·æ°ãåœãŠãããšèããã å°ããæ°ãçããŠééãããšæ Œå¥œæªãã®ã§ãèããããæå€§ã®åæ°ãçãããã å
¥å 1 è¡ç®ã«ã¯æŽæ° $H, W$ ã空çœ... | 38,145 |
A: ééãæ¢ã åé¡ çžŠã« N ãã¹ã暪㫠M ãã¹ããé·æ¹åœ¢ã®ç€é¢ A , B ãäžããããŸããåç€é¢ã«ã€ããŠãããããã®ãã¹ã¯çœãŸãã¯é»ã§å¡ãããŠããŸãã ç€é¢ X ã® i è¡ j åç®ã®ãã¹ã®è²ã C(i, j, X) ãšè¡šèšããããšã«ããŸãã 以äžã®æ¡ä»¶ãæºããæŽæ°ã®çµ (i, j) ãããã€ãããæ°ããŠãã ããã 1 \leq i \leq N 1 \leq j \leq M C(i, j, A) \neq C(i, j, B) å
¥ååœ¢åŒ N M A_1 ... A_N B_1 ... B_N A_i ( 1 \leq i \leq N ) ã® j æåç®ã # ã®ãšã㯠C(i, j, A) ãé»ã . ã®ãšã㯠C(... | 38,146 |
JOIãšIOI åé¡ äžããããæååå
ã®é£ç¶ãã3æåãïŒJOIãŸãã¯IOIãšãã䞊ã³ã«ãªã£ãŠããåæãããããäœåæããã®ããæ°ãäžããããã°ã©ã ãäœæããïŒæååã¯ã¢ã«ãã¡ãããã®å€§æåã ããããªãïŒäŸãã°äžå³ã®ãJOIOIOIããšããæååã«ã¯JOIã1åæïŒIOIã2åæã«å«ãŸããŠããïŒ å
¥å å
¥åã¯è€æ°ã®ããŒã¿ã»ãããããªãïŒåããŒã¿ã»ããã¯1è¡ã§ããïŒ10000æå以äžã®ã¢ã«ãã¡ãããã®å€§æåãããªãïŒå
¥å㯠EOF ã§çµäºãã. ããŒã¿ã»ããã®æ°ã¯ 5 ãè¶
ããªãïŒ åºå ããŒã¿ã»ããããšã«, 1è¡ç®ã«èŠã€ãã£ãJOIã®åæ°ïŒ2è¡ç®ã«èŠã€ãã£ãIOIã®åæ°ãããããåºåããïŒ å
¥åºåäŸ å
¥åäŸ JOIJOI JOIO... | 38,147 |
Twin Prime Prime numbers are widely applied for cryptographic and communication technology. A twin prime is a prime number that differs from another prime number by 2. For example, (5, 7) and (11, 13) are twin prime pairs. In this problem, we call the greater number of a twin prime "size of the twin prime." Your task i... | 38,149 |
æ°åœãŠã²ãŒã (Unique number) åé¡ JOI åã¯åéãšã²ãŒã ãããããšã«ããïŒãã®ã²ãŒã ã«ã¯ N 人ã®ãã¬ã€ã€ãŒãåå ããïŒ1 åã®ã²ãŒã ã®ã«ãŒã«ã¯æ¬¡ã®ãããªãã®ã§ããïŒ ããããã®ãã¬ã€ã€ãŒã¯ 1 ä»¥äž 100 以äžã®å¥œããªæŽæ°ãã«ãŒãã«æžããŠæåºããïŒåãã¬ã€ã€ãŒã¯ïŒèªåãšåãæ°ãæžãã人ãä»ã«ããªãã£ãå ŽåïŒèªåã®æžããæ°ãšåãåŸç¹ãåŸãïŒèªåãšåãæ°ãæžãã人ãä»ã«ããå Žåã¯åŸç¹ãåŸãããªãïŒ JOI åãã¡ã¯ãã®ã²ãŒã ã 3 åè¡ã£ãïŒåãã¬ã€ã€ãŒã 3 åã®ã²ãŒã ã«ãããŠæžããæ°ãäžãããããšãïŒåãã¬ã€ã€ãŒã 3 åã®ã²ãŒã ã§åŸãåèšåŸç¹ãæ±ããããã°ã©ã ãäœæããïŒ å
¥å å
¥å㯠1 + N è¡ãããª... | 38,150 |
ãã³ããã¿ã³ã§ã¯ïŒéè·¯ãx 座æšãŸãã¯y 座æšãæŽæ°ã®ãšããã«éã£ãŠããïŒãã¬ãåã®å®¶ãšãããåã®å®¶ã¯ã©ã¡ããéè·¯äžã«ããïŒçŽç·è·é¢(ãŠãŒã¯ãªããè·é¢) ã¯ã¡ããã© d ã§ããïŒãã¬ãåã®å®¶ãããããåã®å®¶ãŸã§éè·¯ã«æ²¿ã£ãŠç§»åãããšãã®æçè·é¢ãšããŠèããããæå€§å€ãæ±ããïŒ Constraints 0 < d †10 d ã¯å°æ°ç¹ä»¥äžã¡ããã©äžæ¡ãŸã§äžãããã Input d Output çããäžè¡ã«åºåããïŒçµ¶å¯Ÿèª€å·®ãŸãã¯çžå¯Ÿèª€å·®ã 10 â9 以äžã®ãšãæ£çãšå€å®ãããïŒ Sample Input 1 1.000 Sample Output 1 2.000000000000 Sample Input 2 2.345 Sam... | 38,151 |
Problem I: Enjoyable Commutation Isaac is tired of his daily trip to his ofice, using the same shortest route everyday. Although this saves his time, he must see the same scenery again and again. He cannot stand such a boring commutation any more. One day, he decided to improve the situation. He would change his route ... | 38,152 |
Score : 300 points Problem Statement Given an integer N , find the base -2 representation of N . Here, S is the base -2 representation of N when the following are all satisfied: S is a string consisting of 0 and 1 . Unless S = 0 , the initial character of S is 1 . Let S = S_k S_{k-1} ... S_0 , then S_0 \times (-2)^0 + ... | 38,153 |
Problem I: å€ãžã®æ ãªã€ãã¯å€§ã®ãã奜ãã§ããããªã€ãã®å®¶ã§ã¯ãã£ãšããã飌ã£ãŠãããããã奜ããªãªã€ãã¯ãã€ãéè¯ãããšéãã§ãããããããä»åãªã€ãã¯æ±ºå¿ããèªåã®å®¶ã§ãããäžå¹é£Œãããšã«ããããªã€ãã¯ãããå®¶ã«è¿ããã¬ãã³ãšåä»ããŠãããããå§ããã ãªã€ãã®å®¶ã¯ããããã®éšå±ãšãããããã€ãªãããããã®æãããªã£ãŠãããæã¯æ¬¡ã®2çš®é¡ãããã 人éçšã®æ®éã®æ ãªã€ãã¯éããããšãã§ããããã¬ãã³ãèªåã§éããããšã¯ã§ããªãããªã€ããšã¬ãã³ã®äž¡æ¹ãéãããšãã§ãããäžåºŠéããã°ããã®åŸã¯éãããŸãŸã«ããŠãããã ããçšã®å°ããªæ ã¬ãã³ãèªåã§ãããŠèªç±ã«éãããšãã§ããããã ãå°ããããã«ããªã€ããéãããšã¯ã§... | 38,154 |
Score : 300 points Problem Statement We have a grid of H rows and W columns of squares. The color of the square at the i -th row from the top and the j -th column from the left (1 \leq i \leq H, 1 \leq j \leq W) is given to you as a character c_{i,j} : the square is white if c_{i,j} is . , and black if c_{i,j} is # . C... | 38,156 |
Problem 03: Selecting Teams Advanced to Regional æ¥æ¬ã§æ¯å¹Žéå¬ãããåœé倧åŠå¯Ÿæããã°ã©ãã³ã°ã³ã³ãã¹ãã®ã¢ãžã¢å°åºäºéžã«åºå Žããããã«ã¯ãå³ããåœå
äºéžãçªç Žããªããã°ãªããŸããã 倧åŠå¯Ÿæãšã¯èšã£ãŠããïŒã€ã®åŠæ ¡ããè€æ°ã®ããŒã ãåæŠããŸããããã§ãã§ããã ãå€ãã®åŠæ ¡ãã¢ãžã¢å°åºäºéžã«åºå Žã§ããããã«ãçªç ŽããŒã ã®éžæã«ã¯ä»¥äžã®éžæã«ãŒã«ãé©çšãããŸãïŒ è©²åœããŒã ã A ãšããæçžŸã®åªç§ãªé çªã«æ¬¡ã®ã«ãŒã«ãé©çšããŸãïŒ ã«ãŒã« 1ïŒ ãã®æç¹ã§ã®éžæããŒã æ°ã 10 ã«æºããªãå ŽåïŒ A ãšåãæå±ã§ãã®æç¹ã§éžæãããããŒã ã®æ°ã 3 ã«æºããªããã°ã A ã¯éžæãããŸãã... | 38,157 |
8 Queens Problem The goal of 8 Queens Problem is to put eight queens on a chess-board such that none of them threatens any of others. A queen threatens the squares in the same row, in the same column, or on the same diagonals as shown in the following figure. For a given chess board where $k$ queens are already placed,... | 38,158 |
ããããŒãšã³ãåé¡ ãããããŒãšã³ãåé¡ããšåŒã°ããæ°åŠã®æªè§£æ±ºåé¡ã«é¢é£ããããã°ã©ã ãæžããŠã¿ãŸããããå¹³é¢äžã«äžãããã N åã®ç¹ãããã¡ããã© k åã®ç¹ãçµãã§ã§ããåžå€è§åœ¢ã®ãã¡ãæãé¢ç©ã®å°ãããã®ãèŠã€ããããã°ã©ã ãäœæããŠãã ããããã ããNåã®ç¹ã®åº§æšãäžããããåŸã質åãšããŠåžå€è§åœ¢ã®è§ã®åæ° k ãããã€ãäžããããŸãã ïŒè£è¶³ïŒããããŒãšã³ãåé¡ã«ã€ããŠïŒ å¹³é¢äžã«ã©ã®ïŒç¹ãåãçŽç·äžã«ä¹ããªãããã« N åã®ç¹ã眮ããŸãããã®ãšããã©ã®ããã«ç¹ã眮ããŠããkåã®ç¹ãããŸãéžã¶ãškåã®è§ããã€åžå€è§åœ¢ãå¿
ãäœãããšäºæ³ãããŠããŸãã ä»ã®ãšãããäžè§åœ¢ãªãã° N =3ãåè§åœ¢ãªãã° N =5ãäºè§åœ¢ãªã... | 38,159 |
A: ãã£ãã / Cabbage å顿 AOR ã€ã«ã¡ããã¯èã $N$ æãããã£ãããæã«å
¥ããã ãã®ãã£ããã®èã«ã¯å€åŽããé ã« $1,\ldots,N$ ã®çªå·ãã€ããŠããŠã$i$ çªç®ã®èã®æ±ãå
·å㯠$D_i$ ã§ããã ãã®å€ã倧ããã»ã©æ±ãå
·åãé
·ãããšã衚ãã AOR ã€ã«ã¡ããã¯ãã®ãã£ããã®èãæçã«äœ¿ãããã廿£ããåè£ã®æ±ãèã以äžã®æé ã«åŸã£ãŠéžã¶ããšã«ããã 廿£åè£ã空ã«åæåããã ãŸã 調ã¹ãŠããªãæãå€åŽã®èã«æ³šç®ãããå
šãŠèª¿ã¹çµãã£ãŠããå Žåã¯çµäºããã ãã®èã®æ±ãå
·åã $A$ 以äžã§ããã°å»æ£åè£ã«å ãã 2. ã«æ»ããããã§ãªããã°çµäºããã ãããããã®æäœãè¡ã£ãçµæãæçã«äœ¿... | 38,160 |
Problem D: Napoleon's Grumble Legend has it that, after being defeated in Waterloo, Napoleon Bonaparte, in retrospect of his days of glory, talked to himself "Able was I ere I saw Elba." Although, it is quite doubtful that he should have said this in English, this phrase is widely known as a typical palindrome . A pali... | 38,161 |
Problem B: Mountain Climbing Problem ãªãããåã¯å±±ç»ãã®èšç»ãç«ãŠãŠããŸããèšç»ã¯ãšãŠã倧åã§ããé«åã»çå°ãå€ãã®ããå³°ã»çªªå°ãå€ãã®ããå±±è
¹ãããã®ããç¶æ³ã«ãã£ãŠçšæããè·ç©ãå€ãã£ãŠããŸãã ãªãããåãæã£ãŠããç»å±±ã¬ã€ãããã¯ã«ã¯ãä»åç»å±±ã«å©çšããéã®äžå®ã®è·é¢æ¯ã®æšé«ãã¹ã¿ãŒãå°ç¹ãããŽãŒã«å°ç¹ãŸã§é ã«æžãããŠããŸãã ã¬ã€ãããã¯ã«æžãããŠããæšé«ãã¹ã¿ãŒãå°ç¹ãããŽãŒã«å°ç¹ãŸã§é ã« a 1 , a 2 , a 3 , ..., a N ãšããé«åãçå°ãå±±è
¹ãå³°ã窪å°ã次ã®ããã«å®çŸ©ããŸã: é«å a i-1 < a i = a i+1 = ... = a j > a j+1... | 38,162 |
Score : 100 points Problem Statement Takahashi is distributing N balls to K persons. If each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls? Constraints 1 \leq K \leq N \leq 100 ... | 38,163 |
å顿 $N$ æ¬ã®ç·å $s_1, s_2, ..., s_N$ ãäžããããããã®ãšãã dist$(s_i, s_j)$, ( $1 \leq i,j \leq N, i \ne j $ ) ã®ãšãããæå°å€ãæ±ããã dist$(s_i, s_j)$ 㯠$\sqrt{(x_i-x_j)^2 + (y_i-y_j)^2}$, ( $(x_i,y_i)$ 㯠$s_i$ äžã®ç¹ã$(x_j,y_j)$ 㯠$s_j$ äžã®ç¹) ã®ãšãããæå°å€ã§å®çŸ©ãããã 以äžã¯Sample Inputã®ããŒã¿ã»ãããå³ç€ºãããã®ã§ããã å
¥å å
¥åã¯ä»¥äžã®åœ¢åŒã«åŸããäžããããæ°ã¯å
šãп޿°ã§ããã $N$ $x_{1,1}$ $y_{1,... | 38,164 |
Score : 100 points Problem Statement AtCoDeer the deer found two positive integers, a and b . Determine whether the product of a and b is even or odd. Constraints 1 †a,b †10000 a and b are integers. Input Input is given from Standard Input in the following format: a b Output If the product is odd, print Odd ; if it i... | 38,165 |
Greedy, Greedy. Once upon a time, there lived a dumb king. He always messes things up based on his whimsical ideas. This time, he decided to renew the kingdomâs coin system. Currently the kingdom has three types of coins of values 1, 5, and 25. He is thinking of replacing these with another set of coins. Yesterday, he ... | 38,166 |
Problem B: RabbitWalking ãããã®äœãã§ããéœåžã«ã¯, $V$ åã®äº€å·®ç¹ãš $E$ æ¬ã®éããã. 亀差ç¹ã¯ 1-indexed ã§çªå·ãä»ããããŠãã. $i$ çªç®ã®éã¯äº€å·®ç¹ $a_i$ ãšäº€å·®ç¹ $b_i$ ã bidirectional ã«ã€ãªãã§ãã. ãããã¯, æ£æ©ãšå¥æ°ã奜ãã§ããïŒãããã¯ãã亀差ç¹ããåºçºã, éã奿°æ¬èŸ¿ã, åºçºããé ç¹ã«æ»ããããªçµè·¯ã«æ²¿ã£ãŠæ£æ©ããããšæã£ãŠããïŒ ãã®éœåžã®åžé·ã§ããããã¯, éœåžå
ã®ç§»åãå¹çåããããã«ç°ãªã2 ã€ã®äº€å·®ç¹ãçµã¶éããããã远å ããããšããŠããïŒãã ãïŒãã亀差ç¹ã®çµã«å¯ŸããŠæ·èšããããšãåºæ¥ãéã¯é«ã
1æ¬ãŸã§ã§ããïŒãŸãïŒ... | 38,167 |
Score : 200 points Problem Statement You are given three strings A, B and C . Each of these is a string of length N consisting of lowercase English letters. Our objective is to make all these three strings equal. For that, you can repeatedly perform the following operation: Operation: Choose one of the strings A, B and... | 38,168 |
Score : 100 points Problem Statement In a long narrow forest stretching east-west, there are N beasts. Below, we will call the point that is p meters from the west end Point p . The i -th beast from the west (1 †i †N) is at Point x_i , and can be sold for s_i yen (the currency of Japan) if captured. You will choose t... | 38,169 |
ããã³ãªã¬ãŒã²ãŒã ã¢ã«ã髿 ¡ã§ã¯ãæ¯å¹Žå
šæ ¡çåŸãåå ããã²ãŒã ãè¡ã£ãŠããŸãããŸããæ ¡åºã« N 人ã®å
šæ ¡çåŸãå圢ã«äžŠã³ãŸããå³ã®ããã«ãåçåŸã¯ 0 ãã N -1 ãŸã§ã®çªå·ãæžããããŒãã±ã³ãä»ããŠããŸãã ã²ãŒã ã§ã¯ããã³ãïŒæ¬äœ¿ããæåã¯ãŒãã±ã³ 0 çªã®çåŸãããã³ãæã£ãŠããŸããããããã以äžã®æé ã M åç¹°ãè¿ããŸãããŸããçŸæç¹ã§ããã³ãæã£ãŠããçåŸãé©åœãªæ£ã®æŽæ° a ã宣èšããŸãã a ãå¶æ°ã®ãšãã¯æèšåãã奿°ã®ãšãã¯åæèšåãã«é£ã®çåŸã«ããã³ãæž¡ããŠããã a çªç®ã«ããã³ãåãåã£ãçåŸãè±èœããŸããè±èœããçåŸã¯ãæèšåãã§é£ã®çåŸã«ããã³ãæž¡ããåããæããŸãã ã²ãŒã ãçµãã£ãåŸã«åã«æ®ã£... | 38,170 |
Score : 1900 points Problem Statement There is a tree with N vertices. The vertices are numbered 1 through N . For each 1 †i †N - 1 , the i -th edge connects vertices a_i and b_i . The lengths of all the edges are 1 . Snuke likes some of the vertices. The information on his favorite vertices are given to you as a str... | 38,171 |
Score : 900 points Problem Statement We have a grid with (2^N - 1) rows and (2^M-1) columns. You are asked to write 0 or 1 in each of these squares. Let a_{i,j} be the number written in the square at the i -th row from the top and the j -th column from the left. For a quadruple of integers (i_1, i_2, j_1, j_2) such tha... | 38,172 |
Diameter of a Convex Polygon Find the diameter of a convex polygon g . In other words, find a pair of points that have maximum distance between them. Input n x 1 y 1 x 2 y 2 : x n y n The first integer n is the number of points in g . In the following lines, the coordinate of the i -th point p i is given by two real nu... | 38,173 |
ãŽãããŽããå·æž¡ã åé¡ ããå·ã§,äžæ¹ã®å²žããç³ã®äžã次ã
ãšé£ã³ç§»ã£ãŠå察åŽã®å²žãŸã§è¡ããšããå°ã
å±éºãªã²ãŒã ãã¯ãã£ãŠãã. ä»,å³ 4-1 ã®ããã«,ç³ã¯ãã¹ç®ã®äžã«ååšãããšèãã.è¡ã®æ°ã¯ n ã§ãã. å³ 4-1 ã§ã¯ n = 5 ã§ãã. ãã®ã²ãŒã ã§ã¯,äžæ¹ã®å²žããå§ããŠ,éåžžã®ãžã£ã³ããŸã㯠m å以äžã®äžè¡é£ã°ãã®ãžã£ã³ããããŠå察åŽã®å²žãŸã§æž¡ã.éåžžã®ãžã£ã³ããšã¯,ä»ããè¡ã®äžã€å
ã®è¡ã®å²žãŸãã¯ç³ã®ã©ããã«é£ã³ç§»ãããšã§ãã,äžè¡é£ã°ãã®ãžã£ã³ããšã¯,ä»ããè¡ã®äºã€å
ã®è¡ã®å²žãŸãã¯ç³ã®ã©ããã«é£ã³ç§»ãããšã§ãã.å§ãã岞ã®äžã€å
ã®è¡ã¯ 1 è¡ç®,äºã€å
ã®è¡ã¯ 2 è¡ç®ã§ãã,n â 1 è¡ç®ã®äºã€å
ã®è¡,åã³ ... | 38,174 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.