task stringlengths 0 154k | __index_level_0__ int64 0 39.2k |
|---|---|
é·æ¹åœ¢æ¢çŽ¢ 瞊㫠H è¡ã暪㫠W å䞊ã¹ããããåèš W à H ã®ãã¹ç®ããããŸããããã€ãã®ãã¹ç®ã«ã¯å°ãã€ããŠããŸããåãã¹ç®ã®å°ã®ç¶æ
ãèªã¿èŸŒã¿ãå°ã®ã€ããŠããªããã¹ç®ã ããããªãæå€§ã®é·æ¹åœ¢ã®é¢ç©ãåºåããããã°ã©ã ãäœæããŠãã ããã å
¥åããŒã¿ã¯ 1 è¡ W æåããæ§æããã H è¡ãäžããããŸããããšãã°ä»¥äžã®ãããªããŒã¿ãäžããããŸãã ..*....**. .......... **....***. ....*..... ..*....... ...**..... .*.*...... .......... ..**...... .*..*..... å
¥åããŒã¿ã®äžè¡ããäžè¡ã®ãã¹ç®ã衚çŸããŸããå
¥åããŒã¿ã®... | 38,496 |
D: Nose And Lung å顿 ããªãã¯è¬ã®æµå¯Ÿçãªãšã€ãªã¢ã³ã«ã€ããŠç ç©¶ããŠããŸãã ãšã€ãªã¢ã³ã«ã¯éŒ»ã®ç©Žã $N$ åãããèºã $1$ å以äžãããŸãã ããããèºãããã€ããããããã³ãã©ã®éŒ»ã®ç©Žãšã©ã®èºãç¹ãã£ãŠããããåãã£ãŠããŸããã ããªãã¯ãšã€ãªã¢ã³ã«é¢ããŠã以äžã®ä»®èª¬ãç«ãŠãŸãã: ããããã®èºã¯ $1$ å以äžã®éŒ»ã®ç©Žã«ã€ãªãã£ãŠãã ãããã錻ã®ç©Žã¯ $0$ å以äžã®èºã«ã€ãªãã£ãŠãã å
šãŠã®èºã«å¯ŸããŠé
žçŽ ãäŸçµŠãããªããšæ»ãã§ããŸããããªãã¡ãããèºã«ã€ãªãã£ãŠããå
šãŠã®éŒ»ã®ç©Žãå¡ããããšããšã€ãªã¢ã³ã¯æ»ã¬ æ¿åºã¯ããªãã®ä»®èª¬ãæ€èšŒããããã«ãèºãšéŒ»ã®ç©Žã®æ¥ç¶é¢ä¿ãããã£ãŠããªããšã€ãªã¢ã³ã $1... | 38,497 |
ãŸã³ãå³¶ (Zombie Island) åé¡ JOI åãäœãã§ããå³¶ããŸã³ãã«äŸµç¥ãããŠããŸã£ãïŒJOI åã¯å³¶ã§äžçªå®å
šãªé¿é£å ŽæãšããŠèšå®ãããŠããã·ã§ã«ã¿ãŒã«éã蟌ãããšã«ããïŒ JOI åãäœãã§ããå³¶ã¯çº 1 ããçº N ãŸã§ã® N åã®çºãããªãïŒçºãšçºãšã¯éè·¯ã§çµã°ããŠããïŒå³¶ã«ã¯ M æ¬ã®éè·¯ãããïŒãã¹ãŠã®éè·¯ã¯ç°ãªã 2 ã€ã®çºãçµãã§ããïŒJOI åã¯éè·¯ãåæ¹åã«èªç±ã«ç§»åã§ãããïŒé路以å€ãéã£ãŠçºããå¥ã®çºã«è¡ãããšã¯ã§ããªãïŒ ããã€ãã®çºã¯ãŸã³ãã«æ¯é
ãããŠããïŒèšªããããšãåºæ¥ãªãïŒãŸã³ãã«æ¯é
ãããŠããçºãã S æ¬ä»¥äžã®éè·¯ã䜿ã£ãŠå°éã§ããçºã å±éºãªçº ãšããïŒãã以å€ã®çºã å±éºã§ãªã... | 38,498 |
ãããŸã£ãããïŒ ãããšããã«å€§ããªå€ãã屿·ããããïŒå¹ã®ãããäœã¿çããŠããŸãããå³ã®ããã«ãã屿·ã¯äžç©ºããèŠããšåžå€è§åœ¢ã«ãªã£ãŠããããŸã£ãããªå£ã§å²ãŸããããã€ãã®éšå±ã§é ãããŠããŸããïŒæã®å£ã¯ãã®äž¡ç«¯ã«ããæ±ã«ãã£ãŠæ¯ããããŠããŸããã屿·ã¯ãšãŠãå€ããããã©ã®å£ã«ããããéãããšãã§ãããããã®ç©ŽãïŒã€ç©ºããŠããŸããããã¯å£ã®ç©Žãéã£ãŠã屿·ã®éšå±ãšéšå±ãŸãã¯éšå±ãšå€ãè¡ãæ¥ããããšãã§ããŸãã ã屿·ã®ã䞻人ã¯ãããã«é€ããããããã«ãå£ç¬ãå¹ããŠãããã屿·ã®å€ãžåŒã³åºããŸããããã¯ãšãŠãè³¢ããã䞻人ãå£ç¬ãå¹ããšããæè¯ã®éžæãã§ã屿·ã®å€ãžæãåºããŸããã€ãŸããæãå°ãªãåæ°ã ã穎ãéã£ãŠå€ãžåºãŸãã ããã¯... | 38,499 |
Insertion Sort Write a program of the Insertion Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode: for i = 1 to A.length-1 key = A[i] /* insert A[i] into the sorted sequence A[0,...,j-1] */ j = i - 1 while j >= 0 and A[j] > key A[j+1] = A[j] j-- A[j+1]... | 38,500 |
Problem E: Mirror Illusion A rich man has a square room with mirrors for security or just for fun. Each side of the room is eight meters wide. The floor, the ceiling and the walls are not special; however, the room can be equipped with a lot of mirrors on the walls or as vertical partitions. Every mirror is one meter w... | 38,501 |
Best Matched Pair You are working for a worldwide game company as an engineer in Tokyo. This company holds an annual event for all the staff members of the company every summer. This year's event will take place in Tokyo. You will participate in the event on the side of the organizing staff. And you have been assigned ... | 38,502 |
Problem B: Old Bridges Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there. Finally he found n islands that had treasures and one island that had nothing. M... | 38,503 |
Score: 600 points Problem Statement M-kun is a brilliant air traffic controller. On the display of his radar, there are N airplanes numbered 1, 2, ..., N , all flying at the same altitude. Each of the airplanes flies at a constant speed of 0.1 per second in a constant direction. The current coordinates of the airplane ... | 38,504 |
Score : 2000 points Problem Statement You are given a rooted tree with N vertices. The vertices are numbered 0, 1, ..., N-1 . The root is Vertex 0 , and the parent of Vertex i (i = 1, 2, ..., N-1) is Vertex p_i . Initially, an integer a_i is written in Vertex i . Here, (a_0, a_1, ..., a_{N-1}) is a permutation of (0, 1... | 38,506 |
Chicken or the Egg Time Limit: 8 sec / Memory Limit: 64 MB A: åµãå
ãé¶ãå
ã 2012/2/8 åµãå
ãé¶ãå
ããšããåé¡ã¯ããŸã ãã€ãŠèª°ãããããªãã£ãïŒ ãããä»åã®çµç¶æ¹éºè·¡ã§çºæã§ç²åŸããææžã«ã¯ãã®çããèšãããŠãããšããïŒ 2012/2/9 ææžã¯chickenãšeggãšããåèªã®ã¿ã§æ§æãããŠããïŒãã®ãŸãŸã§ã¯çããããããªãïŒ 2012/2/10 ããã«ææžãèªã¿é²ãããšïŒææžäžã®åèªã®é çªã¯ç£ãŸããé çªã衚ããŠããããšãããã£ãïŒ "eggchicken"ãšãã£ãå Žåã¯ïŒå
ã«é¶ãç£ãŸãïŒãã®åŸã«é¶ãåµãç£ãã ãšããããšã瀺ããŠããïŒ 2012/2/11... | 38,507 |
Problem C: Tetrahedra Peter P. Pepper is facing a difficulty. After fierce battles with the Principality of Croode, the Aaronbarc Kingdom, for which he serves, had the last laugh in the end. Peter had done great service in the war, and the king decided to give him a big reward. But alas, the mean king gave him a hard q... | 38,508 |
Score : 400 points Problem Statement There is a grid with H horizontal rows and W vertical columns, and there are obstacles on some of the squares. Snuke is going to choose one of the squares not occupied by an obstacle and place a lamp on it. The lamp placed on the square will emit straight beams of light in four card... | 38,509 |
Problem B: Yu-kun Likes Letters in the English Alphabet Background äŒæŽ¥å€§åŠä»å±å¹Œçšåã¯ããã°ã©ãã³ã°ã倧奜ããªåäŸãéãŸã幌çšåã§ãããåå
ã®äžäººã§ããããåã¯ãããã°ã©ãã³ã°ãšåããããè±å°æåã倧奜ãã ã ãããªããåã¯çŽãšäžžãšç·ããããŠè±å°æåãäœ¿ãæ°ããéã³ãèãããã®æ¡ç¹çšããã°ã©ã ãæžãããšã«ããã Problem åæç¶æ
ãšããŠãçŽã« V åã®äžžãš E æ¬ã®ç·ãæžãããŠãããäžžã«ã¯0ããæé ã«çªå·ãã€ããããŠãããåäžžã®äžã«ã¯è±å°æåã1ã€æžãããŠããããäœãæžãããŠããªãã åç·ã¯ç°ãªãïŒã€ã®äžžãçµãã§ããã1ã€ã®äžžã26æ¬ä»¥äžã®ç·ã§çµã°ããããšã¯ãª... | 38,510 |
Score : 100 points Problem Statement You are parking at a parking lot. You can choose from the following two fee plans: Plan 1 : The fee will be AÃT yen (the currency of Japan) when you park for T hours. Plan 2 : The fee will be B yen, regardless of the duration. Find the minimum fee when you park for N hours. Constrai... | 38,511 |
Problem A: Bicube Mary Thomas has a number of sheets of squared paper. Some of squares are painted either in black or some colorful color (such as red and blue) on the front side. Cutting off the unpainted part, she will have eight opened-up unit cubes. A unit cube here refers to a cube of which each face consists of o... | 38,512 |
Score : 400 points Problem Statement A university student, Takahashi, has to take N examinations and pass all of them. Currently, his readiness for the i -th examination is A_{i} , and according to his investigation, it is known that he needs readiness of at least B_{i} in order to pass the i -th examination. Takahashi... | 38,513 |
Tangent to a Circle Find the tangent lines between a point $p$ and a circle $c$. Input The input is given in the following format. $px \; py$ $cx \; cy \; r$ $px$ and $py$ represents the coordinate of the point $p$. $cx$, $cy$ and $r$ represents the center coordinate and radius of the circle $c$ respectively. All input... | 38,514 |
å£ ïŒXXX幎ãçªç¶åºçŸãã倩æµã®äŸµå
¥ãé²ãããã«ã人é¡ã¯å£ãäœããã®äžã«éã蟌ãã ããã®çµæã人é¡ã®æŽ»åé åã¯ãã®å£ã§å²ãŸããç¯å²ã«éå®ãããŠããŸã£ãããã®é åã¯ãäžç©ºããèŠããš W à H ã®é·æ¹åœ¢ã§ãããé åå
éšã«ã¯ x 軞ããã㯠y 軞ã«å¯ŸããŠå¹³è¡ãªå£ãããã€ãèšçœ®ãããŠãããæŽ»åé åã®äŸãäžå³ã«ç€ºãã 人é¡ã¯æŽ»åé åå
ãèªç±ã«ç§»åããããšãã§ããããå£ãè¶ããããã«ã¯äžå®éã®è³æºãæ¶è²»ããªããã°ãªããªãããã ããå£ãè¶ããããšã¯ã§ãããïŒå³äžã® (1)ïŒãå£ã®äº€ç¹ãè¶ããããš (2)ãå£ã掻åé åã®å¢çã®äžãç§»åããããš (3)ãæŽ»åé åå€ã«åºãããš (4) ã¯ã§ããªãã é åå
éšã®å£ã®æ
å ±ãšããã€ãã®å§ç¹ãšçµç¹ã®çµãå
¥... | 38,515 |
Score : 2100 points Problem Statement There are N jewelry shops numbered 1 to N . Shop i ( 1 \leq i \leq N ) sells K_i kinds of jewels. The j -th of these jewels ( 1 \leq j \leq K_i ) has a size and price of S_{i,j} and P_{i,j} , respectively, and the shop has C_{i,j} jewels of this kind in stock. A jewelry box is said... | 38,516 |
Score : 100 points Problem Statement Given a lowercase English letter c , determine whether it is a vowel. Here, there are five vowels in the English alphabet: a , e , i , o and u . Constraints c is a lowercase English letter. Input The input is given from Standard Input in the following format: c Output If c is a vowe... | 38,517 |
Score : 600 points Problem Statement Takahashi has N cards. The i -th of these cards has an integer A_i written on it. Takahashi will choose an integer K , and then repeat the following operation some number of times: Choose exactly K cards such that the integers written on them are all different, and eat those cards. ... | 38,518 |
Score : 200 points Problem Statement Snuke is having a barbeque party. At the party, he will make N servings of Skewer Meal . Example of a serving of Skewer Meal He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i -th skewer is L_i . Also, he has an infinite supply of ingredients... | 38,519 |
Problem C: Magical Dungeon Arthur C. Malory is a wandering valiant fighter (in a game world). One day, he visited a small village and stayed overnight. Next morning, the village mayor called on him. The mayor said a monster threatened the village and requested him to defeat it. He was so kind that he decided to help sa... | 38,521 |
Score : 900 points Problem Statement Let N be an even number. There is a tree with N vertices. The vertices are numbered 1, 2, ..., N . For each i ( 1 \leq i \leq N - 1 ), the i -th edge connects Vertex x_i and y_i . Snuke would like to decorate the tree with ribbons, as follows. First, he will divide the N vertices in... | 38,522 |
Problem D: Find the Outlier Professor Abacus has just built a new computing engine for making numerical tables. It was designed to calculate the values of a polynomial function in one variable at several points at a time. With the polynomial function f ( x ) = x 2 + 2 x + 1, for instance, a possible expected calculatio... | 38,523 |
C: Project Management / ãããžã§ã¯ã管ç ããªãã¯åè
ã®ãããžã§ã¯ããããŒãžã£ã§ããïŒ ä»åã¯è¶
å€§èŠæš¡ãªãããžã§ã¯ãã®ãããžã¡ã³ããè«ãè² ã£ãïŒ å³1: ã¢ããŒãã€ã¢ã°ã©ã ãããŸã§ã®åãšçµéšãããªããšã å³1 ã®ãããªã¢ããŒãã€ã¢ã°ã©ã ãäœæããïŒ åããŒãã¯äœæ¥ã®çµåç¹ã衚ããŠããïŒ ãŸãïŒSã¯ãããžã§ã¯ãã®éå§ç¶æ
ïŒTã¯ãããžã§ã¯ãã®çµäºç¶æ
ã衚ãçµåç¹ã§ããïŒ äŸãã°çµåç¹P3ã«ãããŠïŒäœæ¥Gã¯äœæ¥Cãšäœæ¥Eãçµäºããªããã°éå§ã§ããªãïŒ ãããžã§ã¯ãã®èšç»ã¯å®ç§ã§ããïŒå
šãŠã®çµåç¹ã¯ïŒããããåºãŠåã³ãã®çµåç¹ã«æ»ãäœæ¥çµè·¯ãæããªãïŒ ãŸãïŒå
šãŠã®äœæ¥ã¯ååŸã«çµåç¹ãæã£ãŠããïŒ éå§ç¶æ
ãšçµäºç¶... | 38,524 |
Range Min of Max Query æŽæ°ã®çµã®å (a_1,b_1), (a_2,b_2),..,(a_N,b_N) ãäžããããŸãã äºçš®é¡ã®ã¯ãšãªãåŠçããŠãã ããã äžçš®é¡ç®ã®ã¯ãšãªã§ã¯ã a_L,a_{L+1},..,a_R ã« X ãå ç®ããŸãã äºçš®é¡ç®ã®ã¯ãšãªã§ã¯ã max(a_L,b_L),max(a_{L+1},b_{L+1}),..,max(a_R,b_R) ã®æå°å€ãæ±ããŸãã å
¥å N Q a_1 b_1 a_2 b_2 : a_N b_N query_1 query_2 : query_Q i çªç®ã®ã¯ãšãªãäžçš®é¡ç®ã®ã¯ãšãªã®å Žåã query_i 㯠1 L_i R_i X_i ãšãªããŸãã i... | 38,526 |
Least Common Multiple Find the least common multiple (LCM) of given n integers. Input n a 1 a 2 ... a n n is given in the first line. Then, n integers are given in the second line. Output Print the least common multiple of the given integers in a line. Constraints 2 †n †10 1 †a i †1000 Product of given integers a i... | 38,527 |
ãã³ãã®è² åé¡ æ
å ±ãªãªã³ããã¯ã®å®£äŒã®ããã«,é·æ¹åœ¢ã®ããã€æ¿ã«ãã³ããå¡ãçæ¿ãå¶äœããã.ããã€æ¿ã«ã¯è²ãå¡ããããªããšããã«ãããããäœæãã®é·æ¹åœ¢ã®ãã¹ãã³ã°ããŒãã貌ãããŠãã.ããã§ãã¹ãã³ã°ããŒãã§åºåãããé åããšã«å¥ã
ã®è²ã䜿ããã³ããå¡ãããšã«ãã.äŸãã°,å³ 5-1 ã®å Žå㯠5 è²ã®ãã³ãã䜿ã. å
¥åãšããŠãã¹ãã³ã°ããŒãã貌ãäœçœ®ãäžããããæ,䜿ããã³ãã®è²ã®æ°ãæ±ããããã°ã©ã ãäœæãã.ãã ã,ããã€æ¿å
šäœããã¹ãã³ã°ããŒãã§èŠãããããšã¯ãªã,å
šãŠã®ãã¹ãã³ã°ããŒãã®èŸºã¯ããã€æ¿ã®ããããã®èŸºã«å¹³è¡ã§ãã. å
¥å å
¥åã¯è€æ°ã®ããŒã¿ã»ãããããªãïŒåããŒã¿ã»ããã¯ä»¥äžã®åœ¢åŒã§äžããããïŒ 1 ... | 38,528 |
C: ãªã»ã åé¡ ãªã»ãã®ç€é¢ãçšæãã. ç€é¢ã¯å·Šäžã $(1,1)$ , å³äžã $(8,8)$ ãšè¡šèšãã. ããã§çšæããç€é¢ã¯, 以äžã®ããã«, $(5,4)$ ã®é»ã®ç³ããªã. ........ ........ ........ ...ox... ....o... ........ ........ ........ é»ç³:x çœç³:o 8x8ã®ç€é¢ ãã®ç¶æ
ãã, é»ãå
æã§ãªã»ããéå§ãã. AORã€ã«ã¡ããã¯, 以äžã®ã«ãŒã«ã§ $q$ åéã¶. å·Šäžã $a$ è¡ç® $b$ åç®ã®ãã¹, å³äžã $c$ è¡ç® $d$ åç®ã®ãã¹ãšãã, ãã¹ç®ã«æ²¿ã£ãé·æ¹åœ¢é åãäžãããã. AORã€ã«ã¡ããã¯, ãã®é·æ¹åœ¢é ... | 38,529 |
Simultaneous Equation Write a program which solve a simultaneous equation: ax + by = c dx + ey = f The program should print x and y for given a , b , c , d , e and f (-1,000 †a, b, c, d, e, f †1,000). You can suppose that given equation has a unique solution. Input The input consists of several data sets, 1 line for ... | 38,530 |
åé¡ 2 å æžä¹é€ã®èšç®ãããé»åããã°ã©ã ãäœããªããïŒ å
¥åããŒã¿ã®åè¡ã«ã¯æ°ãšèšå· +, -, *, /, = ã®ã©ãã1ã€ã亀äºã«æžããŠããïŒ ïŒè¡ç®ã¯æ°ã§ããïŒ æŒç® +, -, *, / ã®åªå
é äœïŒä¹é€ç® *, / ãå æžç® +, - ãããå
ã«èšç®ããããšïŒã¯èããïŒå
¥åã®é åºã§èšç®ãïŒ= ã®è¡ã«ãªã£ããïŒèšç®çµæãåºåããïŒ å
¥åããŒã¿ã®æ°å€ã¯10 8 以äžã®æ£ã®æŽæ°ãšããïŒ èšç®äžããã³èšç®çµæã¯ïŒ0ãŸãã¯è² ã®æ°ã«ãªãããšãããã -10 8 ã10 8 ã®ç¯å²ã¯è¶
ããªãïŒ å²ãç®ã¯åãæšãŠãšããïŒ ãããã£ãŠïŒ100/3*3= 㯠99 ã«ãªãïŒ åºåãã¡ã€ã«ã«ãããŠã¯ïŒ åºåã®æåŸã®è¡ã«ãæ¹è¡ã³ãŒããå
¥ããã... | 38,531 |
ããããæš¡æ§ ãããããæš¡æ§ãã衚瀺ããããã°ã©ã ãäœæããããšã«ããŸããããããããæš¡æ§ãã¯ä»¥äžã®ãããªãã®ãšããŸãã 1 蟺ã®é·ãã n ã®å Žåã n è¡ n åã®æååãšããŠè¡šç€ºããã å·Šäžé
ãåºç¹ãšãïŒæèšåãã«å転ããæžŠç¶ã®æš¡æ§ãšããã ç·ã®ããéšå㯠#ïŒåè§ã·ã£ãŒãïŒã空çœéšå㯠" "ïŒåè§ç©ºçœïŒã§è¡šçŸããã ç·ãšç·ã®éã¯ç©ºçœã眮ãã æŽæ° n ãå
¥åãšãïŒ1 蟺ã®é·ãã n ã®ãããããæš¡æ§ããåºåããããã°ã©ã ãäœæããŠãã ããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããŸãã d n 1 n 2 : n d ïŒè¡ç®ã«ããŒã¿ã»ããã®æ° d ( d †20)ãç¶ã d è¡ã« i åç®ã®ããããæš¡æ§ã®èŸºã®é·ã n i... | 38,532 |
Problem H: Eleven Lover Edward Leven loves multiples of eleven very much. When he sees a number, he always tries to find consecutive subsequences (or substrings) forming multiples of eleven. He calls such subsequences as 11-sequences. For example, he can find an 11-sequence 781 in a number 17819. He thinks a number whi... | 38,533 |
Problem G: Network Mess Gilbert is the network admin of Ginkgo company. His boss is mad about the messy network cables on the floor. He finally walked up to Gilbert and asked the lazy network admin to illustrate how computers and switches are connected. Since he is a programmer, he is very reluctant to move throughout ... | 38,534 |
ãã¬ãåã¯ïŒèªçæ¥ãã¬ãŒã³ããšããŠèŸºã®é·ãã l 1 à . . . à l d ã® d 次å
è¶
çŽæ¹äœãããã£ãïŒãã¬ãåã¯ïŒãã®çŽæ¹äœã i çªç®ã®åº§æšã®ç¯å²ã 0 ä»¥äž l i 以äžãšãªãããã«ããïŒ x 1 + . . . + x d †s ãã¿ããéšåãé£ã¹ãŠããŸã£ãïŒãã ã x i 㯠i çªç®ã®åº§æšã衚ãïŒãã¬ãåã®é£ã¹ãéšåã®äœç©ã V ãšãããšïŒ d!V ( V ã« d ã®éä¹ããããå€) ã¯æŽæ°ãšãªãããšã蚌æã§ããïŒ d!V ã1,000,000,007 ã§å²ã£ãããŸããæ±ããïŒ Constraints 2 †d †300 1 †l i †300 0 †s †$\sum l_{i}$ å
¥åã¯å
šãп޿°... | 38,535 |
Score : 600 points Problem Statement Ringo Mart, a convenience store, sells apple juice. On the opening day of Ringo Mart, there were A cans of juice in stock in the morning. Snuke buys B cans of juice here every day in the daytime. Then, the manager checks the number of cans of juice remaining in stock every night. If... | 38,536 |
Score : 400 points Problem Statement You are given a sequence of positive integers of length N , A=a_1,a_2,âŠ,a_{N} , and an integer K . How many contiguous subsequences of A satisfy the following condition? (Condition) The sum of the elements in the contiguous subsequence is at least K . We consider two contiguous subs... | 38,537 |
Philosopher's Stone In search for wisdom and wealth, Alchemy, the art of transmutation, has long been pursued by people. The crucial point of Alchemy was considered to find the recipe for philosopherâs stone , which will be a catalyst to produce gold and silver from common metals, and even medicine giving eternal life.... | 38,538 |
Score : 700 points Problem Statement Aoki is in search of Takahashi, who is missing in a one-dimentional world. Initially, the coordinate of Aoki is 0 , and the coordinate of Takahashi is known to be x , but his coordinate afterwards cannot be known to Aoki. Time is divided into turns. In each turn, Aoki and Takahashi ... | 38,540 |
Score : 200 points Problem Statement Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A. The problem has N test cases. For each test case i ( 1\leq i \leq N ), you are given a string S_i representing the verdict for that test case. Find the numbers of test... | 38,541 |
F: çŽã®æãããã¿ / Folding Paper å顿 é«ã $H$ ãã¹ãå¹
$W$ ãã¹ã®æ Œåç¶ã«åºåãããé·æ¹åœ¢ã®çŽãããã $0$ ããæ°ããŠäžãã $i$ è¡ç®ãå·Šãã $j$ åç®ã®ãã¹ã«ã¯æŽæ° $i \times W+j$ ãæžãããŠããã $H=2, W=3$ ã®äŸãäžã®å³ã«ç€ºãã AOR ã€ã«ã¡ããã¯ããã®çŽã«å¯ŸããŠæ¬¡ã®ãããªæäœãé ã«è¡ã£ãã $1$ ãã¹åã®é¢ç©ã«ãªããŸã§ãã¹ã®åºåãç·ã«æ²¿ã£ãŠç¹°ãè¿ãæãããã®æã®æãç·ã山谷ãé çªãªã©ã¯ä»»æã§ãããçŽãç Žããªãä»»æã®æãæ¹ãã§ããã $4$ 蟺ãåãèœãšã㊠$H \times W$ æã®çŽã«åå²ããã äžããé ã«ããã£ãŠãããæžãããŠããæŽæ°ã䞊ã¹ãæ°... | 38,542 |
Problem E: Pipeline Scheduling An arithmetic pipeline is designed to process more than one task simultaneously in an overlapping manner. It includes function units and data paths among them. Tasks are processed by pipelining : at each clock, one or more units are dedicated to a task and the output produced for the task... | 38,543 |
Single Source Shortest Path II For a given weighted graph $G = (V, E)$, find the shortest path from a source to each vertex. For each vertex $u$, print the total weight of edges on the shortest path from vertex $0$ to $u$. Input In the first line, an integer $n$ denoting the number of vertices in $G$ is given. In the f... | 38,544 |
H: ããããã®åªåã«ã€ã㊠- About Our Effort - åé¡ â»ãã®åé¡ã¯ããŸãã®åé¡ãšæããŠããã ãããšãããããã ã§ããã°å
ã«ä»ã®åé¡ã®ã»ãããæ¥œãã¿ããã ããã°ãšæã£ãŠãããŸããŠïŒã§ãã®ã§ä»ã®åé¡ãéãçµããŠæã«ãªãïŒãã€ãã®æã ãã®ã³ã³ãã¹ãã§æœ°ãããšããæ°ã«ãªã£ãŠãããæ¹ã«ææŠããŠããã ããã°ãšæããŸãã Dåé¡ã®ã¯ãšãªãé
ããŠãã¿ãŸããã§ããã ãããæã
ãšããããŸããŠã決ããŠãã æ æ
¢ãããŠããããã§ã¯ãªãã®ã§ãã ç§ãã¡ãªãã«åªåããã®ã§ãã ãã®åªåã®çé±ãå³ãã£ãŠããã ãããããã®ãããªåé¡ãåºé¡ããæ¬¡ç¬¬ã§ãããŸãã åé¡: Dåé¡ã®ãµãŒããŒåŽã®åŠçãããããã°ã©ã ãäœæããã ãªããã®åé¡ã¯æ¬... | 38,545 |
Score : 100 points Problem Statement Joisino wants to evaluate the formula " A op B ". Here, A and B are integers, and the binary operator op is either + or - . Your task is to evaluate the formula instead of her. Constraints 1âŠA,BâŠ10^9 op is either + or - . Input The input is given from Standard Input in the following... | 38,546 |
Score : 400 points Problem Statement Takahashi has a string S consisting of lowercase English letters. Starting with this string, he will produce a new one in the procedure given as follows. The procedure consists of Q operations. In Operation i (1 \leq i \leq Q) , an integer T_i is provided, which means the following:... | 38,547 |
ã財åžã¡ã¿ã蚺æ ïŒæã«æ¶è²»çšãïŒïŒ
ã«ãªã£ãŠãããã財åžã硬貚ã§ãã³ãã³ã«ãªã£ãŠããŸããããåãéé¡ãæã¡æ©ããªãç¡¬è²šã®ææ°ãå°ãªããããã§ãããã硬貚ã®åèšãïŒïŒïŒïŒå以äžãªãã硬貚ããæã«äž¡æ¿ããŠãã財åžã®ã¡ã¿ãç¶æ
ãè§£æ¶ã§ããŸãã ã財åžã®äžã®ç¡¬è²šã®ææ°ãçš®é¡ããšã«äžãããããšãã硬貚ããæã«äž¡æ¿ã§ãããã©ãããå€å®ããããã°ã©ã ãäœæããŠãã ããã å
¥å å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããã c1 c5 c10 c50 c100 c500 å
¥åã¯ïŒè¡ãããªãã c1 ã c5 ã c10 ã c50 ã c100 ã c500 (0 †c1, c5, c10, c50, c100, c500 †50) ã¯ãããããã1åã5å... | 38,548 |
Incircle of a Triangle Write a program which prints the central coordinate ($cx$,$cy$) and the radius $r$ of a incircle of a triangle which is constructed by three points ($x_1$, $y_1$), ($x_2$, $y_2$) and ($x_3$, $y_3$) on the plane surface. Input The input is given in the following format $x_1$ $y_1$ $x_2$ $y_2$ $x_3... | 38,549 |
Score : 300 points Problem Statement In a flower bed, there are N flowers, numbered 1,2,......,N . Initially, the heights of all flowers are 0 . You are given a sequence h=\{h_1,h_2,h_3,......\} as input. You would like to change the height of Flower k to h_k for all k (1 \leq k \leq N) , by repeating the following "wa... | 38,550 |
Unequal Dice Time Limit: 8 sec / Memory Limit: 64 MB B: äžæããªãµã€ã³ã ããã³ã³ã競銬ãªã©ã®è³ãäºã«ãéã䜿ããããŠïŒåéãŸã¿ãã«ãªã£ãããªãã¯ïŒ Tæã°ã«ãŒãã®å°äžç£çã«å容ãããŠããŸã£ãïŒ ããã§ããªãã¯ïŒåéãè¿ããŸã§å¥Žé·ã®ããã«åããªããŠã¯ãªããªãïŒ ãŸããã®ç£çã«ã¯ããªããšåãå¢éã®äººãå€ãå容ãããŠããã®ã§ïŒ ããã€ãã®çã«åããããŠããïŒ ããçã§ã¯ïŒãµã€ã³ãã3ã€è»¢ãããŠãæ€ã«ãããŠæ¥œããç¿æ
£ãããïŒ æè¿ïŒããã®çé·ã倧å€ãªç®ã«ãã£ããšããã話ãèãããïŒããªãã«çŽæ¥é¢ä¿ã¯ãªãïŒ ããªãã®æå±ããçã§ã¯ã²ãšã€ã®ãµã€ã³ããæ¯ã£ãŠæ¥œããç¿æ
£ãããïŒ ã«ãŒã«ã¯ïŒãµ... | 38,551 |
Score : 700 points Problem Statement Ringo has an undirected graph G with N vertices numbered 1,2,...,N and M edges numbered 1,2,...,M . Edge i connects Vertex a_{i} and b_{i} and has a length of w_i . Now, he is in the middle of painting these N vertices in K colors numbered 1,2,...,K . Vertex i is already painted in ... | 38,552 |
A Point in a Triangle There is a triangle formed by three points $(x_1, y_1)$, $(x_2, y_2)$, $(x_3, y_3)$ on a plain. Write a program which prints " YES " if a point $P$ $(x_p, y_p)$ is in the triangle and " NO " if not. Input Input consists of several datasets. Each dataset consists of: $x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $... | 38,553 |
ææªã®èšè
åé¡ ããªã㯠JOI æ°è瀟ã®èšè
ã§ããïŒã¹ããŒãèšäºãæ
åœããŠããïŒ æšæ¥ãŸã§ã«ïŒã¯ãã¢ãã¢ã§ã¯ïŒn åã®ãµãã«ãŒããŒã ã«ããç·åœãã®ãªãŒã°æŠãè¡ãããïŒå€§äŒå®è¡å§å¡äŒã¯ïŒè©ŠåçµæãšèŠå®ã«åºã¥ãåããŒã ã« 1 äœãã n äœãŸã§ã®é äœãã€ããããã§ããïŒããªãã«ã¯ïŒäžéšã®è©Šåã®åæãšãšãã«ïŒæ¬¡ã®æ
å ±ãäŒããããïŒ æ
å ± 1 åŒãåãã®è©Šåã¯ãªãã£ãïŒ æ
å ± 2 å
šãŠã®ããŒã ã«ç°ãªãé äœãã€ããïŒ æ
å ± 3 å
šãŠã® 1 †a < b †n ã«å¯ŸãïŒa äœã®ããŒã ãš b äœã®ããŒã ã®è©Šåã«ãããŠïŒå¿
ã a äœã®ããŒã ãåå©ããïŒ ããªãã¯èšäºãäœæããããã«ïŒäžéšã®è©Šåã®åæãšïŒäŒããããæ
å ± 1 3 ãããšã«ïŒé äœ... | 38,554 |
D: Many Decimal Integers åé¡ æ°å ( 0 ãã 9 ) ã®ã¿ãããªãæåå S ãšãæ°å ãš ? ã®ã¿ãããªãæåå T ãäžããããŸãã S ãš T ã¯åãé·ãã§ãã T å
ã«ååšããããããã® ? ã«ã€ããŠã 0 ãã 9 ãŸã§ã®æ°åã®ãããã 1 ã€ã«å€æŽããæ°åã®ã¿ãããªãæåå T' ãäœãããšãèããŸãããã®ãšãã f(T') \leq f(S) ã§ããå¿
èŠããããŸããããã§ f(t) ã¯ãæåå t ã 10 鲿°ãšããŠèªãã ãšãã®æŽæ°å€ãè¿ã颿°ãšããŸãã ãŸãã T' ã®æäžäœã®æ¡ã«ããæ°å㯠0 ã§ãã£ãŠããããã®ãšããŸãã ããåŸãæåå T' ãã¹ãŠã«ã€ããŠã f(T') ã®å€ã®ç·... | 38,555 |
ãã㜠Problem Statement ããã®ããã¯æ£æ©ã倧奜ãã ïŒéãæ©ããšæ°ããçºèŠãããïŒ ããã®äœãçºã¯ N åã®åºå Žãš N-1 æ¬ã®éãããªãïŒ éã¯ã¡ããã©äºã€ã®åºå Žãã€ãªãã§ããïŒæåãããããéã©ããã亀ãã£ããããªãïŒ éã«ã¯ïŒæ©ãã®ã«ãããæé t ïŒåŸãããçºèŠã®åæ°ã®äžé m ïŒããã³ïŒçºèŠäžã€ãããã®äŸ¡å€ v ãæå®ãããŠããïŒ éãäžæ¹ã®ç«¯ããããäžæ¹ã®ç«¯ãŸã§æ©ãããšãïŒ m åç®ãŸã§ã®éè¡ã§ã¯äŸ¡å€ v ã®çºèŠãäžã€åŸããããïŒ m+1 åç®ä»¥éã¯çºèŠãåŸãããªãïŒ ä»æ¥ãããã¯ïŒçºå
ã®æ£æ©ã«åºãããããã ïŒ ããã®æ£æ©ã¯åºå Ž 1 ããå§ãŸãïŒããã€ãã®é ( 0 æ¬ãããããªã ) ãéã£ãŠïŒæåŸã«... | 38,556 |
Problem H: Company Organization You started a company a few years ago and fortunately it has been highly successful. As the growth of the company, you noticed that you need to manage employees in a more organized way, and decided to form several groups and assign employees to them. Now, you are planning to form n group... | 38,557 |
Problem D: Deadly Dice Game T.I. Financial Group, a world-famous group of finance companies, has decided to hold an evil gambling game in which insolvent debtors compete for special treatment of exemption from their debts. In this game, each debtor starts from one cell on the stage called the Deadly Ring. The Deadly Ri... | 38,558 |
Score : 1400 points Problem Statement Snuke is having another barbeque party. This time, he will make one serving of Skewer Meal . He has a stock of N Skewer Meal Packs . The i -th Skewer Meal Pack contains one skewer, A_i pieces of beef and B_i pieces of green pepper. All skewers in these packs are different and disti... | 38,559 |
Score : 1800 points Problem Statement There is a tree T with N vertices, numbered 1 through N . For each 1 †i †N - 1 , the i -th edge connects vertices a_i and b_i . Snuke is constructing a directed graph T' by arbitrarily assigning direction to each edge in T . (There are 2^{N - 1} different ways to construct T' .) ... | 38,560 |
Score : 200 points Problem Statement It's now the season of TAKOYAKI FESTIVAL! This year, N takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The deliciousness of the i -th takoyaki is d_i . As is commonly known, when you eat two takoyaki of deliciousness x and y together, you restore x \time... | 38,561 |
Score: 200 points Problem Statement The number 105 is quite special - it is odd but still it has eight divisors. Now, your task is this: how many odd numbers with exactly eight positive divisors are there between 1 and N (inclusive)? Constraints N is an integer between 1 and 200 (inclusive). Input Input is given from S... | 38,562 |
ãã¬ãåã¯ïŒåæç¶æ
ã§ã¯åãããšã¯ã§ããªãïŒ i çªç®ã®ãã±ããã®å€æ®µã¯ p i ã§ããïŒãããè²·ããšä»»æã® (x, y) ãšä»»æã®éè² å®æ° t ã«å¯Ÿã (x, y) ãã (x + ta i , y + tb i ) ã«ç§»åããããšãã§ããããã«ãªãïŒãã¬ãåãå¹³é¢äžã®ä»»æã®äºç¹éã(ããã€ãã®ãã±ãããçµã¿åãããŠ) ç§»åã§ããããã«ãªãããã«è²·ããªããã°ãªããªããã±ããã®åèšéé¡ã®æå°å€ãæ±ããïŒ Constraints 1 †n †200000 â10 9 †a i , b i †10 9 1 †p i †10 9 å
¥åã¯å
šãп޿°ã§ãã Input n a 1 b 1 p 1 . . . a n b n p n ... | 38,563 |
Problem A: And Then There Was One Letâs play a stone removing game. Initially, n stones are arranged on a circle and numbered 1, ... , n clockwise (Figure 1). You are also given two numbers k and m . From this state, remove stones one by one following the rules explained below, until only one remains. In step 1, remove... | 38,564 |
Score : 700 points Problem Statement Given are positive integers N and K . Determine if the 3N integers K, K+1, ..., K+3N-1 can be partitioned into N triples (a_1,b_1,c_1), ..., (a_N,b_N,c_N) so that the condition below is satisfied. Any of the integers K, K+1, ..., K+3N-1 must appear in exactly one of those triples. F... | 38,565 |
Problem C: Differential Pulse Code Modulation å·®åãã«ã¹ç¬Šå·å€èª¿ã¯äž»ã«é³å£°ä¿¡å·ãå§çž®ããéã«çšããããå§çž®ææ³ã®äžã€ã§ããïŒ é³å£°ä¿¡å·ã¯èšç®æ©äžã§ã¯æŽæ°å(ã€ã³ãã«ã¹å)ãšããŠæ±ãããïŒæŽæ°åã¯å
¥åä¿¡å·ãäžå®æéééã§æšæ¬å(ãµã³ããªã³ã°)ãïŒæ¯å¹
ãèšé²ãããã®ã§ããïŒäžè¬ã«ãã®æŽæ°åã¯ååŸã®å€ãè¿ããšããåŸåãããïŒãããå©çšãïŒååŸã®å€ã®å·®åã笊å·åãïŒå§çž®çãåäžãããã®ãå·®åãã«ã¹ç¬Šå·å€èª¿ã§ããïŒ æ¬åé¡ã§ã¯å·®åã®å€ããããããå®ããããå€ã®éåããéžã¶ããšãèããïŒãã®å€ã®éåãã³ãŒãããã¯ãšåŒã¶ããšã«ããïŒåŸ©å·ååŸã®é³å£°ä¿¡å· y n ã¯ä»¥äžã®åŒã§å®ããããïŒ y n = y ... | 38,566 |
ãããªã§ãŒã·ã« ãããªã§ãŒã·ã«ãšã¯å¥³æ§åãããã©ã£ãæšè£œã®äººåœ¢ã§ããã·ã¢ã®ä»£è¡šçãªæ°èžåã§ãããããªã§ãŒã·ã«ã¯ã倧ããªäººåœ¢ã®äžã«ããããå°ããªäººåœ¢ãå
¥ã£ãŠããå
¥ãåæ§é ã«ãªã£ãŠããã倧ããã®ç°ãªãè€æ°ã®äººåœ¢ã§æ§æãããŠããŸãããã®ãããªå
¥ãåæ§é ã«ãããããå人圢ã®èŽäœã¯äžäžã§åå²ã§ããçç¶ã®æ§é ã«ãªã£ãŠããŸãããããªã§ãŒã·ã«ã¯è·äººã®æã§æäœãããããããäžã€äžã€ã®äººåœ¢ã¯äžçã«äžã€ãããªãéåžžã«è²Žéãªãã®ã«ãªããŸãã å
åŒã§ããäžéåãšæ¬¡éåã¯ããããªã§ãŒã·ã«ã§éã¶ã®ã倧奜ãã§ãåèªããããã1çµã®ãããªã§ãŒã·ã«ãæã£ãŠããŸãããäžéåã®ãããªã§ãŒã·ã«ã¯ n åã®äººåœ¢ããæ§æãããŠãããæ¬¡éåã®ãããªã§ãŒã·ã«ã¯ m åã®äººåœ¢ããæ§æ... | 38,567 |
åé¡ 3 å
¥åãã¡ã€ã«ã®ïŒè¡ç®ã«æ£æŽæ° n ïŒnâ§3ïŒãæžããŠããïŒ ã€ã¥ã n è¡ã«ç°ãªãæ£æŽæ° a 1 , ..., a n ã ïŒã€ãã€æžããŠããïŒ a 1 , ..., a n ããç°ãªãïŒåãéžãã§äœããã é åãïŒæ°ãšããŠèŠãŠïŒå°ããé ã«äžŠã¹ããšãïŒ ïŒçªç®ã«æ¥ããã®ãåºåããïŒ ãã ãïŒ äŸãã°ïŒa 1 = 1ïŒa 4 = 11 ã®ãããªå ŽåãïŒ a 1 a 4 ãš a 4 a 1 ã¯ç°ãªãé åãšã¿ãªãïŒ ãŸãïŒ 1âŠa i âŠ10000 (i=1, ..., n) ã〠3âŠnâŠ10 4 ã§ããïŒ åºåãã¡ã€ã«ã«ãããŠã¯ïŒ åºåã®æåŸã«ãæ¹è¡ã³ãŒããå
¥ããããšïŒ å
¥åºåäŸ å
¥åäŸïŒ 3 2 7 5 åºåäŸïŒ 52 å
¥... | 38,568 |
C: ãµããã³ã¯ãšãª å顿 åçŽç¡åã°ã©ãã§ãä»»æã®èŸºãé«ã
$1$ ã€ã®åçŽéè·¯ã«ããå«ãŸããªããããªãã®ããµããã³ã°ã©ããšåŒã¶ããšã«ããŸãã $N$ é ç¹ $M$ 蟺ã®é£çµãªãµããã³ã°ã©ã $G$ ãäžããããŸãã åé ç¹ã¯ $1$ ãã $N$ ãŸã§çªå·ãä»ããŠããŸãã ãŸãã$i$ åç®ã®èŸºã¯é ç¹ $a_i$ ãšé ç¹ $b_i$ ãçµãã§ãããã³ã¹ã㯠$c_i$ ã§ãã ã°ã©ã $G$ äžã®åçŽãã¹ã®ã³ã¹ããããã®ãã¹äžã«å«ãŸããå
šãŠã®èŸºã®ã³ã¹ãã® XOR ãšå®ããŸãã 以äžã®ãããªåœ¢åŒã® $Q$ åã®ã¯ãšãªã«çããŠãã ããã x_i y_i k_i â é ç¹ $x_i$ ãšé ç¹ $y_i$ ãç¹ããã¹ãŠã®åçŽãã¹ã®ã³ã¹... | 38,569 |
倧åœãã! ããã¥åŠå倧åŠéå±é«æ ¡ã®å€§é¿è¶³ãããåã¯ãã¹ããããã·ãŒã³ã§éã¶ããšã«ããŸããã ãã®ãã·ãŒã³ã¯ãã¡ãã«ãæå
¥ãããšã3 ã€ã®ãªãŒã«ãå転ãå§ããåãªãŒã«ãèªåçã«æ¢ãŸããŸããéåžžã®1ã²ãŒã (éåžžã²ãŒã )㯠3 æã®ã¡ãã«ãæå
¥ãã峿ãæããšããã®å³æã«å¿ããŠæ¬¡ã®ãšããã¡ãã«ãåŸãããŸãã å³æã®æãæ¹ã«ãã£ãŠã¯ç¹å¥ãªãµãŒãã¹ãéå§ãããŸãã 7 ã®å³æã 3 ã€æããšããã°ããŒãã¹ãå§ãŸããããŒãã¹ã²ãŒã ã 5 ã²ãŒã è¡ãããšãã§ããŸãããŸããBAR ã®å³æã 3 ã€æããšã¬ã®ã¥ã©ãŒããŒãã¹ãå§ãŸããããŒãã¹ã²ãŒã ã 3 ã²ãŒã è¡ãããšãã§ããŸãã ã¹ã¿ãŒã®å³æã 3 ã€æããšç¡æã²ãŒã ãéå§ãããã¡ãã«ãåŸãããšã¯... | 38,570 |
Score : 1700 points Problem Statement We have a grid with N rows and N columns. The cell at the i -th row and j -th column is denoted ( i , j ). Initially, M of the cells are painted black, and all other cells are white. Specifically, the cells ( a_1 , b_1 ), ( a_2 , b_2 ), ... , ( a_M , b_M ) are painted black. Snuke ... | 38,571 |
Score : 600 points Problem Statement Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with H east-west rows and W north-south columns. Let (i,j) be the square at the i -th row from the north and j -th column from the west. Some of the squares have a lotus leaf on it and cannot be entered. ... | 38,572 |
KND Warp Problem KNDåã¯äŒæŽ¥å€§åŠã«åšç±ããåŠçããã°ã©ãã ã圌ã¯ãã®åªç§ãªé è³ããã£ãŠã¯ãŒãè£
眮ãéçºããããšã§æåã§ãããã¯ãŒãè£
眮ãšã¯äŸ¿å©ãªãã®ã§ãããå Žæããå¥ã®å ŽæãŸã§ç¬æã«ç§»åããããšãã§ããã圌ã¯ããããå°çäžã«ç¹åšããã¯ãŒãè£
眮ãçšããŠæ§ã
ãªå Žæãå¯èœãªéãæ©ããããæ
ãèšç»ããŠããã 圌ã®é£äººã§ããããªãã®ä»äºã¯3次å
空é (xyzçŽäº€åº§æšç³») äžã«ååšãã N åã®ã¯ãŒãè£
眮ãããŸã䜿çšããŠã1ãã M ãŸã§ã®çªå·ããµããã M åã®ç¹ãé ã«éã£ãŠã M çªç®ã®ç¹ãŸã§ç§»åãããšãã®æå°ã®æèŠæéãæ±ããããšã ãã¯ããã¯1çªç®ã®ç¹ã«ãããã®ãšããã©ã®ã¯ãŒãè£
眮ãä»»æã®ã¯ãŒãè£
çœ®ãžæé0ã§ç§»åã§ãã... | 38,573 |
Points on a Straight Line The university of A stages a programming contest this year as has been the case in the past. As a member of the team in charge of devising the problems, you have worked out a set of input data for a problem, which is an arrangement of points on a 2D plane in the coordinate system. The problem ... | 38,574 |
Problem B: Butterfly Claire is a man-eater. She's a real man-eater. She's going around with dozens of guys. She's dating all the time. And one day she found some conflicts in her date schedule. D'oh! So she needs to pick some dates and give the others up. The dates are set by hours like 13:00 to 15:00. She may have mor... | 38,575 |
Score : 900 points Problem Statement We have an undirected weighted graph with N vertices and M edges. The i -th edge in the graph connects Vertex U_i and Vertex V_i , and has a weight of W_i . Additionally, you are given an integer X . Find the number of ways to paint each edge in this graph either white or black such... | 38,576 |
Equivalent Vertices Background äŒæŽ¥å€§åŠä»å±å¹Œçšåã¯ããã°ã©ãã³ã°ã倧奜ããªåäŸãéãŸã幌çšåã§ããã åå
ã®äžäººã§ããããåã¯,ããã°ã©ãã³ã°ãšåãããããçµµæãã倧奜ãã ã ãããŸã§ããåã¯äžžãšå
è§åœ¢ãšç¢å°ã§æ²¢å±±çµµãæžããŠããã ããæ¥ããåã¯ãããã®çµµãã°ã©ãã§ããããšãç¥ãã äžžãšå
è§åœ¢ã¯é ç¹ãšåŒã°ã,ç¢å°ã¯èŸºãšåŒã°ããŠãããããã ããåã¯2ã€ã®é ç¹éãçµã¶ããã«ããŠç¢å°ãæããæŽã«ãã®äžã«0ã1ãæžãã ãã®ããã«,蟺ã«éã¿(0ãŸãã¯1)ãããæåãªèŸºãããªãã°ã©ãã¯éã¿ä»ãæåã°ã©ããšåŒã°ããã ãŸã,é ç¹ãšæ°å x (0ãŸãã¯1)ãäžããããæ,ãã®é ç¹ããåºãŠããç¢å°ã®ãã¡, x ãšå... | 38,577 |
Score : 800 points Problem Statement Takahashi and Aoki will play a game on a tree. The tree has N vertices numbered 1 to N , and the i -th of the N-1 edges connects Vertex a_i and Vertex b_i . At the beginning of the game, each vertex contains a coin. Starting from Takahashi, he and Aoki will alternately perform the f... | 38,578 |
Problem B: Blame Game Alice and Bob are in a factional dispute. Recently a big serious problem arised in a project both Alice and Bob had been working for. This problem was caused by lots of faults of Alice's and Bob's sides; those faults are closely related. Alice and Bob started to blame each other. First, Alice clai... | 38,579 |
ICPC Calculator In mathematics, we usually specify the order of operations by using parentheses. For example, 7 Ã (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 Ã 3. However, there are people who do not like parentheses. International Counter of Parentheses Council... | 38,580 |
Score : 200 points Problem Statement Takahashi received otoshidama (New Year's money gifts) from N of his relatives. You are given N values x_1, x_2, ..., x_N and N strings u_1, u_2, ..., u_N as input. Each string u_i is either JPY or BTC , and x_i and u_i represent the content of the otoshidama from the i -th relative... | 38,582 |
çææ° é¡ã¯ã㯠è±ã®äžã«ãŠ æ¥æ»ãªã ãã®ããããã® ææã®ãã ããã¯ïŒè¥¿è¡æ³åž«ãè© ãã ãšãããïŒæåãªçæã®äžã€ã§ããïŒ çæã¯ïŒæ¥æ¬ã«ãããŠå€ããã芪ããŸããŠããåæã®äžçš®ã§ããïŒãã®å€ã㯠5ã»7ã»5ã»7ã»7 ã®äºå¥äžåäžé³ãããªãïŒ ãšããã§ïŒ57577 ãšããæ°ã¯ïŒ5 ãš 7 ã®äºçš®é¡ã®æ°åãããªãïŒ ãã®ãããªïŒåé²è¡šèšãã¡ããã©äºçš®é¡ã®æ°åãããªãæ£ã®æŽæ°ãïŒçææ°ãšåŒã¶ããšã«ããïŒ äŸãã°ïŒ10, 12, 57577, 25252 ãªã©ã¯çææ°ã§ãããïŒ5, 11, 123, 20180701 ãªã©ã¯çææ°ã§ã¯ãªãïŒ æ£ã®æŽæ° N ãäžããããïŒ N çªç®ã«å°ããçææ°ãæ±ããïŒ Input å
¥åã¯æå€§ã§ 100... | 38,583 |
Multi-column List Ever since Mr. Ikra became the chief manager of his office, he has had little time for his favorites, programming and debugging. So he wants to check programs in trains to and from his office with program lists. He has wished for the tool that prints source programs as multi-column lists so that each ... | 38,584 |
RSQ and RAQ Write a program which manipulates a sequence A = { a 1 , a 2 , . . . , a n } with the following operations: add(s, t, x) : add x to a s , a s+1 , ..., a t . getSum(s, t) : report the sum of a s , a s+1 , ..., a t . Note that the initial values of a i ( i = 1, 2, . . . , n ) are 0. Input n q query 1 query 2 ... | 38,585 |
Score : 100 points Problem Statement Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than 1200 , and participate in AtCoder Regular Contest (ARC) otherwise. You are given Smeke's current rating, x . Print ABC if Smeke will participate in ABC, and print ARC otherwise. Con... | 38,586 |
Score : 300 points Problem Statement You drew lottery N times. In the i -th draw, you got an item of the kind represented by a string S_i . How many kinds of items did you get? Constraints 1 \leq N \leq 2\times 10^5 S_i consists of lowercase English letters and has a length between 1 and 10 (inclusive). Input Input is ... | 38,587 |
Score : 400 points Problem Statement Snuke lives in another world, where slimes are real creatures and kept by some people. Slimes come in N colors. Those colors are conveniently numbered 1 through N . Snuke currently has no slime. His objective is to have slimes of all the colors together. Snuke can perform the follow... | 38,588 |
Score : 200 points Problem Statement When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC. You, the smartwatch, has found N routes to his home. If Mr. X uses the i -th of these routes, he will get home in time t_i at cost c_i . Find the small... | 38,589 |
Problem C: Save the Energy You were caught in a magical trap and transferred to a strange field due to its cause. This field is three- dimensional and has many straight paths of infinite length. With your special ability, you found where you can exit the field, but moving there is not so easy. You can move along the pa... | 38,590 |
Score : 300 points Problem Statement Gotou just received a dictionary. However, he doesn't recognize the language used in the dictionary. He did some analysis on the dictionary and realizes that the dictionary contains all possible diverse words in lexicographical order. A word is called diverse if and only if it is a ... | 38,591 |
Score : 1200 points Problem Statement We have N irregular jigsaw pieces. Each piece is composed of three rectangular parts of width 1 and various heights joined together. More specifically: The i -th piece is a part of height H , with another part of height A_i joined to the left, and yet another part of height B_i joi... | 38,592 |
Problem Statement Chelsea is a modern artist. She decided to make her next work with ladders. She wants to combine some ladders and paint some beautiful pattern. A ladder can be considered as a graph called hashigo . There are n hashigos numbered from 0 to n-1 . Hashigo i of length l_i has 2 l_{i} + 6 vertices v_{i, 0}... | 38,593 |
Problem A Rearranging a Sequence You are given an ordered sequence of integers, ($1, 2, 3, ..., n$). Then, a number of requests will be given. Each request specifies an integer in the sequence. You need to move the specified integer to the head of the sequence, leaving the order of the rest untouched. Your task is to f... | 38,594 |
ããžãã ã¢ã€ã
èµ€ã¹ãåºã§ã¯ãããžãããšåŒã°ãããŠããŒã¯ãªããããã販売ããŠããŸããåããã«ã¯ãå·Šããå³ãžåãã£ãŠ1åã«$N$åã®æ°åã䞊ãã§ããŸãããã ããæžãããŠããã®ã¯ïŒããïŒãŸã§ã®æ°åã§ãã ããã®è³Œå
¥è
ã¯ããããã®æ°åãã$K$åã®æ°åãæ¶å»ããæ®ã£ã$N-K$åã®æ°åãå·Šããé çªã«äžŠã¹ãŠã§ããæ°ããã€ã³ããšããŠç²åŸããããšãã§ããŸããããšãã°$K=3$ã®ãšããããã«$1414213$ãšæžãããŠããã°ãå·Šãã$1$ã$1$ã$2$ãéžæããŠæ¶å»ããããšã§$4413$ãã€ã³ããç²åŸããããšãã§ããŸãã æ°åã®åãšæŽæ°$K$ãäžãããããšããç²åŸã§ãããã€ã³ãã®æå€§å€ãåºåããããã°ã©ã ãäœæããã å
¥å å
¥åã¯ä»¥äžã®åœ¢åŒ... | 38,595 |
Enumeration of Subsets II You are given a set $T$, which is a subset of $U$. The set $U$ consists of $0, 1, ... n-1$. Print all sets, each of which is a subset of $U$ and includes $T$ as a subset. Note that we represent $0, 1, ... n-1$ as 00...0001, 00...0010, 00...0100, ..., 10...0000 in binary respectively and the in... | 38,596 |
Score : 100 points Problem Statement We have weather records at AtCoder Town for some consecutive three days. A string of length 3 , S , represents the records - if the i -th character is S , it means it was sunny on the i -th day; if that character is R , it means it was rainy on that day. Find the maximum number of c... | 38,597 |
Sum and Average 販売å䟡ãšè²©å£²æ°éãèªã¿èŸŒãã§ã販売éé¡ã®ç·åèšãšè²©å£²æ°éã®å¹³åãåºåããããã°ã©ã ãäœæããŠãã ããã Input å
¥åã¯ä»¥äžã®åœ¢åŒã§äžããããŸãã 販売å䟡,販売æ°é 販売å䟡,販売æ°é : : ã«ã³ãã§åºåããã販売å䟡ãšè²©å£²æ°éã®çµããè€æ°è¡ã«æž¡ã£ãŠäžããããŸããå
¥åãããå€ã¯ãã¹ãŠ 0 ä»¥äž 1,000 以äžã§ã販売å䟡ãšè²©å£²æ°éã®çµã®æ°ã¯ 100 ãè¶
ããŸããã Output ïŒè¡ç®ã«è²©å£²éé¡ã®ç·åèšïŒæŽæ°ïŒãïŒè¡ç®ã«è²©å£²æ°éã®å¹³å(æŽæ°ïŒãåºåããŠãã ããã 販売æ°éã®å¹³åã«ç«¯æ°ïŒå°æ°ç¹ä»¥äžã®æ°ïŒãçããå Žåã¯å°æ°ç¹ä»¥äžç¬¬ 1 äœãåæšäºå
¥ããŠãã ããã Sample Input 100... | 38,598 |
A: Undo Swapping å顿 $N$ è¡ $N$ åã®ãã¹ç®ã®äžã« $N$ åã®ç³ã眮ããŠãããŸãã $i$ çªç®ã®ç³ã¯ $R_i$ è¡ $C_i$ åã«ãããŸããåããã¹ã«è€æ°ã®ç³ã眮ãããŠããããšã¯ãããŸããã ããªãã¯æ¬¡ã®2çš®é¡ã®æäœãä»»æã®é ã§ä»»æã®åæ°è¡ãããšãã§ããŸãã 2ã€ã®è¡ãéžã³ããããã亀æãã 2ã€ã®åãéžã³ããããã亀æããã $N$ åã®ç³ãããã¹ç®ã®å·Šäžããå³äžã«ãããŠã®å¯Ÿè§ç·äžã«äžŠã¹ãããšãåºæ¥ãããå€å®ããããã°ã©ã ãäœæããŠãã ããã å¯èœãªå Žåã¯å¿
èŠãªæå°ã®æäœåæ°ãåºåããŠãã ãããäžå¯èœãªå Žå㯠$-1$ ãåºåããŠãã ããã ãã ãã 察è§ç·äžã«äžŠã¶ç³ã®é çªã¯é¢ä¿ç¡ã ããšã«æ³šæ... | 38,599 |
éééè³(Train Fare) JOI åœã«ã¯ $N$ åã®éœåžãããïŒãããã $1, 2, ..., N$ ã®çªå·ãä»ããããŠããïŒéœåž 1 ã¯JOI åœã®éŠéœã§ããïŒ ãŸãïŒJOI åœã«ã¯ééäŒç€Ÿãã²ãšã€ã ãããïŒãã®äŒç€Ÿã¯ $M$ åã®è·¯ç·ãéè¡ããŠããïŒãããã®è·¯ç·ã«ã¯ãããã $1, 2, ..., M$ ã®çªå·ãä»ããããŠããïŒ$i$ çªç® $(1 \leq i \leq M)$ ã®è·¯ç·ã¯éœåž $U_i$ ãšéœåž $V_i$ ãåæ¹åã«çµãã§ããïŒéœåžãšéœåžã®éãéé以å€ã§ç§»åããããšã¯ã§ããªãïŒãŸãïŒã©ã®éœåžããã©ã®éœåžãžãããã€ãã®è·¯ç·ãä¹ãç¶ãã§ç§»åããããšãã§ããããã«ãªã£ãŠããïŒ çŸåšïŒã©ã®è·¯ç·ã®éè³ã 1... | 38,600 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.