task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
B: å
𿥿¬åž°ãããåäŒ åé¡ æ ªåŒäŒç€Ÿ AOR (Association Of Return home)ã«ã¯ $N$ 人ã®ç€Ÿå¡ãããã ç€Ÿå¡ $i$ ã¯ãšã¬ããŒã¿ãŒã䜿ã£ãŠ $1$ éã«äžããããšèããŠãããæå» $t_i$ ã« $F_i$ éã®ãšã¬ããŒã¿ãŒåã«ãã£ãŠãããããªãã¯æå» $0$ ã« $1$ éã« $1$ åºã ããããšã¬ããŒã¿ãŒãé éæäœãããã¹ãŠã®ç€Ÿå¡ã $1$ éã«éãããšã«ããããšã¬ããŒã¿ãŒã«ã¯ $D$ 人ãŸã§ããä¹ããããªãã ãšã¬ããŒã¿ãŒã¯åäœæéã«äžéåç§»åããããã®å Žã«ãšã©ãŸãäºãã§ããã ç€Ÿå¡ $i$ ã¯ãšã¬ããŒã¿ãŒãæå» $t_i$ ã« $F_i$ éã«ãã£ãŠãèªåãä¹ã£ãŠãå®å¡ãè¶
éããªããšãã®ã¿... | 35,400 |
Score: 300 points Problem Statement As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length N , a = { a_1, a_2, a_3, ..., a_N }. Snuke, an employee, would like to play with this sequence. Specifically, he would like to repeat the following operation as many ti... | 35,401 |
Problem E: Immortal Jewels English text is not available in this practice contest. ããæãã貎æãïŒããè²§ä¹ãªåœã®ããŠãã°ã§åæ¢ãªãå§«æ§ã«æã蟌ã¿çµå©ãç³ã蟌ãã ïŒãå§«æ§ã¯è²Žæã«ããæ¡ä»¶ãåºããïŒãã®æ¡ä»¶ãšã¯ãäžæ»ã®å®ç³ããšåŒã°ããŠããå®ç³ã倧éã«æã£ãŠããããšã§ãã£ãïŒäžæ»ã®å®ç³ã¯ïŒããå±±ã®ç¹å®ã®å Žæã§ããåãããšãã§ããªãéåžžã«åžå°ãªå®ç³ã§ããïŒããã倧å€å£ããããããïŒæ¡åããã«ã¯ç¹å¥ãªæ¹æ³ãå¿
èŠã ã£ãïŒ äžæ»ã®å®ç³ã¯å圢ãããŠããïŒäºæ¬¡å
空éäžã«è€æ°ååšããŠããïŒãã®å®ç³ãåãã«ã¯ïŒããç¹å¥ãªéå±ã®æ£ã§ããããåžçããå¿
èŠãããïŒéå±ã®æ£ã¯ç¡... | 35,402 |
Score : 600 points Problem Statement Given are two integer sequences of N elements each: A_1,...,A_N and B_1,...,B_N . Determine if it is possible to do the following operation at most N-2 times (possibly zero) so that, for every integer i from 1 to N , A_i \leq B_i holds: Choose two distinct integers x and y between 1... | 35,403 |
Score : 300 points Problem Statement You are given an integer N . For two positive integers A and B , we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A , and the number of digits in the decimal notation of B . For example, F(3,11) = 2 since 3 has one digit and 11 ha... | 35,404 |
n åã®éœåžãš n â 1 æ¬ã®éè·¯ãããïŒæšã«ãªã£ãŠããïŒéœåžã«ã¯ 1 ãã n ãŸã§ã®çªå·ãã€ããããŠããïŒéœåž 1 ãæ ¹ãšã¿ããšãïŒéœåž i ã®èŠªã¯ p i ã§ããïŒ i ãš p i ã®è·é¢ã¯ d i ã§ããïŒãã¬ãåã¯ïŒ1 ä»¥äž n 以äžã®å k ã«å¯ŸãïŒæ¬¡ã®åé¡ãè§£ãããïŒ ããéœåžããéœåž 1, . . . . , k ãžã®è·é¢ã®åã®æå°å€ \begin{eqnarray} min_{1 \leq v \leq n} \{ \sum^k_{i=1} dist(i, v)\} \;\;\;\;\;\;\;\;\;\;\;\;\;\;(2) \end{eqnarray} ãæ±ããïŒãã ã dist(u, v) 㯠u ãš v... | 35,405 |
åé¡ïŒ äžåŠæ ¡ã®éåäŒã§æ¬¡ã®ãããªã¯ã©ã¹å¯Ÿæã®ç«¶æãè¡ãªãããšã«ãªã£ãïŒ åã¯ã©ã¹ããçåŸä»£è¡šã®ç·å¥³ n ã㢠(ç·åçåŸ b 1 ïŒ å¥³åçåŸ g 1 )ïŒ (ç·åçåŸ b 2 ïŒ å¥³åçåŸ g 2 )ïŒ âŠ ïŒ (ç·åçåŸ b n ïŒ å¥³åçåŸ g n ) ãéžã³ïŒ 0 ãã 9 ãŸã§ã®æ°åãæžãããæãèªç±ã«éžãã§ããã ïŒããããã®æã¯ååãªåæ°ããïŒïŒ 暪äžåã«äžŠãã§ãããïŒ ãã ãïŒ ãã¢ã«ãªã£ãŠããç·åçåŸãšå¥³åçåŸã¯åãçªå·ã®æãäžäººïŒã€ã〠éžã°ãªããã°ãªããïŒ äžŠã³é 㯠b 1 b 2 ⊠b n c g n ⊠g 2 g 1 ã®ããã«ïŒ ç·åçåŸé n 人ã®äžŠã³é b 1 b 2 ⊠b n ãšã¯éã®é çª ... | 35,406 |
Score : 100 points Problem Statement You are given an integer K . Print the string obtained by repeating the string ACL K times and concatenating them. For example, if K = 3 , print ACLACLACL . Constraints 1 \leq K \leq 5 All values in input are integers. Input Input is given from Standard Input in the following format... | 35,407 |
çæ³ã®äœå è¥æºåºŠãè¡šãææ°ãšããŠBMIïŒBody Mass IndexïŒããããŸããBMIã®å€ã¯ä»¥äžã®åŒã§èšç®ããŸãã BMI = äœé(kg) / (身é·(m)) 2 BMIã®å€ãæšæºå€ã«è¿ãã»ã©ãçæ³ã®äœåããšèããããŸããããã§ãBMIã®æšæºå€ã 22 ãšããå Žåã察象è
ã®æ
å ±ãå
¥åãšããæããçæ³ã®äœåãã«è¿ãäººã®æ
å ±ãåºåããããã°ã©ã ãäœæããŠãã ããã 察象è
ã®æ°ã n ãšãããšãå察象è
ã«ã¯éè€ã®ãªãããã«1 ä»¥äž n 以äžã®æŽæ°å€ã®åä»çªå· p ãæ¯ãããŠããŸãã Input è€æ°ã®ããŒã¿ã»ããã®äžŠã³ãå
¥åãšããŠäžããããŸããå
¥åã®çµããã¯ãŒãã²ãšã€ã®è¡ã§ç€ºãããŸããåããŒã¿ã»ããã¯ä»¥äžã®åœ¢åŒã§äžããããŸãã n... | 35,408 |
Problem C: Satake likes straight Problem Satakeåã¯æ²ãã£ãããšãå«ãã§ãã äŸãã°ãéçã箞ãå®¶ãæ²ãã£ã圢ãããŠããã®ã¯å«ãã§ããã峿ãå·Šæãªã©ã®è¡åããšãããšãå«ãã§ãã ããŠãXY å¹³é¢äžã§æ®ããSatakeå㯠$N$ åã®ãåº $(X_{1},Y_{1}),(X_{2},Y_{2}), \ldots , (X_{N},Y_{N})$ ã§è²·ãç©ãããããã䜿ããé ŒãŸããŸãããåº§æš $(0, 0)$ ã«ããå®¶ãã $(1, 0)$ ã®æ¹åãåããç¶æ
ã§åºçºãããã¹ãŠã®ãåºã§è²·ãç©ãããããšãå®¶ã«åž°ããŸãããåºãåãé çªã¯èªç±ã§ããSatakeåã¯ã䜿ããšããŠæ¬¡ã«ç€ºãä»»æã®è¡åã... | 35,409 |
Extended Euclid Algorithm Given positive integers a and b , find the integer solution ( x , y ) to ax + by = gcd(a, b) , where gcd(a, b) is the greatest common divisor of a and b . Input a b Two positive integers a and b are given separated by a space in a line. Output Print two integers x and y separated by a space. I... | 35,410 |
G: åŽå (Working) ã³ãŠããã¯ãããã $N$ æ¥éãæ¯æ¥ åãä»¶æ°ã® ä»äºãããããšã«ããã $N$ æ¥éã®ãã¡ $i$ æ¥ç®ã«ã¯ä»äºã $A_i$ 件远å ãããã ã³ãŠããã«ã¯ä»æºãŸã£ãŠããä»äºã¯ãªãã$N$ æ¥ç®ãŸã§ã«ãã¹ãŠã®ä»äºãçµãã£ãŠããå¿
èŠã¯ãªãã äžæ¥ã§æå€§äœä»¶ã®ä»äºãã§ãããã ãã ãã³ãŠããã¯åªç§ãªã®ã§ãä»äºãååšããéãäœä»¶ã§ãä»äºãããããšãã§ããã å
¥å 1 è¡ç®ã«ã¯ $N$ãäžããããã 2 è¡ç®ã«ã¯ $N$ åã®æŽæ° $A_1, A_2, A_3, \dots, A_N$ ã空çœåºåãã§äžããããã åºå äžæ¥ã«ã§ããä»äºã®æå€§ã®ä»¶æ°ãåºåãããæåŸã«ã¯æ¹è¡ãå
¥ããããšã å¶çŽ $N$ 㯠... | 35,411 |
Score : 400 points Problem Statement Takahashi has N sticks that are distinguishable from each other. The length of the i -th stick is L_i . He is going to form a triangle using three of these sticks. Let a , b , and c be the lengths of the three sticks used. Here, all of the following conditions must be satisfied: a <... | 35,412 |
Score : 100 points Problem Statement You are given integers A and B , each between 1 and 3 (inclusive). Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number. Constraints All values in input are integers. 1 \leq A, B \leq 3 Input Input is given from Standard Input... | 35,413 |
Score : 200 points Problem Statement Takahashi's house has only one socket. Takahashi wants to extend it with some number of power strips, each with A sockets, into B or more empty sockets. One power strip with A sockets can extend one empty socket into A empty sockets. Find the minimum number of power strips required.... | 35,414 |
Score : 700 points Problem Statement We have a board with an H \times W grid. Each square in the grid is painted in black or white. The square at the i -th row from the top and j -th column from the left is black if the j -th character in S_i is # , and white if that character is . . Snuke can perform the following ope... | 35,415 |
Problem I: The Extreme Slalom Automobile Company Moving has developed a new ride for switchbacks. The most impressive feature of this machine is its mobility that we can move and turn to any direction at the same speed. As the promotion of the ride, the company started a new competition named the extreme slalom . A cou... | 35,416 |
Problem D: King Slime There is a grid of size W Ã H surrounded by walls. Some cells in the grid are occupied by slimes. The slimes want to unite with each other and become a "King Slime". In each move, a slime can move to east, west, south and north direction until it enters a cell occupied by another slime or hit the ... | 35,417 |
Problem B War II ç¬¬äºæ¬¡ProblemBå€§æŠ R倧åŠã®2D奜ãã®äººãã¡ (2DRespecters)ã¯ïŒA接倧åŠã§éå¬ãããããã°ã©ãã³ã°ã®ç·Žç¿å宿ã«åå ããïŒ ãã®ç·Žç¿å宿ã§ã¯ïŒåå è
ãã¡ãèªäœã®ããã°ã©ãã³ã°åé¡ãæã¡å¯ãïŒç·Žç¿ã«çšããïŒ ä»å¹Žã¯ïŒ2DRespectersã®é¢ã
ã¯æè»œã«äœåã§ããBåé¡ã®äœåæ
åœè
ã«ç«åè£ããããïŒBå顿
åœè
ã®åº§ãäºãããšã«ãªã£ãïŒ æŠãã®èå°ã¯ïŒãšããèªè²©æ©ã§ããïŒ ãã®èªè²©æ©ã¯ïŒ90åã®ãžã¥ãŒã¹ã1çš®é¡ã ã販売ããŠããïŒãæé äŸ¡æ Œã§è³Œå
¥ã§ããããšã§æåã§ããïŒ ãã ãïŒèªè²©æ©ã«ã¯ïŒ10åçãš100åçã®2ã€ã®ç¡¬è²šããæå
¥ããããšãã§ããïŒé£éããããã®ç¡¬è²šã§ããæ¯æãããªãïŒ... | 35,418 |
D: ã¿ããã±ããŒã〠- Myampus Sequence - ç©èª ã¿ããã±ããŒïŒ ãŠãïŒç°èã®åæ ¡ã«éãå°åŠäžå¹ŽçãªãïŒ ãããªãŒïŒä»æ¥ã®ææ¥ã¯ããã°ã©ãã³ã°ã ã£ããïŒ ã¿ããªèŠæŠããŠããã©ïŒãŸã£ã€ãã®ã«ãã«ãïŒåãå¢ãã§ã¿ã€ãã³ã°ããŠããïŒ ãããäžäžãªããªãŒïŒ ã«ãã«ãïŒããã°ã©ã ã宿ããŠã©ããè¡ã£ãŠããŸã£ããïŒ ããã§ïŒç»é¢èŠããïŒè²ããªæ°åãåºåãããŠããïŒ ã ãã ãåºåãšåããããªæ°åãæžããããªã£ããïŒãŠãïŒåºåããã¹ãã«åããããªæ°åãããã€ãæžãå ããŠããïŒ ããããïŒã«ãã«ããæ»ã£ãŠããŠïŒãããæããããïŒ ãŠãïŒã«ãã«ãã®å£°åããŠèããããïŒã³ã£ãããããïŒ ã§ãªïŒã«ãã«ãã«è¬ã£ãŠããã°ã©ã ãèŠããŠããã£... | 35,419 |
Tax Rate Changed VAT (value-added tax) is a tax imposed at a certain rate proportional to the sale price. Our store uses the following rules to calculate the after-tax prices. When the VAT rate is x %, for an item with the before-tax price of p yen, its after-tax price of the item is p (100+ x ) / 100 yen, fractions ro... | 35,420 |
ã¢ã«ã»ãã³æç²äœæŠ æªçã¢ã«ã»ãã³ã¯å€§èã«ãããã«ã¬ãžã§ãŒããéã®ã·ã£ããã³ãçã¿å»ã£ããèŠéšã§ããããªãã¯ãã¢ã«ã»ãã³ã仲éã®ã³ããŠæ°ã«ã·ã£ããã³ãæž¡ãããããšããæ
å ±ãæã«å
¥ããããã ãã³ããŠæ°ã¯ã¢ã«ã»ãã³ã®ã¢ãžããŸã§åºåããªãã®ã§ãã¢ãžãã®å€ã§æž¡ãããããããªãã¯ã¢ã«ã»ãã³ãåŸ
ã¡äŒãããŠæãŸããããšã«ããããã®çºã¯å€ãåäžçºãªã®ã§ãéãè€éã«å
¥ãçµãã§ããŠãã©ã®éãäžæ¹éè¡ã«ãªã£ãŠãããã¢ã«ã»ãã³ãã¢ãžãããåãæž¡ãå ŽæãŸã§ã©ã®çµè·¯ãéãã®ãã¯ããããªããã人å¡äžè¶³ã®ãããåŸ
ã¡äŒãå Žæã¯ïŒã€ã«èšå®ããªããã°ãªããªãã ããªãã¯ãã¢ãžããå«ãããã€ãã®å°ç¹ãéžã³ãããããã€ãªãéã調ã¹ãå°å³ãäœã£ããå°å³äžã®å°ç¹ã®ã©ããã§åãæž¡... | 35,421 |
貎éå±ãªãµã€ã¯ã« äŒæŽ¥ç¹ç£ã®è²Žéå±ã§ããã¢ã€ã
ããŠã ããªãµã€ã¯ã«ãã瀟ã¯ãå
šåœåå°ã«ãããã¯ãŒã¯ãæã¡ãããããã®ååè»ã§ã¢ã€ã
ããŠã ãéããŠããŸãããã®äŒç€Ÿã¯ãåŠçã®å¹çåã®ããã«ãå¡ã®éããšåæ°ã®åäœãèŠæ Œã§å®ããŠããŸãã å¡ã®éãã«ã¯ãããã³ããšããåäœã䜿ããŸãã x ããã³ã®ã¢ã€ã
ããŠã ã®éã㯠2 x ã°ã©ã ã§ããå®ç³ã§äŸãããšããã«ã©ãããã®ãããªãã®ã§ãããŸããå¡ã®åæ°ã«ã¯ããã«ã°ããšããåäœã䜿ããŸãã y ãã«ã°ã¯ 2 y åã§ããïŒç®±ã«å
¥ã£ãŠããåç©ã®åæ°ã§ãããããŒã¹ãã®ãããªãã®ã§ãããã ãã x ãš y ã¯ ïŒ ä»¥äžã®æŽæ°ã§ãªããã°ãããŸããã ååè» i ã¯ã a i ããã³ã®éãã®ã¢ã€ã
ããŠã ã... | 35,422 |
Score : 100 points Problem Statement There is a grid with H rows and W columns. The square at the i -th row and j -th column contains a string S_{i,j} of length 5 . The rows are labeled with the numbers from 1 through H , and the columns are labeled with the uppercase English letters from A through the W -th letter of ... | 35,423 |
æµ·å²žç· æµ·å²žã«ã¯æ¯ç§æ³¢ãæŒãå¯ããïŒåºæºç¹ P ãè¶
ããŠäœ m ã®å°ç¹ãŸã§æ³¢ãæŒãå¯ããããïŒ T ç§ã®éã ãæ¯ç§èŠ³æž¬ãèšé²ããããŒã¿ãããïŒããŒã¿ã¯ T åã®æŽæ° x 1 , ... , x T ãããªãïŒå i (1 †i †T) ã«å¯ŸãïŒèŠ³æž¬ãå§ããŠãã i ç§åŸã«ã¯å°ç¹ P ããã¡ããã© x i m ã®å°ç¹ãŸã§ã®æ³¢ãæŒãå¯ãïŒæµ·æ°Žã«æµžã£ãŠããããšã衚ãïŒ æµ·å²žã¯ïŒæåŸã«æµ·æ°Žã«æµžã£ãŠãã D ç§åŸã«ä¹Ÿãããšãåãã£ãŠããïŒããã§ïŒä¹ŸããŸã§ã®æéã¯æåŸã«æµ·æ°Žã«æµžã£ãæéã®ã¿ã«äŸåãïŒãã以åã«æ³¢ã«æµžã£ãŠããåæ°ãæéã«ã¯äŸåããªãããšã«æ³šæããïŒ åºæºç¹ P ããïŒéžã®æ¹åã«è·é¢ L ã ãé¢ããå°ç¹ãïŒèŠ³æž¬ãéå§ããŠãã 1... | 35,424 |
Problem 10: The Last Dungeon åè
ãã³å€ªã¯ããããæçµãã³ãžã§ã³ã®ç®åãŸã§ãã£ãŠãããããã¯ãæªã®åžçããã¢ã¹ã®ç Šã®åã«åºããéã®èéã§ãããããªã匷è
ã®ã¢ã³ã¹ã¿ãŒããããããã®çžåŒµããå®ã£ãŠããã å³ïŒïŒèé èéã¯å³ïŒã«ç€ºãããã«ãå西ãåç¹(0, 0)ãšãã 4 à 4 ã®æ£æ¹åœ¢ã®é åã§è¡šãããŠããããã®é åã®äžã«ãå³ã®ç¹ã§ç€ºãããŠããããã«ãã¢ã³ã¹ã¿ãŒãæ§ããŠãããåè
ãã³å€ªã¯ãã®é åã西ããæ±ãžïŒWããEãžïŒæšªæããªããã°ãªããªããã€ãŸããx 座æšã 0.0 ã§ãã y 座æšã 0.0 ä»¥äž 4.0 以äžã§ããç¹ããåºçºããx 座æšã 4.0 ã§ãã y 座æšã 0.0 ä»¥äž 4.0 以äžã§ãã... | 35,425 |
ã€ã
ã¢åœèªèŸå
ž ããªãã¯ã€ã
ã¢åœã®å
¬çšèªã§ããã€ã
ã¢èªã®åœèªèŸå
žãšãã€ã
ã¢èªã®ã¢ã«ãã¡ãããïŒæåã®äžèŠ§è¡šïŒ ãæã«å
¥ããŸãããã€ã
ã¢èªã®ã¢ã«ãã¡ãããã«ã¯N çš®é¡ã®æåããããŸããã€ã
ã¢èªã®åœèªèŸå
žã«çŸããåèªã®é çªã¯ãã€ã
ã¢èªã®ã¢ã«ãã¡ãããé ã«äžŠãã§ããŸãã èŸå
žãèŠããšãèŒã£ãŠããã©ã®åèªãN æåã§ãããããN çš®é¡ã®æåãã²ãšã€ãã€å«ãã§ããããšãããããŸãããããã«èª¿ã¹ãŠã¿ããšãèŸå
žã«ã¯N çš®é¡ã®æåã®å¯èœãªäžŠã³æ¹ããã¹ãŠæžãããŠããããšãçºèŠããŸããã ãã®çºèŠãããããªãã¯ããåèªãèŸå
žã®äœçªç®ã«åºãŠããããããããã«ãªããŸããããã®ç¥èãå©çšããŠã€ã
ã¢åœã®äººãé©ãããŠã¿ãŸãããããŸããN çš®é¡ã®æåãã²ãšã€ãã€ã¢... | 35,426 |
Problem L: WW Problem 19XX幎ãnã€ã®åœã§é£ååœè»ãçµæããããé£ååœè»ã«å±ããååœã§ã¯ãæµè»ã®äŸµç¥ããèªåœãå®ãããã«åœå
ã«ïŒã€ä»¥äžã®æ ç¹ãäœããåšå²ãèŠæããŠãããå³ïŒã¯é£ååœã®äŸã瀺ããé·æ¹åœ¢ãååœãããã®äžã«ããåããã®åœã®æ ç¹ã衚ãã å³1 æµè»ã䟵ç¥ããŠããå Žåããããäžçªæåã«çºèŠããæ ç¹ãããã®æ
å ±ãé£ååœè»ã«å±ããä»åœãŸãã¯èªåœã®æ ç¹ã«çºä¿¡ããããšã«ãªã£ãŠããã æ
å ±ãä»ã®æ ç¹ã«äŒããã«ã¯æ£ã®æŽæ°ã®ã³ã¹ãããããã ãŸããååœã§ã¯èªåœã®æ ç¹ã®ãã¡ãé£ååœè»ç¿»èš³éä¿¡éš(ATIS : Allied Translator and Interpreter Section)ã«å±ããå
µå£«ãé
å±ãããŠãã... | 35,427 |
å顿 $(X_{1,1}âšX_{1,2})â§(X_{2,1}âšX_{2,2})â§...â§(X_{M,1}âšX_{M,2})$ ã§è¡šãããè«çåŒãäžããããããã ã $X_{i,j} \in \{x_1, x_2, ..., x_N, ~x_1, ~x_2, ..., ~x_N\}$ã§ããã äžããããè«çåŒãçãšãªãããã«å倿° $x_i$ ($1 \leq i \leq N$)ã«çåœå€ãå²ãåœãŠããããã®ãããªå²ãåœãŠæ¹ãäœéãããããæ±ããã å
¥å å
¥åã¯ä»¥äžã®åœ¢åŒã«åŸããäžããããæ°ã¯å
šãп޿°ã§ããã $N$ $M$ $Y_{1,1}$ $Y_{1,2}$ $Y_{2,1}$ $Y_{2,2}$ $...$ $Y_{M,1}... | 35,428 |
Problem K: Gold Rush Problem moritaoyåãšã¯ãã³ã³ãã¥ãŒã¿ã®ãªãã§æ®ãããŠããè¬ã®å€§åŠçã§ãã moritaoyåãæ®ãããŠããåºç»ã¯ã瞊㫠$2^H$ ãæšªã« $2^W$ ãã®å€§ããã®ããäºæ¬¡å
空é $S= \{ (p,q) \in \mathbb{Z}^2 | 0 \leq p \lt 2^H, 0 \leq q \lt 2^W \} $ ãšããŠè¡šãããŸãã moritaoyåã¯ããã€ãã®éè² æŽæ°ãèŠçŽ ãšããäºæ¬¡å
ãã¯ãã«ãæã£ãŠããŠããã®ç©ºéäžãè¶³ãç®ãçšããŠç§»åããŸãã moritaoyåã $(a,b)$ ã«ããŠããã¯ãã« $(i,j)$ ã«ãã£ãŠç§»åãããšã¯ãå
·äœçã«ã¯ä»¥äžã®ãããªè¡å... | 35,429 |
Score : 1100 points Problem Statement Let us consider a grid of squares with 10^9 rows and N columns. Let (i, j) be the square at the i -th column (1 \leq i \leq N) from the left and j -th row (1 \leq j \leq 10^9) from the bottom. Snuke has cut out some part of the grid so that, for each i = 1, 2, ..., N , the bottom-m... | 35,430 |
Score : 300 points Problem Statement Snuke loves "paper cutting": he cuts out characters from a newspaper headline and rearranges them to form another string. He will receive a headline which contains one of the strings S_1,...,S_n tomorrow. He is excited and already thinking of what string he will create. Since he doe... | 35,431 |
Problem Setting Overview Concept: In this programming contest, you will run a delivery service. Customers will place orders with your shop. Each order has a unique \text{ID} and should be delivered to the corresponding customer. Your delivery service has one car. The car will fetch the ordered item from the shop and de... | 35,432 |
Score : 700 points Problem Statement Takahashi and Aoki will play a game with a number line and some segments. Takahashi is standing on the number line and he is initially at coordinate 0 . Aoki has N segments. The i -th segment is [L_i,R_i] , that is, a segment consisting of points with coordinates between L_i and R_i... | 35,433 |
Score : 400 points Problem Statement We have a board with a 2 \times N grid. Snuke covered the board with N dominoes without overlaps. Here, a domino can cover a 1 \times 2 or 2 \times 1 square. Then, Snuke decided to paint these dominoes using three colors: red, cyan and green. Two dominoes that are adjacent by side s... | 35,434 |
Score : 200 points Problem Statement Given is a sequence of N integers A_1, \ldots, A_N . Find the (multiplicative) inverse of the sum of the inverses of these numbers, \frac{1}{\frac{1}{A_1} + \ldots + \frac{1}{A_N}} . Constraints 1 \leq N \leq 100 1 \leq A_i \leq 1000 Input Input is given from Standard Input in the f... | 35,435 |
Problem F: Never Wait for Weights In a laboratory, an assistant, Nathan Wada, is measuring weight differences between sample pieces pair by pair. He is using a balance because it can more precisely measure the weight difference between two samples than a spring scale when the samples have nearly the same weight. He is ... | 35,436 |
Score : 300 points Problem Statement There are N candles placed on a number line. The i -th candle from the left is placed on coordinate x_i . Here, x_1 < x_2 < ... < x_N holds. Initially, no candles are burning. Snuke decides to light K of the N candles. Now, he is at coordinate 0 . He can move left and right along th... | 35,437 |
Score : 600 points Problem Statement Given an undirected tree, let the distance between vertices u and v be the number of edges on the simple path from u to v . The diameter of a tree is the maximum among the distances between any two vertices. We will call a tree good if and only if its diameter is at most K . You are... | 35,438 |
A: ã¿ã€ã«è²Œã åé¡ çžŠ $h$ , 暪 $w$ ã®å€§ããã®é·æ¹åœ¢ã®å£ã«, 瞊 $a$ , 暪 $b$ ã®å€§ããã®é·æ¹åœ¢ã®ã¿ã€ã«ãåºæ¥ãã ããããã貌ããã. ã¿ã€ã«ã貌ãéã¯ä»¥äžã®æ¡ä»¶ãæºããå¿
èŠããã. ã¿ã€ã«ãéããŠã¯ãããªã. ã¿ã€ã«ãæãã«è²Œã£ãŠã¯ãããªã. ããªãã¡, ã¿ã€ã«ã®ã©ã®çžã, å£ã®ã©ã®çžã«å¯ŸããŠãå¹³è¡, ãŸãã¯åçŽã§ãã. ã¿ã€ã«ã®åããå€ããªã. ããªãã¡, 瞊暪ãå
¥ãæ¿ããªã. åºæ¥ãã ãå€ãã®ã¿ã€ã«ã貌ã£ããšã, ã¿ã€ã«ã«èŠãããŠããªãéšåã®é¢ç©ã®ç·åãæ±ãã. å¶çŽ å
¥åå€ã¯å
šãп޿°ã§ãã. $1 \leq h,w,a,b \leq 100$ å
¥ååœ¢åŒ å
¥åã¯ä»¥äžã®åœ¢åŒã§äžãããã. $h\ w$ ... | 35,439 |
Prime Factorization Factorize a given integer n . Input n An integer n is given in a line. Output Print the given integer n and : . Then, print prime factors in ascending order. If n is divisible by a prime factor several times, the prime factor should be printed according to the number of times. Print a space before e... | 35,440 |
Iron Bars A boy PCK had N straight iron bars, which were serially indexed. Unfortunately, the first M bars (0 †M †N ) among them were bent during transportation. They all suffered a perpendicular bend at one point. He is planning to make a cube using a set of bars selected using the following rules: X bars from bent ... | 35,441 |
Range Add Query (RAQ) Write a program which manipulates a sequence A = { a 1 , a 2 , . . . , a n } with the following operations: add(s, t, x) : add x to a s , a s+1 , ..., a t . get(i) : output the value of a i . Note that the initial values of a i ( i = 1, 2, . . . , n ) are 0. Input n q query 1 query 2 : query q In ... | 35,442 |
Shortest Bridge There is a city whose shape is a 1,000 $\times$ 1,000 square. The city has a big river, which flows from the north to the south and separates the city into just two parts: the west and the east. Recently, the city mayor has decided to build a highway from a point $s$ on the west part to a point $t$ on t... | 35,443 |
Problem C: Hexerpents of Hexwamp Hexwamp is a strange swamp, paved with regular hexagonal dimples. Hexerpents crawling in this area are serpents adapted to the environment, consisting of a chain of regular hexagonal sections. Each section fits in one dimple. Hexerpents crawl moving some of their sections from the dimpl... | 35,444 |
Score : 300 points Problem Statement Given any integer x , Aoki can do the operation below. Operation: Replace x with the absolute difference of x and K . You are given the initial value of an integer N . Find the minimum possible value taken by N after Aoki does the operation zero or more times. Constraints 0 †N †10... | 35,445 |
Score : 700 points Problem Statement Find the smallest possible sum of the digits in the decimal notation of a positive multiple of K . Constraints 2 \leq K \leq 10^5 K is an integer. Input Input is given from Standard Input in the following format: K Output Print the smallest possible sum of the digits in the decimal ... | 35,446 |
Move On Dice There is a cube on a rectangle map with H -rows and W -columns grid. Two special squares a start and a goal are marked on the map. Initially, the cube is on the start square. Let's repeat to roll it and take it to the goal square. Rolling the cube means to select one of four edges which touch the map, and ... | 35,447 |
Score : 400 points Problem Statement There are N islands and M bridges. The i -th bridge connects the A_i -th and B_i -th islands bidirectionally. Initially, we can travel between any two islands using some of these bridges. However, the results of a survey show that these bridges will all collapse because of aging, in... | 35,448 |
Problem E: Poor Mail Forwarding Masa åãäœãã§ããå°åã®éµäŸ¿ã·ã¹ãã ã¯å°ã
å€ãã£ãŠããã ãã®å°åã§ã¯ãåã
ã®éµäŸ¿å±ã«å¯Ÿã㊠1 ããé ã«é£ç¶ããç°ãªãçªå·ãã€ããããŠãããããéµäŸ¿å±ã«å±ããããéµäŸ¿ç©ã¯ããã®éµäŸ¿å±ããããã€ãã®éµäŸ¿å±ãçµç±ããŠç®çã®éµäŸ¿å±ã«å±ããããã éµäŸ¿ç©ã®ã転éãã¯ãç¹å®ã®éµäŸ¿å±ã®éã§ããè¡ãããªãã ãã ãã転éãè¡ãããéµäŸ¿å±å士ã®éã§ã¯ã転éã¯åæ¹åã«è¡ãããã ããéµäŸ¿å±ããå®å
ãŸã§éµäŸ¿ç©ã転éããããã®çµè·¯ãè€æ°ååšããå Žåã¯ã å®å
ãŸã§ã®è·é¢ãæçãšãªããããªçµè·¯ã䜿çšããã ãããã£ãŠã転éå
ã¯ãã®ãããªæççµè·¯ã«ãããæ¬¡ã®éµäŸ¿å±ãšãªãã ãããç·è·é¢ãæ... | 35,449 |
Marathon Match N people run a marathon. There are M resting places on the way. For each resting place, the i -th runner takes a break with probability P_i percent. When the i -th runner takes a break, he gets rest for T_i time. The i -th runner runs at constant speed V_i , and the distance of the marathon is L . You ar... | 35,450 |
String in String Problem æåå S ãš Q åã®ã¯ãšãªãäžããããã i çªç®ã®ã¯ãšãª(0 †i †Q -1)ã«ã¯éåºé[ l i , r i ]ãšæåå M i ãäžããããã S ã® l i æåç®ãã r i æåç®ãŸã§ã®éšåæååã®äžã«æåå M i ã¯ããã€ååšãããåºåããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã S Q l 0 r 0 M 0 l 1 r 1 M 1 . . . l Qâ1 r Qâ1 M Qâ1 1è¡ç®ã«æåå S ãšã¯ãšãªã®æ° Q ã空çœåºåãã§äžããããã ç¶ã Q è¡ã«æŽæ° l i , r i , M i ã空çœåºåãã§äžããããã Constraints 1... | 35,451 |
å±ãªãæ© äŒæŽ¥è¥æŸåžãããã£ãšåã«äœçœ®ããäŒæŽ¥å€æŸæã§ã¯ããã€æ©(ãã°ã) ããšåŒã°ããæ©ãåšèŸºã®æãžç§»åããå¯äžã®ææ®µãšãªã£ãŠããŸãããã®æ©ã¯éè¡äººãå€ãã«ãé¢ããããä»ã«ãå£ããããªã»ã©èæœåãé²ãã§ããŸã£ãŠããŸãã ã€æ©ã¯ 150 [kg] ãŸã§èãããã匷床ãæã£ãŠããŸããäŸãã°ã80 [kg] ã®äººãš 50 [kg] ã®äººãåæã«æž¡ãããšã¯ã§ããŸããã80 [kg] ã®äººãæž¡ã£ãŠãããšãã« 90 [kg] ã®äººãæž¡ãå§ãããšãã€æ©ã¯å£ããŠããŸããŸãã ããã€æ©ãå£ããŠããŸã£ãããäŒæŽ¥å€æŸæã®äººã
ã¯åšèŸºã®æãžç§»åããææ®µã倱ã£ãŠããŸããŸããããã§ãæã§å¯äžã®ããã°ã©ããŒã§ããããªãã¯ãææ°ã®ç掻ãå®ãããã«ãæ©ã®æž¡ãæ¹ããæ©... | 35,452 |
GïŒ æ€é²ã«ãã眮æ (Censored String) Problem Statement You are given the string S , and the set of strings \mathcal P whose size is N . Now we consider applying the following operation to S : Choose exactly one character in S , and replace it with '*'. Let s_i be a i -th character of S , S_{ij} be a consecutive substring in S ... | 35,453 |
Problem C: Time Manipulation 圌女ã¯èŠç¿ãã®éæ³äœ¿ãã ã 圌女ã¯ãŸãæåã«æéãæãéæ³ãèŠããã ãããŠåœŒå¥³ã¯çèšãç«ãããããã«é
å±ãéãããšã«ããã 圌女ã®äœãã§ããåœã®äœäººéã¯ã¿ããªãé
ã倧奜ãããšããããšãé¢ä¿ããŠããã äœäººéã¯é·ã幎æ°ããããŠçæããããé
ãç¹ã«å¥œãã§ãçæããã幎æ°ã«å¿ããŠãã®äŸ¡å€ãæ¯äŸããŠäžããã 50幎çæããããé
ãã100幎çæããããé
ã®ã»ãã䟡å€ãé«ãã®ã¯ç°¡åã«æ³åãã€ãã¯ãã ã ãããŠæã«å
¥ããã®ãé£ãããšããããšãã 圌女ã¯èªåã®éæ³ã䜿ã£ãŠãé·ã幎æçæããããé
ãäžç¬ã§äœã£ãŠãããã売ã£ãŠåå
¥ãåŸãããšããŠããã®ã§ãã£ãã 圌女ã¯ãé
ãçæããã幎æ°ã«å¿... | 35,454 |
Problem A: Era Name As many of you know, we have two major calendar systems used in Japan today. One of them is Gregorian calendar which is widely used across the world. It is also known as âWestern calendarâ in Japan. The other calendar system is era-based calendar, or so-called âJapanese calendar.â This system comes ... | 35,455 |
Score : 500 points Problem Statement Snuke has two boards, each divided into a grid with N rows and N columns. For both of these boards, the square at the i -th row from the top and the j -th column from the left is called Square (i,j) . There is a lowercase English letter written in each square on the first board. The... | 35,456 |
Problem Statement You have just transferred to another world, and got a map of this world. There are several countries in this world. Each country has a connected territory, which is drawn on the map as a simple polygon consisting of its border segments in the $2$-dimensional plane. You are strange to this world, so yo... | 35,457 |
Score : 400 points Problem Statement You have N items and a bag of strength W . The i -th item has a weight of w_i and a value of v_i . You will select some of the items and put them in the bag. Here, the total weight of the selected items needs to be at most W . Your objective is to maximize the total value of the sel... | 35,458 |
Score : 1200 points Problem Statement N problems have been chosen by the judges, now it's time to assign scores to them! Problem i must get an integer score A_i between 1 and N , inclusive. The problems have already been sorted by difficulty: A_1 \le A_2 \le \ldots \le A_N must hold. Different problems can have the sam... | 35,459 |
Score : 600 points Problem Statement There is a grid of squares with H+1 horizontal rows and W vertical columns. You will start at one of the squares in the top row and repeat moving one square right or down. However, for each integer i from 1 through H , you cannot move down from the A_i -th, (A_i + 1) -th, \ldots , B... | 35,460 |
ãªã¬ã³ãžã®åºè·(Oranges) ããªãã¯Juicy Orange Industry 瀟ãç¥ã£ãŠããã ããã? ãã®äŒç€Ÿã®æ¥åã¯çŸå³ãããªã¬ã³ãžãæ œå¹ããŠåºè·ããããšã§ããïŒããã§ã¯ç¥ããŠJOI 瀟ãšåŒã¶ïŒ JOI 瀟ã§ã¯ïŒåç©«ããã $N$ åã®ãªã¬ã³ãžã箱詰ãããŠåºè·ããããšã«ãªã£ãïŒãªã¬ã³ãžã¯å·¥å Žã«ãããã«ãã³ã³ãã¢ã®äžã«äžŠã¹ãããŠããïŒãã«ãã³ã³ãã¢ã®åããé çªã« $1$ ãã $N$ ãŸã§ã®çªå·ãä»ããããŠããïŒãªã¬ã³ãžã¯å€§å°ããŸããŸã§ããïŒãªã¬ã³ãž $i$ $(1 \leq i \leq N)$ ã®å€§ãã㯠$A_i$ ã§ããïŒ ãããã®ãªã¬ã³ãžãåããé çªã«ããã€ãã®ç®±ã«åããŠè©°ããïŒã²ãšã€ã®ç®±ã«ã¯é£ç¶ããçªå·ã®ãªã¬ã³... | 35,461 |
Problem B: OOllOll Problem éè² æŽæ°$x$ã2鲿°è¡šèšãããšãã®åæ¡ã®åã$f(x)$ãšããã æ£æŽæ°$N$ãäžããããã®ã§$f(0)$,$f(1)$,...,$f(N)$ã®äžã§æå€§ã®ãã®ãåºåããã 颿°$f(5)$ã®èšç®ã®äŸ: 5ã2鲿°è¡šèšãããš101ã§åæ¡ã®åã¯1+0+1=2 ãã£ãŠ$f(5) = 2$ãšãªãã Note: https://ja.wikipedia.org/wiki/äºé²æ³ Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã $N$ æ£æŽæ°$N$ã1è¡ã«äžããããã Constraints å
¥åã¯ä»¥äžã®æ¡ä»¶ãæºããã $1 \le N \le 10^9$ Ouput $f(0)$,$f(1)... | 35,462 |
Property Distribution ã¿ãã«æ°ã HW ã¢ãŒã«ã®ææš¹åãæ®ããŠäº¡ããªããŸãããææš¹åã¯æ±è¥¿ååæ¹åã« H à W ã®åºç»ã«åããããåºç»ããšã«ãªã³ãŽãã«ãããã«ã³ãæ€ããããŠããŸããã¿ãã«æ°ã¯ãããªéºèšãæ®ããŠããŸããã ææš¹åã¯åºç»åäœã§ã§ããã ãå€ãã®è¡çžè
ã«åããããšããã ããããåºç»ã®æ±è¥¿ååã©ããã®æ¹åã«ãšãªãããåºç»ã«åãçš®é¡ã®æç©ãæ€ããããŠããå Žåã¯ãåºç»ã®å¢çãåãããªãã®ã§ããã㯠1 ã€ã®å€§ããªåºç»ãšããŠæ±ãããšã äŸãã°æ¬¡ã®ãã㪠3 à 10 ã®åºç»ã§ããã° ('ãª'ã¯ãªã³ãŽã'ã«'ã¯ã«ãã'ã'ã¯ãã«ã³ã衚ã) åãæš¹ãããåºç»ã®éã®å¢çãæ¶ããšæ¬¡ã®ããã«ãªãã çµå± 10 åã®åºç»... | 35,463 |
Enumeration of Combinations Print all combinations which can be made by $k$ different elements from $0, 1, ..., n-1$. Note that we represent $0, 1, ... n-1$ as 00...0001, 00...0010, 00...0100, ..., 10...0000 in binary respectively and the integer representation of a combination is calculated by bitwise OR of the select... | 35,464 |
A: four tea åé¡ ããã°ã©ãã³ã°ã³ã³ãã¹ãã«ã¯ãè¶ãæ¬ ãããªãããè¶ã«ã¯ã³ã³ãã¹ã¿ã³ãã®ç·åŒµãåãããäœçšãããã®ã [èŠåºå
ž] ã³ã³ãã¹ãã«åå ããéžæã N 人ããã®ã§ããã®äººæ°åã®ãè¶ãçšæããããšèããŠããããè¶ã®ããã±ãŒãžã¯ A , B , C , D ã® 4 çš®é¡ãããã©ããåãåçš®ã§ãããå
容éãç°ãªããããããã±ãŒãž X ã«ã€ããŠããã®ããã±ãŒãž 1 ã€åã®å€æ®µã¯ p_X åã§ããã1 ã€è²·ããš t_X æ¯åã®ãè¶ãäœããããšãããã£ãŠããã N 人åã®ãè¶ãäœãããã«å¿
èŠãªéé¡ã®æå°å€ãæ±ããããªããå
šã賌å
¥ããªãããã±ãŒãžããã£ãŠããããã¡ããã© N 人åã«ãªãããã«ããã±ãŒãžã賌å
¥ããå¿
èŠããªã (... | 35,465 |
Score: 300 points Problem Statement In Republic of Atcoder, there are N prefectures, and a total of M cities that belong to those prefectures. City i is established in year Y_i and belongs to Prefecture P_i . You can assume that there are no multiple cities that are established in the same year. It is decided to alloca... | 35,466 |
Score : 100 points Problem Statement Snuke is buying a bicycle. The bicycle of his choice does not come with a bell, so he has to buy one separately. He has very high awareness of safety, and decides to buy two bells, one for each hand. The store sells three kinds of bells for the price of a , b and c yen (the currency... | 35,467 |
Score : 400 points Problem Statement Given is an integer S . Find a combination of six integers X_1,Y_1,X_2,Y_2,X_3, and Y_3 that satisfies all of the following conditions: 0 \leq X_1,Y_1,X_2,Y_2,X_3,Y_3 \leq 10^9 The area of the triangle in a two-dimensional plane whose vertices are (X_1,Y_1),(X_2,Y_2), and (X_3,Y_3) ... | 35,468 |
Score : 200 points Problem Statement Joisino is working as a receptionist at a theater. The theater has 100000 seats, numbered from 1 to 100000 . According to her memo, N groups of audiences have come so far, and the i -th group occupies the consecutive seats from Seat l_i to Seat r_i (inclusive). How many people are s... | 35,469 |
Problem F: There is No Alternative ICPC (Isles of Coral Park City) consist of several beautiful islands. The citizens requested construction of bridges between islands to resolve inconveniences of using boats between islands, and they demand that all the islands should be reachable from any other islands via one or mor... | 35,470 |
Score: 600 points Problem Statement We have N non-negative integers: A_1, A_2, ..., A_N . Consider painting at least one and at most N-1 integers among them in red, and painting the rest in blue. Let the beauty of the painting be the \mbox{XOR} of the integers painted in red, plus the \mbox{XOR} of the integers painted... | 35,471 |
Score : 900 points Problem Statement You are given an undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N , and the edges are numbered 1 to M . In addition, each vertex has a label, A or B . The label of Vertex i is s_i . Edge i bidirectionally connects vertex a_i and b_i . The phant... | 35,472 |
Problem B Card Game Strategy Alice and Bob are going to play a card game. There are $n$ cards, each having an integer written on it. The game proceeds as follows: Alice chooses an integer between $a$ and $b$, inclusive. Call this integer $t$. Alice then tells Bob the value of $t$. Bob chooses $k$ out of the $n$ cards. ... | 35,473 |
Problem J: Infected Land The earth is under an attack of a deadly virus. Luckily, prompt actions of the Ministry of Health against this emergency successfully confined the spread of the infection within a square grid of areas. Recently, public health specialists found an interesting pattern with regard to the transitio... | 35,474 |
C: ç¥ç¥· (Pray) ãšããååã¯ãã³ã³ãã¹ãåã«ç¥ç¥·ãããããšã§æåã§ããã 4 ã€ã®æŽæ° $H, W, X, Y$ ããã£ãŠã$H \times W$ ãš $x + y$ ãäž¡æ¹ãšã奿°ã ãšçžèµ·ãæªããããã å
¥å 4 ã€ã®æŽæ° $H, W, X, Y$ ã空çœåºåãã§äžããããã åºå çžèµ·ãæªããªã "No"ãããã§ãªããªã "Yes" ãåºåããªããããã ããæåŸã®æ¹è¡ãå¿ããªãããšã å¶çŽ $H, W, X, Y$ 㯠$1$ ä»¥äž $100$ 以äžã®æŽæ° å
¥åäŸ1 3 5 1 4 åºåäŸ1 No $3 \times 5 = 15$, $1 + 4 = 5$ ã§ãäž¡æ¹ãšã奿°ãªã®ã§ãçžèµ·ãæªãã§ãã å
¥åäŸ2 3 5... | 35,475 |
Sorting Pairs Write a program which print coordinates $(x_i, y_i)$ of given $n$ points on the plane by the following criteria. first by $x$-coordinate in case of a tie, by $y$-coordinate Input The input is given in the following format. $n$ $x_0 \; y_0$ $x_1 \; y_1$ : $x_{n-1} \; y_{n-1}$ In the first line, the number ... | 35,476 |
æ©ã®åãå£ã æ°Žã®åœãŠã©ãŒã¿ãŒããã³ã«ã¯ n åã®éœåžããããŸããåéœåžã¯æ°Žã«å²ãŸããŠãããå³¶åœã®ããã«ãªã£ãŠããŸãããŠã©ãŒã¿ãŒããã³ã«ã¯ m æ¬ã®æ©ããããéœåžéã®äº€éã¯ãããã®æ©ã«ãã£ãŠè¡ãããå
šãŠã®éœåžã«è¡ãæ¥ããããšãã§ããŸãã æè¿ãéè·¯ç¹å®è²¡æºã®èŠçŽãã«ããæ©ã®ç¶æè²»ã®åæžã決å®ãããŸãããå
šéšã®æ©ãç¶æããããšãã§ããªããªã£ãŠããŸããããã€ãã®æ©ãåãå£ãããšã«ãªããŸãããããã§ããŠã©ãŒã¿ãŒããã³ã¯ã©ã®éœåžã«ã§ãè¡ãããšãã§ããããã«æ©ãæ®ãã€ã€ãæ©ã®ç¶æè²»ãæå°åããããšã課é¡ãšãªããŸããã éœåžã®æ°ãæ©ã®æ°ãåæ©ã®ç¶æè²»ãå
¥åãšããæ©ãå©çšããŠã©ã®éœåžã«ãè¡ããããã«ãã€ã€ãæ©ãåãå£ããå Žåã®ç¶æè²»ã®æå°å€ãåºå... | 35,477 |
ãã®ããã«ãŒãã²ãŒã (Card Game is Fun) 1 ãã1000 ãŸã§ã®ã©ããã®æŽæ°ãæžãããã«ãŒããããããããïŒã¢ã³ããšãã«ãŒãã¯ãããã®ã«ãŒããçšããŠïŒæ¬¡ã®ãããªã²ãŒã ãããïŒ ã¢ã³ã㯠A æïŒãã«ãŒã㯠B æã®ã«ãŒããããªãå±±ãæã€ïŒã¢ã³ã㯠A æã®ã«ãŒãã®äžããä»»æã®äœæãïŒ0 æã§ãããïŒãæšãŠãŠæ°ããå±±ãäœãïŒãã«ãŒã㯠B, æã®ã«ãŒããããªãå±±ã®äžçªäžããäœæãïŒ0æã§ãããïŒãšïŒäžçªäžããäœæãïŒ0 æã§ãããïŒãæšãŠãŠæ°ããå±±ãäœãïŒãã ãïŒæšãŠãéã«æ®ã£ãã«ãŒãã®äžŠã³æ¿ãã¯è¡ããªãïŒãã®ããã«äœã£ã2 ã€ã®å±±ãäžèŽããŠãããïŒäžæ¹ã®å±±ã«å«ãŸããã«ãŒãã®ææ°ã2 人ã®åŸç¹ã«ãªãïŒãã ãïŒ2 ã€ã®... | 35,478 |
Problem D: Tunnel Problem 暪軞$x$ã瞊軞$y$ã®$xy$å¹³é¢äžã«$n$åã®é·æ¹åœ¢ãããã$i$çªç®ã®é·æ¹åœ¢ã¯ãé«ã$h_i$ãå¹
$1$ã§ãããé ç¹ã¯ç¹$(i-1, 0)$ãç¹$(i-1, h_i)$ãç¹$(i, h_i)$ãç¹$(i, 0)$ã§ããã ããªãã¯$n$åã®æ£ã®æŽæ°$y_1, y_2, ... y_n$ãéžã³ã以äžã®$n$åã®æäœãè¡ãã (1) 1åç®ã®æäœã§ã¯ãç¹$(0, 1)$ãšç¹$(1, y_1)$ãçµã¶ç·åãåŒãã (2) $i$åç®$(2 \le i \le n)$ã®æäœã§ã¯ãç¹$(i-1, y_{i-1})$ãšç¹$(i, y_i)$ãçµã¶ç·åãåŒãã $i$åç®ã®æäœã«å¯Ÿãã$S... | 35,479 |
Problem B: Erratic Sleep Habits Peter is a person with erratic sleep habits. He goes to sleep at twelve o'lock every midnight. He gets up just after one hour of sleep on some days; he may even sleep for twenty-three hours on other days. His sleeping duration changes in a cycle, where he always sleeps for only one hour ... | 35,480 |
Score : 900 points Problem Statement Alice lives on a line. Today, she will travel to some place in a mysterious vehicle. Initially, the distance between Alice and her destination is D . When she input a number x to the vehicle, it will travel in the direction of the destination by a distance of x if this move would sh... | 35,481 |
Score : 500 points Problem Statement Given are a sequence of N positive integers A_1, A_2, \ldots, A_N , and a positive integer K . Find the number of non-empty contiguous subsequences in A such that the remainder when dividing the sum of its elements by K is equal to the number of its elements. We consider two subsequ... | 35,482 |
Score : 700 points Problem Statement There is an integer sequence of length 2^N : A_0, A_1, ..., A_{2^N-1} . (Note that the sequence is 0 -indexed.) For every integer K satisfying 1 \leq K \leq 2^N-1 , solve the following problem: Let i and j be integers. Find the maximum value of A_i + A_j where 0 \leq i < j \leq 2^N-... | 35,483 |
G: æå°å
å«ç©åœ¢ - Minimum Enclosing Rectangle - ç©èª ã¿ããªããããã«ã¡ã¯ïŒ å
«æ£®äžã·ãããéšã®è座ãããã ããã çªç¶ã ãã©ããããããã®åè§£ããªãã£ãåé¡ãã¿ããªã«è§£ããŠæ¬²ãããã ãïœã ãã®åéšæŽ»ã§ ICPC2010ã®Aåé¡ ãè§£ãããã ãã©ããã®æã®åé¡ãé£ããã£ããã ãã ããICPCã«ã€ããŠèª¬æããªããïŒ ICPCã¯ãããããããŒãªãããªãâŠâŠã¡ã
ãããããâŠâŠã·ãããã¿ããâŠâŠãããŠããšã®ç¥ã§ãæ¥æ¬èªã«çŽããšãåœéäžåŠç察æããã°ã©ãã³ã°ã³ã³ãã¹ããããããïŒ ãããã«ã¯ã¡ãã£ãšãããããèšèããã£ã±ãã ããã ãããéã¯ãã®äžç倧äŒã«åºãããã«æ¯æ¥é 匵ã£ãŠããã ãïŒ éšæŽ»ããåž°ã£ã... | 35,484 |
Score : 1000 points Problem Statement There are N balls and N+1 holes in a line. Balls are numbered 1 through N from left to right. Holes are numbered 1 through N+1 from left to right. The i -th ball is located between the i -th hole and (i+1) -th hole. We denote the distance between neighboring items (one ball and one... | 35,485 |
Problem B: Cubes Without Holes There is a cube which consists of n à n à n small cubes. Small cubes have marks on their surfaces. An example where n = 4 is shown in the following figure. Then, 次ã«ãäžå³ïŒå³ïŒã«ç€ºãããã«ãå°ã®ã€ãã衚é¢ãããå察ã®é¢ãŸã§æ°Žå¹³ãŸãã¯åçŽã«è²«éãã穎ããããã ããªãã®ä»äºã¯ã n ãš å°ã®äœçœ®ãèªã¿èŸŒã¿ã穎ã®ç©ºããŠããªãå°ããç«æ¹äœã®åæ°ãæ°ããããã°ã©ã ãäœæããããšã§ããã Input å
¥åã¯ããã€ãã®ããŒ... | 35,486 |
Score : 100 points Problem Statement We have a cord whose length is a positive integer. We will perform the following condition until the length of the cord becomes at most 2 : Operation: Cut the rope at two positions to obtain three cords, each with a length of a positive integer. Among these, discard one with the lon... | 35,487 |
Score : 500 points Problem Statement Find the number of integers between 1 and N (inclusive) that contains exactly K non-zero digits when written in base ten. Constraints 1 \leq N < 10^{100} 1 \leq K \leq 3 Input Input is given from Standard Input in the following format: N K Output Print the count. Sample Input 1 100 ... | 35,488 |
ã°ãã°ãé¥
é äŒæŽ¥è¥æŸåžã«ããåèåå±ã»åæ å ã®åºé·ããã¯ããšãŠãè
ã®ããè·äººãããªã®ã«ã¡ãã£ãšæ°åå±ãªã®ãçã«ããºã§ããåºé·ããã®äœãé¥
é ã¯ãšãŠãçŸå³ããã®ã§ããããã®æã®æ°åã«ãã£ãŠå€§ããããŸã¡ãŸã¡ã«ãªã£ãŠããŸããŸãã èŠãããåºé·ããã®å¥¥ããã¯ã倧ãããšéããã°ãã°ããªé¥
é ãè¢ã«è©°ããŠå£²ãåºãããšãæãã€ããŸãããäžå®ã®éãã«ãªãããã«é¥
é ãè¢ã«è©°ããŠå£²ãã°ãäžã€äžã€ã®å€§ããã¯ã°ãã°ãã§ãäžå®ã®å€æ®µã§å£²ãåºãããšãåºæ¥ãŸãããã©ããªé¥
é ãå
¥ã£ãŠããã®ãéãããŸã§ããããªããšãããµãã©ã€ãºã売ãã«ãªããããããŸããã ãã°ãã°ãé¥
é ããšããååã§å£²ãã ãããšãããæ°ããã¢ã€ãã£ã¢ã話é¡ãšãªãåæ å ã¯ãã¡ãŸã¡è©å€ãšãªããŸããããã... | 35,489 |
Problem B: Matrix Operations Problem èŠçŽ ã1ãš0ãããªã n à n ã®è¡åã«å¯ŸããŠã以äžã®çš®é¡ã®æäœãè¡ãããã°ã©ã ãäœæããã éšåè¡åãšè§åºŠ(0,90,180,270,360)ãäžããããã®ã§ãã®åã ãæèšåãã«å転ãããã éšåè¡åãäžããããã®ã§å€ãå転ãããã è¡ãäžããããã®ã§å·Šã«1åã·ããããã¯ã¿åºãåã¯å³ç«¯ã«ç§»åããã è¡ãäžããããã®ã§å³ã«ïŒåã·ããããã¯ã¿åºãåã¯å·Šç«¯ã«ç§»åããã è¡( r ),å( c )ãäžããããã Step1ïŒçŸåšã®ã»ã«ã( r , c )ã«ããã Step2ïŒçŸåšã®ã»ã«ã®å€ãå転ããã Step3ïŒé£æ¥ããã»ã«ã®ãã¡ãå€ãçŸåšã®ã»ã«ã®å転åã®å€ãšç... | 35,490 |
Score : 1400 points Problem Statement You are given strings s and t , both of length N . s and t consist of 0 and 1 . Additionally, in these strings, the same character never occurs three or more times in a row. You can modify s by repeatedly performing the following operation: Choose an index i ( 1 \leq i \leq N ) fre... | 35,491 |
Carpenters' Language International Carpenters Professionals Company (ICPC) is a top construction company with a lot of expert carpenters. What makes ICPC a top company is their original language. The syntax of the language is simply given in CFG as follows: S -> SS | (S) | )S( | ε In other words, a right parenthesis ca... | 35,492 |
Karakuri Doll ãããã人圢 English text is not available in this practice contest. ãããã人圢垫㮠JAG æ°ã¯ïŒé·å¹Žã®ç ç©¶ã®æãŠã«ïŒäŒçµ±æè¡ãšææ°æè¡ãèåããããã°ããããè¶æ±²ã¿äººåœ¢ã®éçºã«æåããïŒãã®ãè¶æ±²ã¿äººåœ¢ã¯ïŒäžã®å³ã®ããã«æ Œåã«åºåãããå®¶ã®äžã§ïŒå°æïŒKïŒã§ãè¶ã®å
¥ã£ã湯飲ã¿ãä¹ãããšããã䞻人ïŒMïŒã®å±
å ŽæãŸã§æã£ãŠããïŒäž»äººã飲ã¿çµãã£ã湯飲ã¿ãä¹ãããšå°æãŸã§æ»ã£ãŠãããšããä»äºãããïŒãã ãïŒãã®äººåœ¢ã¯å°æãšäž»äººã®éã®åŸåŸ©çµè·¯ãèªåã§èŠã€ããããã»ã©è³¢ãã¯ãªãïŒäœ¿çšè
ã¯ãã®äººåœ¢ã«ããã°ã©ã ããããããå
¥åããŠïŒäººåœ¢ããã¡ããšåŸåŸ©ã§ããã... | 35,493 |
Score : 100 points Problem Statement You are given two positive integers a and b . Let x be the average of a and b . Print x rounded up to the nearest integer. Constraints a and b are integers. 1 \leq a, b \leq 100 Input Input is given from Standard Input in the following format: a b Output Print x rounded up to the ne... | 35,494 |
Tree Allocation A tree is one of the most popular data structures in computer science. Tree itself is very elegant, but it is incompatible with current computer architecture. In the current architecture, memory can be regarded as a one-dimensional array. Since a tree is not a one-dimensional structure, cache efficiency... | 35,495 |
C - ã¿ããããã®æ ¹ä»ãæš Problem Statement ããªãã¯èŠªåã§ããã¿ããããã®èªçæ¥ãè¿ãããšã«æ°ã¥ãïŒæ ¹ä»ãã®äºåæšããã¬ãŒã³ãããããšã«ããïŒ ããã§ïŒæ ¹ä»ãã®äºåæšãšã¯ïŒä»¥äžã®ãããªã°ã©ãæ§é ã§ããïŒ(å³ 1) åé ç¹ã«ã¯ïŒãã®é ç¹ã®èŠªãšåŒã°ããé ç¹ãã¡ããã© 1 ã€ã ãååšãïŒèŠªãšèŸºã§çµã°ããŠããïŒãã ãïŒæ ¹ãšåŒã°ãã 1 ã€ã®é ç¹ã®ã¿ïŒäŸå€çã«èŠªãæããªãïŒ åé ç¹ã¯ïŒå·Šã®åãšåŒã°ããé ç¹ãã¡ããã©1ã€æã€ãïŒãããã¯æããªãïŒå·Šã®åãæã€å ŽåïŒå·Šã®åãšã¯èŸºã§çµã°ããŠããïŒå·Šã®åã®èŠªã¯ãã®é ç¹ã§ããïŒ åé ç¹ã¯ïŒå³ã®åãšåŒã°ããé ç¹ãã¡ããã©1ã€æã€ãïŒãããã¯æããªãïŒå³ã®åãæã€å ŽåïŒå³ã®åãšã¯èŸºã§çµ... | 35,496 |
Chebyshev's Theorem If n is a positive integer, there exists at least one prime number greater than n and less than or equal to 2 n . This fact is known as Chebyshev's theorem or the Bertrand-Chebyshev theorem, which had been conjectured by Joseph Louis François Bertrand (1822â1900) and was proven by Pafnuty Lvovich Ch... | 35,497 |
Intersection For given two segments s1 and s2 , print "1" if they are intersect, "0" otherwise. s1 is formed by end points p0 and p1 , and s2 is formed by end points p2 and p3 . Input The entire input looks like: q (the number of queries) 1st query 2nd query ... q th query Each query consists of integer coordinates of ... | 35,498 |
ãããããã¯ãæ€åºãã ã³ã³ãã¥ãŒã¿ã«ããããããŒã¿ããŒã¹ããšã¯ãæ
å ±ã管çããããã®å
¥ãç©ã§ããããŒã¿ããŒã¹ãããžã¡ã³ãã·ã¹ãã (DBMS)ããšã¯ããã®ç®¡çãããä»çµã¿ã§ããè€æ°ã®ãŠãŒã¶ãå©çšããããŒã¿ããŒã¹ã§ã¯ãDBMS ã¯æ
éã«æ§ç¯ããå¿
èŠããããŸãã äŸãã°ãå庫ããååãïŒã€åãåºãã人ããããŒã¿ããŒã¹ã«å¯ŸããŠä»¥äžã®åŠçãè¡ããšããŸãããã (1) ååã®åæ° N ãããŒã¿ããŒã¹ããèªãã (2) æ°ããªååã®åæ° N -1 ãããŒã¿ããŒã¹ã«æžã蟌ãã ãŠãŒã¶ïŒã(1)ãçµããŠ(2)ãå§ããåã«ãå¥ã®ãŠãŒã¶ïŒãå庫ããååãåãåºããŠ(1)ãè¡ã£ããšããŸãããŠãŒã¶ïŒããŠãŒã¶ïŒãšåãåæ°ãèªãã®ã§ãïŒäººã(2)ãçµãããšãã«... | 35,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.