task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
Score : 900 points Problem Statement You are given a sequence D_1, D_2, ..., D_N of length N . The values of D_i are all distinct. Does a tree with N vertices that satisfies the following conditions exist? The vertices are numbered 1,2,..., N . The edges are numbered 1,2,..., N-1 , and Edge i connects Vertex u_i and v_... | 37,853 |
Problem E. Magic Triangles Fallen angel Yohane plans to draw a magic symbol composed of triangles on the earth. By casting some magic spell on the symbol, she will obtain magic power; this is the purpose for which she will draw a magic symbol. The magic power yielded from the magic symbol is determined only by the comm... | 37,854 |
åžïŒ å¹³é¢äžã®ç°ãªã 4 ç¹ $A (x_a, y_a)$, $B (x_b, y_b)$, $C (x_c, y_c)$, $D(x_d, y_d)$ ã®åº§æšãèªã¿èŸŒãã§ãããã 4 ç¹ãé ç¹ãšããåè§åœ¢ $ABCD$ ã«å¹ã¿ããªããã° YESãå¹ã¿ãããã° NO ãšåºåããããã°ã©ã ãäœæããŠãã ããã å¹ã¿ã®ããåè§åœ¢ãšã¯å³ 1 ã®ãããªåè§åœ¢ã§ãã Input è€æ°ã®ããŒã¿ã»ãããäžããããŸããåããŒã¿ã»ããã®åœ¢åŒã¯ä»¥äžã®ãšããã§ãã $x_a$,$y_a$,$x_b$,$y_b$,$x_c$,$y_c$,$x_d$,$y_d$ $x_a$, $y_a$, $x_b$, $y_b$, $x_c$, $y_c$, $x_d$,... | 37,855 |
Multi-Set For a set $S$ of integers, perform a sequence of the following operations. Note that multiple elements can have equivalent values in $S$ . insert($x$): Insert $x$ to $S$ and report the number of elements in $S$ after the operation. find($x$): Report the number of $x$ in $S$. delete($x$): Delete all $x$ from $... | 37,856 |
èªèšŒã¬ãã« åé¡ ããªã㯠Just Odd Inventions 瀟ãç¥ã£ãŠããã ããã? ãã®äŒç€Ÿã®æ¥åã¯ããã å¥åŠãªçºæ (just odd inventions)ããããããšã§ãã.ããã§ã¯ç¥ã㊠JOI 瀟ãšåŒã¶. JOI 瀟ã«ã¯ 2 ã€ã®äºåæããã,ããããåã倧ããã®æ£æ¹åœ¢ã®éšå±ããã¹ç®ç¶ã«äžŠãã§ã§ããŠãã.èŸºã§æ¥ããŠãããã¹ãŠã®éšå±ã®éã«,身å蚌ã«ããèªèšŒæ©èœã®ä»ããæããã.JOI 瀟ã§ã¯æ§ã
ãªã¬ãã«ã®æ©å¯æ
å ±ãæ±ã£ãŠãããã,éšå±ããšã«æ©å¯ã¬ãã«ãšããæ£ã®æŽæ°ãèšå®ãããŠãã,身å蚌ã®äºåæããšã«å®ããããéè² æŽæ°ã®èªèšŒã¬ãã«ã,æ©å¯ã¬ãã«ä»¥äžã§ãªããšãã®éšå±ã«å
¥å®€ããããšãã§ããªã.åäºåæã®åºå
¥ãå£ã¯å¯äžã... | 37,857 |
Tree Separator You are given a tree $T$ and an integer $K$. You can choose arbitrary distinct two vertices $u$ and $v$ on $T$. Let $P$ be the simple path between $u$ and $v$. Then, remove vertices in $P$, and edges such that one or both of its end vertices is in $P$ from $T$. Your task is to choose $u$ and $v$ to maxim... | 37,858 |
Problem D: Dimensional Analysis éã®æ¬¡å
ãšã¯ãçžç°ãªãéã®éã®é¢ä¿åŒããå
·äœçæ°å€ãç¡èŠããŠéã®çš®é¡ãšãã®ã¹ãä¹ã ãã«çç®ããæŠå¿µã§ãããå
·äœçã«ã¯å®æ°ä¿æ°ãç¡èŠããçåŒãšããŠã次å
ã®é¢ä¿åŒã衚ããããªãã¡ãé q ã®æ¬¡å
ã[ q ]ãšè¡šãã°ã以äžã®ãããªããã€ãã®æ¬¡å
ã®é¢ä¿åŒãäŸç€ºã§ããã [é¢ç©] = [é·ã] 2 [äœç©] = [é·ã] 3 [éã] = [é·ã][æé] -1 [å é床] = [é·ã][æé] -2 [å] = [質é][é·ã][æé] -2 [ä»äº] = [質é][é·ã] 2 [æé] -2 (Wikipedia ãéãããæç² URL http://ja.wikipedia... | 37,859 |
Design of a Mansion Our master carpenter is designing a condominium called Bange Hills Mansion. The condominium is constructed by stacking up floors of the same height. The height of each floor is designed so that the total height of the stacked floors coincides with the predetermined height of the condominium. The hei... | 37,860 |
åã€åçŽ æ° ( a, a+2, a+6, a+8 ) ã®ããã«äžŠãã 4 ã€ã®çŽ æ°ã®çµãåã€åçŽ æ°ãšãããŸããåã€åçŽ æ°ãæ§æããåã€ã®çŽ æ°ã®ãã¡ãæå€§ã®æ°ããã®åã€åçŽ æ°ã®å€§ãããšåŒã³ãŸããäŸãã°ãæãå°ãã倧ããã®åã€åçŽ æ°ã¯ã(5, 7, 11, 13) ã®çµã§ããããã®å€§ãã㯠13 ã§ããæ¬¡ã«å€§ããåã€åçŽ æ°ã¯ã(11, 13, 17, 19) ã®çµã§ããã®å€§ãã㯠19 ã§ãã æŽæ° n (13 †n †10,000,000) ãå
¥åãšãã倧ããã n 以äžã«ãªããããªåã€åçŽ æ°ã®ãã¡ãæå€§ãšãªããã®ã®å€§ãããåºåããããã°ã©ã ãäœæããŠãã ããã Input è€æ°ã®ããŒã¿ã»ããã®äžŠã³ãå
¥åãšããŠäžããããŸããå
¥åã®... | 37,861 |
Rubik Dungeon Problem ããªã㯠n à n à n ã®ç«æ¹äœã®ã«ãŒããã¯ãã¥ãŒãåã®ãã³ãžã§ã³ã«ãã£ãŠããã ããªãã¯çŸåš( x 1 , y 1 , z 1 )ã®éšå±ã«ããã ç®æšã®å®ã¯( x 2 , y 2 , z 2 )ã®éšå±ã«ããã ããªãã¯é£æ¥ããŠããååŸå·Šå³äžäžã®éšå±ã«åäœæéã§ç§»åããããšãã§ããã åéšå±ã«ã¯6ã€ã®ãã¿ã³ããããããããã®ãã¿ã³ãæŒãããšã«ãããåäœæéã§ãã«ãŒããã¯ãã¥ãŒãã®ããã«ä»¥äžã®æäœãè¡ãããšãã§ããïŒ çŸåšããéšå±ãš x 座æšã®å€ãåãå
šãŠã®éšå±ãæèšãŸãã¯åæèšåšãã«90床å転ããããšãã§ãã çŸåšããéšå±ãš y 座æšã®å€ãåãå
šãŠã®éšå±ãæèšãŸãã¯åæèšåšãã«90床... | 37,862 |
Problem I: Train King Roland has been given a mission of dangerous material transfer by Train King. The material is stored in the station A and subject to being transferred to the station B. He will bring it by direct trains between A and B, one (or zero) unit per ride. Your task is to write a program to find out the m... | 37,863 |
å顿 人éã®é女 KLARISSA ã¯ã³ã³ãµãŒãããŒã«ã®äžã§åšããæ¥ã®æåã倢èŠã€ã¥ããŠããïŒåœŒå¥³ã®éåœã®è»èŒªã¯å
·çŸåãïŒã³ã³ãµãŒãããŒã«ã®äžã§è»¢ããç¶ããŠããïŒ äœåæå ã¯ãã®éåœã®è»èŒªãåã§ã¯ãªãã«ã©ãã«ãªæ£æ¹åœ¢ã§ããããšã«æ°ãã€ããïŒéåœã®è»èŒªã¯ã³ã³ãµãŒãããŒã«ã®è¥¿ããæ±ãžè»¢ããããšããŠããïŒ äœåæå ã¯éåœã®è»èŒªãããæãŸã§è»¢ãã£ããšãã«ãã®äžã«é£ã³ç§»ãããšã«ããïŒããã§é£ã³ç§»ãã¹ãé¢ã®è²ãç¥ãïŒé£ã³ç§»ãã¿ã€ãã³ã°ãèŠèšããããïŒ ããã§ã¯è»èŒªã 2 次å
å¹³é¢ã«ããã 1 蟺ã®é·ãã 1 ã®æ£æ¹åœ¢ãšèŠãªãïŒè¥¿ããæ±ãžåããæ¹åã x è»žã®æ£åãïŒéçŽäžæ¹åã y è»žã®æ£åããšããïŒ ä»ïŒéåœã®è»èŒªã®äžé¢ãåºã«å¯ŸããŠæ¥å°... | 37,864 |
Amida, the City of Miracle å¥è·¡ã®éœåžã¢ããïŒAmida, the City of MiracleïŒã®åžé·ã¯ä»ã®åžã®ããã«éžæã§éžã¶ã®ã§ã¯ãªãïŒãã€ãŠé·ãæ¿æš©éäºãšå€©å€å°ç°ã«ããç²åŒãããã®éœåžã¯ïŒåè£è
å
šå¡ãå
¬å¹³ã«éžã³ïŒãã€å¹žéã®æã®äžã«çãŸããè
ãåžé·ã«ããããã«ïŒåè£è
å
šå¡ã®éåœãããã«ãã ããããšã«ããã®ã§ããïŒåŸã«ãã¿ã ãããšåŒã°ããããã§ããïŒ éžæã¯ä»¥äžã®ããã«è¡ãããïŒåè£è
æ°ãšåæ°ã®é·ã瞊ç·ãåŒããïŒããã«ããã€ãã®æšªç·ãããã«åŒãããïŒæšªç·ã¯é£æ¥ãã瞊ç·ã®éäžå士ãçµã¶ããã«åŒãããïŒããããã®çžŠç·ã®äžã«ã¯ãåœéžããšæžãããŠããïŒã©ã®çžŠç·ãåœéžã§ãããã¯åè£è
ããããããªãããã«é ããã... | 37,865 |
Problem F: Exciting Bicycle You happened to get a special bicycle. You can run with it incredibly fast because it has a turbo engine. You can't wait to try it off road to enjoy the power. You planned to go straight. The ground is very rough with ups and downs, and can be seen as a series of slopes (line segments) when ... | 37,866 |
Problem H: Laser Cutter Ciel is going to do woodworking. Ciel wants to make a cut in a wooden board using a laser cutter. To make it simple, we assume that the board is a two-dimensional plane. There are several segments on the board along which Ciel wants to cut the board. Each segment has a direction and Ciel must cu... | 37,868 |
Problem D: Twirling Robot Let's play a game using a robot on a rectangular board covered with a square mesh (Figure D-1). The robot is initially set at the start square in the northwest corner facing the east direction. The goal of this game is to lead the robot to the goal square in the southeast corner. Figure D-1: E... | 37,869 |
Three Meals You are running a restaurant that serves dishes only three times a day. Each of your customer has his/her own separate time zones for eating breakfast, lunch and supper. Thus, your customer enjoys your dish only when he/she visits your restaurant to meet your serving time settings. Your wish is to modify yo... | 37,870 |
Score : 1600 points Problem Statement Let X = 10^{100} . Inaba has N checker pieces on the number line, where the i -th checker piece is at coordinate X^{i} for all 1 \leq i \leq N . Every second, Inaba chooses two checker pieces, A and B , and move A to the symmetric point of its current position with respect to B . A... | 37,871 |
Score : 200 points Problem Statement There are N apple trees in a row. People say that one of them will bear golden apples. We want to deploy some number of inspectors so that each of these trees will be inspected. Each inspector will be deployed under one of the trees. For convenience, we will assign numbers from 1 th... | 37,873 |
Score : 600 points Problem Statement There are N blocks arranged in a row, numbered 1 to N from left to right. Each block has a weight, and the weight of Block i is A_i . Snuke will perform the following operation on these blocks N times: Choose one block that is still not removed, and remove it. The cost of this opera... | 37,874 |
Score : 700 points Problem Statement Limak can repeatedly remove one of the first two characters of a string, for example abcxyx \rightarrow acxyx \rightarrow cxyx \rightarrow cyx . You are given N different strings S_1, S_2, \ldots, S_N . Among N \cdot (N-1) / 2 pairs (S_i, S_j) , in how many pairs could Limak obtain ... | 37,875 |
Problem Statement You have a grid with $H$ rows and $W$ columns. Each cell contains one of the following 11 characters: an addition operator + , a multiplication operator * , or a digit between $1$ and $9$. There are paths from the top-left cell to the bottom-right cell by moving right or down $H+W-2$ times. Let us def... | 37,876 |
Bit Operation I Given a non-negative decimal integer $x$, convert it to binary representation $b$ of 32 bits. Then, print the result of the following operations to $b$ respecitvely. Inversion: change the state of each bit to the opposite state Logical left shift: shift left by 1 Logical right shift: shift right by 1 In... | 37,877 |
Problem M: Manhattan Bomb Problem 2次å
å¹³é¢äžã«$n$åã®ç匟ããããç匟ã«ã¯ãããã1ãã$n$ãŸã§ã®çªå·ãå²ãæ¯ãããŠããã$i$çªç®ã®ç匟ã¯åº§æš$(x_i,y_i)$ã«ååšããŠããã ãªããã©ã®ç匟ãåç¹ããã®ãã³ããã¿ã³è·é¢ãçããããšãåãã£ãŠããã $i$çªç®ã®ç匟ãççºãããšãã座æš$(x_i,y_i)$ããã®ãã³ããã¿ã³è·é¢ã$r_i$以å
ã®åº§æšã«ååšããŠããç匟ãé£éçã«ççºããã $n$åã®ç匟ããããã«ã€ããŠããã®ç匟ã®ã¿ã«çç«ããå Žåã«ãççºããã«æ®ãç匟ã®åæ°ãæ±ããã Input $n$ $x_1$ $y_1$ $r_1$ $x_2$ $y_2$ $r_2$ ... $x... | 37,878 |
Score : 100 points Problem Statement You are given a string of length N . Calculate the number of distinct substrings of S . Constraints 1 \leq N \leq 500,000 S consists of lowercase English letters. Input Input is given from Standard Input in the following format: S Output Print the answer. Sample Input 1 abcbcba Samp... | 37,879 |
Score : 1400 points Problem Statement There is a tree with N vertices numbered 1 through N . The i -th of the N-1 edges connects vertices a_i and b_i . Initially, each edge is painted blue. Takahashi will convert this blue tree into a red tree, by performing the following operation N-1 times: Select a simple path that ... | 37,880 |
Score : 100 points Problem Statement Given are three integers A_1 , A_2 , and A_3 . If A_1+A_2+A_3 is greater than or equal to 22 , print bust ; otherwise, print win . Constraints 1 \leq A_i \leq 13 \ \ (i=1,2,3) All values in input are integers. Input Input is given from Standard Input in the following format: A_1 A_2... | 37,881 |
Problem F: Young, Poor and Busy Ken and Keiko are young, poor and busy. Short explanation: they are students, and ridden with part-time jobs. To make things worse, Ken lives in Hakodate and Keiko in Tokyo. They want to meet, but since they have neither time nor money, they have to go back to their respective jobs immed... | 37,882 |
Score : 100 points Problem Statement There are a total of A + B cats and dogs. Among them, A are known to be cats, but the remaining B are not known to be either cats or dogs. Determine if it is possible that there are exactly X cats among these A + B animals. Constraints 1 \leq A \leq 100 1 \leq B \leq 100 1 \leq X \l... | 37,883 |
Sunny Graph The Sun is a great heavenly body. The Sun is worshiped by various religions. Bob loves the Sun and loves any object that is similar to the Sun. He noticed that he can find the shape of the Sun in certain graphs. He calls such graphs "Sunny". We define the property "Sunny" mathematically. A graph G=(V,E) wit... | 37,885 |
Score : 800 points Problem Statement There are N squares arranged in a row, numbered 1 to N from left to right. Takahashi will stack building blocks on these squares, on which there are no blocks yet. He wants to stack blocks on the squares evenly, so he will repeat the following operation until there are H blocks on e... | 37,886 |
Problem H: Yu-kun Likes a Directed Graph Background äŒæŽ¥å€§åŠä»å±å¹Œçšåã¯ããã°ã©ãã³ã°ã倧奜ããªåäŸãéãŸã幌çšåã§ãããåå
ã®äžäººã§ããããåã¯ãããã°ã©ãã³ã°ãšåãããããçµµæãã倧奜ãã ã ãããŸã§ããåã¯ãäžžãšç¢å°ã§æ²¢å±±çµµãæžããŠãããç¢å°ã¯å¿
ãäžžãšäžžãçµã¶ããã«ããŠæããŠãããããæ¥ããåã¯ãããã®çµµãã°ã©ãã§ããããšãç¥ãã äžžã¯é ç¹ãšåŒã°ããç¢å°ã¯èŸºãšåŒã°ããŠããããããæŽã«ããåã¯ãç¢å°ãæãéã«ãå¿
ããã®äžã«ïŒã€æ£ã®æŽæ°ãæžããŠããããã®ããã«ã蟺ã«éã¿ãããæåãªèŸºãããªãã°ã©ãã¯éã¿ä»ãæåã°ã©ããšåŒã°ããã 仿¥ããåã¯ãæ°ãã«éè·¯ãšããèšèãç¥ã£ããéè·¯ãš... | 37,887 |
åäž»ãããã®çµæ« çŸäººäžéŠã®æã䜿ã£ã鿝ã®ïŒã€ã«ããåäž»ãããããšãããã®ããããŸããçµµæã ãã䜿ãç°¡åãªéæ¯ãªã®ã§åºã楜ããŸããŠããŸããããŸãã«ã¯æ§ã
ãªæŽŸçåããããŸãããããã§èããåäž»ãããã¯N人ã®åå è
ã§ã以äžã®ãããªã«ãŒã«ã§è¡ããŸãã ïŒïŒæã®ãç·ããïŒïŒæã®ãåäž»ããïŒïŒæã®ãå§«ããèšïŒïŒïŒæã®æã䜿ãã çµµãèŠããªãããã«æãè£ãããã«ããŠããæ··ãããæå±±ããã€ããã åå è
ã®äžäººç®ããé çªã«ïŒæãã€æå±±ã®æãåŒããN人ç®ã®æ¬¡ã¯ããŸãäžäººç®ããç¹°ãè¿ãã åŒããæãç·ãªããåŒãã人ã¯ãã®æãæã«å
¥ããã åŒããæãåäž»ãªããåŒãã人ã¯ãã®æãå«ããæã£ãŠããæããã¹ãŠãå Žãã«åºãã åŒããæãå§«ãªããåŒãã人ã¯ãã®æ... | 37,888 |
String Search Find places where a string P is found within a text T . Print all indices of T where P found. The indices of T start with 0. Input In the first line, a text T is given. In the second line, a string P is given. Output Print an index of T where P found in a line. Print the indices in ascending order. Constr... | 37,889 |
G: Cryptex åé¡ AORã€ã«ã¡ããã¯èªåã®å®ç®±ã«ãã€ã€ã«åŒã®éµããããŠããã éµã«ã¯ $N$ åã®ã·ãªã³ããŒãã€ããŠããã ãããããèšå®ããŠããã $N$ åã®æ°ã®äžŠã³ãããªãæèšŒçªå· $T$ ãšãã·ãªã³ããŒãç€ºãæ°åãåãã§ããã°éé ããããšãã§ããã ã·ãªã³ããŒã«ã¯ã $0$ ãã $M-1$ ãŸã§ã® $M$ çš®é¡ã®æ°ãåãåãã«é ã«å»ãŸããŠãããæåã¯ãã¹ãŠã®ã·ãªã³ããŒã $0$ ã瀺ããŠããã éµã¯ç¹å¥è£œã§ãããã·ãªã³ããŒãäžã€ãã€åãããšãã§ããªããä»»æã®ã·ãªã³ããŒãäºã€éžã³ãããããåæã«åãããªããã°ãªããªãã äžåã·ãªã³ããŒãåããšã¯ã以äžã®ããã«å®çŸ©ãããã ã·ãªã³ããŒãäºã€éžã¶ããã ããåãã·ãªã³ããŒ... | 37,890 |
Problem E: Frisbee Dogs ã¯ã¬ã€ã³ã¯, åœŒå¥³ã®æç¬ã§ãã Jack ãããªã¹ããŒããã°å€§äŒã«åºå ŽãããããšããŠãã. ããã, 圌女㯠Jack ãããæçžŸãåãããèªä¿¡ãç¡ã. 圌女ã®ããã«, 倧äŒãã·ãã¥ã¬ãŒãã㊠Jack ã®æçžŸãèŠç©ããããã°ã©ã ãäœæããŠã»ãã. ãã®å€§äŒã¯, 2次å
å¹³é¢äžã«ãã N å¹ã®ç¬ã«ãã£ãŠè¡ããã. 倧äŒã®éå§æç¹ã«ãããŠ, i çªç®ã®ç¬ã¯ ( D i x , D i y ) ã®äœçœ®ã«ãã. i çªç®ã®ç¬ã¯ V i [m/s] ã§èµ°ãããšãã§ã, å
šãŠã®ç¬ã¯ååå°ããã®ã§ç¹ãšã¿ãªãã. ããæå»ã«, 2 å¹ä»¥äžã®ç¬ãåãäœçœ®ã«ããŠãæ§ããªã. 1æç®ã®ããªã¹ããŒã®çºå°ããã£... | 37,891 |
Problem Statement AtCoder currently hosts three types of contests: ABC, ARC, and AGC. As the number of users has grown, in order to meet the needs of more users, AtCoder has decided to increase the number of contests to 26 types, from AAC to AZC. For convenience, we number these 26 types as type 1 through type 26. AtCo... | 37,892 |
ã¯ãŒã ã³ã³ãã¥ãŒã¿ã§æ±ãããããŒã¿ã®æå°åäœãããã(bit)ãšåŒã³ãè€æ°ã®ãããããŸãšããŠè¡šããæ
å ±éãã¯ãŒã(word)ãšåŒã³ãŸããçŸåšãå€ãã®ã³ã³ãã¥ãŒã¿ã§ã¯ïŒã¯ãŒããïŒïŒããããšããŠåŠçããŠããŸãã ïŒã¯ãŒããïŒïŒãããã§è¡šãã³ã³ãã¥ãŒã¿ã«ã€ããŠãã¯ãŒãåäœã§äžããããããŒã¿é W ããããåäœã§åºåããããã°ã©ã ãäœæããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã W å
¥åã¯ïŒè¡ãããªããããŒã¿é W (0 †W †100) ãäžããããã Output ãããåäœã®å€ãïŒè¡ã«åºåããã Sample Input 1 4 Sample Output 1 128 Sample Input 2 3 Sample Ou... | 37,893 |
A: ãã€ãã³ã㌠- My Number - åé¡ ãã£ããªãŒãïŒé
å»é
å»ïŒ ãã£ïŒç§ã仿¥ããæ§ãã®ãã®äŒç€Ÿã§åãããšã«ãªã£ããã ïŒ ãããªã®ã«ã忥ããå¯åã ãªããŠâŠïŒïŒ 仿¥ã¯äŒç€Ÿã«ãã€ãã³ããŒãæããªããã°ãªããªã倧åãªæ¥ãªã®ã«âŠïŒ ã¿ããªç¥ã£ãŠãããšæãããã©ãäžå¿ãã€ãã³ããŒã®èª¬æããããïŒ ãã€ãã³ããŒã¯è¡æ¿æç¶ãã«ãããå人ãèå¥ããããã«çšãããã 12 æ¡ãããªãæ°åå ( P_{11} P_{10} P_{9} ... P_{1} P_{0} ) ã§ããã æ«å°Ÿã® P_{0} ã¯ãã§ãã¯ãã£ãžãããšåŒã°ãã ç·åç什第å
«åäºå·ç¬¬äºç« ã«å®ããããŠããããã«ã次åŒã§å®çŸ©ãããã 11 â ( ({\rm Σ}_... | 37,894 |
Millennium A wise king declared a new calendar. "Tomorrow shall be the first day of the calendar, that is, the day 1 of the month 1 of the year 1. Each year consists of 10 months, from month 1 through month 10, and starts from a big month . A common year shall start with a big month, followed by small months and big mo... | 37,895 |
B - ç°¡æãªã»ã å顿 Båã¯ãªã»ãã倧奜ãã§ãã (ãªã»ãã®ã«ãŒã«ã«ã€ããŠã¯ Wikipediaã®ãªã»ãã®ããŒãž ãåç
§ããïŒããã¹ãã«ã€ããŠã Wikipedia ã«æžãããŠãããšããïŒé§ãæã€ããšãã§ããªãå Žåã®ã¿ãã¹ã§ãããã®ãšãïŒãã¹ã®åæ°ã«å¶éã¯ç¡ããã®ãšããïŒ) Båã¯é§ã®åæé
眮ã«ãã£ãŠã²ãŒã ã®çµæãã©ã®ããã«å€ããã®ãã«èå³ãããïŒ ããããããªã 2 次å
ã®ç€é¢ã§èããã®ã¯é£ããã®ã§ïŒã²ãšãŸã㯠1 次å
ã®ç€é¢ã§èããããšã«ããïŒ ããªãã¡ïŒãã®åé¡ã§ã¯ç€é¢ã¯çžŠå¹
1ïŒæšªå¹
ç¡éã®ãã¹ç®ã§ãããšèŠãªãïŒ ãŸãïŒãªã»ãã®é§ã¯ã¢ã«ãã¡ãããå°æåã® o ãš x ã«ãã£ãŠè¡šãããšã«ããïŒ Båã¯ãã®ç€é¢äžã®ãªã»ãã®å... | 37,896 |
Problem A: Everlasting...? Everlasting Sa-Ga, a new, hot and very popular role-playing game, is out on October 19, 2008. Fans have been looking forward to a new title of Everlasting Sa-Ga. Little Jimmy is in trouble. He is a seven-year-old boy, and he obtained the Everlasting Sa-Ga and is attempting to reach the end of... | 37,897 |
Multiplication of Big Integers Given two integers $A$ and $B$, compute the product, $A \times B$. Input Two integers $A$ and $B$ separated by a space character are given in a line. Output Print the product in a line. Constraints $-1 \times 10^{1000} \leq A, B \leq 10^{1000}$ Sample Input 1 5 8 Sample Output 1 40 Sample... | 37,898 |
è¹æ
åé¡ JOIåœã«ã¯ïŒn å³¶ã®å³¶ãããïŒåå³¶ã«ã¯ 1 ãã n ãŸã§ã®çªå·ãä»ããããŠããïŒçŸåšïŒJOIåœã§ã¯åå³¶ã®éãçµã¶èªè·¯ç¶²ã®æŽåãé²ãã§ããïŒ ããªãã¯ïŒè¹è¶ã®åç¬Šãæ±ã£ãŠãããã±ããã»ã³ã¿ãŒã«å€åããŠããïŒJOIåœã«ã¯è¹è¶ã䜿ã£ãŠïŒã§ããéãå®äŸ¡ã«ïŒå³¶ãšå³¶ã®éãæ
è¡ããããšèããŠããäººãæ²¢å±±ããïŒåœŒãã¯ïŒåºçºå°ãšç®çå°ã泚æç¥šã«èšå
¥ããŠïŒããªãã®ãšããã«éã£ãŠããïŒ ããªãã®ä»äºã¯ïŒå®¢ããæ³šæç¥šãåãåã£ããããã«ïŒããã€ãã®è¹è¶ãä¹ãç¶ãã§ïŒåºçºå°ãšç®çå°ãçµã¶èªè·¯ã®äžã§ïŒãã£ãšãå®äŸ¡ãªéè³ãèšç®ãïŒå®¢ã«äŒããããšã§ããïŒ ãã ãïŒæ
çšã«ãã£ãŠã¯ïŒè¹è¶ã䜿ã£ãŠæ
è¡ããããšãåºæ¥ãªãå ŽåãããïŒãã®ãšãã¯ãè¹è¶ã䜿ã£ãŠ... | 37,899 |
J: éœ (City) ãµã³ã¿ã¯ããéœã«ãã¬ãŒã³ããå±ããããšã«ããã ãã®éœã¯åå $H$ åºç» à æ±è¥¿ $W$ åºç»ã«åããããé·æ¹åœ¢ã®åœ¢ãããŠãããååºç»ã«ãã¬ãŒã³ããå±ããå®¶ã 1 ã€ãã€ããã åããæ°ã㊠$X$ çªç®ã西ããæ°ã㊠$Y$ çªç®ã®åºç»ã $(X, Y)$ ã§è¡šãã ãµã³ã¿ã¯æ¬¡ã®æ¡ä»¶ã§ç§»åããã ã¯ããã«åºç» $(S, T)$ ã«éãããã®å Žæããã¹ã¿ãŒãããã 1 åã®ç§»åã§æ±è¥¿ååã«é£ãåãåºç»ã«ç§»åã§ããè¡ã®å€ã«ã¯ç§»åã§ããªãã 1 床蚪ããåºç»ã«ã¯ã2 床ãšå
¥ããªãã ãµã³ã¿ãéœã«ãããã¹ãŠã®å®¶ã蚪ããããšãã§ãããå€å®ããã å
¥å $H, W, S, T$ã空çœåºåãã§äžããããã åºå ãµã³... | 37,900 |
Factorial Write a program which reads an integer n and prints the factorial of n . You can assume that n †20. Input An integer n (1 †n †20) in a line. Output Print the factorial of n in a line. Sample Input 5 Output for the Sample Input 120 | 37,901 |
Problem I: Memory Match Memory match is a single-player game which employs a set of 2 M cards. Each card is labeled with a number between 1 and M on its face. For each number i (1 †i †M ), there are exactly two cards which have the number i . At the start of the game, all cards are shuffled and laid face down on a ta... | 37,902 |
Score : 200 points Problem Statement There is a square in the xy -plane. The coordinates of its four vertices are (x_1,y_1),(x_2,y_2),(x_3,y_3) and (x_4,y_4) in counter-clockwise order. (Assume that the positive x -axis points right, and the positive y -axis points up.) Takahashi remembers (x_1,y_1) and (x_2,y_2) , but... | 37,903 |
1 Problem Statement é·ã n ã®ãããåãããïŒ å·Šãã i çªç®ã®ãããã1ã®ãšãïŒã¹ã³ã¢ã a_i ç¹åŸãããïŒ å·Šãã i çªç®ã®ããããäžå¿ã«è·é¢ w 以å
ã«ãã1ã®åæ°( =|\{j \in \{1,...,n\}â©\{i-w,...,i+w\} | å·Šãã j çªç®ã®ãããã1\}| )ã奿°ã®ãšãïŒã¹ã³ã¢ã b_i ç¹åŸãããïŒ ã¹ã³ã¢ãæãå€ãåŸããããããªãããåãæ±ããïŒ Input å
¥åã¯ä»¥äžã®åœ¢åŒã«åŸãïŒäžããããæ°ã¯å
šãп޿°ã§ããïŒ n w a_1 ... a_n b_1 ... b_n Constraints 1âŠnâŠ1,000 1âŠwâŠ1,000 0âŠa_iâŠ10^5 0âŠb_iâŠ1... | 37,904 |
Score : 100 points Problem Statement In K-city , there are n streets running east-west, and m streets running north-south. Each street running east-west and each street running north-south cross each other. We will call the smallest area that is surrounded by four streets a block. How many blocks there are in K-city? C... | 37,905 |
Score : 200 points Problem Statement Today is August 24 , one of the five Product Days in a year. A date m - d ( m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day and d_1 is the ones digit of t... | 37,906 |
Score : 1000 points Problem Statement Snuke arranged N colorful balls in a row. The i -th ball from the left has color c_i and weight w_i . He can rearrange the balls by performing the following two operations any number of times, in any order: Operation 1 : Select two balls with the same color. If the total weight of ... | 37,908 |
Score : 400 points Problem Statement There is a knight - the chess piece - at the origin (0, 0) of a two-dimensional grid. When the knight is at the square (i, j) , it can be moved to either (i+1,j+2) or (i+2, j+1) . In how many ways can the knight reach the square (X, Y) ? Find the number of ways modulo 10^9 + 7 . Con... | 37,909 |
Problem M: 1333 Problem é·ã$N$ã®æåå$S$ãäžããããã 以äžã®ã¯ãšãªã$Q$ååŠçããã ã¯ãšãª $S[L: R]$ã$S$ã®$L$æåç®ãã$R$æåç®ãŸã§ïŒäž¡ç«¯ãå«ãïŒãããªãæååãšããã $ S[L: R] $ãé©åœãªæåå$A,B,C,X$ãçšããŠ$AXBXCX(1 \leq |A|,|B|,|C|,|X|)$ ãšè¡šãããšãèãããã®ãããª$X$ã®äžã§æé·ã®ãã®ã®é·ããåºåããã ãã ãããã®ãããª$X$ãååšããªãå Žåã¯ä»£ããã«0ãåºåããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã $N$ $Q$ $S$ $L_1$ $R_1$ $L_2$ $R_2$ $\vdots$ $L_Q$ $... | 37,910 |
Problem 07: Crop Circle ã¢ã«ãŒã³ãã³ã®åºå€§ãªèŸ²å°ã«çªåŠãã¹ããªãŒãµãŒã¯ã«ãåºæ²¡ããããã¹ããªãŒãµãŒã¯ã«ã¯éãªã£ãŠãããã®ãããã³ãšãããã®ã倧ãããã®ãå°ãããã®ãšåèš n å確èªãããã ãããã¹ããªãŒãã³ã¿ãŒã空äžãããã¹ããªãŒãµãŒã¯ã«ã®å
šäœåãæ®åœ±ããããšè©Šã¿ããšãããååã®èŒªéãã¯ã£ããããŠããªãã£ããããæ åã«ãã®çŸããæš¡æ§ãæ ãåºãããšãé£ããããšãåãã£ãã ããã§ããã®ãã¹ããªãŒãã³ã¿ãŒã¯èŒªéã«æ²¿ã£ãŠç¹æ®çŽ æã®çŽãèšçœ®ãã茪éã匷調ããææ¡ãããã çŽãèšçœ®ããéšåã¯ããããã¹ããªãŒãµãŒã¯ã«ã®ååšäžã§ãä»ã®ã©ã®ãã¹ããªãŒãµãŒã¯ã«ã«ãå«ãŸããªãéšåã§ããã æ®åœ±éã¯å¿
èŠãªçŽã®é·ããèšæž¬ããããã«... | 37,911 |
F: æšãé ãã®ãªã森ã®äž ç©èª ãæšã¯ããã§ãã å«è¶åºãã¿ãŒãã«ããŠã¹ããçµå¶ãããã³ã¡ããã¯ãæšã«äžŠã
ãªãã¬ææ
ãæã£ãŠããããªãã§ããæšã®äžåã®ããæ¹ã«å¿ãæŽããããããããããããªãã³ã¡ããã®æšãžã®ææ
ã確ããããããåãå«è¶åºã§ãã€ããããŠããã³ã³ãã¡ããã¯ãã³ã¡ããã«ããããã仿ããããšã«ããã ã³ã³ãã¡ããã¯ããã³ã¡ããã®ããã«æ£®ãçšæããŠãå«è¶åºè¿ãã«çããŠããæšãäœæ¬ã森ã®äžã«é ãããã³ã¡ããã®æšãžã®ææ
ã詊ãããšã«ãããå
·äœçã«ã¯ããã³ã¡ããã«ãé ããæšãæ£®ã®äžããèŠã€ããŠãããããšã«ãããæšããããªãæãããã³ã¡ãããªããäžåºŠèŠãããšãããæšã¯ãå¿ã®æŽããæ¹ã®éãã§ãããã®ã ããæšãç§»åããŠããŸã£ããããæš... | 37,912 |
éåã®å 以äžã®ããã«ãå³ãã 7 ãããåãå°æ°éšãç¶ã24 ãããåãæŽæ°éšã§ãäžçªå·Šã® 1 ãããåã笊å·éšãšãã 32 ããã宿°åãèãã(b 1 , ... , b 32 㯠0 ã1 ã衚ãïŒã ãã®åœ¢åŒãã人ãçè§£ãããã 10 鲿°è¡šçŸã«çŽããšãã¯ã以äžã®ããã«è§£éããã (-1) 笊å·éš à (æŽæ°éš + å°æ°éš) äžã®è¡šçŸã§ãæŽæ°éšã®å€ã¯ b 8 ïŒ 2 1 Ãb 9 ïŒ 2 2 Ãb 10 ïŒ ... ïŒ 2 23 Ãb 31 ã«ãªããäŸãã°æŽæ°éšã ã®ããã«ãªã£ãŠããå ŽåãæŽæ°éšã®å€ã¯ä»¥äžã®ããã«èšç®ãããã 1 + 2 1 + 2 3 = 1 + 2 + 8 = 11 äžæ¹ãå°æ°éšã®å€ã¯(0.5) 1 Ã... | 37,913 |
Problem D: Pump up Batteries Bill is a boss of security guards. He has pride in that his men put on wearable computers on their duty. At the same time, it is his headache that capacities of commercially available batteries are far too small to support those computers all day long. His men come back to the office to cha... | 37,914 |
Problem G: Yu-kun Likes Building Block Background äŒæŽ¥å€§åŠä»å±å¹Œçšåã¯ããã°ã©ãã³ã°ã倧奜ããªåäŸãéãŸã幌çšåã§ãããåå
ã®äžäººã§ããããåã¯ããã°ã©ãã³ã°ãšåããããé·æ¹åœ¢ã®ç©ã¿æšã倧奜ãã ã ãããªããåã¯ãæè¿ç©ã¿æšã§å±±ãäœãéã³ã«ç±äžããŠããã 仿¥ãããåã¯å±±ãäœã£ãŠéãã§ããã®ã ããæã£ãŠããç©ã¿æšã§æ²¢å±±ã®å±±ãäœãäºã¯ç°¡åãªã®ã§ã仿¥ã¯å
šãŠã®ç©ã¿æšã䜿ã£ãŠåºæ¥ãå±±ã®æ°ãæå°åããããšèããã ããã§ããåã¯ãå®éã«å
šãŠã®ç©ã¿æšã䜿ã£ãŠå±±ãäœã£ãåŸãæ¬åœã«ãã®å±±ã®æ°ãæå°ã«ãªã£ãŠããã®ãã©ããã確ãããããã«ãããã°ã©ã ãæžãäºã«ããã Problem ããåãæã£ãŠãã... | 37,915 |
å顿 ãµããã®ãã¬ã€ã€ãŒãã²ãŒã ãããŠããã以äžãã²ãŒã ã®ã«ãŒã«ã説æããã $NÃN$ ãã¹ã®ããŒãããããåãã¹ã«ã¯æ°å $X_{i,j}$ ($1 \leq i,j \leq N$)ãæžãããŠãããå
æãšåŸæã¯äº€äºã«æãéžãã§ç¹ãç©ã¿éããŠãããæåã«å
æã¯ $F$ ç¹æã£ãŠãããåŸæã¯ $0$ ç¹æã£ãŠããã $t$ ã¿ãŒã³ç®($1 \leq t \leq 2N$)ã®ãã¬ã€ã€ãŒã®è¡åã瀺ãã ãã以éèªåãšçžæãã©ã®ãããªæãéžãã ãšããŠãèªåãè² ããŠããŸãå Žåãå³åº§ã«è² ãã宣èšããŠã²ãŒã ãçµäºããã ãããŸã§ã«èªåãäžåºŠãéžãã ããšã®ãªãæ°åã $1,2,...,N$ ããäžã€éžãã§ $Y_t$ ãšããã å
æã®æçª(ã€... | 37,916 |
Problem H: Slippy Floors The princess of the Fancy Kingdom has been loved by many people for her lovely face. However the witch of the Snow World has been jealous of the princess being loved. For her jealousy, the witch has shut the princess into the Ice Tower built by the witchâs extreme magical power. As the Ice Towe... | 37,917 |
Problem E: Alice in Foxland - The world is made of foxes; people with watchful eyes will find foxes in every fragment of the world. Defoxyrenardnucleic Acids (or DNAs for short) and Renardnucleic Acids (or RNAs) are similar organic molecules contained in organisms. Each of those molecules consists of a sequence of 26 k... | 37,918 |
Code Art Online G: ã³ãŒãã¢ãŒããªã³ã©ã€ã³ ã³ãŒãã¢ãŒããªã³ã©ã€ã³ïŒCAOïŒã¯ïŒæ§ã
ãªåé¡ãããã°ã©ãã³ã°ã«ãã£ãŠè§£ãããšã«ããïŒåéºãé²ããŠè¡ããªã³ã©ã€ã³RPGã§ããïŒ CAOã¯ïŒäžçåã®ããŒãã£ã«ãªã¢ãªãã£ç©ºéãå®çŸããã²ãŒã ã§ãã£ãããšãããïŒå€§äººæ°ã®å
ã«å®å£²ãïŒã²ãŒã ã賌å
¥ãããŠãŒã¶éã¯ãã®äžçãæ¥œããã¯ãã§ãã£ãïŒ ãããïŒã²ãŒã ã«ãã€ããããã¬ã€ã€ãŒéã¯ïŒã²ãŒã ãã¹ã¿ãŒããæãã¹ãèšå®£ãèããããïŒ ãåãã¡ãã¬ã€ã€ãŒã®å
ã®èª°ããïŒã©ã¹ããã³ãžã§ã³ã®ã©ã¹ããããã¬ã ãè§£ããªãéãïŒãã®ä»®æ³ç©ºéããæãåºãããšã¯ã§ããªãïŒãããŠïŒãã®äžçã§ã®ïŒWAãTLEã»REã¯ïŒçŸå®äžçã§ã®æ»ãæå³ããïŒå¿ããŠåé¡ã«ãš... | 37,919 |
Encryption System A programmer developed a new encryption system. However, his system has an issue that two or more distinct strings are `encrypted' to the same string. We have a string encrypted by his system. To decode the original string, we want to enumerate all the candidates of the string before the encryption. Y... | 37,920 |
G: æ
è²»æ¯çµŠ - Travel Support - ç©èª ç§ïŒéŠåç©ä¹æ16æ³ïŒåŠçã¢ã€ãã«ããã£ãŠããŸãïŒïŒ åŠçã¢ã€ãã«ã®è¯ããã¿ããªã«äŒããããã®ã©ã€ããããããšïŒããããã®åŠçã¢ã€ãã«ã®äººãã¡ãåŒãã§ã¢ããã¹ã¿ãžã¢ã ã§ã©ã€ããããŸãïŒ ã ãã©ïŒé ãããæ¥ãã©ã€ãåå è
ãããŠãšã£ãŠãé»è»è³ããããã®ïŒã ããuâsã®ã¡ã³ããŒã§ãã€ããããŠïŒã©ã€ãåå è
ãã¡ã«é»è»è³ãæž¡ãããšã«ãããã ïŒãã ïŒãã€ã代ãå
¥ãã®ãé
ãããé»è»è³ãæž¡ãã®ãã©ã€ãåå è
ã®åºçºã«éã«åããªãããšããã£ããïŒãã€ã代ãè¶³ããªããŠé»è»è³ã®å
šé¡ã¯æž¡ããªãããšããããã ïŒãããªæã¯ïŒã©ã€ãåå è
ã«è¶³ããªãåã®ãéãäºåã«çšæããŠãããã®ã ãã©ïŒã©ã®ãããçšæããŠ... | 37,921 |
Score : 900 points Problem Statement There is a string S of length N consisting of characters 0 and 1 . You will perform the following operation for each i = 1, 2, ..., m : Arbitrarily permute the characters within the substring of S starting at the l_i -th character from the left and extending through the r_i -th char... | 37,922 |
ã¹ã±ãžã¥ãŒã© ããªãã¯ãŠããŒã¯ãªãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ããŠã³ãºã°ãïŒïŒãã®éçºã«åãçµãã§ãããæ§èœã決å®ä»ããã¹ã±ãžã¥ãŒã©ã®èšèšã«é ãæ©ãŸããŠãããã¹ã±ãžã¥ãŒã©ãšã¯ãå®è¡ãã¹ãåŠçãã¿ã¹ã¯ãšããåäœã§è¡šçŸããããããã©ã®é åºã§å®è¡ããããæ±ºå®ããããã°ã©ã ã§ãããã¹ã±ãžã¥ãŒã©ã¯ã¿ã¹ã¯ã«ïŒãã N ã®çªå·ãã€ããŠç®¡çãããå
šãŠã®ã¿ã¹ã¯ã¯ K åã®å±æ§ f 1 , f 2 ,..., f K ãæã¡ãå屿§ã«ã¯ããããåºæã®å€ãèšå®ãããŠããããã ããããïŒã€ã®ã¿ã¹ã¯ã«ã€ããŠã察å¿ãã屿§ã®å€ãã¹ãŠãåãã«ãªãããšã¯ãªãã ããã¿ã¹ã¯ã«ã¯ããã®ã¿ã¹ã¯ã®å®è¡ãå§ããåãŸã§ã«å®è¡ãå®äºããŠããªããã°ãªããªãã¿ã¹ã¯ãäžããããããšãããã... | 37,923 |
Score : 800 points Problem Statement There are N cards placed on a grid with H rows and W columns of squares. The i -th card has an integer A_i written on it, and it is placed on the square at the R_i -th row from the top and the C_i -th column from the left. Multiple cards may be placed on the same square. You will fi... | 37,924 |
Score : 100 points Problem Statement Snuke lives at position x on a number line. On this line, there are two stores A and B , respectively at position a and b , that offer food for delivery. Snuke decided to get food delivery from the closer of stores A and B . Find out which store is closer to Snuke's residence. Here,... | 37,925 |
Score : 1300 points Problem Statement We will call a non-negative integer increasing if, for any two adjacent digits in its decimal representation, the digit to the right is greater than or equal to the digit to the left. For example, 1558 , 11 , 3 and 0 are all increasing; 10 and 20170312 are not. Snuke has an integer... | 37,926 |
Score : 200 points Problem Statement There is a grid of squares with H horizontal rows and W vertical columns. The square at the i -th row from the top and the j -th column from the left is represented as (i, j) . Each square is black or white. The color of the square is given as an H -by- W matrix (a_{i, j}) . If a_{i... | 37,927 |
C: çŽæ°ã²ãŒã / Divisor Game åé¡ tsutaj ããã¯çŽæ°ã²ãŒã ã§éãŒããšããŠããŸãã çŽæ°ã²ãŒã ã§ã¯ããŸã 2 以äžã®èªç¶æ° N ãäžãããããã®åŸã¯ä»¥äžã®æé ã§ã²ãŒã ãé²ãã§ãããŸãã N 以å€ã® N ã®çŽæ°ã®äžãããæŽæ°ã 1 ã€å®£èšããããã ããã®ãšããæ¢ã«å®£èšããããšãããæŽæ°ã®çŽæ°ã«ãªããã®ã¯å®£èšã§ããªãã 宣èšã§ããæŽæ°ãããéããããç¹°ãè¿ãã宣èšã§ãããã®ããªããã°ã²ãŒã ã¯çµäºããã ã²ãŒã ãçµäºããããŸã§ã«è¡ããã宣èšã®åæ°ãšããŠããåŸãæ°ã®æå°å€ãšæå€§å€ãæ±ããŠãã ããã å
¥ååœ¢åŒ å
¥å㯠1 è¡ã§äžããããã N å¶çŽ 2 \leq N \leq 10^{12} åºååœ¢åŒ å®£èšåæ°ã®æå°å€... | 37,928 |
ã¢ã«ã猶ã®äžã«ãããã«ã³ (Oranges on Cans) square1001 åã¯ãããŒãã«ã«ã¢ã«ã猶ã $N$ 猶眮ããŸããã E869120 åã¯ãããŒãã«äžã®ããããã®ã¢ã«ã猶ã®äžã« $M$ åãã€ãã«ã³ãä¹ããŸããã ã¢ã«ã猶ã®äžã«ä¹ã£ãŠãããã«ã³ã¯å
šéšã§äœåãããŸããïŒ å
¥å å
¥åã¯ä»¥äžã®åœ¢åŒã§æšæºå
¥åããäžããããã $N$ $M$ åºå ã¢ã«ã猶ã®äžã«ä¹ã£ãŠãããã«ã³ã®æ°ã 1 è¡ã§åºåããŠãã ããã ãã ããæåŸã«ã¯æ¹è¡ãå
¥ããããšã å¶çŽ $1 \leq N \leq 9$ $1 \leq M \leq 9$ å
¥åã¯å
šãп޿°ã§ããã å
¥åäŸ1 3 4 åºåäŸ1 12 å
¥åäŸ2 7 7 åºåäŸ2 49 | 37,929 |
Multi-Map For a dictionary $M$ that stores elements formed by a pair of a string key and an integer value, perform a sequence of the following operations. Note that multiple elements can have equivalent keys . insert($key$, $x$): Insert an element formed by a pair of $key$ and $x$ to $M$. get($key$): Print all values w... | 37,930 |
C: åå€åœé¡ åé¡ $N$ åã®åœé¡ããã, ãããã $1, 2, \cdots,N$ ãšããååãã€ããŠãã. ãŸã, åœé¡ã«é¢ããæ
å ±ã $M$ åäžãããã. $i$ çªç®ã®æ
å ±ã¯ã$a_i$ $b_i$ããšãã圢åŒã§äžããã, ãã㯠$a_i$ ãªãã° $b_i$ ã§ããããšã衚ã.ïŒããªãã°ãã¯è«çå
å«ã§ãããæšç§»åŸãæãç«ã€ïŒ ååœé¡ $i$ ã«å¯Ÿã㊠$i$ ãšåå€ãªåœé¡ãå
šãŠæé ã«åºåãã. ãã ãåœé¡ $i$ ãšåœé¡ $i$ ã¯åžžã«åå€ã§ãã. åœé¡ $X$ ãšåœé¡ $Y$ ãåå€ãšã¯,ã$X$ ãªãã° $Y$ããã€ã$Y$ ãªãã° $X$ãã®ããšã§ãã. å¶çŽ å
¥åå€ã¯å
šãп޿°ã§ãã. $ 2 \leq N... | 37,931 |
Problem E: Manhattan Wiring There is a rectangular area containing n à m cells. Two cells are marked with "2", and another two with "3". Some cells are occupied by obstacles. You should connect the two "2"s and also the two "3"s with non-intersecting lines. Lines can run only vertically or horizontally connecting cente... | 37,932 |
Score : 600 points Problem Statement 10^9 contestants, numbered 1 to 10^9 , will compete in a competition. There will be two contests in this competition. The organizer prepared N problems, numbered 1 to N , to use in these contests. When Problem i is presented in a contest, it will be solved by all contestants from Co... | 37,933 |
Score : 1000 points Problem Statement How many infinite sequences a_1, a_2, ... consisting of { {1, ... ,n} } satisfy the following conditions? The n -th and subsequent elements are all equal. That is, if n \leq i,j , a_i = a_j . For every integer i , the a_i elements immediately following the i -th element are all equ... | 37,934 |
Score : 2400 points Problem Statement Takahashi and Aoki love calculating things, so they will play with numbers now. First, they came up with one positive integer each. Takahashi came up with X , and Aoki came up with Y . Then, they will enjoy themselves by repeating the following operation K times: Compute the bitwis... | 37,935 |
White Bird Angry Birds is a mobile game of a big craze all over the world. You were convinced that it was a waste of time to play the game, so you decided to create an automatic solver. You are describing a routine that optimizes the white bird's strategy to defeat a pig (enemy) by hitting an egg bomb. The white bird f... | 37,936 |
Problem D: One-Time Path Problem N åã®å³¶ãš M æ¬ã®æ©ãããã N åã®å³¶ã«ã¯ãããã1ãã N ãŸã§ã®çªå·ãå²ãæ¯ãããŠããã M æ¬ã®æ©ã«ããããã1ãã M ãŸã§ã®çªå·ãå²ãæ¯ãããŠããã ãã£ã¡ãåã¯çŸåš(æå»0ã®æç¹ã§)ã1çªç®ã®å³¶ã«ããã ãã£ã¡ãå㯠i çªç®ã®æ©ãå©çšããããšã«ããã a i çªç®ã®å³¶ãã b i çªç®ã®å³¶ãžãšåæ¹åã«ç§»åããããšãã§ããã ããããæå»0ã®æç¹ã§ã¯ããã¹ãŠã®æ©ã¯æœ®ãæºã¡ãŠããŠæµ·ã®äžã«æ²ãã§ããŸã£ãŠããã i çªç®ã®æ©ã¯ãæå» c i ã«ãªããšæœ®ãåŒããŠæž¡ããããã«ãªãã ãããŠãæå» c i ãéãããšãããã«ãŸãæœ®ãæºã¡ãŠ i çªç®ã®æ©ã¯åã³æ²ã... | 37,938 |
Score : 200 points Problem Statement Snuke has come to a store that sells boxes containing balls. The store sells the following three kinds of boxes: Red boxes, each containing R red balls Green boxes, each containing G green balls Blue boxes, each containing B blue balls Snuke wants to get a total of exactly N balls b... | 37,939 |
ã«ãŒãã¯ããã€ã«å
¥ããŸããïŒ(Are Cards Snacks?) square1001å㯠$N$ æã®ã«ãŒããæã£ãŠããŸãã ãããã®ã«ãŒãã«ã¯ããããæŽæ°ãæžãããŠããã$i$ æç®ã®ã«ãŒãã«æžãããŠããæŽæ°ã¯ $A_i$ ã§ãã square1001åã®ä»æ¥ã®ä¹±æ°ã¯ $K$ ã§ããsquare1001åã¯ãããã® $N$ æã®ã«ãŒãã®äžããäœæãã®ã«ãŒããéžã³ãåèšã $K$ ãšãªãããã«ãããã§ãã ãã®æ§åãèŠãŠããE869120åã¯ãããã黿¢ããããšèããŸããã å
·äœçã«ã¯ãäºåã«äœæãã®ã«ãŒããé£ã¹ãããšã§ãsquare1001 åãã©ã®ããã«æ®ãã®ã«ãŒããéžãã§ãåèšã $K$ ãšãªããªãããã«ãããã§ãã ãã... | 37,940 |
äŒæŽ¥ã®åèµé äŒæŽ¥ã«ã¯å€ãããäŒããåèµéã®äŒèª¬ããããŸããããªãã¯ãéã«åèµéãåãŸã£ãŠããå Žæãçªãæ¢ããŸãããåèµéãåãŸã£ãŠããæ·±ããæãé²ããå°å±€ã®ç¶æ
ãåãã£ãŠããã®ã§ãç¶¿å¯ã«èšç»ãç«ãŠãã°æå°è²»çšã§åèµéãŸã§å°éããããšãã§ããŸããããã§ããªãã¯ãå°å±€ã®ç¶æ
ãèªã¿åã£ãŠåèµéã®åãŸã£ãŠããæ·±ããŸã§æå°è²»çšã§å°éããã«ãŒããç®åºããããã°ã©ã ãäœæããããšã«ããŸããã å°å±€ã®ç¶æ
㯠2 次å
æ Œåç¶ã«é
眮ãããã»ã«ã§è¡šããããåã»ã«ã®äœçœ®ã¯åº§æš (x,y) ã§è¡šãããŸããå·Šäžã (1,1) ãšããx 座æšã¯å³ã«è¡ãã«ã€ããŠå€§ãããªããy 座æšã¯äžã«æ·±ããªãã«ã€ããŠå€§ãããªããã®ãšããŸããããªã㯠y 座æšã®äžçªå°ããã»ã«ã®... | 37,941 |
Score : 300 points Problem Statement Compute A \times B , truncate its fractional part, and print the result as an integer. Constraints 0 \leq A \leq 10^{15} 0 \leq B < 10 A is an integer. B is a number with two digits after the decimal point. Input Input is given from Standard Input in the following format: A B Output... | 37,942 |
Problem F: Cosmic Market Cosmic market(ã³ãºããã¯ã»ããŒã±ãã)ãéç§°ã³ãºãã±ãã¯å
šå®å®æå€§èŠæš¡ã®å人å³å£²äŒã ã ã³ãºãã±ã«ã¯ãããããžã£ã³ã«ã®å人æå¥œå®¶éãéãã è¿å¹Žãã³ãºãã±ãžã®æ¥å Žè
ã¯å¢å åŸåã«ããã æåããå
šãŠã®äººãå
¥å Žã§ãããšå€§å€æ··éããŠå±éºãªã®ã§ãéå ŽçŽåŸã¯å
¥å ŽèŠå¶ãè¡ã£ãŠããã ããäžå®äººæ°ã®äººã ããéå Žãšåæã«å
¥å Žããããšãåºæ¥ãã®ã ã ãã以å€ã®äººãã¡ã¯ãã°ããåŸ
ã£ãŠããã®å
¥å Žãšãªã£ãŠããã ãããå
çé ã«äŒå Žã«å
¥ãããšã«ãããšã培å€ã§åæ¥ãã䞊ã¶äººãåºãŠããŸãã ã³ãºãã±ã®åå è
ã«ã¯æªæå¹Žãå€ããæ²»å®äžã®åé¡ãããã®ã§å
çé ãšããæ±ºãæ¹ã¯ãšãŠãè¯ããªãã ããããçç±ãã... | 37,943 |
C: äžèŽ åé¡ é·ã $N$ ã®æ°å $a_i$ ãäžããããã æ¬¡ã®æ¡ä»¶ãæºããæŽæ° $K (1 \le K \le N)$ ãå
šãŠåºåããã æ¡ä»¶: $a_1, \cdots, a_K$ ãããŸãäžŠã³æ¿ãããš $a_{N-K+1}, \cdots, a_N$ ãšäžèŽããã å¶çŽ $1 \le N \le 10^5$ $1 \le a_i \le 10^9$ å
¥åã¯å
šãп޿° å
¥å: $N$ $a_1 \cdots a_N$ åºå: æ¡ä»¶ãæºãã $K$ ãæé ã«ç©ºçœåºåãã§åºåããããŸãæ«å°Ÿã«æ¹è¡ãåºåããã ãµã³ãã« ãµã³ãã«å
¥å 1 8 5 2 4 9 4 9 2 5 ãµã³ãã«åºå 1 1 2 4 6 7 8 ãµã³ãã«å
¥å ... | 37,944 |
Lottery Box A lottery is being held in a corner of the venue of the Aizu festival. Several types of balls are inside the lottery box and each type has its unique integer printed on the surfaces of the balls. An integer T is printed on the lottery box. In the lottery, you first declare two integers A and B , and draw up... | 37,945 |
D: éé£ åé¡ $H * W$ ã®ã°ãªããã§è¡šãããå°å³ãäžããããã åãã¹ã¯ '#' ã '.' ã§ãããåè
ã¯éžå°ã§ããããšããåŸè
ã¯æµ·ã§ããããšã瀺ããŠããã 以äžã®ããã«äžäžå·Šå³ã«é£æ¥ããŠããéžå°ã®éåãå³¶ãšåŒã¶ã ..... .###. ..##. ..#.. ..... éžå° $6$ ãã¹ã®å³¶ã ...... .##.#. ....#. ...... éžå° $2$ ãã¹ã®å³¶ã $2$ ã€ã äžããããå°å³ã¯ã以äžã®æ¡ä»¶ãæºããã å°å³ã®ç«¯ $1$ ãã¹ã¯å¿
ã '.' ã§ããã åã圢ã®å³¶ãäºã€ä»¥äžååšããããšã¯ãªãã ã€ãŸããå³¶ã«å«ãŸããéžå°ã®ãã¡ãæãäžã«ããããã®äžã§æãå·Šã«ããéžå°ãåºæºãšããéžå°ã®åº§æšéåãç... | 37,946 |
Problem F: Cleaning Robot Here, we want to solve path planning for a mobile robot cleaning a rectangular room floor with furniture. Consider the room floor paved with square tiles whose size fits the cleaning robot (1 Ã 1). There are 'clean tiles' and 'dirty tiles', and the robot can change a 'dirty tile' to a 'clean t... | 37,947 |
Modern Announce Network Today, modern teenagers use SNS to communicate with each other. In a high school, $N$ students are using an SNS called ICPC (International Community for Programming Contest). Some pairs of these $N$ students are 'friends' on this SNS, and can send messages to each other. Among these $N$ students... | 37,948 |
Enumeration nåã®æŽæ°a 1 , a 2 , âŠ, a n ãšnåã®æŽæ°p 1 , p 2 , âŠ, p n ãæŽæ°mãäžãããããkçªç®ã®æŽæ°a k ãp k [%]ã®ç¢ºçã§éžã¶ããšããæäœãåk(1 †k †n)ã«ã€ããŠè¡ãã0å以äžnå以äžã®æŽæ°ãéžã³åºãã1以äžm以äžã®æŽæ°ã®äžã§ãéžã°ããæŽæ°ã®å°ãªããšã1ã€ã§å²ãåãããã®ã®åæ°ã®æåŸ
å€ãæ±ããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã n m a 1 a 2 ⊠a n p 1 p 2 ⊠p n Constraints 1 †n †20 1 †m †10 18 1 †a k †10 18 (1 †k †n) 1 †p k †99 ... | 37,949 |
Water Pipe Construction 21XX 幎ïŒã€ãã«äººé¡ã¯ç«æãžã®ç§»äœèšç»ãéå§ãããïŒç«æãžã®ç§»äœç¬¬äžé£ã«éžæãããããªãã¯ïŒç«æè¡æ¿äžå€®å±ïŒthe Administrative Center of MarsïŒã«é
å±ããïŒç«æã§èµ·ããæ§ã
ãªåé¡ã«å¯ŸåŠããŠããïŒè¡æ¿äžå€®å±ã®ç®äžã®æå€§ã®åé¡ã¯èªç«ããéèŠäŸçµŠãµã€ã¯ã«ã®ç¢ºä¿ã§ããïŒæããã®æŽå©ç©è³ãå±ããŸã§ã«ã¯æ°ã¶æåäœã®æéããããããïŒåºæ¬çã«ã¯ç«æå
ã®éèŠã¯ç«æå
ã§è§£æ±ºããå¿
èŠãããïŒããã«å ããŠïŒåŸªç°ã·ã¹ãã ã確ç«ãããŸã§ã¯è³æºã極åç¯çŽããããšãæ±ããããïŒ è¡æ¿äžå€®å±ã¯æ¥µå°ã«ããæ°·ã®æ¡æãéå§ããïŒå€ªéœå
ã§ãããæº¶ããïŒæ°ŽãšããŠåã
ã®åºå°ã«äŸçµŠããããšãæçµ... | 37,950 |
ããŒãã¡ã³ãã®èšé² ããŒãã¡ã³ããçµãã£ãŠåªåè
ãæ±ºãŸããŸã§ãèšé²ä¿ã®ããªãã¯å¯ŸæŠã®åè
ãšæè
ãèšé²ããŸãããããªãã¯å¯ŸæŠããšã«ïŒæã®çŽã䜿ã£ãŠæ£ããèšé²ããŸããããèšé²ããçŽã®é åºãããã€ãå
¥ãæ¿ãã£ãå¯èœæ§ããããŸãã é åºãå
¥ãæ¿ãã£ãå¯èœæ§ã®ãã察æŠã®èšé²ãããããåŸã察æŠã®é çªãäœéãããããæ±ããããã°ã©ã ãäœæããããã ããããŒãã¡ã³ãã®åå è
ã«ã¯1ãã$N$ãŸã§ã®çªå·ãå²ãåœãŠãããŠãããã®ãšããã å
¥å å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã $N$ $a_1$ $b_1$ $a_2$ $b_2$ : $a_{N-1}$ $b_{N-1}$ ïŒè¡ç®ã«åºå Žè
ã®æ°$N$ ($2 \leq N \leq 1000$)ãäžãããã... | 37,951 |
Stack Stack is a container of elements that are inserted and deleted according to LIFO (Last In First Out). For $n$ stack $S_i$ ($i = 0, 1, ..., n-1$), perform a sequence of the following operations. push($t$, $x$): Insert an integer $x$ to $S_t$. top($t$): Report the value which should be deleted next from $S_t$. If $... | 37,952 |
çŽäº€å€å® å¹³é¢äžã®ç°ãªã 4 ç¹ã$A (x_A, y_A)$, $B (x_B, y_B)$, $C (x_C, y_C)$, $D (x_D, y_D)$ ã®åº§æšãèªã¿èŸŒãã§ãçŽç· $AB$ ãš $CD$ ãçŽäº€ããå Žåã«ã¯ YES ãçŽäº€ããªãå Žåã«ã¯ NO ãšåºåããããã°ã©ã ãäœæããŠãã ãããããã§ããçŽç·ããšã¯ç·åã®ããšã§ã¯ãããŸããã以äžã®å³ãåèã«ããŠäžããã Input è€æ°ã®ããŒã¿ã»ãããäžããããŸããåããŒã¿ã»ããã®åœ¢åŒã¯ä»¥äžã®ãšããã§ãã $x_A$ $y_A$ $x_B$ $y_B$ $x_C$ $y_C$ $x_D$ $y_D$ $x_A$, $y_A$, $x_B$, $y_B$, $x_C$, $y... | 37,953 |
F: ã°ãªããã®çªå· åé¡ ãã³ã¡ããã¯ã暪 n åã瞊 2 è¡ã®ã°ãªããã« 1 ãã 2 \times n ãŸã§ã®æŽæ°ãã¡ããã© 1 ã€ãã€æžã蟌ãããšããŠããŸãã ã°ãªããã®åãã¹ã«ã¯ã¡ããã© 1 ã€ã®æŽæ°ããæžã蟌ããŸããã æ®éã«æžã蟌ãã ãã§ã¯é¢çœããªãã®ã§ã以äžã®ãããªã«ãŒã«ãå®ããŸããã é£ãåã 2 ã€ã®ãã¹ã«æžã蟌ãŸããæŽæ°ã®ãå·®ã®çµ¶å¯Ÿå€ã¯ k 以äžã§ããã ãããã¹ã®å³ã«ãã¹ãååšããæããããã¹ã«æžã蟌ãŸããæŽæ°ã¯ãå³ã®ãã¹ã«æžã蟌ãŸããæŽæ°ããçã«å°ããã ãããã¹ã®äžã«ãã¹ãååšããæããããã¹ã«æžã蟌ãŸããæŽæ°ã¯ãäžã®ãã¹ã«æžã蟌ãŸããæŽæ°ããçã«å°ããã ããã§ãé£ãåã 2 ã€ã®ãã¹ãšã¯ããããã¹ãšäž... | 37,954 |
Problem D: Private Teacher You are working as a private teacher. Since you are giving lessons to many pupils, you are very busy, especially during examination seasons. This season is no exception in that regard. You know days of the week convenient for each pupil, and also know how many lessons you have to give to him ... | 37,956 |
Score : 1200 points Problem Statement We have a weighted directed graph with N vertices numbered 0 to N-1 . The graph initially has N-1 edges. The i -th edge ( 0 \leq i \leq N-2 ) is directed from Vertex i to Vertex i+1 and has a weight of 0 . Snuke will now add a new edge (i â j) for every pair i, j ( 0 \leq i,j \leq ... | 37,957 |
Problem Statement You have a billiard table. The playing area of the table is rectangular. This billiard table is special as it has no pockets, and the playing area is completely surrounded with a cushion. You succeeded in producing a ultra-precision billiards playing robot. When you put some balls on the table, the ma... | 37,959 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.