task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
ãã¿ã ãã åé¡ ããªã㯠J åãšäžç·ã«ãã¿ã ããã䜿ã£ãŠéãã§ãã.ãã¿ã ãã㯠n æ¬ã®çžŠæ£ãš m æ¬ã®æšªæ£ãããªã.瞊æ£ã«ã¯å·Šããé ã« 1 ãã n ã®çªå·ãã€ããŠãã,çžŠæ£ i ã®äžç«¯ã«ã¯æ£æŽæ° s i ãæžãããŠãã. å³ 3-1 ãã¿ã ããã®äŸ( n = 4, m = 5, s 1 = 20, s 2 = 80, s 3 = 100, s 4 = 50) çžŠæ£ i ã®äžçªäžããé ã«éããã©ã£ãŠããå°éããäžç«¯ã«æžãããŠããæŽæ°ã, 瞊 æ£ i ãéžãã å Žåã®åŸç¹ã§ãã.äŸãã°,å³ 3-1 ã§ã¯,çžŠæ£ 1 ãéžã¶ãšåŸç¹ã¯ 80 ç¹ ã§ãã,çžŠæ£ 2 ãéžã¶ãšåŸç¹ã¯ 100 ç¹ã§ãã. å³ 3-2 éã®ãã©ãæ¹ã®äŸ J å... | 39,132 |
é£åãªäººãã¡ãåº§ãæ€
å 4ã€ã®åœã®äžå¿ã«ããäžç«éœåžã¢ã€ãºã·ãã£ã«ã¯ãå€§éžæšªæåè»ãã³ãã€å·ã®ããŒã ããããŸãã ããŒã ã«ã¯ããã³ãã€å·ãåŸ
ã€ä¹å®¢çšã®æ€
åãäžåã«çšæãããŠãããããŒã ã«å
¥ã£ãŠãã人ã¯èªç±ã«æ€
åãå©çšããããšãã§ããŸãã ãã®ãã³ãã€å·ãå®ããæ©ããå¿«é©ãšããããšã§ãåšå²ã®4ã€ã®åœããã®å©çšè
ãçµ¶ããŸããã仿¥ã¯ééèšå¿µæ¥ãšããããšã§ãããŒã ã«åº§ã£ãŠãã人ãã¡ã«ç¹å¥ãªããšãããŠãããããšæã£ãŠããŸãããã®ããã«ã¯ãæ¹æãéã£ã人ãã¡ãã©ãã«åº§ã£ãŠãããææ¡ããªããã°ãªããŸããã4ã€ã®åœã®äººãã¡ã®é£åãªæ§æ Œãèæ
®ããŠãæ€
åãã©ã®ããã«åãŸã£ãŠããããã·ãã¥ã¬ãŒãããããã°ã©ã ãäœæããŠãã ãããæ¹æãéã£ã人ãã¡ã¯ã次... | 39,133 |
ååã®èªæžææ³æ ååã®ã¢ããšãããéãåŠæ ¡ã§ã¯æ©ããå€äŒã¿ã«çªå
¥ãïŒä»å¹Žããã³ãã ããéã®å®¿é¡ãåºãããïŒ ãããïŒéã³çãã®2人ã¯ä»æ¥ã宿é¡ã«ã¯äžåæãã€ããã«å€ãžéã³ã«è¡ãããšããŠããïŒ ãã®ãŸãŸã§ã¯å€äŒã¿æçµæ¥ã«æ³£ããèŠãã®ã¯æãããªã®ã§ïŒä¿è·è
圹ã®ããªãã¯ïŒå¿ã鬌ã«ããŠä»æ¥ã¯èªæžææ³æã®å®¿é¡ãçµãããŸã§2人ãå®¶ããåºããªãããšã«ããïŒ æºåã®è¯ãããªãã¯æ¢ã«å³æžé€šããå
šãŠã®èª²é¡å³æžãåããŠããïŒ ãã ãïŒå³æžé€šã®èŠåã«ãã忬ã¯1åãã€ããåããããŠããªãïŒ ããŠïŒæè²äžã®çç±ãã2人ã«ã¯äºãã«ååããããšãªãïŒããããå
šãŠã®æ¬ãèªã¿ïŒææ³ãæžããŠãããäºã«ããïŒ å ããŠïŒæ¬ã®è¿åŽæéãè¿ãããïŒãŸãã¯ãªãã¹ãæ©ããã¹ãŠã®... | 39,134 |
Problem G: Flipping Parentheses A string consisting only of parentheses '(' and ')' is called balanced if it is one of the following. A string "()" is balanced. Concatenation of two balanced strings are balanced. When a string $s$ is balanced, so is the concatenation of three strings "(", $s$, and ")" in this order. No... | 39,135 |
Problem F: Shore Erosion ããªãã¯å°å
ã®åžåœ¹æã«å€ããããã°ã©ããŒã§ããïŒããªãã®äœãã§ããçºã¯èгå
æ¥ãçãã§ïŒãšãã«é¢ãå°å³¶ã«ããæµ·å²žã®æµ·æ°ŽæµŽå Žã人æ°ãããïŒãã®å³¶ã®åšå²ã¯ç æµã«ããæ§æãããŠããã®ã ãïŒè¿å¹Žæµ·å²žæµžé£ã«ãã£ãŠç æµã®é¢ç©ãæžã£ãŠããïŒäºæ
ãéãèŠã芳å
課ã¯ïŒããªãã«ç æµã®åœ¢ç¶å€åã®ã·ãã¥ã¬ãŒã·ã§ã³ãäŸé ŒããŠããïŒ ã·ãã¥ã¬ãŒã·ã§ã³ã§ã¯ïŒçŸåšã®ç æµã®åœ¢ç¶ãããšã«ïŒããæéãçµéããåŸã®ç æµã®åœ¢ç¶ãæ±ããïŒç°¡åã®ããïŒå³¶ã®æµ·å²žç·ã®åœ¢ç¶ã¯å€è§åœ¢ïŒåžãšã¯éããªãïŒãšã¿ãªãïŒæéã®ãã¡ã«ïŒç æµã¯çŸåšã®æµ·å²žç·ãããã³ããã¿ã³è·é¢ã§ R ã ãæµžé£ãããŠæµ·ã«æ²ããã®ãšä»®å®ããïŒããã§ïŒãã³ããã¿ã³è·é¢ãšã¯ x... | 39,136 |
I - Tokyo Olympics Center Problem Statement You are participating in the Summer Training Camp for Programming Cotests. The camp is held in an accommodation facility called Tokyo Olympics Center . Today is the last day of the camp. Unfortunately, you are ordered to check if all the participants have properly cleaned the... | 39,137 |
Barter Problem ãããåã¯ãããŸãæ£ã x æ¬ããµããã y æ¬æã£ãŠããã n 人ã®ãèå亀æäººãããã ããããã®äº€æäºº i ã¯ã ãããåã®ããŸãæ£ a i æ¬ãšäº€æäººã®ãµãã b i æ¬ ãããåã®ãµãã c i æ¬ãšäº€æäººã®ãã¿ã¡ãœ d i å ã®ã©ã¡ãã1ã€ã®æ¹æ³ã§1åã ã亀æããŠãããã ãã®å¶çŽã®äžã§ãæçµçã«ææããŠãããã¿ã¡ãœã®åæ°ãæå€§åããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã n x y a 1 b 1 c 1 d 1 a 2 b 2 c 2 d 2 ... a n b n c n d n 1è¡ç®ã«æŽæ° n ãäžããããã 2è¡ç®ã«æŽæ° x , y ã空çœåºåãã§äžããããã 3è¡ç®ã... | 39,138 |
Score : 2200 points Problem Statement You are given a tree T with N vertices and an undirected graph G with N vertices and M edges. The vertices of each graph are numbered 1 to N . The i -th of the N-1 edges in T connects Vertex a_i and Vertex b_i , and the j -th of the M edges in G connects Vertex c_j and Vertex d_j .... | 39,139 |
å顿 ãã¥ã¥ã¹ã ã¯ã¯ã«ãã«ã®ã¹ã®å€ã«åããŠé女ã®åæã«æãæ®ããŠããïŒã¯ã«ãã«ã®ã¹ã®å€ã®ããã«ïŒç¹å¥ãª ã°ãªãŒãã·ãŒã (é女ã®åµ) ã䜿ã£ãŠæã«å
¥ããããé女ãããŸãåæãç®çã§ããèå°è£
眮ã®é女ãåµãäžããªããã°ãªããªãããã§ããïŒ ãã¥ã¥ã¹ã ã¯æã«å
¥ããããçš®é¡ã®é女㮠ã°ãªãŒãã·ãŒã ããé女ã®çŽ ãšãªããã®ãåãåºãïŒç©ºã®ç¹å¥ãª ã°ãªãŒãã·ãŒã ã«å
¥ããããšã§ïŒãã® ã°ãªãŒãã·ãŒã ã«é女ã宿ãããããšãã§ããïŒãŸãïŒãã®äžçã«ã¯ïŒããçµã¿åããã§è€æ°ã®é女ãåæãããšæ°ã㪠1 ã€ã®é女ãçã¿åºãããšãã§ãããšããåææ³åãããã€ãããïŒããã§ïŒããã€ãã®ç¹å¥ãª ã°ãªãŒãã·ãŒã ã䜿ãïŒãããã®äžã«ããé女ã®çŽ ãšãªã... | 39,140 |
Score : 200 points Problem Statement Takahashi has N blue cards and M red cards. A string is written on each card. The string written on the i -th blue card is s_i , and the string written on the i -th red card is t_i . Takahashi will now announce a string, and then check every card. Each time he finds a blue card with... | 39,141 |
Conveyor Belt Awesome Conveyor Machine (ACM) is the most important equipment of a factory of Industrial Conveyor Product Corporation (ICPC). ACM has a long conveyor belt to deliver their products from some points to other points. You are a programmer hired to make efficient schedule plan for product delivery. ACM's con... | 39,142 |
Score : 800 points Problem Statement Given are N pairwise distinct non-negative integers A_1,A_2,\ldots,A_N . Find the number of ways to choose a set of between 1 and K numbers (inclusive) from the given numbers so that the following two conditions are satisfied: The bitwise AND of the chosen numbers is S . The bitwise... | 39,143 |
Problem F: Strawberry Cake äŒæŽ¥å€§åŠéå±å°åŠæ ¡ (äŒæŽ¥å€§å°) ã«å
¥åŠããã·ã£ãããããšãªãã³ãŒã¯ç«¶æããã°ã©ããšããŠæŽ»èºããããã« IPPC ãšããããã°ã©ãã³ã°ã³ã³ãã¹ãã«åºå Žããããšã«ãããããã IPPC 㯠3 人 1 çµã§ããŒã ãšããŠã³ã³ãã¹ãã«åºå Žããæ±ºãŸãã§ã4 人ã§ããŒã ãçµãããšã¯ã§ããªããããã§åœŒã㯠2 人ãã€ã«åãããŠããŒã ãçµã¿ã2 人 1 çµã§åå ã§ãã IPOCH ãšããããã°ã©ãã³ã°ã³ã³ãã¹ãã«åºå Žããããšã«ããã ããŒã ã¯åãããŠããŸã£ãããå®åã¯æ®æããŠããäºãã«è¯ãç·Žç¿çžæã«ãªã£ãŠããã ããæ¥åœŒãã®ã³ãŒããå·®ãå
¥ãã«ããŒã«ã±ãŒããè²·ã£ãŠããã圌ãã¯ãããã·ã£ã®å®¶ã§é£ã¹... | 39,144 |
H: éæ³äœ¿ãã®å¡ å顿 ããªããæã£ãŠããéå°æžã«ã¯ã $N$ åã®éæ³ãèŒã£ãŠããŸãã éæ³ã«ã¯ $1$ ãã $N$ ãŸã§ã®çªå·ãã€ããŠããŠãéæ³ $i (1 \le i \le N)$ ã®ã³ã¹ãã¯ã¯ããæŽæ° $A_i$ ã§ãã ããªãã®ç®çã¯ãéå°æžã«èŒã£ãŠãããã¹ãŠã®éæ³ã $1$ åãã€å±ããããšã§ãã éæ³ãå±ãã¯ãããåã«ãããªãã¯ã¯ãããŒã $K$ æé£ã¹ãããšãã§ããŸããã¯ãããŒãé£ã¹ãã®ã«æéã¯ããããŸããã ããªãã¯ã¯ãããŒã $1$ æé£ã¹ããã³ã«ãã³ã¹ããæ£ã®éæ³ã $1$ ã€éžã³ããã®ã³ã¹ãã $1$ äžããããšãã§ããŸãã ã¯ãããŒãé£ã¹ãããšãããªãã¯éæ³ãå±ãå§ããŸãã ããªãã® MP ã¯ã¯ãã... | 39,145 |
èªè»¢è»ã§ãã€ãšãã A ããã¯çããã®ã倧奜ãã§ãããæè¿ã¯å¥¥ãããããã€ãšããããããã«èšãããŠããŸããããæ¥ãA ãããèªå®
ããåžåœ¹æã«åºããããšãã奥ããã¯èªè»¢è»ã§è¡ãããšãå§ããŸãããããã§A ããã¯ãã¶ãã¶èªè»¢è»ã«ä¹ã£ãŠåºãããŸããããçãç©ã®å¥œã㪠A ããã¯ãéäžã«ããã±ãŒãå±ããã«ç«ã¡å¯ãã±ãŒãã®é£ã¹æ©ããããããšæãã€ããŸããã èªè»¢è»ãããã°èµ°è¡è·é¢ã«å¿ããŠã«ããªãŒãæ¶è²»ãããŸãããã±ãŒããé£ã¹ãã°ãã®åã«ããªãŒãæåãããŸããæ£å³ã®æ¶è²»ã«ããªãŒã¯ãèªè»¢è»ãããã§æ¶è²»ããã«ããªãŒããã±ãŒããé£ã¹ãŠæåããã«ããªãŒãåŒããå€ã«ãªããŸãããããã£ãŠãæ£å³ã®æ¶è²»ã«ããªãŒã 0 ããå°ãããªãããšããããŸãã ã±ãŒãå±ã... | 39,146 |
Problem F: Marching Course Since members of Kitafuji High School Brass Band Club succeeded in convincing their stern coach of their playing skills, they will be able to participate in Moon Light Festival as a marching band. This festival is a prelude in terms of appealing their presence for the coming domestic contest.... | 39,147 |
Problem D: Cliff Climbing At 17:00, special agent Jack starts to escape from the enemy camp. There is a cliff in between the camp and the nearest safety zone. Jack has to climb the almost vertical cliff by stepping his feet on the blocks that cover the cliff. The cliff has slippery blocks where Jack has to spend time t... | 39,148 |
Road Improvement Aizu is a country famous for its rich tourism resources and has N cities, each of which is uniquely identified with a number (0 to N -1). It has a road network consisting of M one-way roads connecting a city to another. All the roads connecting the cities in Aizu have a row of cherry trees along their ... | 39,149 |
A: IPã¢ãã¬ã¹ (Internet Protocol Address) åé¡ æ°ååã 1 ã€äžããããã®ã§ãIPv4ã®IPã¢ãã¬ã¹ãšããŠæå¹ãªåºåãæ¹ã®åæ°ãæ±ããã ãã ããIPv4ã®IPã¢ãã¬ã¹ãšããŠæå¹ãªåºåãæ¹ã¯ä»¥äžã®éãã§ããã æ°åå㯠4 ã€ã«åºåãããåºåãããååã«ã€ããŠä»¥äžããã¹ãŠæºããã 空åã§ãªãã 10 鲿°ãšããŠèªããš 0 ä»¥äž 255 以äžã®æŽæ°ã§ããã ãã®æ°ã 0 ãªãã°ããã®å㯠0 ã§ããïŒ 00 ãªã©ã¯èªããããªãïŒã ãã®æ°ã 0 ã§ãªããªãã°ãå
é ã®æ°å㯠0 ã§ãªãïŒ 01 ãªã©ã¯èªããããªãïŒã å
¥ååœ¢åŒ S å¶çŽ 4 \leq |S| \leq 12 S ã«å«ãŸããæåã¯æ°åã®... | 39,150 |
Tally Counters A number of tally counters are placed in a row. Pushing the button on a counter will increment the displayed value by one, or, when the value is already the maximum, it goes down to one. All the counters are of the same model with the same maximum value. Fig. D-1 Tally Counters Starting from the values i... | 39,151 |
Usoperanto Usoperanto is an artificial spoken language designed and regulated by Usoperanto Academy. The academy is now in study to establish Strict Usoperanto, a variation of the language intended for formal documents. In Usoperanto, each word can modify at most one other word, and modifiers are always put before modi... | 39,152 |
éçŽ ãã¯ã·ã³ã°ã¯äœéã«ãã£ãŠéçŽãåããããŠããŸããäœéãèªã¿èŸŒãã§ããã®éçŽãåºåããããã°ã©ã ãäœæããŠãã ãããéçŽãšäœéã®é¢ä¿ã¯ä»¥äžã®è¡šã®ãšãããšããŸãã éçŽ äœéïŒkgïŒ light fly 48.00kg ä»¥äž fly 48.00kg è¶
51.00kg ä»¥äž bantam 51.00kg è¶
54.00kg ä»¥äž feather 54.00kg è¶
57.00kg ä»¥äž light 57.00kg è¶
60.00kg ä»¥äž light welter 60.00kg è¶
64.00kg ä»¥äž welter 64.00kg è¶
69.00 kg ä»¥äž light middle 69.00kg è¶
75.00 kg 以äž... | 39,153 |
Problem Statement Your friend, Tatsumi, is a producer of Immortal Culture Production in Chiba (ICPC). His company is planning to form a zombie rock band named Gray Faces and cheer Chiba Prefecture up. But, unfortunately, there is only one zombie in ICPC. So, Tatsumi decided to release the zombie on a platform of Soga s... | 39,154 |
決ãŸãããšã®å€ããžã ã€ã
ã¢æã®ã¹ããŒããžã ã«ã¯$1$ãã$N$ãŸã§ã®çªå·ãä»ãã$N$å°ã®ãã¬ãŒãã³ã°æ©åšããããŸãããã¬ãŒãã³ã°æ©åšãïŒåå©çšããã«ã¯ããã®æ©åšã®çªå·ãæžããããã±ãããïŒæå¿
èŠã§ãããã¬ãŒãã³ã°æ©åšãïŒåå©çšãããšãã®æ¶è²»ã«ããªãŒã¯ãæ©åšããšã«æ±ºãŸã£ãŠããŸãã ãã®ã¹ããŒããžã ã®ãã±ãããäœæãããã£ãã¢ãã·åã¯ãéåäžè¶³è§£æ¶ã®ããã«ãžã ã«è¡ããŸããããã®ãžã ã§ã¯ãå©çšè
ãéåããããããŠäœãçããªãããã«ãæ©åšã®å©çšåæ°ã«ã«ãŒã«ããããŸããããšãã°ããïŒçªã®æ©åšã¯ïŒçªã®æ©åšãããïŒå以äžå€ã䜿ã£ãŠã¯ãããŸããããšãããããªã«ãŒã«ã§ããæ©åšã䜿ã人ã¯ãã«ãŒã«ãå®ã£ãŠæ©åšãå©çšããªããã°ãªããŸããã ã¢ãã·åã¯ã... | 39,155 |
Bit Flag A state with $n$ flags of ON or OFF can be represented by a sequence of bits where $0, 1, ..., n-1$ -th flag corresponds to 1 (ON) or 0 (OFF). The state can be managed by the corresponding decimal integer, because the sequence of bits is a binary representation where each bit is 0 or 1. Given a sequence of bit... | 39,156 |
Score : 900 points Problem Statement Mole decided to live in an abandoned mine. The structure of the mine is represented by a simple connected undirected graph which consists of N vertices numbered 1 through N and M edges. The i -th edge connects Vertices a_i and b_i , and it costs c_i yen (the currency of Japan) to re... | 39,157 |
D - ã«ãŒããã ç·åç ç©¶7å·é€šã®åŒè¶ãã«äŒŽãïŒç 究宀ã«ã«ãŒããããæ·ãããšã«ãªã£ãïŒ ãã®åé¡ã§ã¯ç 究宀ãäžããèŠããšãã®åºãïŒäºæ¬¡å
å¹³é¢äžã®å€è§åœ¢ãšã¿ãªãïŒ åºã®åœ¢ç¶ã衚ãèŠçŽ æ° N ã®æ°å \{a_i\} ãäžããããïŒ R_i ãïŒå·Šäžã®åº§æšã (i,0) ã§å³äžã®åº§æšã (i+1,a_i) ã§ããå蟺ãx軞ãŸãã¯y軞ã«å¹³è¡ãªé·æ¹åœ¢ã®å¢çåã³å
éšé åãšããïŒ ãã®ãšãïŒåºã衚ãå€è§åœ¢ã¯ R_1 ⪠R_2 ⪠R_3 ⪠⊠⪠R_N ã«ãã£ãŠè¡šãããïŒ ã«ãŒãããã¯é·æ¹åœ¢ã§ããã°ã©ããªå€§ããã®ãã®ãäœæã§ãçšæããããšãã§ããïŒ ä»¥äžã®æ¡ä»¶ãæºããããã«ã«ãŒããããé
眮ãïŒç 究宀ã®åºãå
šãŠèŠãã€ããããïŒ ã«ãŒãããã¯... | 39,158 |
Score : 700 points Problem Statement You are given a simple connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N , and the i -th edge connects Vertex A_i and Vertex B_i . Takahashi will assign one of the two possible directions to each of the edges in the graph to make a directed gra... | 39,159 |
Score : 900 points Problem Statement There are 2N points evenly spaced on the circumference of a circle. These points are numbered 1 to 2N in clockwise order, starting from some of them. Snuke will divide these points into N pairs, then for each pair, he will draw a line segment connecting the two points. After the lin... | 39,160 |
Problem C: ! You are one of ICPC participants and in charge of developing a library for multiprecision numbers and radix conversion. You have just finished writing the code, so next you have to test if it works correctly. You decided to write a simple, well-known factorial function for this purpose: Your task is to wri... | 39,161 |
Score : 300 points Problem Statement There is an empty array. The following N operations will be performed to insert integers into the array. In the i -th operation (1â€iâ€N) , b_i copies of an integer a_i are inserted into the array. Find the K -th smallest integer in the array after the N operations. For example, the 4... | 39,162 |
Score : 500 points Problem Statement For an integer n not less than 0 , let us define f(n) as follows: f(n) = 1 (if n < 2 ) f(n) = n f(n-2) (if n \geq 2 ) Given is an integer N . Find the number of trailing zeros in the decimal notation of f(N) . Constraints 0 \leq N \leq 10^{18} Input Input is given from Standard Inpu... | 39,163 |
Score : 100 points Problem Statement X and A are integers between 0 and 9 (inclusive). If X is less than A , print 0 ; if X is not less than A , print 10 . Constraints 0 \leq X, A \leq 9 All values in input are integers. Input Input is given from Standard Input in the following format: X A Output If X is less than A , ... | 39,164 |
Problem G: Combine Two Elements Problem $N$åã®éè² æŽæ°ã®ãã¢$(a_i, b_i)$ãšéè² æŽæ°$A$, $B$ ãäžããããã 以äžã®ããããã®æäœãã§ããã ãããããè¡ãããã $|a_i - b_i| \leq A$ ãŸã㯠$B \leq |a_i - b_i| \leq 2A$ãæºããèŠçŽ $i$ãåãåºããåé€ãã $|(a_i + a_j) - (b_i + b_j)| \leq A$ ãŸã㯠$B \leq |(a_i + a_j) - (b_i + b_j)| \leq 2A$ ãæºããèŠçŽ $i$ãšèŠçŽ $j$ ($i \neq j$)ã®çµãåãåºããåé€ãã æå€§ã®æäœåæ°ã... | 39,166 |
Score : 100 points Problem Statement In this problem, you should process T testcases. For each testcase, you are given four integers N, M, A, B . Calculate \sum_{i = 0}^{N - 1} floor((A \times i + B) / M) . Constraints 1 \leq T \leq 100,000 1 \leq N, M \leq 10^9 0 \leq A, B < M Input Input is given from Standard Input ... | 39,167 |
å
¥å Žæé ã¢ã€ã
æž©æ³ã«ã¯ãæµŽå ŽãšããŒã«ããããæµŽå Žãå©çšããã«ã¯å
¥æµŽåžããããŒã«ãå©çšããã«ã¯ããŒã«åžãããããè²·ãå¿
èŠããããŸãããããã®åžã®å€æ®µã¯ãæ¥ã«ãã£ãŠå€ãããããããŸããããŸããã¢ã€ã
æž©æ³ã«ã¯ä»¥äžã®ãããªã«ãŒã«ããããŸãã åžã¯è³Œå
¥åœæ¥ïŒåã®å©çšã«éãæå¹ã ãå
¥æµŽåžïŒæä»¥äžãã€ããŒã«åžïŒæä»¥äžãã§ãŸãšããŠè²·ããšããã¹ãŠã®åžãïŒå²åŒã«ãªãã æž©æ³å¥œãã®è²åãããšãã®å人ãã¡ã¯ãã¢ã€ã
æž©æ³ã«æ¯æ¥ã®ããã«éã£ãŠããŸãã圌ãã¯çæ°ãŸããã§ãæ¥ã«ãã£ãŠäœ¿ãææ°ã¯ç°ãªããŸããã¢ã€ã
æž©æ³ã«ã¯å²åŒã«ãŒã«ããããããã°ã«ãŒãã§ååããŠäžæã«è²·ãã°ãåèšæéãå®ãæžãŸãããšãã§ãããããããŸããã å
¥æµŽåžãšããŒã«åžã®æéã䜿çšããå
¥æµŽåžã®... | 39,168 |
Problem B: Square Coins People in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values of all square numbers up to 289 (= 17 2 ), i.e., 1-credit coins, 4-credit coins, 9-credit coins, ..., and 289-credit coins, are available in Silverland. There are f... | 39,169 |
A: äžžä»ã åé¡ AORã€ã«ã¡ããã¯ãã¹ãã«åæ Œããããå匷ããŠããŸãã AORã€ã«ã¡ããã¯ã $N$ åãåé¡ãè§£ããŸããã ãã®åŸãè§£ããåé¡ã®äžžä»ãã以äžã®æé ã§è¡ããŸãã è§£çã®æ£èª€ã確èªããã è§£çãæ£ããå Žåã¯ãã«å°ã誀ã£ãŠããå Žåã¯ããå°ãè§£ççšçŽã«æžã蟌ãã è§£çã $2$ åé£ç¶ã§èª€ãã§ãããšããã£ãç¬éããã¹ãã«äžåæ Œã«ãªã£ãŠããŸãææãããAORã€ã«ã¡ããã¯å€±ç¥ããŠããŸããŸãããããŠããã以éäžžä»ããè¡ãããšã¯ã§ããŸããã 倱ç¥ã¯æé $1$ ãš $2$ ã®éã§èµ·ãããŸãã AORã€ã«ã¡ãããè§£ããåé¡ã®æ°ãè¡šãæŽæ° $N$ ãšãè§£çã®æ£èª€ã衚ããé·ã $N$ ã®æåå $S$ ãäžããããŸãã æåå㯠'... | 39,170 |
Problem C: Midnight Teatime ICPCã®åœå
äºéžã«åããŠåé¡ãè§£ããŠããåã¯, ãã®æ¥3ã€ç®ã®Acceptãè²°ã£ããšããã§ããŒããŒããå©ãæãæ¢ãã. æèšãèŠãã°, ããæ¥ä»ãå€ãããããšããæå»ã . çŽ
è¶ãšãèåã§äžæããŠ, 仿¥ã¯ããå¯ãããšã«ããã. ããæã£ãŠåã¯ãããã³ãžãšåãã£ã. ããŒãžãªã³ã®ãããããéŠãããããã³ãæºãããé , 効ããã£ãŠãã. åéšçã§ãã圌女ã¯ä»æ¥ããããªæéãŸã§çé¢ç®ã«å匷ããŠããããã . åã¯åœŒå¥³ãèªã£ãŠ, å°ããªæ·±å€ã®ãè¶äŒãéãããšã«ãã. éœåã®è¯ãããšã«, ãããã³ã«ã¯4ã€ã®ãèåããã£ã. ããããã 2人ã§åããã®ãã€ãŸããªãã®ã§, åã¯ãã®ãèåãè³ã... | 39,171 |
Network Reliability An undirected graph is given. Each edge of the graph disappears with a constant probability. Calculate the probability with which the remained graph is connected. Input The first line contains three integers N ( 1 \leq N \leq 14 ), M ( 0 \leq M \leq 100 ) and P ( 0 \leq P \leq 100 ), separated by a ... | 39,172 |
Dock to the Future You had long wanted a spaceship, and finally you bought a used one yesterday! You have heard that the most difficult thing on spaceship driving is to stop your ship at the right position in the dock. Of course you are no exception. After a dozen of failures, you gave up doing all the docking process ... | 39,173 |
Problem E: Rooted Tree Game Problem åæç¶æ
ãšããŠè€æ°ã®æ ¹ä»ãæšãäžãããããããã«å¯ŸãAliceãšBobã¯ã²ãŒã ãè¡ããã²ãŒã ã¯2人亀äºã«è¡ããå
æãAliceã§åŸæãBobã§ãããã¿ãŒã³ãåã£ãŠãããã¬ã€ã€ãŒã¯ä»¥äžã®è¡åãåãã æ ¹(芪ãæããªãé ç¹)ã1ã€éžæããããã®é ç¹ã S ãšããã S ãæ ¹ãšããæ ¹ä»ãæšã«å«ãŸããé ç¹ãéžæãã(ããã§ã¯ S ãéžæå¯èœ)ããã®é ç¹ã T ãšããã S ãã T ãžã®çµè·¯äžã«ããé ç¹ãã S ãš T ãå«ããã¹ãŠåé€ããããŸããåé€ãããé ç¹ã端ç¹ã§ãããããªèŸºããã¹ãŠåé€ããã ã¿ãŒã³ãåã£ãŠããæç¹ã§é ç¹ããã¹ãŠåé€ãããŠããå Žåããã®ãã¬ã€ã€ãŒ... | 39,174 |
H - æ€æ å顿 ãšãã倧åŠã®éæ³åŠéšã®çåŸã§ããKåã¯åºå€§ãªå±æ·ã«äœãã§ããïŒ å±æ·ã®è£ã«ã¯æãåºãã£ãŠãããïŒæã
æšãçããŠããªãç®æããã£ãïŒ ãã®ãŸãŸã§ã¯å±æ·ããã®èŠãç®ãæªããšæããã®ã§ïŒKåã¯æšãçããŠããªãç®æã«æšãæ€ããããšã«æ±ºããïŒ éæ³äœ¿ãã®åµã§ããKåã¯äœ¿ãéãå¬åããããšãåºæ¥ãã®ã§ïŒæ€æã®äœæ¥ã䜿ãéã«ããããããšèããïŒ æã¯ H à W åã®ã»ã«ãæã€é·æ¹åœ¢é åãšã¿ãªãããšãåºæ¥ãïŒ åã»ã«ã¯æšã1æ¬çããŠããã1æ¬ãçããŠããªããã®ã©ã¡ããã§ããïŒ Kåã¯ãã® H à W åã®ã»ã«ã®ã©ãã 1 ã€ãæå®ãïŒããã«äœ¿ãéãå¬åããïŒ ãããKåã¯ãŸã æªçè
ãªã®ã§ïŒéåã調ç¯ããããšãåºæ¥ãïŒäœ¿ãéã... | 39,175 |
Problem G: Entangled Tree The electronics division in Ishimatsu Company consists of various development departments for electronic devices including disks and storages, network devices, mobile phones, and many others. Each department covers a wide range of products. For example, the department of disks and storages dev... | 39,176 |
ç¹°ãè¿ãåªæ å€ä»£åœå®¶ã€ã¯ã·ããçºèŠã調æ»ãé²ããæã
ç ç©¶è
ã¯ãã€ãã«ã€ã¯ã·ãã®äžå¿éšã«ããç¥æ®¿ãçºèŠãããç¥æ®¿ã«ã¯ã€ã¯ã·ãã®ç¥ã«ããããç³çãä¿ç®¡ãããŠãããç³çã«ã¯ãæç« ãšåªæãäžã€ãã€ãïŒã€ã®æååãæžãããŠããã ã€ã¯ã·ãã§ã¯åªæãæç« ã®äžã«ãäœåçŸããããéèŠãªæå³ãæã€ããã ããåªæã«å«ãŸãããã¹ãŠã®æåãé çªã«ãæç« ã®äžã«ãšã³ãšã³ã§çŸãããã®ãïŒåçŸããŠãããšèãããäŸãã°ãæç« ã"abab" ã§ãåªæã "ab" ã§ããã°ãé£ç¶ã§ãªããã®ãå«ã㊠"ab" 㯠"abab" ã®äžã«ïŒåçŸãããŠããïŒ ab ab, ab ab , a ba b ã®ïŒéãïŒã æç« ãšåªæãäžãããããšããåªæãæç« ã®äžã«äœåçŸããããåº... | 39,177 |
C: æé·ããç¹ - Growing Point - åé¡ ç²èã³ã³ãã¥ãŒã¿ãšãããã®ãããã ããçš®ã®ç²èã«ã¯ãé€ãæ±ããé€ãšé€ã®æçè·é¢ãã€ãªã圢ã«å€åœ¢ããã ãšããæ§è³ªãããã ãããå©çšããé€ããå
¥åãã圢ããåºåããšã¿ãªã㊠ã³ã³ãã¥ãŒã¿ãšããŠå©çšããããšãã§ããã ä»ãäºæ¬¡å
å¹³é¢äžã«1ã€ã®ç²èã®æ ç¹ãš N åã®é€ãååšãããããããã®é€ã«ã¯ 1 ãã N ãŸã§ã®ç°ãªãçªå·ãäžããããæ ç¹ã«ã¯çªå·0ãäžããããŠããã ãã®ç²èã¯ããé€ãé£ã¹ãããã«ããã®é€ãšæãè¿ãæ ç¹ã®æçè·é¢ãçµã¶ç®¡ç¶ã« æé·ããé£ã¹ãäœçœ®ã«æ°ãã«æ ç¹ã圢æããã æ°ãã«åœ¢æããæ ç¹ã¯æ ç¹ã圢æããçŽåã«é£ã¹ãé€ãšåãçªå·ãæã€ã ç²èã¯æ ç¹ä»¥å€ã®å Žæ... | 39,178 |
Patisserie ACM Amber Claes Maes, a patissier, opened her own shop last month. She decided to submit her work to the International Chocolate Patissier Competition to promote her shop, and she was pursuing a recipe of sweet chocolate bars. After thousands of trials, she finally reached the recipe. However, the recipe req... | 39,180 |
Score : 400 points Problem Statement There is a grid of square cells with H horizontal rows and W vertical columns. The cell at the i -th row and the j -th column will be denoted as Cell (i, j) . In Cell (i, j) , a_{ij} coins are placed. You can perform the following operation any number of times: Operation: Choose a c... | 39,182 |
Score : 300 points Problem Statement We have N clocks. The hand of the i -th clock (1â€iâ€N) rotates through 360° in exactly T_i seconds. Initially, the hand of every clock stands still, pointing directly upward. Now, Dolphin starts all the clocks simultaneously. In how many seconds will the hand of every clock point dir... | 39,183 |
Score : 100 points Problem Statement You will be given a string S of length 3 representing the weather forecast for three days in the past. The i -th character (1 \leq i \leq 3) of S represents the forecast for the i -th day. S , C , and R stand for sunny, cloudy, and rainy, respectively. You will also be given a strin... | 39,184 |
G: Restricted DFS åé¡ N é ç¹ N-1 蟺ãããªããèªå·±ã«ãŒããå€é蟺ãååšããªãç¡åæš G ããããé ç¹ã¯ãããã 1 ãã N ãŸã§çªå·ä»ããããŠããã蟺ããããã 1 ãã N-1 ãŸã§çªå·ä»ããããŠããã i çªç®ã®èŸºã¯ u_i ãš v_i ãçµãã§ããããŸãã i çªç®ã®é ç¹ã«ã¯éè² æŽæ° A_i ãããããå²ãåœãŠãããŠããã ãã®æšã«å¯ŸããŠãæ ¹ r ãã以äžã®æ¬äŒŒã³ãŒãã«ãããã£ãŠ DFS (æ·±ãåªå
æ¢çŽ¢) ãè¡ãããšãèããã // [input] // G: dfs ã®å¯Ÿè±¡ãšãªãã°ã©ã // A: ããããã®é ç¹ã«å²ãåœãŠãããéè² æŽæ° // v: dfs ãéå§ããé ç¹ // step: ã¹ãã... | 39,185 |
Addition of Big Integers Given two integers $A$ and $B$, compute the sum, $A + B$. Input Two integers $A$ and $B$ separated by a space character are given in a line. Output Print the sum in a line. Constraints $-1 \times 10^{100000} \leq A, B \leq 10^{100000}$ Sample Input 1 5 8 Sample Output 1 13 Sample Input 2 100 25... | 39,186 |
H: æ
æ² (Mercy) ãµã³ã¿ã¯ããŒã¹ã¯ãã¯ãªã¹ãã¹ãªã®ã«ããã°ã©ãã³ã°ããã£ãŠããéå£ãèŠã€ããã ãµã³ã¿ã¯ããŒã¹ã¯åœŒããå¯åæ³ã«æã£ãã®ã§ãã±ãŒãããã¬ãŒã³ãããããšã«ããã ã¯ãªãŒã ã $N$ çš®é¡ãã£ãŠãçŸå³ãã㯠$A_1, A_2, A_3, \dots, A_N$ ã§ããã ã¹ãã³ãžã $M$ çš®é¡ãã£ãŠãçŸå³ãã㯠$B_1, B_2, B_3, \dots, B_M$ ã§ããã ã¯ãªãŒã 1 çš®é¡ãšã¹ãã³ãž 1 çš®é¡ãçµã¿åãããŠã±ãŒããäœãããã®çŸå³ãã㯠(ã¯ãªãŒã ã®çŸå³ãã) à (ã¹ãã³ãžã®çŸå³ãã) ã«ãªãã ãµã³ã¿ã¯ããŒã¹ã¯æ
æ²æ·±ãã®ã§ã$N \times M$ éãã®çµã¿åããã®ã±ãŒãããã¹ãŠäžã€... | 39,187 |
Score : 400 points Problem Statement You are given a sequence A_1, A_2, ..., A_N and an integer K . Print the maximum possible length of a sequence B that satisfies the following conditions: B is a (not necessarily continuous) subsequence of A . For each pair of adjacents elements of B , the absolute difference of the ... | 39,188 |
Problem F: Bus Problem åç°ç¶ã« $1$ ãã $N$ ãŸã§ã®çªå·ãã€ãããã $N$ åã®ãã¹åãå³åãã«äžŠãã§ããã 飿¥ãããã¹åã©ããã¯éã§çµã°ããŠããã å $i \ (1 \le i \le N)$ ã«ã€ããŠããã¹å $i$ ãšãã¹å $i+1$ ã®éãçŽæ¥çµã¶éã®é·ã㯠$d_i$ ã¡ãŒãã«ã§ããã ãã ãããã¹å $N+1$ ã¯ãã¹å $1$ ã®ããšã衚ãã $M$ å°ã®ãã¹ãããã $j \ (1 \le j \le M)$ çªç®ã®ãã¹ã¯ $c_j='R'$ ã®ãšãå³åãã$c_j='L'$ ã®ãšãå·Šåãã«èµ°è¡ããã ãŸããæå» $0$ ã«ãã¹å $b_j$ ãåºçºãã$1$ ã¡ãŒãã«é²ãã®ã«... | 39,189 |
Score: 400 points Problem Statement Takahashi became a pastry chef and opened a shop La Confiserie d'ABC to celebrate AtCoder Beginner Contest 100. The shop sells N kinds of cakes. Each kind of cake has three parameters "beauty", "tastiness" and "popularity". The i -th kind of cake has the beauty of x_i , the tastiness... | 39,190 |
Score : 400 points Problem Statement You are given N items. The value of the i -th item (1 \leq i \leq N) is v_i . Your have to select at least A and at most B of these items. Under this condition, find the maximum possible arithmetic mean of the values of selected items. Additionally, find the number of ways to select... | 39,191 |
Problem F: Slim Span Given an undirected weighted graph G , you should find one of spanning trees specified as follows. The graph G is an ordered pair ( V , E ), where V is a set of vertices { v 1 , v 2 , ... , v n } and E is a set of undirected edges { e 1 , e 2 , ... , e m }. Each edge e â E has its weight w ( e ). A... | 39,192 |
Score : 600 points Problem Statement We will create an artwork by painting black some squares in a white square grid with 10^9 rows and N columns. The current plan is as follows: for the i -th column from the left, we will paint the H_i bottommost squares and will not paint the other squares in that column. Before star... | 39,193 |
Score : 800 points Problem Statement Takahashi and Aoki will take N exams numbered 1 to N . They have decided to compete in these exams. The winner will be determined as follows: For each exam i , Takahashi decides its importance c_i , which must be an integer between l_i and u_i (inclusive). Let A be \sum_{i=1}^{N} c_... | 39,194 |
Problem I: Sum of Last Digits Problem 3ã€ã®æŽæ° n , m , k ãäžããããã®ã§ n 1 %10 + n 1+ m %10 + n 1+2 m %10 + ... + n 1+( k -1) m %10 ãèšç®ããã a % b 㯠a ã b ã§å²ã£ããšãã®äœãã衚ãã Input n m k 1è¡ã« n , m , k ãäžããããã Constraints å
¥åã¯ä»¥äžã®æ¡ä»¶ãæºãã 0 †n †10 18 0 †m †10 9 1 †k †10 9 Output çãã1è¡ã«åºåããã Sample Input 1 1 1 9 Sample Output 1 9 Samp... | 39,195 |
å顿 以äžã®æ¡ä»¶ãæºããæŽæ°å $X_1, X_2, ..., X_N$ ã®åæ°ãæ±ããã ä»»æã®æŽæ° $i$ ($1 \leq i \leq N$)ã«å¯ŸããŠã$X_j=i$ ãšãªã $j$ ($1 \leq j \leq N$)ãååšããã $X_s = t$ $X_{a_i} < X_{b_i}$ ($1 \leq i \leq C$) å
¥å å
¥åã¯ä»¥äžã®åœ¢åŒã«åŸããäžããããæ°ã¯å
šãп޿°ã§ããã $N$ $C$ $s$ $t$ $a_1$ $b_1$ $a_2$ $b_2$ $...$ $a_C$ $b_C$ å¶çŽ $1 \leq N \leq 2000$ $0 \leq C \leq N$ $1 \leq s \leq N... | 39,197 |
Problem 09: Building Houses ãã®ç§ãå²ç«ããŠã¹ã¯æè¿éæãé²ãã§ããæŸçå°åºã®ç¥æéãæ²¿ãã®åå°ãåè²ããããšã«ããã å
æ¥åéãããã仿¥ã¯è³Œå
¥è
ã«åè²èª¬æäŒãéå¬ããã 賌å
¥è
ã説æäŒå Žã«éãŸãã ãããšããããªãã ã空æ°ããšãŠãåãä»ããŠãããäžæè°ã«æã£ãæ
åœè
ã¯éå¬åã« ãçããæ°å€©å°ãæ±ããŠãããšããã®ã«ãã¡ãã£ãšè¡šæ
ãæãã§ãã倧äžå€«ã§ããïŒã ãšèããŠã¿ããããã§æãã¬äºå®ã倿ãããå®ã¯ã賌å
¥è
å
šå¡ãçŸåšé£çºã®éåå£å°ã®äœäººã§ãããŸãã«ãåšèŸºã®äººãã¡ãšæãåããåããªãããä»ååŒè¶ããããããšæ€èšããŠããã®ã ã£ãã 賌å
¥è
ãã¡ã¯ãã§ã«è²»çšãæ¯ææžã¿ã§ä»¥åã®äœãŸããåŒãæã£ãŠãããåŸã£ãŠãä»... | 39,198 |
Score : 300 points Problem Statement Let f(n) be the number of triples of integers (x,y,z) that satisfy both of the following conditions: 1 \leq x,y,z x^2 + y^2 + z^2 + xy + yz + zx = n Given an integer N , find each of f(1),f(2),f(3),\ldots,f(N) . Constraints All values in input are integers. 1 \leq N \leq 10^4 Input ... | 39,199 |
åžå€è§åœ¢æ±å·¥æ¥éœåž åžå€è§åœ¢æ±å·¥æ¥éœåž (Industrial Convex Pillar City, ICPC) ã¯ããã€ãã®åžå€è§åœ¢æ±ã®åœ¢ç¶ããã建ç©ãããªãè¡ã§ããïŒããªãã¯ãã®è¡ã®äžãçŸåšå° S ããç®çå° T ã«åããŠæ©ãããšããŠããïŒä»æ¥ã¯æ¥å·®ãã匷ãã®ã§ïŒåºæ¥ãéãã²ãªããéããã«ç®çå°ãžåããããïŒããªããç«ã£ãŠããå°ç¹ãšå€ªéœãäžçŽç·ã«çµãã ç·äžã«å»ºç©ãããå ŽåïŒããªãã¯å»ºç©ã®é°ã«ããã®ã§æ¥å·®ããåããã«ããïŒãŸãïŒãã®è¡ã®å»ºç©ã®å€åšã«ã¯å
šãŠã²ãããä»ããŠããã®ã§ïŒå»ºç©ã®å€åšã«æ²¿ã£ãŠæ©ããŠããéã¯ïŒæ¥ãåœããçžã«æ²¿ã£ãŠæ©ããŠãæ¥å·®ããåããããšã¯ãªãïŒããªãã¯å»ºç©ã®å
éšä»¥å€ã¯ãã®è¡ãã©ãã§ãèªç±ã«æ©ãããšãã§ããïŒ ... | 39,200 |
ã¢ãžã¥ãã»ã¯ãšãª ããªãã« N æã®ã«ãŒããæž¡ããŸããã©ã®ã«ãŒãã«ãäžã€ã ãèªç¶æ°ãæžããŠãããŸãããã ããåãæ°ãæžããŠããããšã¯ãããŸããã ãããã質åãšããŠãé©åœãªèªç¶æ°ãèšããŸããããªããæã£ãŠããã«ãŒãã«æžããŠããæ°ãç§ãèšã£ãæ°ã§å²ã£ããšãã«åŸãããäœãã®ãã¡æã倧ããªãã®ãçããŠãã ããã ããšãã°ãããªã㯠3 æã®ã«ãŒããæã£ãŠããŠããããã 9ã3ã8 ãšæžããŠãããšããŸããç§ãã4ããšèšã£ããã9 ãš 3 ãš 8 ããããã4 ã§å²ã£ãäœããæ±ããŠãã ãããäœãã¯ãããã 1ã3ã0 ã§ããããã®äžã§ãã£ãšã倧ããªäœãã¯3 ãªã®ã§ã3 ãæ£ããçãã«ãªããŸãã ã§ã¯å§ããŸããããããïŒ ã«ãŒãããã£ã±ããããš... | 39,201 |
Maximum Profit You can obtain profits from foreign exchange margin transactions. For example, if you buy 1000 dollar at a rate of 100 yen per dollar, and sell them at a rate of 108 yen per dollar, you can obtain (108 - 100) Ã 1000 = 8000 yen. Write a program which reads values of a currency $R_t$ at a certain time $t$ ... | 39,202 |
Prime Caves An international expedition discovered abandoned Buddhist cave temples in a giant cliff standing on the middle of a desert. There were many small caves dug into halfway down the vertical cliff, which were aligned on square grids. The archaeologists in the expedition were excited by Buddha's statues in those... | 39,203 |
E: æã®äœãæ¹ - How To Make Stars - ç©èª åãæšååŠé¢1幎çã®æå±éŽã ãã£ïŒéŽã¯ãææ§ãã ãã奜ãïŒå€ã¯ãã€ã幌銎æã®è±ä»£ã¡ããšäžç·ã«ïŒãã£ãããšåŠæ ¡ã®å±äžã§ãææ§ãèŠãŠããã ïŒã ãã©ïŒä»æ¥ã®ã倩æ°ã¯ããã«ãã®éšã»ã»ã»ïŒããããïŒãææ§ãèŠãããšãã§ããªããã£ïŒè±ä»£ã¡ãã©ãããããïŒ éŽãã»ã»ã»ããã£ïŒããããšæãä»ãããã£ïŒè²ããªãææ§ãèŠãããããªïŒãã£ããªãã©ãã¿ãªãŠã ãäœããã£ïŒè±ä»£ã¡ãïŒãã£ãããããã£ïŒã è±ä»£ããã£ïŒããã£ïŒéŽã¡ããã¡ãã£ãšåŸ
ã£ãŠïŒãã©ãã¿ãªãŠã ã®äœãæ¹ãªããŠïŒç§ç¥ããªããïŒã éŽã倧äžå€«ãã£ïŒ2人ã§åãåãããã°ãã£ãšã§ãããïŒãã£ãã£ãã£ãã£ãïŒã è±ä»£ãã ïŒãã¬ã«ã¿ã¹ã±ã... | 39,204 |
çŽæ¹äœ ã¢ã€ã
æŸéåäŒã®æè²çªçµ(æè²)ã§ã¯ãåäŸåãã®å·¥äœçªçµããããã§ã€ããããšããçªçµãæŸéããŠããŸãã仿¥ã¯ç»çšçŽã§ç®±ãäœãåã§ãããçšæããé·æ¹åœ¢ã®ç»çšçŽã§çŽæ¹äœãã§ãããã確ãããããšæããŸãããã ããç»çšçŽã¯åã£ããæã£ããããŠã¯ãããŸããã ïŒã€ã®é·æ¹åœ¢ãäžããããã®ã§ããããã䜿ã£ãŠçŽæ¹äœãäœãããã©ããå€å®ããããã°ã©ã ãäœæããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã h 1 w 1 h 2 w 2 h 3 w 3 h 4 w 4 h 5 w 5 h 6 w 6 å
¥åã¯ïŒè¡ãããªããããããã®è¡ã«åé·æ¹åœ¢ã®çžŠã®é·ããè¡šãæŽæ° h i (1 †h i †1000) ãšæšªã®é·ããè¡šãæŽæ° w i (... | 39,205 |
Problem G: Traffic You are a resident of Kyoot (oh, well, itâs not a misspelling!) city. All streets there are neatly built on a grid; some streets run in a meridional (north-south) direction and others in a zonal (east-west) direction. The streets that run from north to south are called avenues, whereas those which ru... | 39,206 |
Flick Input A: ããªãã¯å
¥å äºæ¬¡å
ã倧奜ããªå€§åŠçïŒéç§°2Dåã¯ïŒé·å¹Žäœ¿çšããŠããã¬ã©ããŽã¹æºåž¯ããã¹ããã«è²·ããããïŒåããŠã¹ãããæäœãã2Dåã¯ïŒæåå
¥åã®æ¹åŒãïŒæã®æºåž¯ãšå°ãéãããšã«æ°ä»ããïŒã¹ããã§ã¯ïŒç»é¢ãã¿ããã»ããªãã¯ã§ããããšãå©çšããŠïŒããªãã¯å
¥åãšããæ¹åŒãæ¡çšãããŠããã®ã§ãã(ããªãã¯ãšã¯ïŒãç»é¢äžã§æãæ»ãããŠåŒŸãæäœããæå³ãã)ïŒããªãã¯å
¥åã¯ïŒæ¬¡ã«ç€ºããããªæåå
¥åæ¹åŒã§ããïŒ ããªãã¯å
¥åã§ã¯ïŒå³A(a)ã®ããã«ïŒ0-9ã®10åã®ãã¿ã³ã«ããå
¥åãè¡ã(#ãš*ã«ã€ããŠã¯ïŒä»åã¯çç¥ããŠãã)ïŒåãã¿ã³ã«ã¯ïŒå³ã®ããã«ãè¡-ãè¡ã1ã€ãã€å²ãåœãŠãããŠããïŒ å³A: ã¹ããã®ãã¿... | 39,207 |
E: åŸåŸ©æåå / Round-trip String ç©èª ããã¯å
šäººé¡ãç«¶æããã°ã©ããŒã«ãªã£ãäžçããã®äžçã§ã¯ã¿ãªããã®çããçŸä»£ã§ã¯èããããªããããªç¿æ
£ã倿°ååšããããã®äžã®äžã€ã«ã䞡芪ãç¹ã«æ¯èŠªã«æè¬ã®èšŒã衚ãæã¯ãæååãéããšãã颚ç¿ããããéãæååãšããŠã©ã®ãããªæååããµãããããã¯å°åå·®ãããããåã®å€§å°åæµ·éã§ã¯ãã§ããã ãã·ã³ãã«ãªæååãèŽãç©ãšããŠãµããããããŸããéãããåŽã®æ¯èŠªã¯åäŸã«è¿ç€ŒãšããŠãéãããæååãã©ãã»ã©çŸããããçããå¿
èŠãããã ããŠãä»ããªãã¯1å
ã®æ¯èŠªããçžè«ãåããŠããããã®æ¯èŠªã¯åäŸããçŽ æŽãããããªæååãããã£ãã®ã ããã©ããããçŽ æŽãããã®ãããŸã枬ããªãã§... | 39,208 |
Prime Number Write a program which reads an integer n and prints the number of prime numbers which are less than or equal to n . A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7. Input Input consists of ... | 39,209 |
Set Intersection Find the intersection 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 n... | 39,210 |
ã·ã£ããã« åé¡ 1 ãã n ãŸã§ã®çªå·ãæžããã n æã®ã«ãŒããããïŒãŸãïŒäžçªäžãçªå· 1 ã®ã«ãŒãïŒäžãã2æç®ãçªå· 2 ã®ã«ãŒãïŒâŠïŒäžçªäžãçªå· n ã®ã«ãŒããšãªãããã«é çªã«éããŠïŒã«ãŒãã®å±±ãäœãïŒ ã«ãŒãã®å±±ã«å¯ŸããŠïŒãã·ã£ããã«(x,y)ããšåŒã°ããæ¬¡ã®ãããªæäœãè¡ãããšã§ïŒã«ãŒããäžŠã³æ¿ããïŒx, y 㯠1 †x < y < n ãã¿ããæŽæ°ïŒïŒ ã·ã£ããã«(x,y) n æã®ã«ãŒããïŒäžçªäžãã x æç®ãŸã§ã®ã«ãŒããããªãå±±AïŒ x+1 æç®ãã y æç®ã®ã«ãŒããããªãå±±BïŒ y+1 æç®ãã n æç®ã®ã«ãŒããããªãå±±C ã®3ã€ã®å±±ã«åããïŒãããŠïŒå±±Aã®äžã«å±±BãéãïŒããã«ãã®äžã«å±±Cãé... | 39,211 |
Score : 500 points Problem Statement Given are two strings s and t consisting of lowercase English letters. Determine if there exists an integer i satisfying the following condition, and find the minimum such i if it exists. Let s' be the concatenation of 10^{100} copies of s . t is a subsequence of the string {s'}_1{s... | 39,212 |
F: Opeartion training for BYDOL / BYDOLã®æäœèšç·Ž u'sãšããã¹ã¯ãŒã«ã¢ã€ãã«ãçµæããç§éã¯ïŒãããªãé«ã¿ãç®æãããïŒéšå®€ã«ãã£ãDVDã§æ§ãã®841ãããã¯ã·ã§ã³ã«æå±ããã¢ã€ãã«éãèŠãŠããïŒ ãã®ã¢ã€ãã«éã¯ä»ã§ããèŒãã¹ããŒãžã®äžã§æŽ»èºããŠãããïŒä»¥åã¯BYDOLãšåŒã°ããããããã«ä¹ã蟌ã¿ïŒéç³ã®æ€å»äœæ¥ãããŠãããããïŒ ããã§ïŒãããã¢ã€ãã«ã«ãªãããã«ïŒBYDOLã®æçžŠæè¡ãå¿
èŠã§ããããšãç¥ã£ãç§éã¯ïŒæ¥éœBYDOLãå
¥æãïŒä»æ ¡ã®ã¹ã¯ãŒã«ã¢ã€ãã«ãšBYDOLãçšããæš¡æ¬æŠãããããšã«ããïŒ ãã®æš¡æ¬æŠã§ã¯ïŒçœã®è»ãšèµ€ã®è»ã«åããïŒBYDOLã«ç©ãŸããŠãã匟ã«ããæã¡åã... | 39,213 |
Problem I: Text Justification You are hired by the âI¶×Îâ, an extraterrestrial intelligence, as a programmer of their typesetting system. Your task today is to design an algorithm for text justification . Text justification is to equalize the line widths as much as possible by inserting line breaks at appropriate posi-... | 39,215 |
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... | 39,217 |
Score : 200 points Problem Statement Snuke signed up for a new website which holds programming competitions. He worried that he might forget his password, and he took notes of it. Since directly recording his password would cause him trouble if stolen, he took two notes: one contains the characters at the odd-numbered ... | 39,218 |
Score : 400 points Problem Statement There is a grid with N rows and N columns of squares. Let (i,j) be the square at the i -th row from the top and the j -th column from the left. These squares have to be painted in one of the C colors from Color 1 to Color C . Initially, (i,j) is painted in Color c_{i,j} . We say the... | 39,219 |
Problem J: Ukunichia Query Problem $N$ 人ã®äººãå·Šããå³ãžäžåã«äžŠãã§ããã圌ãã®éã§ã¯æåå $S$ ãæµè¡ããŠããã å人ã¯ã以äžã®æ¡ä»¶ãæºãããšã 幞ã ã§ãããããã§ãªããšã 幞ã ã§ã¯ãªãã ä»ãŸã§ã« $|S|$ æå以äžã®æåãäŒããããŠããŠããã€çŽè¿ã® $|S|$ æåãå€ãé ããæ°ããé ã«äžŠã¹ããš $S$ ãšäžèŽãã 以äžã® $2$ çš®é¡ã®ã¯ãšãªãåèš $Q$ ååŠçããã ã¯ãšãª1 $1$ $l$ $r$ $c$ åºé $[l, r]$ ã«å«ãŸããäººã«æåå $c$ ãå·Šããäžæåãã€äŒããã ã¯ãšãª2 $2$ $l$ $r$ åºé $[l, r]$ ã«å«ãŸãã 幞ã ãªäººã®æ°... | 39,220 |
人çã²ãŒã 倪éåã¯ãããã¡ãå±ããã«äŒæŽ¥ãããŒç€Ÿè£œã®äººçã²ãŒã ãè²·ãã«è¡ããŸããã人çã²ãŒã ã¯ããã¹ç®ã®æžãããããŒããšã«ãŒã¬ããã䜿ã£ãŠéã³ãŸããããŒãã«ã¯å³ã®ããã«ã¹ã¿ãŒãå°ç¹ãšãŽãŒã«å°ç¹ãäžã€ãã€ããããããã¯ã²ãšã€ãªããã®ãã¹ç®ã§ã€ãªãã£ãŠããŸããæåã«ãã³ãã¯ã¹ã¿ãŒãå°ç¹ã®ãã¹ã«çœ®ãããã«ãŒã¬ãããåããŠåºãæ°ã«ãã£ãŠã³ããé²ããŸãããã¹ã«ãã£ãŠã¯ãããã«æ¢ãŸã£ããééãããããããšã§ãéãåŸãããã³ãã®äœçœ®ãå€ãããããã€ãã³ããã¹ããããŸããæçµçãªåæã¯ãã³ãããŽãŒã«å°ç¹ã«å°éããæç¹ã®ææéã®å€å¯¡ã§æ±ºãŸããŸãã ãã®äŒç€Ÿã®äººçã²ãŒã ã®é¢çœããšããã¯ãã«ãŒã¬ããã®åºãç®ã®å€§ããããŽãŒã«ãŸã§ã®ãã¹ã®æ°ãã€ãã³ããã¹ã®... | 39,221 |
Problem D: The Great Summer Contest çŸåšã人ã
ã®å𝿥œã¯ããã°ã©ãã³ã°ã³ã³ãã¹ãã«éãããŠããã圌女ãæå±ããŠãããšããäžåŠæ ¡ã®å𝿥œéšã®æŽ»åå
容ã¯ãããã°ã©ãã³ã°ã³ã³ãã¹ããäŒç»ãéå¶ããããšã ã圌女ã®ä»äºã¯åé¡ãäœæããããšã§ã¯ãªããå€ãã®äººããåé¡ãåãã審å€å£ãçµç¹ãããŸãã³ã³ãã¹ãã®å®£äŒãè¡ããããã°è£æ¹ã®ãä»äºã ãã«ãªã¹ãäœé¡è
ãèåãªã¢ã«ãŽãªãºããŒãšéãããããã£ãä»äºããã人ã«å
ãåœããããšã¯ã»ãšãã©ãªããååšæã¯ãªãããã©ãæ¬ ããããšã®ã§ããªããã®ä»äºã«ã圌女ã¯èªããæã£ãŠåãçµãã§ããã 嚯楜éšã¯åžžã«åé¡ãåéããŠãããããããã®åé¡ã¯ä»¥äžã® 6 çš®é¡ã«åé¡ãããã Math Gr... | 39,222 |
DïŒ çŽ å æ°åè§£ã®å€æ§æ§ (The Diversity of Prime Factorization) Problem Ebi-chan has the FACTORIZATION MACHINE, which can factorize natural numbers M (greater than 1) in O( $\log$ M) time! But unfortunately, the machine could display only digits and whitespaces. In general, we consider the factorization of M as p_1^{e_1} \times p_... | 39,223 |
Road Construction The Zuia Kingdom has finally emerged through annexation of $N$ cities, which are identified by index from $1$ to $N$. You are appointed the Minister of Transport of the newly born kingdom to construct the inter-city road network. To simplify the conceptual design planning, you opted to consider each c... | 39,224 |
Rabbit Party A rabbit Taro decided to hold a party and invite some friends as guests. He has n rabbit friends, and m pairs of rabbits are also friends with each other. Friendliness of each pair is expressed with a positive integer. If two rabbits are not friends, their friendliness is assumed to be 0. When a rabbit is ... | 39,225 |
Problem B: Potatoes Problem ãã£ã¡ãå㯠N é¢ã®çãš M åã®èãææããŠãããåçã«ã¯ãããã1ãã N ãŸã§ã®çªå·ãä»ããããŠããããã£ã¡ãåã¯çã«èãæ€ãåç©«ããããšã§ãèã®æ°ãå¢ãããããšèããŠããã ãã£ã¡ãåã¯äžäººæ®ããã§ããã1人ã§ã¯ K é¢ãŸã§ã®çãã管çããããšãã§ããªãããŸããåçã®åã®ç¶æ
ãé¢ç©ã¯æ§ã
ã§ãèã®åç©«æ°ãæ€ããããšã®ã§ããèã®æ°ãæ§ã
ã§ãããèãç i ã«æ€ããå Žåã1幎åŸã«ã¯ç i ã«æ€ããè1ã€ã«ã€ã a i åã®èãåç©«ããããšãã§ããããã ããç i ã«ã¯æå€§ã§ã b i åã®èããæ€ããããšãã§ããªãã ãã£ã¡ãåã K é¢ä»¥å
ã®çã« M å以å
ã®èãæ€ããæ... | 39,226 |
Problem I: Strange Currency System The currency system in the Kingdom of Yoax-Musty is strange and fairly inefficient. Like other countries, the kingdom has its own currencty unit denoted by K $ (kingdom dollar). However, the Ministry of Finance issues bills for every value between 1 K $ and (2 31 - 1) K $ worth. On th... | 39,227 |
Pipeline Plans There are twelve types of tiles in Fig. 1. You were asked to fill a table with R Ã C cells with these tiles. R is the number of rows and C is the number of columns. How many arrangements in the table meet the following constraints? Each cell has one tile. the center of the upper left cell (1,1) and the c... | 39,228 |
Problem F: Gather the Maps! ã¯ããæãå
«å°Ÿæ°ãæ®ãããšãããäŒèª¬ã®ç§å®ãå
«çåã®ã©ããã«ç ã£ãŠãããšããã ãã®åšåŠã瀺ããšãããå®ã®å°å³ã¯ãããã€ãã®æçã«åå²ãããç¶æ
ã§ãå
«å°Ÿæ°ã® n 人ã®åå«éã«ãã£ãŠåãç¶ãããŠããã ä»ãå
«å°Ÿæ°ã®åå«éã¯ååããŠãã®ç§å®ãæã«å
¥ããããšããŠããã ãšããããç§å®ã®åšåŠãæã瀺ãå®ã®å°å³ã®äžéšåã ãã§ã¯ç§å®ãèŠã€ããããšãã§ããªãã ããã§ãå
«å°Ÿæ°ã®åå«éã¯å
šå¡ã§éãŸã£ãŠå°å³ã 1 ã¶æã«éããããšããã ãšããããããå®è¡ã«ç§»ãããšããŠããªããªãäºå®ãåããã«éãŸãããšãã§ããªãã ããããã®ç§å®ã«é¢ããæ
å ±ã¯ãäžæã«ãããŠç§å¯è£ã«äŒããããŠãã貎éãªæ
å ±ã§ãã... | 39,229 |
Cake Party Iâm planning to have a party on my birthday. Many of my friends will come to the party. Some of them will come with one or more pieces of cakes, but it is not certain if the number of the cakes is a multiple of the number of people coming. I wish to enjoy the cakes equally among the partiers. So, I decided t... | 39,230 |
Problem F Secrets in Shadows Long long ago, there were several identical columns (or cylinders) built vertically in a big open space near Yokohama (Fig. F-1). In the daytime, the shadows of the columns were moving on the ground as the sun moves in the sky. Each column was very tall so that its shadow was very long. The... | 39,231 |
Score : 500 points Problem Statement There are N boxes arranged in a circle. The i -th box contains A_i stones. Determine whether it is possible to remove all the stones from the boxes by repeatedly performing the following operation: Select one box. Let the box be the i -th box. Then, for each j from 1 through N , rem... | 39,232 |
Donut Decoration Donut maker's morning is early. Mr. D, who is also called Mr. Donuts, is an awesome donut maker. Also today, he goes to his kitchen and prepares to make donuts before sunrise. In a twinkling, Mr. D finishes frying $N$ donuts with a practiced hand. But these donuts as they are must not be displayed in a... | 39,233 |
Score: 400 points Problem Statement Amidakuji is a traditional method of lottery in Japan. To make an amidakuji, we first draw W parallel vertical lines, and then draw horizontal lines that connect them. The length of each vertical line is H+1 [cm], and the endpoints of the horizontal lines must be at 1, 2, 3, ..., or ... | 39,234 |
Score : 400 points Problem Statement Given is a string S . Each character in S is either a digit ( 0 , ..., 9 ) or ? . Among the integers obtained by replacing each occurrence of ? with a digit, how many have a remainder of 5 when divided by 13 ? An integer may begin with 0 . Since the answer can be enormous, print the... | 39,236 |
Score : 200 points Problem Statement We will call a string that can be obtained by concatenating two equal strings an even string. For example, xyzxyz and aaaaaa are even, while ababab and xyzxy are not. You are given an even string S consisting of lowercase English letters. Find the length of the longest even string t... | 39,237 |
List For a dynamic list $L$ of integers, perform a sequence of the following operations. $L$ has a special element called END at the end of the list and an element of $L$ is indicated by a cursor. insert($x$): Insert $x$ before the element indicated by the cursor. After this operation, the cursor points the inserted el... | 39,238 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.