task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Problem J: Hanimon ããã«ã ã¢ã³ã¹ã¿ãŒã¯ããã«ã æš¡æ§ã®å
è§åœ¢ç¶ã®äžæè°ãªçãç©ã§ããã ããã«ã ã¢ã³ã¹ã¿ãŒã«ã¯æ§ã
ãªãµã€ãºã®ãã®ããããäžèŸºã N åã®æ£å
è§åœ¢ã®ãã¹ããæãããã«ã ã¢ã³ã¹ã¿ãŒããµã€ãº N ã®ããã«ã ã¢ã³ã¹ã¿ãŒãšããã äžæ¹ãèãªãæš¡æ§ã¯ããã«ã ã¢ã³ã¹ã¿ãŒãšåãããå
è§åœ¢ãšããŠå®çŸ©ãã1蟺ã P åã®æ£å
è§åœ¢ã®ãã¹ããæãèãªãæš¡æ§ããµã€ãº P ã®èãªãæš¡æ§ãšããã ããã«ã ã¢ã³ã¹ã¿ãŒãšèãªãæš¡æ§ã®åœ¢ã®äŸã以äžã«ç€ºãããµã€ãºã¯1èŸºã®æ£å
è§åœ¢ã®ãã¹ã®æ°ã«å¯Ÿå¿ããã å³1: ãµã€ãºã®äŸ å³2: ããã«ã ã¢ã³ã¹ã¿ãŒãšèãªãæš¡æ§ã®äŸ (Sample Input 1) ããã«ã ã¢ã³ã¹ã¿ãŒãšèãªãæš¡æ§ã®åãã¹ã«... | 38,284 |
Score : 600 points Problem Statement You are given a string s consisting of A , B and C . Snuke wants to perform the following operation on s as many times as possible: Choose a contiguous substring of s that reads ABC and replace it with BCA . Find the maximum possible number of operations. Constraints 1 \leq |s| \leq... | 38,285 |
å顿 1ã€ã®é°é¢æ° $Ax^2+Bxy+Cy^2+Dx+Ey+F=0$ ã§äžããããæ²ç·ãšã $N$ åã®é°é¢æ° $A_ix+B_iy+C_i=0$ ã§äžããããçŽç·ãããã ãããã®æ²ç·ãšçŽç·ã«ãã£ãŠå¹³é¢ãããã€ã®é åã«åå²ãããŠãããæ±ããã 以äžã¯Sample Inputã®ããŒã¿ã»ãããå³ç€ºãããã®ã§ããã å
¥å å
¥åã¯ä»¥äžã®åœ¢åŒã«åŸããäžããããæ°ã¯å
šãп޿°ã§ããã $N$ $A$ $B$ $C$ $D$ $E$ $F$ $A_1$ $B_1$ $C_1$ $...$ $A_N$ $B_N$ $C_N$ å¶çŽ $1 \leq N \leq 20$ $-100 \leq A,B,C,D,E,F \leq 100$ $-100... | 38,286 |
Score : 200 points Problem Statement You have A 500 -yen coins, B 100 -yen coins and C 50 -yen coins (yen is the currency of Japan). In how many ways can we select some of these coins so that they are X yen in total? Coins of the same kind cannot be distinguished. Two ways to select coins are distinguished when, for so... | 38,287 |
Score : 400 points Problem Statement Let \mathrm{popcount}(n) be the number of 1 s in the binary representation of n . For example, \mathrm{popcount}(3) = 2 , \mathrm{popcount}(7) = 3 , and \mathrm{popcount}(0) = 0 . Let f(n) be the number of times the following operation will be done when we repeat it until n becomes ... | 38,288 |
Problem 08: Provident Housewife 䞻婊ã®çŽåã¯ãã®äžæ³ã®ããªãé£è²»ãæããããšã«éå¿ãçãããŠããŸãããæ¯ææ°èåºåãå¿
ããã§ãã¯ãè²·ãç©ãªã¹ããšæãå®ã売ãããŠãããåºããã£ãããªã¹ãã¢ããããŠããåºãã¯ããããªããããšããã³ã»ãµã³ãã«ãšããæŠéã¹ã¿ã€ã«ã§èªè»¢è»ãããããè²·ãç©ã«è¡ããŸãã ããã§å€«ã®ããªãã¯å°ãã§ãçŽåã®åœ¹ã«ç«ãšããšãåŸæã®ããã°ã©ãã³ã°ã§å®¶èšç°¿ããã°ã©ã ãäœæããããšã«ããŸãããããã°ã©ã ã¯ãåã¹ãŒããŒã«å£²ã£ãŠããåç©ã®ååãšå€æ®µïŒåïŒãçŽåãå¿
èŠãªåç©ãå
¥åããå
šãŠã®åç©ãéããããã®æå°éé¡ãåºåããŸãã çŽåã¯å®¶ãåºãŠå¿
èŠãªåç©ãéããå®¶ã«æ»ã£ãŠããªããã°ãªããŸããã ããã§... | 38,289 |
ã²ãŒã ãã©ã³ã¹ ããªãã¯åéºã²ãŒã ãäœæããŠããïŒãã®ã²ãŒã ã®ãã¬ã€ã€ãŒã¯ïŒäž»äººå
¬ãæäœããŠæµã¢ã³ã¹ã¿ãŒãåãïŒäž»äººå
¬ã®ã¬ãã«ãäžããããšã§åéºãé²ããŠããïŒäž»äººå
¬ã®åæã¬ãã«ã¯ 1 ã§ããïŒ ãã®ã²ãŒã ã«ã¯ N çš®é¡ã®æµã¢ã³ã¹ã¿ãŒãçšæãããŠããïŒåŒ±ãé ã§ i çªç®ã®çš®é¡ã®æµã¢ã³ã¹ã¿ãŒã®åŒ·ã㯠s i ã§ããïŒäž»äººå
¬ã 1 åã®æŠéãè¡ããšãã«ã¯ïŒæ¬¡ã«æŠãæµã¢ã³ã¹ã¿ãŒã®çš®é¡ãèªç±ã«éžã³ïŒã¡ããã© 1 äœã®æµã¢ã³ã¹ã¿ãŒãšæŠéãè¡ãïŒäž»äººå
¬ã¯åãçš®é¡ã®æµã¢ã³ã¹ã¿ãŒãšäœåã§ãæŠãããšãã§ãïŒäœåã§ãåãããšãã§ããïŒ ããªãã¯ããŸïŒãã®ã²ãŒã ã®ãã©ã³ã¹ã調æŽããããã«ïŒãããã©ã¡ãŒã¿ãŒ X ãæ±ºããããšããŠããïŒãã©ã¡ãŒã¿ãŒ X ã¯æ£ã®... | 38,290 |
Bubble Sort Write a program of the Bubble Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode: BubbleSort(A) 1 for i = 0 to A.length-1 2 for j = A.length-1 downto i+1 3 if A[j] < A[j-1] 4 swap A[j] and A[j-1] Note that, indices for array elements are bas... | 38,291 |
颚ããç§ã®æ¢
ã®éŠããå±ããŠãããïŒ åŒã£è¶ããæ±ºãŸãããã®å°ãå»ãããšã«ãªã£ãããã®åå°èªäœã«æªç·Žã¯ç¡ãããïŒã€ã ãæ°ã«ãªãããšããããããã¯ãåºã«æ€ããæ¢
ã®æšã®ããšã ãç§ã¯æ¯å¹Žããã®æ¢
ãè±ãå²ããããšã楜ãã¿ã«ããŠããããããé¢ããåŸã¯æ¥ã®æ¥œãã¿ãïŒã€æžã£ãŠããŸããç§ã®æ¢
ã®éŠãã ãã§ã颚ã«ä¹ã£ãŠåŒã£è¶ãå
ã®å®¶ãŸã§å±ããæ¥ãæ¥œããŸããŠã¯ãããªããã®ãã æ¥æ¬ã«ã¯æ¥ã象城ããïŒã€ã®è±ããããæ¢
ã»æ¡ã»æ¡ã®ïŒã€ã ãåŒã£è¶ãå
ã«ã¯ãç§ã®æ¢
以å€ã«ãããããã®è±ã®éŠããå±ãã ãããããããç§ã®æ¢
ã®éŠãã ããå±ãæ¥æ°ãæãå€ãå®¶ã«äœã¿ããã å³ã®ããã«ãè±ã®éŠãã¯æç¶ã«åºããããã®é åã¯é¢šã®åããæ¹åãšåŒ·ãã«ãã£ãŠæ±ºãŸããæåœ¢ã¯é¢šã®åããæ¹å w... | 38,292 |
Anchored Balloon A balloon placed on the ground is connected to one or more anchors on the ground with ropes. Each rope is long enough to connect the balloon and the anchor. No two ropes cross each other. Figure E-1 shows such a situation. Figure E-1: A balloon and ropes on the ground Now the balloon takes off, and you... | 38,293 |
F: ã¿ãã¿ãŒæåå - Miko Mi String - ç©èª ã¿ã£ãã¿ã£ãã¿ãïŒã¿ããªã®ã¢ã€ãã«ïŒç°æŸ€ã¿ãã¿ãïŒä»æ¥ã¯ãïŒã¿ããšäžç·ã«ãïŒæååã¢ã«ãŽãªãºã ã®ç·Žç¿ïŒããâ ã¿ãã®ãšã£ãŠããã® ãã£ã©äœã åèšèïŒãã¿ã£ãã¿ã£ãã¿ããã¯ïŒããŒãåã«ãããš âMikoMikoMiâ ã«ãªãã¿ãïŒã€ãŸãïŒ A= âMiâ, B= âKoâ ãšãããšïŒ ABABA ã®åœ¢ã§æžããã£ãŠããšãªã®ïŒãããªé¢šã«ïŒé©åã« A ãš B ãæ±ºãããš ABABA ã®åœ¢ã«åè§£ã§ããæååã®ããšããã¿ãã¿ãŒæååãã£ãŠèšããïŒæååã®ååã«ãŸã§ãªã£ã¡ãããªããŠïŒã¿ãã¯ã¿ããªã®äººæ°è
ã¿ããïŒ ã¿ããªã§ã¿ãã¿ãŒæååãããã£ãšäœ¿ã£ãŠããããã«ïŒäžããããæååã... | 38,294 |
é¢é£åå ã€ã³ã¿ãŒãããé販ãµã€ãã§ã¯ããŠãŒã¶ãçŸåšèŠãŠããååãšåãããŒãžã«ãéå»ã«ä»ã®ãŠãŒã¶ã«ãã£ãŠãçŸåšèŠãŠããååãšäžç·ã«è²·ãããå¥ã®ååãããã€ã衚瀺ããŠãããŸããé¢é£æ§ã®é«ããšæãããååãæç€ºããããšã§ã売ãäžãã䌞ã°ãããšãã§ãããšèããããŠããããã§ãã 䌌ããããªããšã¯ãäžç·ã«è²·ãããããšãå€ãååãè¿ãã«é
眮ããããšãã工倫ãšããŠãè¿æã®ã¹ãŒããŒããŒã±ããã§ãç®ã«ããããšãã§ããŸãïŒäŸãã°ããã³ãšãžã£ã ã®ãããªïŒãããªãã®ä»äºã¯ãååé
眮ã®å·¥å€«ãå©ããããã°ã©ã ãæžãããšã§ããä»åã¯ãããåºæºãšãªãåæ°ãèšå®ããäžç·ã«è²·ãããåæ°ãåºæºåæ°ä»¥äžã§ãããïŒã€ã®ååã®çµã¿åãããæ±ããããšæããŸãã äžç·ã«è²·ããã... | 38,295 |
Problem F: It Prefokery Pio You are a member of a secret society named Japanese Abekobe Group , which is called J. A. G. for short. Those who belong to this society often exchange encrypted messages. You received lots of encrypted messages this morning, and you tried to decrypt them as usual. However, because you recei... | 38,296 |
K - XORåå» å顿 KU倧åŠã§ã¯äžé¢šå€ãã£ãã©ãªãŒã²ãŒã ã人æ°ã§ããïŒ ãã®ã²ãŒã ã®èå°ã§ãããµãŒãããã«ã¯ïŒ N åã®äŒæ©æãš M åã®éãããïŒ i çªç®ã®é㯠f i çªç®ã®äŒæ©æãš t i çªç®ã®äŒæ©æã®éã«ããïŒ ãã¹ãŠã®éã«ã¯ãã§ãã¯ãã€ã³ããäžã€ãã€ååšãïŒé i ã®ãã§ãã¯ãã€ã³ããééãããšã©ã¡ãã®åãã§éã£ãŠã p i ã®åŸç¹ãXORã§å ç®ãããïŒ XORã§ å ç®ãããïŒå€§äºãªããšãªã®ã§2åèšããŸããïŒ ãã®ã²ãŒã ã§ã¯ïŒåãäŒæ©æãéãäœåºŠéã£ãŠãè¯ããïŒ ãŽãŒã«ã«ãã©ãçããŠããã®ãŸãŸã©ãªãŒãç¶è¡ããããšãã§ãããïŒ éã®éäžã«ãããã§ãã¯ãã€ã³ããè¿åããŠå¥ã®äŒæ©æãžè¡ãããšã¯çŠæ¢ãããŠããïŒ ãã®ã... | 38,297 |
Score : 300 points Problem Statement There are N cities on a number line. The i -th city is located at coordinate x_i . Your objective is to visit all these cities at least once. In order to do so, you will first set a positive integer D . Then, you will depart from coordinate X and perform Move 1 and Move 2 below, as ... | 38,299 |
Score : 200 points Problem Statement Alice and Bob are controlling a robot. They each have one switch that controls the robot. Alice started holding down her button A second after the start-up of the robot, and released her button B second after the start-up. Bob started holding down his button C second after the start... | 38,300 |
Score : 600 points Problem Statement We have one slime. You can set the health of this slime to any integer value of your choice. A slime reproduces every second by spawning another slime that has strictly less health. You can freely choose the health of each new slime. The first reproduction of our slime will happen i... | 38,301 |
Min Element æ°å a_1,a_2,..,a_N ãäžããããŸãã ãã®æ°åã®æå°å€ã®çªå·ãæ±ããŠãã ããã æå°å€ãè€æ°ã®å Žæã«ãããšãã¯ãçªå·ã®æãå°ãããã®ãçããŠãã ããã å
¥å N a_1 a_2...a_N åºå a_i ãæ°åã®æå°å€ãšãªããã㪠i ã®ãã¡ãæãå°ãããã®ãåºåããã å¶çŽ 1 \leq N \leq 10^5 1 \leq a_i \leq 10^9 å
¥åäŸ 6 8 6 9 1 2 1 åºåäŸ 4 | 38,302 |
Difference of Big Integers Given two integers $A$ and $B$, compute the difference, $A - B$. Input Two integers $A$ and $B$ separated by a space character are given in a line. Output Print the difference in a line. Constraints $-1 \times 10^{100000} \leq A, B \leq 10^{100000}$ Sample Input 1 5 8 Sample Output 1 -3 Sampl... | 38,303 |
I: ç Žå£ (Ravage) ãµã³ã¿ã¯ããŒã¹ã¯ãè¡ã®ã€ã«ãããŒã·ã§ã³ã«åŒã£ããããå£ããã ã€ã«ãããŒã·ã§ã³ã«ã¯Nåã®é»çãããã$i$ çªç®ã®é»çã¯é»å§ã $A_i$ ä»¥äž $B_i$ 以äžã®ãšãã«ããä»ããªããªã£ãŠããŸã£ãã é»å§ã¯ã€ã«ãããŒã·ã§ã³ã®ã©ãã§ãåãã«ããå¿
èŠãããã é»å§ã調ç¯ããããšã§ãæå€§ããã€ã®é»çãåæã«å
ãããããšãã§ãããæ±ããã å
¥å 1 è¡ç®ã«ã¯æŽæ° $N$ ãäžããããã ç¶ã $N$ è¡ã®ãã¡ $i$ è¡ç®ã«ã¯ $A_i, B_i$ ã空çœåºåãã§äžããããã åºå åæã«å
ãããããšãã§ããé»çã®åæ°ã®æå€§å€ãåºåããã å¶çŽ $N$ 㯠$1$ ä»¥äž $100 \ 000$ 以äžã®æŽæ° $A... | 38,304 |
Score : 300 points Problem Statement There are N cities numbered 1 through N , and M bidirectional roads numbered 1 through M . Road i connects City A_i and City B_i . Snuke can perform the following operation zero or more times: Choose two distinct cities that are not directly connected by a road, and build a new road... | 38,305 |
Problem E: Cyclic Shift Sort Problem é·ã $N$ ã®é å $P = \{ P_1, P_2, \ldots, P_N \} $ ãšæŽæ° $K$ ãäžããããã 以äžã®æäœã $0$ å以äžä»»æã®åæ°ç¹°ãè¿ãããšã§ãé å $P$ ãå調å¢å ã«ããããšãã§ãããã©ããå€å®ããã æŽæ° $x \ (0 \le x \le N-K)$ ãéžã¶ã $ P_{x+1}, \ldots, P_{x+K} $ ãå·¡åå³ã·ãããã ãã ããéšåå $U=U_1, \ldots, U_M$ ã®å·¡åå³ã·ãããšã¯ã $U=U_1, \ldots, U_M$ ã $U=U_M, U_1, \ldots, U_{M-1}$... | 38,306 |
Score : 100 points Problem Statement Decades have passed since the beginning of AtCoder Beginner Contest. The contests are labeled as ABC001 , ABC002 , ... from the first round, but after the 999 -th round ABC999 , a problem occurred: how the future rounds should be labeled? In the end, the labels for the rounds from t... | 38,307 |
Score : 100 points Problem Statement Two deer, AtCoDeer and TopCoDeer, are playing a game called Honest or Dishonest . In this game, an honest player always tells the truth, and an dishonest player always tell lies. You are given two characters a and b as the input. Each of them is either H or D , and carries the follo... | 38,308 |
Score : 100 points Problem Statement How many ways are there to choose two distinct positive integers totaling N , disregarding the order? Constraints 1 \leq N \leq 10^6 N is an integer. Input Input is given from Standard Input in the following format: N Output Print the answer. Sample Input 1 4 Sample Output 1 1 There... | 38,309 |
Problem E: Geometric Map Your task in this problem is to create a program that finds the shortest path between two given locations on a given street map, which is represented as a collection of line segments on a plane. Figure 4 is an example of a street map, where some line segments represent streets and the others ar... | 38,310 |
ãã±ããã®å£²ãäžã 仿¥ã¯ãã¢ã€ã
ã»ãšã³ã¿ãŒãã€ã³ã¡ã³ã瀟ã€ããªã·ã®ã¢ã€ãã«ã°ã«ãŒããã¢ã«ãã³ïŒã³ããŠã·ãã®ãã±ããçºå£²æ¥ã§ãããã±ããã«ã¯ä»¥äžã®ïŒçš®é¡ããããŸãã ïŒ³åž 6000å ïŒ¡åž 4000å ïŒ¢åž 3000å ïŒ£åž 2000å 販売責任è
ã®ããªãã¯ãããããããªããçºå£²éå§ãåŸ
ã£ãŠããŸããããããçºå£²éå§ã売ãè¡ã絶奜調ã§ãïŒ çºå£²éå§ãããã°ããçµã£ããšããã§ããããŸã§ã®æ³šæããŸãšãã衚ãåãåããŸããã衚ã®åè¡ã«ã¯ããããŸã§ã«å£²ãããã±ããã®çš®é¡ãšææ°ãæžããŠãããŸãããã ãããã±ããã®çš®é¡ãïŒïŒ¡ïŒïŒ¢ïŒïŒ£ã®é ã«çŸãããšã¯éããŸããããã®è¡šã®è¡ããšã®å£²äžéé¡ãæ±ããããã°ã©ã ãäœæããŠãã ããã å
¥å å
¥åããŒã¿ã¯ä»¥äž... | 38,311 |
Problem A: Rational Irrationals Rational numbers are numbers represented by ratios of two integers. For a prime number p , one of the elementary theorems in the number theory is that there is no rational number equal to â p . Such numbers are called irrational numbers. It is also known that there are rational numbers a... | 38,312 |
Big Maze ããªã㯠Jumbo Amusement GardenïŒç¥ããŠãJAGããšåŒã°ãã巚倧ãªéåå°ã§åããŠããïŒãã®éåå°ã®æ·å°ã¯åºå€§ã§ïŒã¢ãã©ã¯ã·ã§ã³ãããšããšã巚倧ãªãã®ãèšçœ®ãããïŒ ãã®åºŠJAGã«ïŒæ°ããªå·šå€§è¿·è·¯ã¢ãã©ã¯ã·ã§ã³ãBig Mazeããå°å
¥ãããããšã«ãªã£ãïŒ Big Maze ã®åœ¢ç¶ã¯ïŒå¹³é¢å³ã§èŠããšïŒçžŠæšªå
±ã« N ãã¹ã®æ£æ¹åœ¢ç¶ã®è¿·è·¯ M åãïŒé£æ¥ããå·Šå³ã®èŸºå士ãç¹ãåããïŒçžŠ N ãã¹ïŒæšª NM ãã¹ã®é·æ¹åœ¢ç¶ã«ãªãäºå®ã§ããïŒ M åã®è¿·è·¯ãå·Šããã©ã®é çªã§ç¹ãåããããã¯ãããããæ±ºãŸã£ãŠãããïŒé£ãåãè¿·è·¯ã®ã©ã®èŸºå士ãç¹ãåããããã¯æªå®ã§ããïŒ M åã®è¿·è·¯ãç¹ãåãããåã«ïŒå... | 38,313 |
Problem B: Monster Factory æ ªåŒäŒç€Ÿå倩å ã¯, Packet Monster ãšããã²ãŒã ãœãããçºå£²ããŠãã. ãã®ã²ãŒã ã¯ã¢ã³ã¹ã¿ãŒãæãŸã, è²ãŠ, æŠããããšããè¶£æšã®ãã®ã§, äžçäžã§å€§äººæ°ã®ã²ãŒã ã§ãã£ã. ãã®ã²ãŒã ã«ã¯åŸæ¥ã®ã²ãŒã ã«ã¯ç¡ãç¹åŸŽããã£ã. ãã®ã²ãŒã ã«ã¯ Red ãš Green ãšãã2ã€ã®ããŒãžã§ã³ããã, ããããã®ã²ãŒã ã§æãŸããããã¢ã³ã¹ã¿ãŒãç°ãªãã®ã . Red ã§ããæãŸããããªãã¢ã³ã¹ã¿ãŒã Green ã§å
¥æããã«ã¯, é信亀æãšããã·ã¹ãã ã䜿ã. ã€ãŸã, èªåã®ãœããå
ã®ã¢ã³ã¹ã¿ãŒãšåéã®ãœããå
ã®ã¢ã³ã¹ã¿ãŒã亀æããããšãã§ããã®ã . ãã®ã·ã¹ãã 㯠P... | 38,314 |
Runaway Domino ``Domino effect'' is a famous play using dominoes. A player sets up a chain of dominoes stood. After a chain is formed, the player topples one end of the dominoes. The first domino topples the second domino, the second topples the third and so on. You are playing domino effect. Before you finish to set u... | 38,315 |
Flame of Nucleus Year 20XX â a nuclear explosion has burned the world. Half the people on the planet have died. Fearful. One city, fortunately, was not directly damaged by the explosion. This city consists of N domes (numbered 1 through N inclusive) and M bidirectional transportation pipelines connecting the domes. In ... | 38,316 |
Problem F: Coupling Problem ææŽ¥å€§åŠã§ã¯æ¯å¹Žå€§èŠæš¡ãªåã³ã³ãè¡ãããŠããŸãã ä»å¹Žã¯ N 人ã®ç·æ§ãš M 人ã®å¥³æ§ãåå ããŸãã ããããç·æ§ã¯0ããé ã« N â1ãŸã§IDãå²ãæ¯ããããã女æ§ã¯0ããé ã« M â1ãŸã§IDãå²ãæ¯ãããŠããŸãã ãã®åã³ã³ã§ã¯èªåã®ã倧奜ããªäººããšããããã奜ããªäººãã®IDãæç€ºããŸãã ç·æ§ã¯ãããã女æ§ã®IDãã女æ§ã¯ããããç·æ§ã®IDãæç€ºããŸãã ãã®åŸã以äžã®ã«ãŒã«ã«åŸã£ãŠã«ããã«ãæç«ããŸãã ç·æ§ã¯è€æ°ã®å¥³æ§ã女æ§ã¯è€æ°ã®ç·æ§ãšã«ããã«ã«ãªã£ãŠã¯ãããªãã äºãã«ã倧奜ããªäººããšæç€ºããç·æ§ãšå¥³æ§ã§ãã¢ãã§ããã ãããããä»»æã®ãã¢ãéžã³ã«ããã«ãäœãã... | 38,317 |
G - æ å顿 ãã€ãã®ãããã¯ïŒäŒæã§ãšããå°ããªæã蚪ããŠããïŒåœŒå¥³ãé©ããã®ã¯ïŒãã®æã®è¡šæããã€æ§è³ªã§ããïŒ æã«ã¯ N åã®å®¶å±ãããïŒããã§ã¯ç°¡åã®ããïŒæã¯ 2 次å
å¹³é¢ã§ãããšãïŒå®¶å±ã¯ãã®å¹³é¢äžã®ç¹ã§ãããšèŠãªãïŒ ããããã®å®¶å±ã«ã¯è¡šæã 1 åèšããããŠããïŒãã®å®¶ã®èåã衚ããŠããïŒãããã¯æã®äžã蚪åããã«ã€ããŠïŒãã®æã®è¡šæã次ã®ãããªæ§è³ªãæã£ãŠããããšã«æ°ä»ããïŒ ãã宿° R ãååšããïŒ ãã 2 ã€ã®å®¶å±ã®è·é¢ã R 以äžã§ãããªãïŒãã® 2 ã€ã®å®¶å±ã¯åã衚æãæã€ïŒ ãã 2 ã€ã®å®¶å±ã®è·é¢ã 3R 以äžã§ãããªãïŒãã® 2 ã€ã®å®¶å±ã¯ç°ãªã衚æãæã€ïŒ ä»»æã® 2 ã€ã®å®¶å±ã®è·é¢ã¯ R... | 38,318 |
Problem F: Controlled Tournament National Association of Tennis is planning to hold a tennis competition among professional players. The competition is going to be a knockout tournament, and you are assigned the task to make the arrangement of players in the tournament. You are given the detailed report about all parti... | 38,319 |
æã®éè·¯èšç» äŒæŽ¥åœã®è¥æŸå¹³éã«ãéèœãç¹åšããŠããŸãããããã€ãã®éèœã®éã¯ãŸã£ããã§äºãã«è¡ãæ¥ã§ããéã§ç¹ãã£ãŠããŠãå¹³éã«ããã©ã®éèœã®éãéã蟿ã£ãŠè¡ãæ¥ãã§ããŸããããããã®éã«ã¯é·ãã«å¿ããç¶æè²»ãããããŸããããã¹ãŠã®éèœãè³éãåºãåã£ãŠéãç¶æããŠããŸããã ãããšãããã¹ãŠã®éèœãäžã€ã®æã«ãŸãšãŸãããšã決ãŸããæãå²ãå¢çç·ãåŒãããšã«ãªããŸãããåœã®æ±ºãŸãã§ã¯ãæãæ§æããã©ã®ïŒã€ã®éèœãçµãã ãŸã£ãããªç·ããæã®å€ãéã£ãŠã¯ãããŸããïŒå¢çç·äžãéãããšã¯èš±ãããŸãïŒãããã«ãäŒæŽ¥åœã§ã¯æãå²ãå¢çç·äžã«éããªããã°ãªããŸãããå¢çç·äžã«éããªãå Žæã«ã¯ãåœãæ°ãã«éãäœã£ãŠãããŸãã ããããéã®ç¶æè²»... | 38,320 |
D: Complex Oracle - Complex Oracle - åé¡ â»ãã®åé¡ã¯ãªã¢ã¯ãã£ãåé¡ã§ãïŒããªãã¡ïŒãµãŒããŒåŽã«çšæãããããã°ã©ã ãšå¯Ÿè©±çã«å¿çããããšã§æ£çãå°ãããã°ã©ã ãäœæããå¿
èŠããããŸãïŒ ãŸãããµãŒããŒåŽã®ããã°ã©ã ãèšç®æ©è³æºãå
±æããé¢ä¿äžããµãŒããŒã ãã§æå€§ 3 secçšåºŠã®å®è¡æéãæå€§ 300 MBçšåºŠã®ã¡ã¢ãªã䜿çšããå ŽåããããŸãã®ã§ãTLEã»MLEã«ãæ°ãã€ããã ããã ãããã«ããã¯è¥ã¶æŸé«æ ¡ã®ããã°ã©ãã³ã°ã³ã³ãã¹ãéšãéç§°ã·ãããéšã«æå±ãã2幎çã§ãããèŠç®éºããããããã«ããã¯ãã®å°ããªäœãç¡éã«ååšãããã£ãŒã ãã€ã³ãã®1ã€ã§ããããæ¬äººã¯ã³ã³ãã¬ãã¯ã¹ãæããŠãã... | 38,322 |
Integral Rectangles Let us consider rectangles whose height, h , and width, w , are both integers. We call such rectangles integral rectangles . In this problem, we consider only wide integral rectangles, i.e., those with w > h . We define the following ordering of wide integral rectangles. Given two wide integral rect... | 38,323 |
Problem Statement Have you experienced $10$-by-$10$ grid calculation? It's a mathematical exercise common in Japan. In this problem, we consider the generalization of the exercise, $N$-by-$M$ grid calculation. In this exercise, you are given an $N$-by-$M$ grid (i.e. a grid with $N$ rows and $M$ columns) with an additio... | 38,324 |
è¡æ¶²å ããåŠçŽã®çåŸã®åºåžçªå·ãš ABO è¡æ¶²åãä¿åããããŒã¿ãèªã¿èŸŒãã§ããã®ãã®ã®è¡æ¶²åã®äººæ°ãåºåããããã°ã©ã ãäœæããŠãã ããããªããABO è¡æ¶²åã«ã¯ãA åãB åãAB åãO åã®ïŒçš®é¡ã®è¡æ¶²åããããŸãã Input ã«ã³ãã§åºåãããåºåžçªå·ãšè¡æ¶²åã®çµããè€æ°è¡ã«æž¡ã£ãŠäžããããŸããåºåžçªå·ã¯ 1 ä»¥äž 50 以äžã®æŽæ°ãè¡æ¶²åã¯æåå "A", "B", "AB" ãŸã㯠"O" ã®ããããã§ããçåŸã®äººæ°ã¯ 50 ãè¶
ããŸããã Output ïŒè¡ç®ã« A åã®äººæ° ïŒè¡ç®ã« B åã®äººæ° ïŒè¡ç®ã« AB åã®äººæ° ïŒè¡ç®ã« O åã®äººæ° ãåºåããŸãã Sample Input 1,B 2,A 3,... | 38,325 |
Bit Operation II Given two non-negative decimal integers $a$ and $b$, calculate their AND (logical conjunction), OR (logical disjunction) and XOR (exclusive disjunction) and print them in binary representation of 32 bits. Input The input is given in the following format. $a \; b$ Output Print results of AND, OR and XOR... | 38,326 |
å±±ãžåž°ãã è¿å¹Žã€ãºã¢åœã§ã¯ãå±±ããè¡ã«éããŠããåç©ã«æ©ãŸãããŠãããããªãã¯åç©ãå±±ãžåž°ãããšç ç©¶ãéãã以äžã®ããšãæããã«ããã ããããã®åç©ã«ã¯åºæã®ååãã€ããŠããã ïŒäœã®åç©ã«ã€ããŠãäžæ¹ã®åç©ã®ååã®ã©ããã®äœçœ®ã«ïŒæåãæ¿å
¥ãããšãããäžæ¹ã®åç©ã®ååãšäžèŽããå Žåããããããã¢ã«ããŠå±±ãžåž°ãããšãã§ããã äžåºŠå±±ãžåž°ã£ãåç©ããåã³è¡ã«éããŠããããšã¯ãªãã ããªãã¯ãè¡ã«éããŠããåç©ãããã®æ¹æ³ã§ã©ã®ãããå±±ãžåž°ãããšãã§ããããèšç®ããããšã«ããã è¡ã«éããŠããåç©ã®ååãäžãããããšãããã®æ¹æ³ã§æå€§ããã€ã®ãã¢ãå±±ãžåž°ãããšãã§ããããæ±ããããã°ã©ã ãäœæããã å
¥å å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããã... | 38,327 |
C - ãã§ã³ã¬ãŒã ç®ã®åã« M \times N åã®ããŒã¹ã§ã§ããæ¿ãã§ã³ãããïŒ ããŒã¹ã«ã¯çãããŒã¹ãšèŸãããŒã¹ã®2çš®é¡ãããïŒã§ããã ãå€ãã®çãããŒã¹ãé£ã¹ããïŒ ãããïŒæ¿ãã§ã³ã®é£ã¹æ¹ã«ã¯ã«ãŒã«ãããïŒä»¥äžã®ã«ãŒã«ãå®ããªããã°ãªããªãïŒ ããããŒã¹ãé£ã¹ãããã«ã¯ïŒãã®ããŒã¹ã®çäžã«é£æ¥ããããŒã¹ãååšããïŒå ããŠãã®ããŒã¹ã®å°ãªããšãå·Šå³ã©ã¡ããã«ã¯ããŒã¹ãååšããªãå¿
èŠãããïŒ äŸãã°ïŒå³ã®ãããªåœ¢ã®ãã§ã³ã¬ãŒãã§ã¯ïŒèµ€ãè²ä»ããããããŒã¹ã次ã«é£ã¹ãããšãã§ããïŒ ãŸãå¥åŠãªããšã«ïŒããããŒã¹ãé£ã¹ããšãã®ããŒã¹ã®äžäžå·Šå³ã«é£æ¥ããŠããŠãã€ãŸã é£ã¹ãããŠããªãããŒã¹ã®å³ãå€åããïŒ (çãããŒã¹ã¯èŸãïŒèŸã... | 38,328 |
Score : 200 points Problem Statement There are N bags of biscuits. The i -th bag contains A_i biscuits. Takaki will select some of these bags and eat all of the biscuits inside. Here, it is also possible to select all or none of the bags. He would like to select bags so that the total number of biscuits inside is congr... | 38,329 |
Score : 700 points Problem Statement You are given an integer N . Determine if there exists a tree with 2N vertices numbered 1 to 2N satisfying the following condition, and show one such tree if the answer is yes. Assume that, for each integer i between 1 and N (inclusive), Vertex i and N+i have the weight i . Then, fo... | 38,330 |
Problem B: Turn Left Taro got a driverâs license with a great effort in his campus days, but unfortunately there had been no opportunities for him to drive. He ended up obtaining a gold license. One day, he and his friends made a plan to go on a trip to Kyoto with you. At the end of their meeting, they agreed to go aro... | 38,331 |
Score : 1400 points Problem Statement You are given P , a permutation of (1,\ 2,\ ...\ N) . A string S of length N consisting of 0 and 1 is a good string when it meets the following criterion: The sequences X and Y are constructed as follows: First, let X and Y be empty sequences. For each i=1,\ 2,\ ...\ N , in this or... | 38,332 |
Score : 200 points Problem Statement There are N cities and M roads. The i -th road (1â€iâ€M) connects two cities a_i and b_i (1â€a_i,b_iâ€N) bidirectionally. There may be more than one road that connects the same pair of two cities. For each city, how many roads are connected to the city? Constraints 2â€N,Mâ€50 1â€a_i,b_iâ€N ... | 38,333 |
Score : 400 points Problem Statement We have N bricks arranged in a row from left to right. The i -th brick from the left (1 \leq i \leq N) has an integer a_i written on it. Among them, you can break at most N-1 bricks of your choice. Let us say there are K bricks remaining. Snuke will be satisfied if, for each integer... | 38,334 |
Score : 600 points Problem Statement There are N dots in a two-dimensional plane. The coordinates of the i -th dot are (x_i, y_i) . We will repeat the following operation as long as possible: Choose four integers a , b , c , d (a \neq c, b \neq d) such that there are dots at exactly three of the positions (a, b) , (a, ... | 38,335 |
Score : 200 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 †... | 38,336 |
Problem H: Hth Number Problem é·ã$N$ã®æåå$S$ãããã$S$ã«å«ãŸããæåã¯ãã¹ãŠ0以äž9以äžã®æ°åã§ããã $S$ã®ãã¹ãŠã®éšåæååããäœãããæ°ãå
šåæããŠã§ããé
æ°$\frac{N\times(N+1)}{2}$ã®æ°åãäœã£ãæã ãã®æ°åã®äžã§$H$çªç®ã«å°ããå€ãæ±ããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã $N$ $H$ $S$ å
¥åã¯ãã¹ãп޿°ã§äžããããã 1è¡ç®ã«$N$ãš$H$ã空çœåºåãã§äžããããã 2è¡ç®ã«é·ã$N$ã®æåå$S$ãäžããããã Constraints å
¥åã¯ä»¥äžã®æ¡ä»¶ãæºããã $1 \leq N \leq 10^5$ $1 \leq H \l... | 38,337 |
Score : 100 points Problem Statement You are given a grid of N rows and M columns. The square at the i -th row and j -th column will be denoted as (i,j) . Some of the squares contain an object. All the remaining squares are empty. The state of the grid is represented by strings S_1,S_2,\cdots,S_N . The square (i,j) con... | 38,338 |
Score : 100 points Problem Statement A biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation. Find the total number of biscuits produced within T + 0.5 seconds after activation. Constraints All values in input ar... | 38,339 |
Array Update 2 Problem é
æ° N ãåé
a ãå
¬å·® d ã®çå·®æ°å A ãããã 以äžã®åœ¢åŒã§ãæ°åãæžãæãã M åã®åœä»€æãäžããããã®ã§ãäžããããé åºã§ M å æ°å A ãæžãæãããšãã®æ°å A ã® K é
ç®ã®å€ãæ±ããªããã i çªç®ã®åœä»€æã¯3ã€ã®æŽæ° x i , y i , z i ã§äžããããã(1 †i †M ) x i ã0ã ã£ãå Žåã y i é
ç®ãã z i é
ç®ãŸã§ã®åºéã«ãããŠãå€ã®é åºãå転ããã x i ã1ã ã£ãå Žåã y i é
ç®ãã z i é
ç®ãŸã§ã®åºéã«ãããŠãããããã®å€ã1å¢å ãããã x i ã2ã ã£ãå Žåã y i é
ç®ãã z i é
ç®ãŸã§ã®åºéã«... | 38,340 |
å顿 å§å¡é·ã®é女 PATRICIA ã¯ïŒèèã®ãããªç³žãåãçµçã®äžã§æ®ãããŠããïŒäœ¿ãéã® MATHIEU ã¯ïŒå§å¡é·ã®é女ãåãã糞ãåŒã£ã±ãèªåšã«ç©ºãé£ãã§ããïŒç³žã¯ç©ºéäžã®ç·åãšã¿ãªãããšã«ããïŒ æçŸã»ãã ã¯å§å¡é·ã®é女ã«å¯ŸããŠæ»æã仿ããããšãïŒç匟ãšééããŠè±ç«çãæã蟌ãã§ããŸã£ãïŒãã®çµæïŒããããã®ç³žã«ã€ããŠïŒé女ããè·é¢ p_1, ..., p_M ã®äœçœ®ã«ããéšåãåããã ããšãªã£ãŠããŸã£ãïŒè±ç«çãæããåïŒããããã®ç³žã«ã€ããŠïŒç³žã® 2 ã€ã®ç«¯ç¹ãšé女ã¯ãã®é çªã§åäžçŽç·äžã«äžŠãã§ããïŒç«¯ç¹ã®ã©ã¡ããäžæ¹ã䜿ãéãåŒã£åŒµã£ãŠããïŒççºã§ç³žã¯åãïŒäœ¿ãéãæã£ãŠããéšåãšããããäžã€çœ®ãã®éšåãæ®ã... | 38,342 |
AïŒæ²¢å±±ã®çš®é¡ã®ææª (Many Kinds of Apples) Problem Statement Apple Farmer Mon has two kinds of tasks: "harvest apples" and "ship apples". There are N different species of apples, and N distinguishable boxes. Apples are labeled by the species, and boxes are also labeled, from 1 to N . The i -th species of apples are stored in th... | 38,343 |
Problem G: Sports Days äŒæŽ¥å€§åŠéå±å°åŠæ ¡ïŒäŒæŽ¥å€§å°ïŒã¯æ¥æ¬ææ°ã®ç«¶æããã°ã©ããŒé€ææ ¡ãšããŠæåã§ããã ãã¡ãããéåäŒã«åå ããŠãããšãã§ããã¢ã«ãŽãªãºã ã®ä¿®è¡ãæ¬ ãããªãã ç«¶æããã°ã©ãã³ã°éšéšé·ã®ããªãã¯ãã¡ãããã®å€§äŒã§ãåå©ãããã ä»åã¯ããç«¶æã«æ³šç®ããã ããç«¶æãšã¯äŒæŽ¥å€§å°ã§è¡ãããŠããäŒçµ±çãªç«¶æã ã æ ¡åºã«ã³ãŒã³ãnå眮ããŠããã ã³ãŒã³ã¯4è²çšæãããŠããã ã³ãŒã³ã®ããã€ãã®ãã¢ã¯çœç·ã§æãããç¢å°ã§çµã°ããŠããã ç¢å°ã¯çåŽã ãã«ã€ããŠãããæŽæ°ã䜵èšãããŠããã ç«¶æè
ã¯k人1ããŒã ãšããŠè¡åããã ããã¹ã¿ãŒãå°ç¹ã®ã³ãŒã³ãããŽãŒã«å°ç¹ã®ã³ãŒã³ãŸã§ç¢å°ã®äžããã®åãã«ç§»åã... | 38,344 |
Score : 700 points Problem Statement We have a rooted binary tree with N vertices, where the vertices are numbered 1 to N . Vertex 1 is the root, and the parent of Vertex i ( i \geq 2 ) is Vertex \left[ \frac{i}{2} \right] . Each vertex has one item in it. The item in Vertex i has a value of V_i and a weight of W_i . N... | 38,345 |
ãã¶ãã¬ãã€ãã Aåããã®å®¶ã«èŠªæã®Bç·åããã£ãŠããŸããã圌ã¯3æ³ã§æã倧奜ãã§ãã圌ã¯å¹Œçšåã§ãªãã£ãããã¶ãã¬ãã€ããã(å±±æ¬çŽçŽäœè©ã»äœæ²)ãšããæãäžçæžåœã«æã£ãŠããŸãããã®æã§ã¯ã4ã€ã®ããšã°ããã¶ãã ããã¬ãã ããã€ãããããããé ã«ãããšãã«ãªã£ãŠããŠãããã«æåŸã®é³ãšæåã®é³ãåãã«ãªã£ãŠããŸããBç·åã¯ãAåããã«ãåããããªãããšãããBç·åãèšã£ãåèªããäœãããæããŠæ¬²ãããšèšãããŸããã ããã§ãAåãããå©ããããã«ãäžããããåèªããããã®åèªããã¹ãŠäœ¿ã£ãŠãé ã«ãããšããã€ããããã®äžã§ã 第1 ã®åèªã®æåã®æåãšæçµã®åèªã®æåŸã®æåãåãã§ããããã«ã§ãããåŠããå€å®ããããã°ã©ã ãäœ... | 38,346 |
G: äžçªé ãçº å顿 $N$ åã®çºãš $N-1$ åã®éããããŸãã ãã¹ãŠã®çºãšéã«ã¯ãããã $1$ ãã $N$, $1$ ãã $N-1$ ã®çªå·ãã€ããŠããŸãã é $i$ ã¯çº $a_i$ ãšçº $b_i$ ãè·é¢ $d_i$ ã§åæ¹åã«ã€ãªãã§ããŸãã æåã¯ãã¹ãŠã®éãéè¡å¯èœãªç¶æ
ã§ãããã©ã®çºãããããã€ãã®éãéãããšã§ãã¹ãŠã®çºã«è¡ãããšãã§ããŸãã ããã°ãããã¯æåãçº $1$ ã«ããŸãã $Q$ åã®ã¯ãšãªãäžããããã®ã§é çªã«åŠçããŠãã ãããã¯ãšãªã¯ $3$ çš®é¡ããã以äžã®åœ¢åŒã§äžããããŸãã ã¯ãšãª $1$ : 1 x â ããã°ããããçº $x$ ã«ç§»åããããã ãããã®ã¯ãšãªæç¹ã§ãã... | 38,347 |
Problem E: Enclose Points There are $N$ points and $M$ segments on the $xy$-plane. Each segment connects two of these points and they don't intersect each other except at the endpoints. You are also given $Q$ points as queries. Your task is to determine for each query point whether you can make a polygon that encloses ... | 38,348 |
Problem C: Cut the Cake Today is the birthday of Mr. Bon Vivant, who is known as one of the greatest pâtissiers in the world. Those who are invited to his birthday party are gourmets from around the world. They are eager to see and eat his extremely creative cakes. Now a large box-shaped cake is being carried into the ... | 38,349 |
Swapping Characters You are given a string and a number k . You are suggested to generate new strings by swapping any adjacent pair of characters in the string up to k times. Write a program to report the lexicographically smallest string among them. Input The input is given in the following format. s k The first line ... | 38,350 |
NINJA GAME æ°äœã²ãŒã "NIN JA G AME" ãã€ãã«çºå£²ãšãªã£ãïŒãã®ã²ãŒã ã§ã¯ãã¬ã€ã€ãŒã¯äºæ¬¡å
ãããäžã®å¿è
ãæäœããŠç§»åãè¡ãïŒäºæ¬¡å
ããã㯠x 軞ïŒãŸã㯠y 軞ã®ã©ã¡ããäžæ¹ã«å¹³è¡ãªèŸºã®ã¿ãããªãïŒèªå·±äº€å·®ã®ãªãå€è§åœ¢ã§è¡šãããïŒããŸïŒå€è§åœ¢ã®å
éšã«ååšããã¹ã¿ãŒãå°ç¹ãããŽãŒã«å°ç¹ãžãšç§»åããå¿
èŠãããïŒ ç§»åã¯äžäžå·Šå³ãšæã45°ã®8æ¹åãå¯èœã§ïŒããããã®å¯Ÿå¿ããã³ãã³ããå
¥åãããšïŒæå®ããæ¹åã«èªåã§é²ã¿ç¶ããïŒãã®èªåç§»åã®æäžã®ä»»æã®ã¿ã€ãã³ã°ã§å¥ã®ã³ãã³ããå
¥åããå ŽåïŒå³åº§ã«ç§»åæ¹åã®è»¢æãå¯èœã§ããïŒããªãã®ç®æšã¯ïŒãã®ã²ãŒã ã§ã®å®çžŸãè§£é€ããããïŒæå°ã®ã³ãã³ãå
¥ååæ°ã§ã¹ã¿ãŒã... | 38,351 |
Cube Surface Puzzle Given a set of six pieces, âCube Surface Puzzleâ is to construct a hollow cube with filled surface. Pieces of a puzzle is made of a number of small unit cubes laid grid-aligned on a plane. For a puzzle constructing a cube of its side length n , unit cubes are on either of the following two areas. Co... | 38,352 |
Problem A: Adhoc Translation One day, during daily web surfing, you encountered a web page which was written in a language you've never seen. The character set of the language was the same as your native language; moreover, the grammar and words seemed almost the same. Excitedly, you started to "decipher" the web page.... | 38,353 |
A : Soccer / ãµãã«ãŒ å顿 AåœãšBåœã®éã§AIãµãã«ãŒã®è©Šåããããããªãã®æå
ã«ã¯ãããæå»ã«ããŒã«ãæã£ãŠããéžæãšãã®äœçœ®ãèšé²ãã衚ãããã衚㯠N è¡ãããªããäžãã i çªç®ã®è¡ã¯æ¬¡ã«ç€ºãèŠçŽ ãããªãã ãã¬ãŒã æ° f_i ããŒã«ãæã£ãŠããéžæã®èçªå· a_i ãã®éžæãå±ããããŒã t_i ãã®éžæã®äœçœ®ã衚ãåº§æš x_i , y_i ãã¬ãŒã æ°ãšã¯ãã²ãŒã ã®éå§æå»ã« 0 ã«èšå®ããã 1 / 60 ç§ããšã« 1 å ç®ãããæŽæ°ã®ããšã§ãããäŸãã°ãã²ãŒã éå§ããã¡ããã© 1.5 ç§åŸã®ãã¬ãŒã æ°ã¯ 90 ã§ããã èçªå·ã¯åããŒã å
ã® 11 人ã®éžæã«äžæã«ãµãããæŽæ°ã§ãããããã«ã衚äžã®é£ç¶... | 38,354 |
Score : 300 points Problem Statement Takahashi has come to an integer shop to buy an integer. The shop sells the integers from 1 through 10^9 . The integer N is sold for A \times N + B \times d(N) yen (the currency of Japan), where d(N) is the number of digits in the decimal notation of N . Find the largest integer tha... | 38,355 |
Problem A: Cubist Artwork International Center for Picassonian Cubism is a Spanish national museum of cubist artworks, dedicated to Pablo Picasso. The center held a competition for an artwork that will be displayed in front of the facade of the museum building. The artwork is a collection of cubes that are piled up on ... | 38,356 |
Problem D: THE BYDOLM@STER Description THE BYDOLM@STER(ãã€ãã«ãã¹ã¿ãŒ)ãšã¯1rem瀟ãã2010/4/1ã«EXIDNAã§çºå£²ãäºå®ãããŠããè²æã·ãã¥ã¬ãŒã·ã§ã³ã²ãŒã ã§ãããäžå¿æã£ãŠãããã仿åãã«ãããã¯ãŒã¯æ¥ç¶ãµãŒãã¹ã忢ããæã¢ãŒã±ãŒãã²ãŒã ãšã¯ãã¶ãé¢ä¿ãç¡ãã ãã®ã²ãŒã ã¯ãã€ãã«ãã¡ãããããã¥ãŒã¹ãããŠããã(ç·šé)ã®ã¡ã³ããŒãéžæããã¡ã³ããŒãã¡ãšã®ã¬ãã¹ã³ãã³ãã¥ãã±ãŒã·ã§ã³ãéããŠã圌女(圌)ãããã€ãã«ã®é ç¹ãããããã€ãã«ã«è²ãŠäžããã²ãŒã ã§ããã åãã€ãã«ã«ã¯èœåå€ãšããŠããŒã«ã«ããã³ã¹ãã«ãã¯ã¹ã®3ã€ã®ãã©ã¡ãŒã¿ãæã¡ããŠãããã®èœåå€ã¯ãŠ... | 38,357 |
ïŒéœåžéã®è·é¢ å°çäžã®2 éœåžã®åç·¯ãšæ±çµãå
¥åãšããå°è¡šè·é¢ãèšç®ããŠåºåããããã°ã©ã ãäœæããŠãã ããããã ããå°çã¯ååŸ 6,378.1 km ã®çãšãã2 ç¹éã®å°è¡šè·é¢ãšã¯ãã®çé¢ã«æ²¿ã£ãæçè·é¢ã§ãããŸããååçã§ãåç·¯ã¯çšããã«åç·¯ 0 ~ -90 床ãçšããã°ãªãããžååç·ã®è¥¿ã§ã西çµã¯çšããã«æ±çµ 180 ~ 360 床ãçšããããšãšããŸããå°è¡šè·é¢ã¯ km åäœã§æ±ããå°æ°ç¹ä»¥äžã¯åæšäºå
¥ããæŽæ°å€ãšããŠåºåããŠãã ããã 以äžã«äž»èŠéœåžã®åç·¯ãæ±çµã®äŸã瀺ããŸãã å°å åç·¯(床) æ±çµ(床) æ±äº¬ 35.68 139.77 ã·ã³ã¬ããŒã« 1.37 103.92 ã·ãã㌠-33.95 151.18 ã·ã«ãŽ... | 38,358 |
IOI åè»ã§è¡ãã(Take the 'IOI' train) IOI åœã§ã¯ãã®ãã³æ°ãã«ééãæ·èšããïŒIOI åœã®ééãèµ°ãåè»ã¯ããã€ãã®è»äž¡ãé£çµããããã®ã§ããïŒè»äž¡ã«ã¯ I , O ã® 2 çš®é¡ãããïŒè»äž¡ã¯ããããç°ãªãçš®é¡ã®è»äž¡ãšããé£çµã§ããªãïŒãŸãïŒåè»ã«é転åžãèšããé¢ä¿äžïŒåè»ã®äž¡ç«¯ã®è»äž¡ã¯çš®é¡ I ã§ãªããã°ãªããªãïŒåè»ã¯è»äž¡ã®çš®é¡ã衚ãæåãé ã«ã€ãªããæååã§è¡šããïŒåè»ã®é·ãã¯ãã®æååã®é·ãã§ãããšããïŒããšãã°ïŒ IOIOI ã®é ã«è»äž¡ãé£çµãããšé·ã 5 ã®åè»ãç·šæã§ãïŒãŸãè»äž¡ I ã¯åç¬ã§é·ã 1 ã®åè»ã§ããïŒè»äž¡ã OIOI ã IOOI ãšãã£ãé ã«äžŠã¹ãŠãåè»ãç·šæããããšã¯... | 38,359 |
ãã©ã¹ãã£ãã¯æ¿ æ©æ¢°ã«èŸºã»å¯Ÿè§ç·ã®é·ãã®ããŒã¿ãå
¥åãããã©ã¹ãã£ãã¯æ¿ã®åæããããŠããå·¥å ŽããããŸãããã®å·¥å Žã§ã¯ããµã€ãºã¯æ§ã
ã§ãããå¹³è¡å蟺圢ã®åã®ã¿ãåãåºããŠããŸããããªãã¯ãåãåºãããå¹³è¡å蟺圢ã®ãã¡ãé·æ¹åœ¢ãšã²ã圢ã®è£œé åæ°ãæ°ããããã«äžåžããåœããããŸããã ãæ©æ¢°ã«å
¥åããããŒã¿ããèªã¿èŸŒãã§ãé·æ¹åœ¢ãšã²ã圢ã®è£œé åæ°ãåºåããããã°ã©ã ãäœæããŠãã ããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããŸãã a 1 , b 1 , c 1 a 2 , b 2 , c 2 : æ©æ¢°ã«å
¥åããããŒã¿ãè€æ°è¡ã«äžããããŸãã i è¡ç®ã« i çªç®ã®å¹³è¡å蟺圢ã®é£ãåãïŒèŸºã®é·ããè¡šãæŽæ° a i , b i ãšå¯Ÿè§ç·... | 38,360 |
ãã¶ åé¡ JOI ãã¶ã§ã¯,åžã®äžå¿éšãéãå
šé· d ã¡ãŒãã«ã®ç°ç¶ç·ã®æ²¿ç·äžã§ãã¶ã®å®
é
販 売ãè¡ã£ãŠãã. JOI ãã¶ã¯,ç°ç¶ç·äžã« n åã®åºè S 1 , ... , S n ãæã€.æ¬åºã¯ S 1 ã§ãã. S 1 ãã S i ãŸã§,æèšåãã«ç°ç¶ç·ãç§»åãããšãã®éã®ãã d i ã¡ãŒãã«ãšãã. d 2 , ... , d n 㯠1 ä»¥äž d - 1 以äžã®æŽæ°ã§ãã. d 2 , ... , d n ã¯å
šãŠç°ãªã. ãã¶ã®æ³šæãåãããš, ãã¶ãå·ããªãããã«, å®
é
å
ãŸã§ã®ç§»åè·é¢ããã£ãšãçãåºèã§ãã¶ãçŒãå®
é
ãã. å®
é
å
ã®äœçœ®ã¯ 0 ä»¥äž d - 1 以äžã®æŽæ° k ã§è¡šããã.ããã¯, æ¬åº S ... | 38,361 |
ç«æ¹äœã®äœå èžè¡å®¶åå·ã¯ n ç¹ã®äœåãåºå±ããããã«äŸé ŒãããŸãããããã§ãç«æ¹äœã® 6 é¢ããã³ãã§è²ä»ããããã®ãäœåãšããŠåºå±ããããšã«ããŸãããäœåã¯ãRedãYellowãBlueãMagentaãGreenãCyan ã® 6 è²å
šãŠã䜿ãããŠããŠãåé¢ã¯ 1 è²ã§å¡ãã€ã¶ãããŠããŸããåå·ã¯åœ¢ãåãç«æ¹äœã®äœåã§ãè²ã®é
眮ã®ä»æ¹ãå€ããç°ãªãäœåãšã㊠n ç¹äœæããŸããã 圌ã®å人ã§ããããªãã¯ãå人ã®ããã¿ã§äœåãåºå±åã«é²èЧãããŠããããŸããããããã§ããããšã«æ°ãä»ããŸããããããã®äœåã®äžã«ç°ãªãè²ä»ãããããŠããããã«èŠããŠããå®ã¯åãè²ã®çµã¿åãããããç«æ¹äœãååšããŠããã®ã§ãããã®ãŸãŸã§ã¯ã n ç¹... | 38,362 |
38,363 | |
Problem H: Cornering at Poles You are invited to a robot contest. In the contest, you are given a disc-shaped robot that is placed on a flat field. A set of poles are standing on the ground. The robot can move in all directions, but must avoid the poles. However, the robot can make turns around the poles touching them.... | 38,364 |
Problem A: Infected Computer Adam Ivan is working as a system administrator at Soy Group, Inc. He is now facing at a big trouble: a number of computers under his management have been infected by a computer virus. Unfortunately, anti-virus system in his company failed to detect this virus because it was very new. Adam h... | 38,365 |
J - Unfair Game Problem Statement Rabbit Hanako and Fox Jiro are great friends going to JAG primary school. Today they decided to play the following game during the lunch break. This game is played by two players with $N$ heaps of some number of stones. The players alternatively take their turn to play the game. Jiro i... | 38,366 |
B: äžå³¶ãããããããïŒ - Match Peas War - åé¡ äžå³¶ããã
ã£ã»ã»ã»ã 磯éãäžå³¶ïŒå€§äžå€«ãïŒã äžå³¶ãã»ã»ã»ãªãã ãå«ãªå€¢ãèŠãŠããæ°ããããã 磯éãã©ããªå€¢ã ãïŒã äžå³¶ãç¡éã«éã¶å€¢ã 磯éãæå³ããããïŒãŸããããïŒäžå³¶ïŒããããããïŒã äžå³¶ãããã£ãŠãŸããïŒãããããªãããªã»ã»ã»ã 磯éãããã ãïŒããã äžå³¶ããã£ïŒãããããªããïŒããããããã 磯éããããããïŒãŸãã¯ãããããã ãªïŒã ãªã«ããïŒå
¬åã§2人ã®åäŸãéãã§ããããã§ãïŒæããããæããŸããïŒãšããã§ïŒããªãã¯ããããã»ã°ãªãŒã³ããŒã¹ã»æŠäºããªã©ãšåŒã°ããæéã³ãç¥ã£ãŠããŸããïŒãã®åç§°ã«ãã³ãšããªãã£ããšããŠãïŒãã£ãšïŒåäŸæ... | 38,368 |
Score: 600 points Problem Statement After being invaded by the Kingdom of AlDebaran, bombs are planted throughout our country, AtCoder Kingdom. Fortunately, our military team called ABC has managed to obtain a device that is a part of the system controlling the bombs. There are N bombs, numbered 1 to N , planted in our... | 38,369 |
Largest Square Given a matrix ( H Ã W ) which contains only 1 and 0, find the area of the largest square matrix which only contains 0s. Input H W c 1,1 c 1,2 ... c 1,W c 2,1 c 2,2 ... c 2,W : c H,1 c H,2 ... c H,W In the first line, two integers H and W separated by a space character are given. In the following H lines... | 38,370 |
Score : 100 points Problem Statement There is a grid with H horizontal rows and W vertical columns. Let (i, j) denote the square at the i -th row from the top and the j -th column from the left. For each i and j ( 1 \leq i \leq H , 1 \leq j \leq W ), Square (i, j) is described by a character a_{i, j} . If a_{i, j} is .... | 38,371 |
Score : 1600 points Problem Statement Snuke found a random number generator. It generates an integer between 0 and 2^N-1 (inclusive). An integer sequence A_0, A_1, \cdots, A_{2^N-1} represents the probability that each of these integers is generated. The integer i ( 0 \leq i \leq 2^N-1 ) is generated with probability A... | 38,373 |
Score : 1000 points Problem Statement For an n \times n grid, let (r, c) denote the square at the (r+1) -th row from the top and the (c+1) -th column from the left. A good coloring of this grid using K colors is a coloring that satisfies the following: Each square is painted in one of the K colors. Each of the K colors... | 38,374 |
Score : 400 points Problem Statement You are going out for a walk, when you suddenly encounter a monster. Fortunately, you have N katana (swords), Katana 1 , Katana 2 , ⊠, Katana N , and can perform the following two kinds of attacks in any order: Wield one of the katana you have. When you wield Katana i (1 †i †N) ,... | 38,375 |
Score : 200 points Problem Statement Takahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer K such that Takahashi will be at the starting position again after he does the following action K times: Go one meter in the direction he is facing. Then, turn X degrees counter-clockwi... | 38,377 |
Score : 900 points Problem Statement We have a connected undirected graph with N vertices and M edges. Edge i in this graph ( 1 \leq i \leq M ) connects Vertex U_i and Vertex V_i bidirectionally. We are additionally given N integers D_1, D_2, ..., D_N . Determine whether the conditions below can be satisfied by assigni... | 38,378 |
Reverse Polish notation is a notation where every operator follows all of its operands. For example, an expression (1+2)*(5+4) in the conventional Polish notation can be represented as 1 2 + 5 4 + * in the Reverse Polish notation. One of advantages of the Reverse Polish notation is that it is parenthesis-free. Write a ... | 38,379 |
ã¹ããŒã(Stove) JOI åã®éšå±ã«ã¯ã¹ããŒããããïŒJOI åèªèº«ã¯å¯ãã«åŒ·ãã®ã§ã²ãšãã§éšå±ã«ãããšãã¯ã¹ããŒããã€ããå¿
èŠã¯ãªããïŒæ¥å®¢ããããšãã¯ã¹ããŒããã€ããå¿
èŠãããïŒ ãã®æ¥ïŒJOI åã®ããšã«ã¯ N äººã®æ¥å®¢ãããïŒ i çªç®( 1 \leq i \leq N ) ã®æ¥å®¢ã¯æå» T_i ã«å°çãïŒæå» T_i + 1 ã«éåºããïŒåæã«è€æ°äººã®æ¥å®¢ãããããšã¯ãªãïŒ JOI åã¯ä»»æã®æå»ã«ã¹ããŒããã€ãããæ¶ãããã§ããïŒãã ãïŒã¹ããŒããã€ãã床ã«ãããã1æ¬æ¶è²»ããïŒJOI åã¯ãããã K æ¬ããæã£ãŠããªãã®ã§ïŒ K åãŸã§ããã¹ããŒããã€ããããšãã§ããªãïŒäžæ¥ã®ã¯ããã«ã¹ããŒãã¯æ¶ããŠããïŒ ã¹... | 38,380 |
ããã£ã·ãš ã±ãŒãå±ãããããŸã¡ãŸã¡ãªå€§ããã®ããŒã«ã±ãŒããããããäœããŸãããããªãã¯ããã®ã±ãŒããç®±ã«äžŠã¹ãä»äºãä»»ãããŸããã ããŒã«ã±ãŒãã¯ãšãŠããããããã®ã§ãä»ã®ããŒã«ã±ãŒããäžã«ä¹ããšã€ã¶ããŠããŸããŸããã§ããããå³(a) ã®ããã«å
šãŠã®ããŒã«ã±ãŒãã¯å¿
ãç®±ã®åºé¢ã«æ¥ããŠããããã«äžŠã¹ãªããã°ãªããŸãããäžŠã¹æ¿ãããšå¿
èŠãªå¹
ãå€ãããŸãã å³(a) å³(b) n åã®ããŒã«ã±ãŒãã®ååŸ r 1 , r 2 , ..., r n ãšç®±ã®é·ããèªã¿èŸŒã¿ãããããã«ã€ããŠãç®±ã®äžã«ããŸãåãŸããã©ããå€å®ãã䞊ã¹ãé çªã工倫ãããšç®±ã«å
¥ãå Žå㯠"OK"ãã©ã䞊ã¹ãŠãå
¥ããªãå Žåã«ã¯ "NA"ãåºåããããã°ã©ã ãäœæããŠã... | 38,381 |
Problem C: Dungeon Quest II The cave, called "Mass of Darkness", had been a agitating point of the evil, but the devil king and all of his soldiers were destroyed by the hero and the peace is there now. One day, however, the hero was worrying about the rebirth of the devil king, so he decided to ask security agency to ... | 38,382 |
Draw in Straight Lines You plan to draw a black-and-white painting on a rectangular canvas. The painting will be a grid array of pixels, either black or white. You can paint black or white lines or dots on the initially white canvas. You can apply a sequence of the following two operations in any order. Painting pixels... | 38,383 |
Nathan O. Davis has been running an electronic bulletin board system named JAG-channel. He is now having hard time to add a new feature there --- threaded view. Like many other bulletin board systems, JAG-channel is thread-based. Here a thread (also called a topic) refers to a single conversation with a collection of p... | 38,384 |
Problem E: Molecular Formula Your mission in this problem is to write a computer program that manipulates molecular for- mulae in virtual chemistry . As in real chemistry, each molecular formula represents a molecule consisting of one or more atoms. However, it may not have chemical reality. The following are the defin... | 38,385 |
Problem B: å®å
šæ° ããæŽæ° N ã«å¯ŸãïŒãã®æ°èªèº«ãé€ãçŽæ°ã®åã S ãšããïŒ N = S ã®ãšã N ã¯å®å
šæ° (perfect number)ïŒ N > S ã®ãšã N ã¯äžè¶³æ° (deficient number)ïŒ N < S ã®ãšã N ã¯éå°æ° (abundant number) ãšåŒã°ããïŒ äžããããæŽæ°ãïŒå®å
šæ°ã»äžè¶³æ°ã»éå°æ°ã®ã©ãã§ãããã å€å®ããããã°ã©ã ãäœæããïŒ ããã°ã©ã ã®å®è¡æéãå¶éæéãè¶ããªãããã«æ³šæããããšïŒ Input å
¥åã¯ããŒã¿ã»ããã®äžŠã³ãããªãïŒ ããŒã¿ã»ããã®æ°ã¯ 100 以äžã§ããïŒ åããŒã¿ã»ããã¯æŽæ° N (0 < N †100000000) ã®ã¿ãå«ã... | 38,387 |
Score: 100 points Problem Statement There is a train going from Station A to Station B that costs X yen (the currency of Japan). Also, there is a bus going from Station B to Station C that costs Y yen. Joisino got a special ticket. With this ticket, she can take the bus for half the fare if she travels from Station A t... | 38,388 |
H - Rings Problem Statement There are two circles with radius 1 in 3D space. Please check two circles are connected as chained rings. Input The input is formatted as follows. {c_x}_1 {c_y}_1 {c_z}_1 {v_x}_{1,1} {v_y}_{1,1} {v_z}_{1,1} {v_x}_{1,2} {v_y}_{1,2} {v_z}_{1,2} {c_x}_2 {c_y}_2 {c_z}_2 {v_x}_{2,1} {v_y}_{2,1} {... | 38,389 |
Score : 600 points Problem Statement We have a sequence of length N consisting of non-negative integers. Consider performing the following operation on this sequence until the largest element in this sequence becomes N-1 or smaller. (The operation is the same as the one in Problem D.) Determine the largest element in t... | 38,390 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.