task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Problem C: Unhappy Class Problem å±±ä¹åŸ¡è¹åŠåã®1幎Gçµã¯ãäžå¹žãèè² ã£ã女åçåŸãã¡ãéãŸãã¯ã©ã¹ã§ããã 圌女ãã¡ã¯ã幞çŠã«ãªãããšãç®æšã«ãæ¥ã
æ§ã
ãªè©Šç·Žã«ç«ã¡åããã 圌女ãã¡ã®ã¯ã©ã¹ã§ã¯ã幞çŠã«ãªãããã®è©Šç·Žã®äžç°ãšããŠã幞çŠå®æç§ç®ãåè¬ããããšãã§ããã ææããéæã®ãããã1éãã N éãŸã§ã«ææ¥ç§ç®ã®æ ãããã M åã®åè¬å¯èœãªç§ç®ãããã ç§ç® i ã¯ãææ¥ d i ( d i = 0, 1, 2, 3, 4ããããããææãç«æãæ°Žæãæšæãéæã«å¯Ÿå¿ãã)ã® a i éç®ããå§ãŸããé£ç¶ãã k i ã³ãã§è¡ããããããåè¬ãããšãã«åŸããã幞çŠåºŠã¯ t i ã§ããã å... | 37,544 |
ãµãŒãžã§ã³ãã»ã©ã€ã¢ã³ ãã©ã€ã¢ã³è»æ¹ãæãããšããæä»€ã®ããšãã¢ã€ã
è»ã®æåºéšéã¯ãã€ããªãŒã®æ°Žäžéœåžã§æµè»ãšæ¿ããæŠéãç¹°ãåºããŠããŸããã圌ãã¯ç¡äºã«è»æ¹ãšåæµããŸããããæµã®æŠè»ãå€ããæåºããªãåŒã¹ãã«ããŸãããããã§ã圌ãã¯æµã®æŠè»ãæ··ä¹±ããããããéœåžã«ããæ©ãå
šãŠçç ŽãããšããäœæŠãå®è¡ããããšã«ããŸããã äœæŠã¯ããã«åžä»€éšã«äŒããããæåºããªã®æºåãé²ããããŸãããæåºããªãé£ã°ãããã«ã¯ããã€æ©ãå
šãŠçç Žãããããäºæž¬ããªããã°ãªããŸãããè»ã®ããã°ã©ãã§ããããªãã®ä»»åã¯ãæåºéšéãå
šãŠã®æ©ã®çç Žã«å¿
èŠãªæéãèšç®ããããšã§ãã æ°Žäžéœåžã¯ N åã®å³¶ã§æ§æãããŠãããå³¶ãšå³¶ãšã®éã«ã¯æ©ãããã£ãŠããŸãããã¹... | 37,545 |
ã«ããµã³ã (Cutlet Sandwich) ããäžçã«ã¯ã $X$ çš®é¡ã®ããµã³ããã $Y$ çš®é¡ã®ãã«ããã $Z$ çš®é¡ã®ãã«ã¬ãŒããšããé£ã¹ç©ããããŸãã ãã®äžçã«ã¯ $N$ çš®é¡ã®ãã«ããµã³ãããšããé£ã¹ç©ãããã $i$ çš®é¡ç®ã®ã«ããµã³ã㯠$A_i$ çš®é¡ç®ã®ãµã³ããš $B_i$ çš®é¡ç®ã®ã«ããåæã§ãã ãŸãã $M$ çš®é¡ã®ãã«ãã«ã¬ãŒããšããé£ã¹ç©ãããã $i$ çš®é¡ç®ã®ã«ãã«ã¬ãŒã¯ $C_i$ çš®é¡ç®ã®ã«ããš $D_i$ çš®é¡ç®ã®ã«ã¬ãŒãåæã§ãã Segtree åã¯ãããã«ããµã³ããŸãã¯ã«ãã«ã¬ãŒãæã£ãŠãããšããåæã®ãã¡å°ãªããšã $1$ ã€ãå
±éããŠãããããªã«ããµã³ããŸãã¯ã«ãã«ã¬ãŒãšäº€æ... | 37,546 |
Problem G : Everything Starts With Your Vote ãã¥ãŒãªã¹ãã£ã¯ã¹ãšããèšèãããã確å®ã«ããŸããããšããä¿èšŒã¯ãªãããã©ã倧æµã®å Žåã¯ããŸããããæ¯èŒçåçŽãªã¢ãããŒãã®ããšã ãåçŽã«ããŠåŒ·åã§ãããããã«ããã®äžã®äžã¯å€ãã®ãã¥ãŒãªã¹ãã£ã¯ã¹ã§æºã¡æº¢ããŠããã ãã¥ãŒãªã¹ãã£ã¯ã¹ã®äžäŸãšããŠããããªãã®ãæãããããã¢ãã¡çªçµã«ãããŠããããã£ã©ã¯ã¿ãŒã®äººæ°åºŠã¯ããã®ã¢ãã¡æ¬ç·šäžã«ãããç»å Žæéã®ç·åã«æ¯äŸããã確ãã«ããã¯å€ãã®å Žåã«æãç«ã£ãŠããããã ãããããã©ãããåã¯å°æ°æŽŸã«å±ãããããã圱ã®èããã£ã©ãèæ¯ã«ã¡ãããšæ ãã¢ããã£ã©ãªããã«éã£ãŠå¯æãèŠãããããã®ã ã èªåã®... | 37,547 |
Score : 200 points Problem Statement Given N integers A_1, ..., A_N , compute A_1 \times ... \times A_N . However, if the result exceeds 10^{18} , print -1 instead. Constraints 2 \leq N \leq 10^5 0 \leq A_i \leq 10^{18} All values in input are integers. Input Input is given from Standard Input in the following format: ... | 37,548 |
D: æ°Žæ§œ åé¡ AORã€ã«ã¡ããã¯çžŠ $1$ 暪 $N$ ã®å€§ããã®æ°Žæ§œãããã£ããæ°Žæ§œã¯æ°Žãå
¥ããã®ã«ååãªé«ããããã æ°Žæ§œã«ã¯ $N-1$ åã®ä»åãããã $N$ åã®åºç»ã«çééã«åºåãããŠããã ããã«æ°Žã泚ãã ãšãããååºç»ã®æ°Žã®é«ã㯠$a_i$ ã«ãªã£ãã AORã€ã«ã¡ããã¯ããã€ãä»åããåãé€ããåºç»ã®æ°ã $M$ å以äžã«ããããšã«ããã ä»åããåãé€ãçµãã£ãæãååºç»ã®æ°Žã®é«ãã®ç·åã®æå€§å€ãæ±ããã ãªããä»åãã®åãã¯ç¡èŠã§ãããã®ãšããã å¶çŽ $1 \le N \le 500$ $1 \le M \le N$ $1 \le a_i \le 10^9$ å
¥åã¯å
šãп޿° å
¥å $N \ M$ $a... | 37,549 |
Lake Survery The Onogawa Expedition is planning to conduct a survey of the Aizu nature reserve. The expedition planner wants to take the shortest possible route from the start to end point of the survey, while the expedition has to go around the coast of the Lake of Onogawa en route. The expedition walks along the coas... | 37,550 |
C: çŽ æ° åé¡ ããæ¥ãçŽ æ°ã倧奜ããªããããå㯠$p + q$ ãçŽ æ°ãšãªãã㢠$(p, q)$ ã§éãã§ããã ããããåã¯çªç¶ããã®ãã¢ã®ãã¡ã $p$ ãš $q$ ããšãã« $N$ 以äžã®çŽ æ°ã§ãããã¢ãããã€ãããæ°ã«ãªãã ããã ããããåã«ä»£ãã£ãŠåæ°ãæ±ããã å¶çŽ å
¥åå€ã¯å
šãп޿°ã§ããã $1 \leq N \leq 10^7$ å
¥ååœ¢åŒ å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã $N$ åºå ãã¢ã®åæ°ãåºåããããŸããæ«å°Ÿã«æ¹è¡ãåºåããã ãµã³ãã« ãµã³ãã«å
¥å 1 3 ãµã³ãã«åºå 1 2 ãã¢ã¯ $(2, 3), (3, 2)$ ã®äºã€ã§ããã ãµã³ãã«å
¥å 2 20 ãµã³ãã«åºå 2 8 | 37,551 |
Problem E: Earth Observation with a Mobile Robot Team A new type of mobile robot has been developed for environmental earth observation. It moves around on the ground, acquiring and recording various sorts of observational data using high precision sensors. Robots of this type have short range wireless communication de... | 37,552 |
Shifting a Matrix You are given $N \times N$ matrix $A$ initialized with $A_{i,j} = (i - 1)N + j$, where $A_{i,j}$ is the entry of the $i$-th row and the $j$-th column of $A$. Note that $i$ and $j$ are 1-based. You are also given an operation sequence which consists of the four types of shift operations: left, right, u... | 37,553 |
A Two Floors Dungeon It was the last day of the summer camp you strayed into the labyrinth on the way to Komaba Campus, the University of Tokyo. The contest has just begun. Your teammates must impatiently wait for you. So you have to escape from this labyrinth as soon as possible. The labyrinth is represented by a grid... | 37,554 |
Problem A: Keitai Message Alice ãã㯠Miku ããã«æºåž¯é»è©±ã§ã¡ãŒã«ãéãããšããŠããã æºåž¯é»è©±ã«ã¯å
¥åã«äœ¿ãããã¿ã³ã¯æ°åã®ãã¿ã³ãããªãã ããã§ãæåã®å
¥åãããããã«æ°åãã¿ã³ãäœåºŠãæŒããŠæåã®å
¥åãè¡ããæºåž¯é»è©±ã®æ°åãã¿ã³ã«ã¯ãæ¬¡ã®æåãå²ãåœãŠãããŠããããã¿ã³ 0 ã¯ç¢ºå®ãã¿ã³ãå²ãåœãŠãããŠããããã®æºåž¯é»è©±ã§ã¯ 1 æåã®å
¥åãçµãã£ããå¿
ã確å®ãã¿ã³ãæŒãããšã«ãªã£ãŠããã 1: . , ! ? (ã¹ããŒã¹) 2: a b c 3: d e f 4: g h i 5: j k l 6: m n o 7: p q r s 8: t u v 9: w x y z 0: 確å®ã... | 37,555 |
Score: 600 points Problem Statement AtCoder's head office consists of N rooms numbered 1 to N . For any two rooms, there is a direct passage connecting these rooms. For security reasons, Takahashi the president asked you to set a level for every passage, which is a positive integer and must satisfy the following condit... | 37,556 |
Score : 2000 points Problem Statement You are participating in a quiz with N + M questions and Yes/No answers. It's known in advance that there are N questions with answer Yes and M questions with answer No, but the questions are given to you in random order. You have no idea about correct answers to any of the questio... | 37,557 |
Score : 900 points Problem Statement Takahashi has a lot of peculiar devices. These cylindrical devices receive balls from left and right. Each device is in one of the two states A and B, and for each state, the device operates as follows: When a device in state A receives a ball from either side (left or right), the d... | 37,558 |
Score : 100 points Problem Statement There is an N -car train. You are given an integer i . Find the value of j such that the following statement is true: "the i -th car from the front of the train is the j -th car from the back." Constraints 1 \leq N \leq 100 1 \leq i \leq N Input Input is given from Standard Input in... | 37,559 |
D: ç¢ / Arrow åé¡ rodea å㯠1 次å
座æšç³»ã®äžã«ããã x = 0 ã®å Žæã«ç«ã£ãŠããããã®äœçœ®ããã x = N ã®äœçœ®ã«ããçãç®ãããŠã åžžã«éã 1 ã§ç§»åããæ£ã®æŽæ°ã®é·ãã®ç¢ãæãããããããrodea åã¯éåãªããã åºé 0 \leq x \leq N ã®äžã«åèš M åã®é颚æ©ã眮ãããšã«ããŠããã ããã§ãç¢ã®å
端ããæ ¹å
ãŸã§ã®äœçœ®ã« 1 ã€ã®é颚æ©ãå«ãŸããªãå Žåããæå€±ããšå®çŸ©ãããæå€±ã®å€å®ã¯ãç¢ã®å
端ã x = 1, 2, 3, $\ldots$ , N ã«å°éããéã«è¡ãïŒã€ãŸããåèš N åè¡ãïŒã ãã®ãšãã以äžã®ã¯ãšãªã Q ååŠçããã ãæå€±ã蚱容å¯èœãªåæ° l_i ã... | 37,560 |
èµ°ãåå (Run, Twins) E869120åã¯ãå®¶ããåŠæ ¡ãžåãã£ãŠåé $P$ ã¡ãŒãã«ã§èµ°ãåºããŸããã square1001åã¯ãE869120åãå®¶ãåºçºããŠãã $A$ ååŸã«E869120åã®å¿ãç©ã«æ°ãä»ããåé $Q$ ã¡ãŒãã«ã§è¿œããããŸããã ãã®åŸãE869120åã¯ãE869120åãå®¶ãåºçºããŠãã $B$ ååŸã«å¿ããã®ã«æ°ãä»ããåé $R$ ã¡ãŒãã«ã§éãåŒãè¿ããŸããã E869120åãå®¶ãåºçºããŠããäœååŸã«ååã¯åºäŒãã§ããããïŒ ãã ãã$B$ ååŸãŸã§ã«E869120åãšsquare1001åãåºäŒãããšã¯ãããŸããã ãŸããE869120åãšsquare1001åã®å®¶ããåŠæ ¡ãŸã§... | 37,561 |
Set Union Find the union of two sets $A = \{a_0, a_1, ..., a_{n-1}\}$ and $B = \{b_0, b_1, ..., b_{m-1}\}$. 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}$ Elements of $A$ and $B$ are given in ascending order respectively. There are no duplicate el... | 37,562 |
B: Shortest Crypt åé¡ xryuseixããã®åŠæ ¡ã§ã¯æå·ãæµè¡ããŠãã. æ Œåç¶ã®è¡ã«äœãã§ããxryuseixããã¯éåå Žæã決ããæ°ããæå·ãèãã. æå·æã¯ $N$ æåã®æåå $S$ ãããªã, $S_i$ ã®æåã«ãã£ãŠçŸåšå°ããã®ç§»åæ¹åãæ±ºãã. ç§»åæ¹åã«é¢ããŠã¯ä»¥äžã®éãã§ãã. A ~ M : åã«ïŒãã¹é²ã. N ~ Z : åã«ïŒãã¹é²ã. a ~ m : æ±ã«ïŒãã¹é²ã. n ~ z : 西ã«ïŒãã¹é²ã. ããŠ,ããã§xryuseixããã¯, yryuseiyã¡ããã«ããŒãã®éåå Žæãæå·æã§æããããšæã£ãã®ã ã, æå·æãåé·ãªããšã«æ°ã¥ãã. äŸãã°,ãANAããšããæå·æãã... | 37,563 |
Score : 800 points Problem Statement Given is a positive even number N . Find the number of strings s of length N consisting of A , B , and C that satisfy the following condition: s can be converted to the empty string by repeating the following operation: Choose two consecutive characters in s and erase them. However,... | 37,564 |
Problem D: Sum of Different Primes A positive integer may be expressed as a sum of different prime numbers (primes), in one way or another. Given two positive integers n and k , you should count the number of ways to express n as a sum of k different primes. Here, two ways are considered to be the same if they sum up t... | 37,565 |
Score : 300 points Problem Statement There are 3N participants in AtCoder Group Contest . The strength of the i -th participant is represented by an integer a_i . They will form N teams, each consisting of three participants. No participant may belong to multiple teams. The strength of a team is defined as the second l... | 37,566 |
Score : 100 points Problem Statement You are given two integers A and B . Find the largest value among A+B , A-B and A \times B . Constraints -1000 \leq A,B \leq 1000 All values in input are integers. Input Input is given from Standard Input in the following format: A B Output Print the largest value among A+B , A-B an... | 37,567 |
Problem 06: Ghost Buster! äžè¬äººã«ã¯ç¥ãç±ãç¡ãããšã ãããã®è¡ã¯å¹œéã§æº¢ããŠããããã®ã»ãšãã©ã¯ç¡å®³ãªã®ã ããå°ã£ãããšã«ã人ãåªãæªéãå°ãªãããããã®ã ã ãããšããã«ããããªæªéãšæŠãå°å¥³ããããåœŒå¥³ã¯æŒéã¯äœé£ãã¬é¡ã§é«æ ¡ã«éããªããããå€ã«ãªããšè¡äžãæ©ãåãã圷埚ããéãèŠä»ããŠã¯æä»ãããã®ã ã 幜éãæä»ãããããã«ã¯ãŸããã®å¹œéã«æ¥è¿ããå¿
èŠãããã®ã ããããã¯ç°¡åãªããšã§ã¯ãªãã幜éã¯ç©ãããæããããããã ã幜éã¯æ°å®¶ã«å£ãã䟵å
¥ããŠåæå£ããåºãŠè¡ã£ãããä¿¡å·ã®ç¡ã倧éããæ ã
ãšæšªæãããããã人éã§ãã圌女ã«ã¯ãããªããšã¯ã§ããªãã®ã§ã幜éã远跡ããã®ã¯ãšãŠãé£ããã®ã ã 圌女ã¯... | 37,568 |
EïŒãã€ããªå - Binary Sequence - ç©èª ããã¯ãã€ããªå€§å¥œãBonald.Brvin.BnuthããïŒ ãªããã¥ã³ãã©ãŒã倧åŠã§ãã€ããªåã®æ§è³ªãç ç©¶ããŠãã£ãŠã®ããBnuthãããããšåŒã°ããŠã芪ããŸããŠããããïŒ ã¡ãªã¿ã«ãããã®ååãBonald.Brvin.BnuthããASCIIã³ãŒããããã€ããªåãããšã1000010 1101111 1101110 1100001 1101100 1100100 101110 1000010 1110010 1110110 1101001 1101110 101110 1000010 1101110 1110101 1110100 1101000ãã«ãªãããïŒ æ¥œ... | 37,569 |
ãããã¯ã®äžè§åœ¢ å³a ã®ããã«ç©ãŸãããããã¯ã«å¯Ÿãã以äžã®äžŠã¹æ¿ãæäœãç¹°ãè¿ãã äžçªäžã®ãããã¯å
šãŠïŒå³a äžã®çœã®ãããã¯ïŒãå³ç«¯ã«æ°ããç©ã¿äžããïŒæ®ãã®ãããã¯ã¯èªåçã«ïŒæ®µäžã«èœã¡ãå³b ã®ããã«ãªãïŒã ãããã¯ã®éã«ééãã§ããããå·Šã«è©°ããŠééããªããïŒå³ b ããå³c ã®ããã«ãªãïŒã 1 以äžã®æŽæ° k ã«å¯ŸããŠãkÃ(kïŒ1)/2 ã§è¡šãããæ° (äŸ:1, 3, 6, 10, ...)ãäžè§æ°ãšããããããã¯ã®ç·æ°ãäžè§æ°ã®å Žåãäžèšã®äžŠã¹æ¿ããç¹°ãè¿ããšã巊端ã®é«ãã1 ã§å³ã«åãã£ãŠïŒã€ãã€é«ããªã£ãŠãããããªäžè§åœ¢ã«ãªããšäºæ³ãããŠããïŒå³d ã¯ç·æ°ã15 åã®å ŽåïŒã ãããã¯ã®æåã®äžŠã³ãäžãã... | 37,570 |
Problem C: Push!! Mr. Schwarz was a famous powerful pro wrestler. He starts a part time job as a warehouseman. His task is to move a cargo to a goal by repeatedly pushing the cargo in the warehouse, of course, without breaking the walls and the pillars of the warehouse. There may be some pillars in the warehouse. Excep... | 37,571 |
Problem H: Caterpillar ãšãã倩空éœåžã«äœã倧åŠçã®Gã¯ãèè«ã®ãã倪éã飌ã£ãŠããã 圌ã¯ããã倪éã«æçæ©æ°ã§å
šãŠã®ãããé çªã«é£ã¹ãããã«èºŸããããã圌ã®å人ã§ããããªãã¯ã圌ãããã倪éãæ¬åœã«èºŸããããŠãããã©ããã調ã¹ãŠæ¬²ãããšäŸé Œãããã®ã§ãããã°ã©ã ãæžãããšã«ããã Problem è€æ°ã®é害ç©ãšãšãµãã°ãªããç¶ã®ãšãªã¢å
ã«ååšãããé ãš 5 ã€ã®èŽäœãæã€èè«ããã®ãšãªã¢ãæ¢çŽ¢ãããèè«ãé çªã«æåŸãŸã§ãšãµãé£ã¹ããšãã®æå°ã®æ©æ°ãæ±ããã ãã ãå
šãŠã®ãšãµãé£ã¹ãããšãäžå¯èœãªå Žå㯠-1 ãåºåããããšããªãããšãµã®äžã«èè«ã®é ãéãªã£ããšãããšãµãé£ã¹ãããšãã§ããã ãšãªã¢ã¯ä»¥äžã®æ... | 37,572 |
å顿 æåå $S$ ãäžããããã$S$ ã®ãã¹ãŠã®ã¢ãã°ã©ã ã®ãã¡ãåæã«ãªã£ãŠãããã®ã®åæ°ãæ±ããã æåå $X$ ã $Y$ ã®ã¢ãã°ã©ã ã§ãããšã¯ã$X$ ã $Y$ ãšçãããã$X$ ã®æåãäžŠã³æ¿ããã $Y$ ã«çãããªãããšããããäŸãã°æååabcdã«å¯ŸããŠãabcdãcbdaãªã©ã¯ã¢ãã°ã©ã ã§ããããabedãcabãabcddãªã©ã¯ã¢ãã°ã©ã ã§ãªãã æåå $X$ ãåæã§ãããšã¯ã$X$ ãéããèªãã ãã®ã $X$ èªèº«ãšçãããªãããšããããäŸãã°abcãabã¯åæã§ãªããaãabccbaãªã©ã¯åæã§ããã å
¥å å
¥åã¯ä»¥äžã®åœ¢åŒã«åŸãã $S$ å¶çŽ $1 \leq |S| \leq 40$... | 37,573 |
Problem I: Roads in a City Roads in a city play important roles in development of the city. Once a road is built, people start their living around the road. A broader road has a bigger capacity, that is, people can live on a wider area around the road. Interstellar Conglomerate of Plantation and Colonization (ICPC) is ... | 37,574 |
Problem D: So Sleepy You have an appointment to meet a friend of yours today, but you are so sleepy because you didnât sleep well last night. As you will go by trains to the station for the rendezvous, you can have a sleep on a train. You can start to sleep as soon as you get on a train and keep asleep just until you g... | 37,575 |
Transparent Mahjong F: éæãªéº»éç ããªãã¯ïŒéã«èãéãã倩çœãšåãããã®ã£ã³ãã©ãŒã®é·¹å·£ãããšéº»éã§å¯Ÿå±ããããšã«ãªã£ãïŒ é·¹å·£ããã¯å€©çœãšåãããã ããã£ãŠïŒé·¹å·£çãšãã奿ªãªéº»éçãçšãã察å±ãææ¡ããŠããïŒ éº»éãšã¯ïŒãã¬ã€ã€ãŒãäºãã«æçãšããè€æ°æã®çãæã¡åãïŒèªåã®æçãçžæãããã¯ããïŒã¢ã¬ãªã®åœ¢ã«ããããšã§åå©ã確å®ããã²ãŒã ã§ããïŒ éº»éã®çã®è¡šåŽã«ã¯ïŒãã®çãäœã§ããããæãããŠããïŒçã®è£åŽã«ã¯ïŒäœãæãããŠããªãïŒ ãã£ãŠïŒããªãã麻éã§å¯Ÿå±ãããšãã¯ïŒããªãã®æçã®è¡šåŽãããªãã®åŽã«ïŒè£åŽã察å±è
ã®åŽã«åãããšããïŒ ããããããšã§ïŒããªãã®æçãäœã§ãããã¯ïŒããªãã®ã¿ãç¥ã... | 37,576 |
Bridge Removal ICPC islands once had been a popular tourist destination. For nature preservation, however, the government decided to prohibit entrance to the islands, and to remove all the man-made structures there. The hardest part of the project is to remove all the bridges connecting the islands. There are n islands... | 37,577 |
Score : 900 points Problem Statement There are N pinholes on the xy -plane. The i -th pinhole is located at (x_i,y_i) . We will denote the Manhattan distance between the i -th and j -th pinholes as d(i,j)(=|x_i-x_j|+|y_i-y_j|) . You have a peculiar pair of compasses, called Manhattan Compass . This instrument always po... | 37,578 |
A: ç§€ / Steelyard å顿 æ
倪ããã¯é·ã $2L$ ã®æ£ã䜿ã£ãŠäžã®å³ã®ãããªç§€ãäœã£ãïŒ æ£ã«ã¯çééã« $2L+1$ åã®ç©ŽãããããïŒå·Šããé ã« $-L, -L+1, \cdots, -1, 0, 1, \cdots, L-1, L$ ãšããçªå·ãä»ããããŠããïŒãã㊠$0$ çªã®ç©Žã®å Žæã倩äºããçŽã§åãããŠããïŒ æ
倪ããã¯ïŒç§€ã®ç©Žã« $N$ åã®ããããåãããïŒ$i$ çªç®ã®ããããåããã穎ã®çªå·ã¯ $x_i$ ã§ïŒãããã®éã㯠$w_i$ ã§ããïŒãããã $1$ ã€ãåããããªã穎ãïŒè€æ°ã®ããããåãããã穎ãååšãããïŒ æ
倪ãããåããããããã«ãã£ãŠã¯ïŒç§€ãåŸããŠãããããããªãïŒå§ã®... | 37,579 |
æ¶ããæ°åãæ¶ããªãæ°å ãã ãåã¯é ã®äœæãããããã«ãæ°åã䜿ã£ãã²ãŒã ãããŠããŸãããã®ã²ãŒã ã§ã¯ãã¯ããã«ãïŒããïŒãŸã§ã®æ°åãã©ã³ãã ã«äžŠãã åãäžããããŸãããã ãåã¯ãæ°åãããã®äžéšåãæ¶ããŠãããŸããã«ãŒã«ã¯ã以äžã®éãã§ãã æ°åãããåãæ°åãïŒã€ä»¥äžäžŠãã§ããéšåãé©åœã«éžã¶ããã®éšåãå«ã¿ãé£ç¶ããŠçŸããŠããåãæ°åããã¹ãŠæ¶ãã æ¶ããéšåã®å³åŽã«æ°åãæ®ã£ãŠããå Žåã¯ããããå·Šã«è©°ããŠãæ°åãïŒã€ã«ãŸãšããã äžã®ïŒã€ã®æäœãç¹°ãè¿ããçµæããã¹ãŠã®æ°åãæ¶ããã°ã²ãŒã ã¯ãªã¢ãšãªãã äŸãã°ãäžã®å³ã®ãã㪠1,2,3,3,2,2,1,2,2 ãšããæ°åã®å Žåã å·Šããæ°ããŠãïŒçªç®ãïŒçªç®ã®ïŒãæ¶ããš... | 37,580 |
ãããã¹ã åé¡ IOI補èã§ã¯ïŒåµæ¥ä»¥æ¥ã®äŒçµ±ã®è£œæ³ã§ç
é€
ïŒããã¹ãïŒãçŒããŠããïŒãã®äŒçµ±ã®è£œæ³ã¯ïŒçç«ã§äžå®æé衚åŽãçŒãïŒè¡šåŽãçŒãããšè£è¿ããŠïŒçç«ã§äžå®æéè£åŽãçŒããšãããã®ã§ããïŒãã®äŒçµ±ãå®ãã€ã€ïŒç
é€
ãæ©æ¢°ã§çŒããŠããïŒãã®æ©æ¢°ã¯çžŠ R (1 †R †10) è¡, 暪 C (1 †C †10000) åã®é·æ¹åœ¢ç¶ã«ç
é€
ã䞊ã¹ãŠçŒãïŒéåžžã¯èªåé転ã§ïŒè¡šåŽãçŒãããäžæã«ç
é€
ãè£è¿ãè£åŽãçŒãïŒ ããæ¥ïŒç
é€
ãçŒããŠãããšïŒç
é€
ãè£è¿ãçŽåã«å°éãèµ·ããäœæãã®ç
é€
ãè£è¿ã£ãŠããŸã£ãïŒå¹žããªããšã«çç«ã®ç¶æ
ã¯é©åãªãŸãŸã§ãã£ããïŒãã以äžè¡šåŽãçŒããšåµæ¥ä»¥æ¥ã®äŒçµ±ã§å®ããããŠããçŒãæéãè¶
ããŠããŸãïŒç
é€
... | 37,581 |
Division of Big Integers Given two integers $A$ and $B$, compute the quotient, $\frac{A}{B}$. Round down to the nearest decimal. Input Two integers $A$ and $B$ separated by a space character are given in a line. Output Print the quotient in a line. Constraints $-1 \times 10^{1000} \leq A, B \leq 10^{1000}$ $B \ne 0$ Sa... | 37,582 |
Sorting Five Numbers Write a program which reads five numbers and sorts them in descending order. Input Input consists of five numbers a , b , c , d and e (-100000 †a , b , c , d , e †100000). The five numbers are separeted by a space. Output Print the ordered numbers in a line. Adjacent numbers should be separated b... | 37,583 |
K: ææž (Angel Relief) 倩䜿ã®å€©çããã¯ãããè¡ãæãããšã«ããã ãã®è¡ã¯åå $H$ åºç» à æ±è¥¿ $W$ åºç»ã«åããããé·æ¹åœ¢ã®åœ¢ãããŠãããååºç»ã«å®¶ãããã åããæ°ã㊠$X$ çªç®ã西ããæ°ã㊠$Y$ çªç®ã®åºç»ã $(X, Y)$ ã§è¡šãã åºç» $(i, j)$ ã«ããå®¶ã«ã¯ $A_{i, j}$ 人ã®äººãäœãã§ããã 倩çããã¯ã蟺ãååãŸãã¯æ±è¥¿ã«å¹³è¡ãŸãã¯åçŽãªé·æ¹åœ¢ã®ãšãªã¢ãéžã³ããã®äžã«äœãã§ãã人å
šå¡ã ã²ãšããã€ ææžããã 倩çããã¯ãèãããããã¹ãŠã®é·æ¹åœ¢ã§ãã®æäœãè¡ãã 倩çãããäººãææžããåæ°ã®åèšãæ±ããã å
¥å 1 è¡ç®ã«ãæŽæ° $H, W$ ã空çœåºåãã§äž... | 37,584 |
Score : 100 points Problem Statement Find the number of ways to choose a pair of an even number and an odd number from the positive integers between 1 and K (inclusive). The order does not matter. Constraints 2\leq K\leq 100 K is an integer. Input Input is given from Standard Input in the following format: K Output Pri... | 37,585 |
Problem J: Tile Puzzle You are visiting Ancient and Contemporary Museum. Today there is held an exhibition on the history of natural science. You have seen many interesting exhibits about ancient, medieval, and modern science and mathematics, and you are in a resting space now. You have found a number of panels there. ... | 37,586 |
Score : 400 points Problem Statement You are given a tree with N vertices. Here, a tree is a kind of graph, and more specifically, a connected undirected graph with N-1 edges, where N is the number of its vertices. The i -th edge (1â€iâ€N-1) connects Vertices a_i and b_i , and has a length of c_i . You are also given Q q... | 37,587 |
One Problem Statement é»è»ã®çªããçŸãã山䞊ã¿ãèŠããïŒ çªã¯ïŒå·Šäžé
ã®åº§æšã (0, 0) ïŒå³äžé
ã®åº§æšã (W, H) ã®é·æ¹åœ¢ã§ããïŒ çªãã㯠N ã€ã®å±±ãèŠããŠããïŒ i çªç®ã®å±±ã¯äžã«åžãªæŸç©ç· y = a_i (x-p_i)^2 + q_i ã®åœ¢ãããŠããïŒ å±±ãšç©ºãšã®å¢çç·ã®é·ããæ±ããïŒ æ¬¡ã®äžã€ã®å³ã¯ Sample Input ã«å¯Ÿå¿ããŠããïŒå€ªç·ã§ç€ºãããŠããéšåãå±±ãšç©ºãšã®å¢çç·ã§ããïŒ Input å
¥åã¯ä»¥äžã®åœ¢åŒã«åŸãïŒäžããããæ°ã¯å
šãп޿°ã§ããïŒ W H N a_1 p_1 q_1 ... a_N p_N q_N Constraints 1 ⊠W, H ⊠100 1 ⊠N... | 37,588 |
Score: 600 points Problem Statement E869120 is initially standing at the origin (0, 0) in a two-dimensional plane. He has N engines, which can be used as follows: When E869120 uses the i -th engine, his X - and Y -coordinate change by x_i and y_i , respectively. In other words, if E869120 uses the i -th engine from coo... | 37,589 |
Score : 700 points Problem Statement In the State of Takahashi in AtCoderian Federation, there are N cities, numbered 1, 2, ..., N . M bidirectional roads connect these cities. The i -th road connects City A_i and City B_i . Every road connects two distinct cities. Also, for any two cities, there is at most one road th... | 37,590 |
Score : 1000 points Problem Statement There are N oases on a number line. The coordinate of the i -th oases from the left is x_i . Camel hopes to visit all these oases. Initially, the volume of the hump on his back is V . When the volume of the hump is v , water of volume at most v can be stored. Water is only supplied... | 37,591 |
Score : 500 points Problem Statement Takahashi is at an all-you-can-eat restaurant. The restaurant offers N kinds of dishes. It takes A_i minutes to eat the i -th dish, whose deliciousness is B_i . The restaurant has the following rules: You can only order one dish at a time. The dish ordered will be immediately served... | 37,592 |
Problem L: Product Problem äŒæŽ¥åã¯ãçŽ æ°$P$ãèªç¶æ°ãããªãéå$G$ãèªç¶æ°$A$ã䜿ã£ãŠã²ãŒã ãããããšã«ããŸããã ãŸããäŒæŽ¥åã¯æå
ã®çŽã«$1$ãæžããŸãããã®åŸã以äžã®äžé£ã®æäœãä»»æã®åæ°è¡ããŸãã $G$ããèŠçŽ ãäžã€éžã¶ãããã$g$ãšããã æå
ã®çŽã«æžãããæ°ãš$g$ãšã®ç©ãæ°ããçŽã«æžãã å
ã
çŽã«æžãããŠããæ°ãæ¶ãã æå
ã®çŽã«æžãããæ°ã$P$ã§å²ã£ãããŸããš$A$ãçãããã°äŒæŽ¥åã®åã¡ã§ãããã§ãªããã°è² ãã§ãã$P$ã$G$ã$A$ãäžãããããšãã«äŒæŽ¥åãåã€ããšãã§ãããå€å®ããŠãã ããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã $P$ $T$ $Test_1$... | 37,593 |
Testing Circuits A Boolean expression is given. In the expression, each variable appears exactly once. Calculate the number of variable assignments that make the expression evaluate to true. Input A data set consists of only one line. The Boolean expression is given by a string which consists of digits, x, (, ), |, &, ... | 37,594 |
Problem I: Hard Beans Problem 倧接倧åŠã§ã¯è±ãçãã§ãã N åã®è±ãäžçŽç·äžã«äžŠãã§ããŸãã ãããã0ããé ã« N â1ãŸã§çªå·ããµãããŠããã i çªç®ã®è±ã®ç¡¬ãã a i ãšããŸãã ã·ã¢ã³åã¯çæ³ã®è±ã®ç¡¬ãã D ã ãšèããŠããŸããããããã·ã¢ã³åã¯é¢åãããããªã®ã§ããŸãé ãã«ããè±ãåãã«è¡ããããããŸããããããã£ãŠãã·ã¢ã³å㯠l çªç®ã®è±ãã r çªç®ã®è±ã®äžã§ç¡¬ãã D ã«æãè¿ãè±ãç¥ããããšæã£ãŠããŸãã ã·ã¢ã³å㯠Q åã®è³ªåãããŠããã®ã§ãããããã®è³ªåã«å¯Ÿãéåºé[ l , r ]çªç®ã«ãã | è±ã®ç¡¬ã â D | ã®æå°å€ãæ±ããããã°ã©ã ãäœæããŠãã ããã(ãã ... | 37,596 |
Score : 600 points Problem Statement The squirrel Chokudai has N acorns. One day, he decides to do some trades in multiple precious metal exchanges to make more acorns. His plan is as follows: Get out of the nest with N acorns in his hands. Go to Exchange A and do some trades. Go to Exchange B and do some trades. Go to... | 37,597 |
Pattern Search Find places where a R Ã C pattern is found within a H Ã W region. Print top-left coordinates ( i , j ) of sub-regions where the pattern found. The top-left and bottom-right coordinates of the region is (0, 0) and ( H -1, W -1) respectively. Input In the first line, two integers H and W are given. In the ... | 37,598 |
ããããã®æ¯å ãžã§ãŠåãšã€ãšããã¯ä»²ã®è¯ãã«ããã«ã§ãããžã§ãŠåã¯ã«ãã»ã«ç©å
·èªè²©æ©(ã¬ãã£ãã³)ã®æ¯åãéããŠãããäºäººã§åºããããšãããã¬ãã£ãã³ãèŠã€ãããšäœåºŠããã£ãŠã¿ãã»ã©ã®ç±ã®å
¥ãããã§ããã€ãšããã¯æ¥œããããªãžã§ãŠåããã°ã§èŠãŠããã ãã§ãããããžã§ãŠåã®ä»åºŠã®èªçæ¥ãã¬ãŒã³ãã«ã¬ãã£ãã³ã®æ¯åãã²ãšã€ãããããšã«ããŸãããã€ãšããã¯ã¬ãã£ãã³èªäœã«ã¯ããŸãèå³ããããŸããã§ããããã§ããã°ãžã§ãŠåãšããããã®æ¯åãæ¬²ãããšæã£ãŠããŸãã ã€ãšããããã£ãŠã¿ãããšæãã¬ãã£ãã³ã¯ãïŒåã®ãã£ã¬ã³ãžã§æ¯åãã²ãšã€åºãŸããååãã®ãã®ãå«ãæ¯åãäœçš®é¡ããã®ããšãããããã®æ¯åãããã€æ®ã£ãŠããã®ãã¯ããããŸãããããã... | 37,599 |
F: Steps åé¡ AORã€ã«ã¡ããã¯æ ªåŒäŒç€ŸAORã®èŠå¯ã«èšªããã æ ªåŒäŒç€ŸAOR㯠$N$ é建ãŠã®ãã«ã§ãããå°äžéã¯ååšããªãã AORã€ã«ã¡ãã㯠$1$ éããèŠå¯ãéå§ããã¡ããã© $M$ åç§»åããããšã«ããã $1$ åã®ç§»åã§ $i$ éãã $i + 1$ éãããã㯠$i - 1$ éã«ç§»åããããšãã§ããã ãã ãã ç§»åå
ã $0$ éã $N + 1$ éãšãªãããã«ç§»åããããšã¯ã§ããªãã AORã€ã«ã¡ãããå
šãŠã®éã«äžåºŠä»¥äžèšªããç§»åæ¹æ³ã®éãæ°ã $1000000007 (= 10^9 + 7)$ ã§å²ã£ãäœããæ±ããã ãªãã $1$ éã«ã¯ãã§ã«èšªãããã®ãšããã å¶çŽ $2 \leq ... | 37,600 |
(Please read problem A first. The maximum score you can get by solving this problem B is 1, which will have almost no effect on your ranking.) Beginner's Guide Let's first write a program to calculate the score from a pair of input and output. You can know the total score by submitting your solution, or an official pro... | 37,601 |
Problem D: Dr. Nakamura's Lab. Dr.äžæã¯å倧ãªçºæè
ã§ãã, 仿¥ã垞人ã«ã¯çºæ³åºæ¥ãªãæ°ããªçºæã«åãæãã£ãŠãã. ä»çºæããŠããã®ã¯æ°ããªé²ç¯ã·ã¹ãã ãšã³ã³ããã§ãã. é²ç¯ã·ã¹ãã ã®æ¹ã¯äžã«ä¹ã£ãè
ãèå¥ããŠæãããã客ã ã£ãå Žå, 黿µãæµããŠæ°çµ¶ãããããã«ã§ãã. ãã®ããã«ã¯èžãŸãªãããã«äžãééããŠãç¡é§ã§, 空äžã®ãã®ã«å¯ŸãæŸé»ãã. ããã, ãŸã 宿ã«ã¯çšé ã, 黿µã¯åŒ·ãããŠèª¿ç¯ãäžå¯èœã§, äžåºŠæŸé»ãããšå
é»ããªãéã䜿ããªã. ãŸã, 人ãšç©äœã®åºå¥ãã§ãã, ãããã人èªäœåºå¥ã§ããªãçæ¬ ç¹ããããã°ããªããªã. ã³ã³ããã®æ¹ã¯è¬ã®åã«ãã£ãŠåžžæå°é¢ããæµ®ããŠãã, ... | 37,602 |
æ¥ã®åºãšæ¥ã®å
¥ã 倪éœãçŸããããšããæ¥ã®åºããé ããããšããæ¥ã®å
¥ãããšåŒã³ãŸããããã®å³å¯ãªæå»ã¯å€ªéœãå°å¹³ç·ã«å¯ŸããŠã©ã®ãããªäœçœ®ã«ããæã§ããããã äžã®å³ã®ããã«ã倪éœãåãå°å¹³ç·ãçŽç·ã§è¡šãããšã«ããŸãããã®ãšãã倪éœã®ãæ¥ã®åºããæ¥ã®å
¥ããã®æå»ã¯ã倪éœã衚ãåã®äžç«¯ãå°å¹³ç·ã衚ãçŽç·ãšäžèŽããç¬éãšãããŠããŸããæ¥ã®åºã®æå»ãéããåã®äžç«¯ãçŽç·ããäžã«ããæéåž¯ãæŒéãåãçŽç·ã®äžãžå®å
šã«é ããŠããæé垯ãå€éãšãªããŸãã ããæå»ã®å°å¹³ç·ãã倪éœã®äžå¿ãŸã§ã®é«ããšã倪éœã®ååŸãå
¥åãšãããã®æå»ããæŒéããããæ¥ã®åºãŸãã¯æ¥ã®å
¥ãããããå€éãããåºåããããã°ã©ã ãäœæããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžã... | 37,603 |
B: åšææ°å - Periodic Sequence - åé¡ H倧åŠã®ææãåããŠããPeriodå士ã¯ãäžç©ã«æœããšãããåšæãšåŒã°ããæ§è³ªãç ç©¶ããŠãããäžè¬çã«ç¥ãããŠããåºæ¬çãªåšæãšããŠã¯ãæ°åã«æœãåšæãèããããã ãããããªãã¡ãé·ã N ã®æ°å S = S_1, S_2, ... , S_N ã以äžã®æ§è³ªãæºãããªãã°ãåšæ t ( t \†N ) ãæã€ãšããäºå®ã§ããã 1 \†i \†N â t ã«ã€ããŠã S_i=S_{i+t} ã§ããã ä»ãPeriodå士ãçç®ããŠããã®ã¯ãåšæãçšããŠããç°¡æãªèšè¿°ãã§ããæ°åã§ãããäŸãã°ãé·ã N ã®æ°åãåšæ t ( \†N ) ãæã€ãšããããæŽæ° ... | 37,604 |
Recurring Decimals A decimal representation of an integer can be transformed to another integer by rearranging the order of digits. Let us make a sequence using this fact. A non-negative integer a 0 and the number of digits L are given first. Applying the following rules, we obtain a i +1 from a i . Express the integer... | 37,605 |
A - ã¢ã«ãã³ã å顿 ãããã¯è¿æã®ã¹ãŒããŒã§åããŠã¹ãã²ããã£ãšãããã®ã賌å
¥ããïŒããã±ãŒãžã®æ
å ±ã«ãããšïŒãã®ã¹ãã²ããã£ã¯ T ç§è¹ã§ããšæãçæ³çãªç¶æ
ã«è¹ã§äžãããããïŒ ãšããã§ãããã¯é»æ°ãå«ããªäººéã§ããïŒå®¶ã«ã¯ãã¬ããããœã³ã³ã¯ãããïŒæèšããç¡ãïŒ ãã®ããã¹ãã²ããã£ãè¹ã§ããã«ãïŒæéãæž¬ãããšãã§ããªãïŒ é»æ± åŒã®æèšã¯å«ãªã®ã§ïŒãããã¯ä»£ããã«ç æèšãè²·ãããšèãïŒã¹ãŒããŒã®ç æèšå£²ãå Žãžãšåãã£ãïŒ å£²ãå Žã«ã¯ N åã®ç æèšããã£ãïŒ i çªç®ã®ç æèšã¯ã¡ããã© x i ç§ã ãæž¬ãããšãã§ããããã§ãã£ãïŒ ãããããã£ãŠæ©ãŸãããïŒã¹ãã²ããã£ã®ããã«ç æèšãäœåãè²·ãã®ã¯éŠ¬é¹¿ãããã®ã§ãã®... | 37,606 |
Problem H: Robot's Crash Prof. Jenifer A. Gibson is carrying out experiments with many robots. Since those robots are expensive, she wants to avoid their crashes during her experiments at her all effort. So she asked you, her assistant, as follows. âSuppose that we have n (2 †n †100000) robots of the circular shape w... | 37,607 |
Score : 100 points Problem Statement You planned a trip using trains and buses. The train fare will be A yen (the currency of Japan) if you buy ordinary tickets along the way, and B yen if you buy an unlimited ticket. Similarly, the bus fare will be C yen if you buy ordinary tickets along the way, and D yen if you buy ... | 37,608 |
Score : 800 points Problem Statement This is an interactive task. Snuke has a favorite positive integer, N . You can ask him the following type of question at most 64 times: "Is n your favorite integer?" Identify N . Snuke is twisted, and when asked "Is n your favorite integer?", he answers "Yes" if one of the two cond... | 37,609 |
Score : 300 points Problem Statement You are given a sequence of length N : A_1, A_2, ..., A_N . For each integer i between 1 and N (inclusive), answer the following question: Find the maximum value among the N-1 elements other than A_i in the sequence. Constraints 2 \leq N \leq 200000 1 \leq A_i \leq 200000 All values... | 37,610 |
Score : 700 points Problem Statement We have a directed weighted graph with N vertices. Each vertex has two integers written on it, and the integers written on Vertex i are A_i and B_i . In this graph, there is an edge from Vertex x to Vertex y for all pairs 1 \leq x,y \leq N , and its weight is {\rm min}(A_x,B_y) . We... | 37,611 |
Score : 300 points Problem Statement You are given N real values A_1, A_2, \ldots, A_N . Compute the number of pairs of indices (i, j) such that i < j and the product A_i \cdot A_j is integer. Constraints 2 \leq N \leq 200\,000 0 < A_i < 10^4 A_i is given with at most 9 digits after the decimal. Input Input is given fr... | 37,612 |
Problem Statement In A.D. 2101, war was beginning. The enemy has taken over all of our bases. To recapture the bases, we decided to set up a headquarters. We need to define the location of the headquarters so that all bases are not so far away from the headquarters. Therefore, we decided to choose the location to minim... | 37,613 |
Transformation Write a program which performs a sequence of commands to a given string $str$. The command is one of: print a b : print from the a -th character to the b -th character of $str$ reverse a b : reverse from the a -th character to the b -th character of $str$ replace a b p : replace from the a -th character ... | 37,614 |
Problem A: Special Chat Problem 人æ°åç»æçš¿ãµã€ããZouTubeãã¯ä»ã空åã®ãããŒãã£ã«ZouTuberãããŒã ã®çã£åªäžã«ããããã®äžã§ããæè¿ç¹ã«æ³šç®ãéããŠããã®ã¯ãåŸèŒ©ç³»ããŒãã£ã«ZouTuberãã¢ã€ã
ããªã ïŒéç§°ïŒã¢ã
ãªã ïŒãã ã ã¢ã
ãªã ã®å€§ãã¡ã³ã§ããããªãã¯ãæ¬æ¥ã®ã¢ã
ãªã ã®ã©ã€ãé
ä¿¡ã§ã圌女ã«ãã¹ãã·ã£ã«ãã£ããããéãã€ããã ã ãã¹ãã·ã£ã«ãã£ããããšã¯ãZouTubeã®æäŸãããèŠèŽè
ãé
ä¿¡è
ã«ãã€ã³ãããã¬ãŒã³ãããæ©èœã ã ãèŠèŽè
ã¯ã¹ãã·ã£ã«ãã£ãã$1$åã«ã€ãã$500$, $1000$, $5000$, $10000$ã®ããããã ããã€ã³ããæ¶è²»ããŠãæ¶è²»ãã... | 37,615 |
Score : 100 points Problem Statement You are given an array a_0, a_1, ..., a_{N-1} of length N . Process Q queries of the following types. The type of i -th query is represented by T_i . T_i=1 : You are given two integers X_i,V_i . Replace the value of A_{X_i} with V_i . T_i=2 : You are given two integers L_i,R_i . Cal... | 37,616 |
Score : 900 points Problem Statement There is a tree with N vertices numbered 1 through N . The i -th of the N-1 edges connects vertices a_i and b_i . Initially, each vertex is uncolored. Takahashi and Aoki is playing a game by painting the vertices. In this game, they alternately perform the following operation, start... | 37,617 |
Problem G: Nim Let's play a traditional game Nim. You and I are seated across a table and we have a hundred stones on the table (we know the number of stones exactly). We play in turn and at each turn, you or I can remove one to four stones from the heap. You play first and the one who removed the last stone loses. In ... | 37,618 |
Score : 600 points Problem Statement We have a tree with N vertices. The i -th edge connects Vertex A_i and B_i bidirectionally. Takahashi is standing at Vertex u , and Aoki is standing at Vertex v . Now, they will play a game of tag as follows: 1 . If Takahashi and Aoki are standing at the same vertex, the game ends. ... | 37,619 |
Score : 900 points Problem Statement Akaki, a patissier, can make N kinds of doughnut using only a certain powder called "Okashi no Moto" (literally "material of pastry", simply called Moto below) as ingredient. These doughnuts are called Doughnut 1 , Doughnut 2 , ..., Doughnut N . In order to make one Doughnut i (1 †... | 37,620 |
RPG Maker You are planning to create a map of an RPG. This map is represented by a grid whose size is $H \times W$. Each cell in this grid is either ' @ ', ' * ', ' # ', or ' . '. The meanings of the symbols are as follows. ' @ ': The start cell. The story should start from this cell. ' * ': A city cell. The story goes... | 37,621 |
Problem E: School Excursion æ¥ãããã¯ä¿®åŠæ
è¡ã®ææã§ããã äŒæŽ¥å€§åŠéå±å°åŠæ ¡ïŒäŒæŽ¥å€§å°ïŒã§ããæ¥å¹ŽåºŠã®ä¿®åŠæ
è¡ã®èšç»ã建ãŠãããŠããã ä¿®åŠæ
è¡ã¯é»è»ã§ç§»åããããšãäŒçµ±ã«ãªã£ãŠããã äŒæŽ¥è¥æŸåžå
ã§ã¯é»è»ãå©çšããæ©äŒãå°ãªãããã ã ããããåŠæ ¡ã«å±ããããèŠæ
ã«ããæå¡ãã¡ã¯é ãæ©ãŸããŠããã ããã¯ããããé§
ã§å€§äººæ°ã§ä¹ãæããè¡ã£ãŠããã®ã§ããã®é§
ãå©çšããä»ã®ä¹å®¢ã«è¿·æã§ãã£ãããšããå
容ã ã£ãã ãšãã«ãé»è»ãéããããšããŒã ããã®éè·¯ã§å€§æ··éããŠããŸã£ããšããã ããã¯è¿å¹ŽãäŒæŽ¥å€§å°ã®çåŸæ°ãæ¥äžæããŠããããã§ãã£ãã ãã®åå ã¯æ¥æ¬ã«ãããŠç«¶æããã°ã©ãã³ã°ã倧æµè¡ãã å°åŠæ ¡ãã... | 37,622 |
Pilling Blocks We make a tower by stacking up blocks. The tower consists of several stages and each stage is constructed by connecting blocks horizontally. Each block is of the same weight and is tough enough to withstand the weight equivalent to up to $K$ blocks without crushing. We have to build the tower abiding by ... | 37,623 |
è¿·åã®åå ããããåãšããããåã¯ä»²è¯ãã®ååã§ãããè¡åãçéã§ãã äŸãã°ãããããåã西ã«è¡ãã°ãããããåã¯æ±ãžè¡ããããããåãåãžè¡ãã°ãããããåã¯åãžè¡ããŸãã çŸåš 2 人ã¯ãããŒãã«æ¥ãŠãããå¥ã
ã®å Žæã«ããŸããçéã«ç§»åããŠããŸã 2 人ãã§ããã ãæ©ãåºäŒãããã«ã¯ã©ããããããã§ãããã? ãããŒãã¯æšª W å à 瞊 H åã®ãã¹ã§æ§æãããã°ãªããã§è¡šããã2 人ã¯åäœæéã«æ±è¥¿ååã« 1 ãã¹åç§»åããããšãã§ããŸãããã ããã°ãªããã®ç¯å²å€ãé害ç©ã®ãããã¹ã«ç§»åããããšã¯ã§ããŸããã å³ã®ããã«ãã°ãªããã®ãã¹ã®äœçœ®ã¯åº§æš ( x , y ) ã§è¡šãããŸãã ã°ãªããã®æ
å ±ãš 2 人ã®åæäœçœ®ã... | 37,624 |
Courage Test Pã仿¥ã¯è詊ãäŒç»ã®çªçµã®åé²ã ãã Oåæºçµµéãããããã ããâŠâŠã åæããªåãæºçµµéã¡ãã倧äžå€«ïŒã æéèããããPããïŒäžè¡ã§ç¶æ³ãææ°å€æã«ãããçŽ æŽããã解説ã§ãïŒããïŒç«ã®çã«åãã£ãŠèµ°ããŸãããïŒã Pãã«ãŒã«ã¯ç°¡åãã¿ããªã§ååããŠãã®ãšãªã¢ã®ãã¹ãŠã®ç¥ç€Ÿã«ãåãããŠããã ãã ãã èããªãŒãœããã¯ã¹ã§ããïŒæ©éç¥ç€Ÿã«åãã£ãŠèµ°ããŸãããïŒã ããªåãã§ããããæ¥æ¬ææ°ã®ç¥ç€Ÿå¯åºŠã§è¡ããªãã¡ããããªãç¥ç€Ÿãããããããããããªãã£ãã£ãâŠâŠã ããªåãã§ãèã¡ãããããã°å¿åŒ·ããïŒã Pãã¡ãªã¿ã«ã¹ã¿ãŒãã¯å
šå¡éãç¥ç€Ÿããã¹ã¿ãŒããåæµãçŠæ¢ã ããããããæºçµµéãšããªåã¯åæäœçœ®ã«ã€ã... | 37,625 |
Problem H: Testing Sorting Networks A N sorting network is a circuit that accepts N numbers as its input, outputs them sorted. Mr. Smith is an engineer of a company that sells various sizes of the circuit. One day, the company got an order of N sorting networks. Unfortunately, they didn't have the circuit for N numbers... | 37,626 |
å顿 圱ã®é女 ELSAMARIA ã¯ãã¹ãŠã®ãã®ã«å¯ŸããŠç¥ããç¶ããé女ã§ããïŒåœ±ã«æãŸã£ãããããåœã¯ãã®é女ã®äžã«åŒããã蟌ãŸããŠããŸãïŒ åœ±ã¯è§Šæã®ããã«åã çŸæš¹ããã ãåŒããã蟌ãããšçã£ãŠããïŒ çŸæš¹ããã ã¯ãã®éå¥³ã«æãŸãããšãªãæ»æããããã«ïŒé女ã«ãšã£ãŠäºæž¬ã®é£ããã§ããããªåããããããšãèããïŒå
·äœçã«ã¯ïŒãŸãé ã®äžã§ 1 ãã N ãŸã§ã®æŽæ°ãäžæ§ãªç¢ºçã§ K åäœãïŒãã®åèšå€ã®è·é¢ã ãä»ã®äœçœ®ããéå¥³ã®æ¹åãžãžã£ã³ãããïŒãšããããšãç¹°ãè¿ãã®ã§ããïŒãããŠé女ã®äœçœ®ã«å°éããæã«æ»æããã®ã§ããïŒ ããã ãšé女ã¯ããäžçŽç·äžã«ãããšãïŒæåé女ã¯åº§æš 0 ïŒ ããã ã¯åº§æš S ã®äœçœ®ã«ããã... | 37,627 |
X-Ray Screening System ãã㯠20XX 幎ã®è©±ã§ããïŒåççºé»ç¶²ã«ããå®å®ãããšãã«ã®ãŒäŸçµŠïŒããã³æ¶²ååæçæã®çºæã«ãã£ãŠèªç©ºæ
客æ°ã¯é°»ç»ãã«å¢å ããïŒãããïŒèªç©ºæ©ã«ãããããªãºã ã®è
åšã¯äŸç¶ãšããŠååšããããïŒé«éã§ãã€é«ãä¿¡é Œæ§ããã€èªåæè·ç©æ€æ»ã·ã¹ãã ã®éèŠæ§ãé«ãŸã£ãŠããïŒæ€æ»å®ãå
šéšã®è·ç©ã調ã¹ãããšã¯å®éåé¡ãšããŠå°é£ã§ããããšããïŒèªåæ€æ»ã«ãããŠçããããšå€æãããæè·ç©ã ããæ€æ»å®ã§æ¹ããŠèª¿ã¹ããšããä»çµã¿ãæŽãããããã§ããïŒ èªç©ºæ©æ¥çããã®èŠè«ãåãïŒåœé客宀ä¿è·äŒç€ŸïŒInternational Cabin Protection CompanyïŒã§ã¯ïŒæ°ããªèªåæ€æ»ã·ã¹ãã ãé... | 37,628 |
Problem H: Magic Walls You are a magician and have a large farm to grow magical fruits. One day, you saw a horde of monsters, approaching your farm. They would ruin your magical farm once they reached your farm. Unfortunately, you are not strong enough to fight against those monsters. To protect your farm against them,... | 37,629 |
Problem G: Surface Area of Cubes Taro likes a single player game "Surface Area of Cubes". In this game, he initially has an $A \times B \times C$ rectangular solid formed by $A \times B \times C$ unit cubes (which are all 1 by 1 by 1 cubes). The center of each unit cube is placed at 3-dimentional coordinates $(x, y, z)... | 37,630 |
Score : 700 points Problem Statement Snuke has decided to play a game, where the player runs a railway company. There are M+1 stations on Snuke Line, numbered 0 through M . A train on Snuke Line stops at station 0 and every d -th station thereafter, where d is a predetermined constant for each train. For example, if d ... | 37,631 |
Problem C: How can I satisfy thee? Let me count the ways... Three-valued logic is a logic system that has, in addition to "true" and "false", "unknown" as a valid value. In the following, logical values "false", "unknown" and "true" are represented by 0, 1 and 2 respectively. Let "-" be a unary operator (i.e. a symbol ... | 37,632 |
Electric Metronome A boy PCK is playing with N electric metronomes. The i -th metronome is set to tick every t_i seconds. He started all of them simultaneously. He noticed that, even though each metronome has its own ticking interval, all of them tick simultaneously from time to time in certain intervals. To explore th... | 37,633 |
ãµã€ã³ãããºã« åé¢ã«ã¢ã«ãã¡ãããäžæå(a ã zãA ã Z)ãæããããµã€ã³ãããããŸãã ãã®ãããªãµã€ã³ãã8ã€çµã¿åãã㊠2 à 2 à 2 ã®ç«æ¹äœãäœãããšãèããŸãã çµã¿åããæ¹ã«ã¯æ¡ä»¶ããããåãµã€ã³ãã®åãåãé¢ã¯åãã¢ã«ãã¡ãããã§ãã€äžæ¹ãå°æåãã ãäžæ¹ã倧æåã§ãªããã°ãªããŸãããäŸãã°ãa ãšæãããé¢ã«æ¥ããããšãã§ããã®ã¯ A ãšæã ããé¢ã§ãããã ããæ¥ãããšãã®æåã®åãã¯åããŸããã ãã®ã«ãŒã«ã«åŸããïŒã€ã®ãµã€ã³ãã®æ
å ±ãå
¥åãšããç«æ¹äœãäœãããåŠããå€å®ããããã°ã©ã ãäœæããŠãã ãããç«æ¹äœãäœããå Žå㯠YESïŒåè§è±å€§æåïŒãäœããªãå Žå㯠NOïŒåè§è±å€§æåïŒãšåºåã... | 37,634 |
JOI çŽç« (JOI Emblem) æ
å ±ãªãªã³ããã¯æ¥æ¬å§å¡äŒã§ã¯ïŒå°æ¹Ÿå€§äŒã«åããéžæãå¿æŽããããã«æ°ããJOI æãäœæããããšã«ããïŒ JOI æã¯ïŒæ£æ¹åœ¢ã瞊㫠$M$ è¡ïŒæšªã« $N$ å䞊ãã 圢ãããŠããïŒåæ£æ¹åœ¢ã«ã¯ JïŒOïŒI ã®ããããã®æåã1 ã€ãã€æžãããŠããïŒ æ
å ±ãªãªã³ããã¯æ¥æ¬å§å¡äŒã¯JOI æãšã¯å¥ã«JOI çŽç« ãšãããã®ã決ããŠããïŒJOI çŽç« ã¯ïŒæ£æ¹åœ¢ã瞊ã«2 è¡ïŒæšªã«2 å䞊ãã 圢ãããŠããïŒåæ£æ¹åœ¢ã«ã¯JïŒOïŒI ã®ããããã®æåã1 ã€ãã€æžãããŠããïŒ JOI æã«å«ãŸããJOI çŽç« ã®åæ°ãšã¯ïŒJOI æã«å«ãŸãã瞊2 è¡ïŒæšª2 åã®é åã®ãã¡ïŒãã®é åã®JïŒOïŒI ã®é
眮ãJOI... | 37,635 |
A : Taps / èå£ Problem ããã¥åã®å®¶ã®æµŽæ§œã«ã¯2ã€ã®èå£ A , B ãã€ããŠããã ã²ãããšã²ãã£ãè§åºŠã«æ¯äŸããéã®æ°ŽãåºãŠããã åºãŠããæ°Žã®æž©åºŠã¯ A 㯠t A [â]ã B 㯠t B [â]ã§äžå®ã§ããã 颚åã«å
¥ããšãã«ã¯ãããã®éã調ç¯ããŠæ··ãããããããšã§é©åºŠãªæž©åºŠã«ãªãããã«ããŠããã t A [â] ã®æ°Ž v A [L] ãš t B [â]ã®æ°Ž v B [L] ãæ··ãåãããåŸã®æž©åºŠã¯ã( t A à v A + t B à v B ) / ( v A + v B ) ã«ãªãã äŸãã°ã t A = 80â, t B = 20â ã§ 40â ã®ã湯ã匵ããããšãã«ã¯ã A ãã 100mL... | 37,636 |
Problem I: Common Polynomial Math teacher Mr. Matsudaira is teaching expansion and factoring of polynomials to his students. Last week he instructed the students to write two polynomials (with a single variable x), and to report GCM (greatest common measure) of them as a homework, but he found it boring to check their ... | 37,637 |
Problem J: å€é
åŒã®è§£ã®åæ° ãããŸãåã¯å€§åŠã§ããŸããŸãªå€æã«ã€ããŠç ç©¶ããŠãããæè¿ããããŸãåãèå³ãæã£ãŠããå€æã¯æ¬¡ã®ãããªãã®ã§ããã N+1åã®æŽæ° a 0 , ..., a N ãåºå®ããæŽæ° z ãå
¥åãšããããŸã P ãçŽ æ°ãšããã t = ( a N z N + a N-1 z N-1 + ... + a 2 z 2 + a 1 z + a 0 ) mod P ãããŸãåã¯ãã®å€æã«ãã£ãŠ t = 0 ã«ãªã£ãŠããŸã z ãããã€ãããããšã«æ°ãã€ããã ããã§ããããŸãåã¯å人ã§ããã¹ãŒããŒããã°ã©ããŒã§ãããããªãã«ã倿åŸã« t = 0 ã«ãªã z ã 0ãP-1 ã«ããã€ããããèšç®ããŠããã... | 37,638 |
Score : 500 points Problem Statement You have a string A = A_1 A_2 ... A_n consisting of lowercase English letters. You can choose any two indices i and j such that 1 \leq i \leq j \leq n and reverse substring A_i A_{i+1} ... A_j . You can perform this operation at most once. How many different strings can you obtain? ... | 37,639 |
ããã©å§«ã®ããºã« ãã¬ã¹çåœã®ããã©å§«ã¯ç¡é¡ã®ããºã«å¥œããšããŠç¥ãããŠããïŒæè¿ã¯èªèº«ãèæ¡ãããããã©ããºã«ãã«ç±äžããŠããïŒ ããã¯ïŒæ£äžè§åœ¢ã®ãã¹ãæ·ãè©°ããããŒããšïŒããã©ãããã¯ãšåŒã°ãã 4 æã®æ£äžè§åœ¢ã®ããã«ãããªãæ£åé¢äœã®ãããã¯ã䜿ã£ãããºã«ã§ããïŒ ããºã«ã®ç®çã¯ïŒããŒãäžã®ãã¹ãŠã®ããã©ãããã¯ã以äžã®æ¡ä»¶ãã¿ããããã«å±éããããšã§ããïŒ å±éãããããã©ãããã¯ãïŒçœ®ãããŠãããã¹ããã³ïŒããããã«æå®ãããç°ãªã 2 ã€ã®ãã¹ãèŠã£ãŠãã ã©ã®ãã¹ãïŒ2 ã€ä»¥äžã®ããã«ã§èŠãããŠããªã å³F-1ã¯ããã©ããºã«ã®åé¡äŸããã³ïŒãã®è§£çäŸã§ããïŒ â
ã®ãã¹ãšâã®ãã¹ã«ããã©ãããã¯ã眮ãããŠããïŒãããã... | 37,640 |
Problem C Sibling Rivalry You are playing a game with your elder brother. First, a number of circles and arrows connecting some pairs of the circles are drawn on the ground. Two of the circles are marked as the start circle and the goal circle . At the start of the game, you are on the start circle. In each turn of the... | 37,641 |
Score : 700 points Problem Statement You are given a string s of length n . Does a tree with n vertices that satisfies the following conditions exist? The vertices are numbered 1,2,..., n . The edges are numbered 1,2,..., n-1 , and Edge i connects Vertex u_i and v_i . If the i -th character in s is 1 , we can have a co... | 37,642 |
Problem C: Dial Lock A dial lock is a kind of lock which has some dials with printed numbers. It has a special sequence of numbers, namely an unlocking sequence, to be opened. You are working at a manufacturer of dial locks. Your job is to verify that every manufactured lock is unlocked by its unlocking sequence. In ot... | 37,643 |
ééè·¯ç· è€ç·ïŒäžããšäžããå¥ã®ç·è·¯ã«ãªã£ãŠããŠã©ãã§ã§ãããéããïŒã®ééè·¯ç·ããããŸãããã®è·¯ç·ã«ã¯çµç«¯é§
ãå«ããŠ11 ã®é§
ããããããããã®é§
ãšé§
ã®éã¯å³ã§ç€ºãåºéçªå·ã§åŒã°ããŠããŸãã ãã®è·¯ç·ã®äž¡æ¹ã®çµç«¯é§
ããåè»ãåæã«åºçºããŠãéäžã§åãŸããã«èµ°ããŸããååºéã®é·ããš2 æ¬ã®åè»ã®é床ãèªã¿èŸŒãã§ãããããã®å Žåã«ã€ããŠåè»ãããéãåºéã®çªå·ãåºåããããã°ã©ã ãäœæããŠãã ããããã ããã¡ããã©é§
ã®ãšããã§ããéãå Žåã¯ãäž¡åŽã®åºéçªå·ã®ãã¡å°ããã»ãã®æ°åãåºåããŸãããŸããåè»ã®é·ããé§
ã®é·ãã¯ç¡èŠã§ãããã®ãšããŸãã Input è€æ°ã®ããŒã¿ã»ãããäžãããããåããŒã¿ã»ããã¯ä»¥äžã®ãããªåœ¢åŒã§äžããããã ... | 37,644 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.