question_id
stringlengths
6
6
content
stringlengths
1
27.2k
p03740
<span class="lang-en"> <p>Score : <var>500</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Alice and Brown loves games. Today, they will play the following game.</p> <p>In this game, there are two piles initially consisting of <var>X</var> and <var>Y</var> stones, respectively. Alice and Bob ...
p03310
<span class="lang-en"> <p>Score : <var>600</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Snuke has an integer sequence <var>A</var> of length <var>N</var>.</p> <p>He will make three cuts in <var>A</var> and divide it into four (non-empty) contiguous subsequences <var>B, C, D</var> and <var>...
p00496
<H1>倜店(Night Market) </H1> <p> 倪郎くんはJOI 神瀟で開かれる倏祭りに行くこずにした </p> <p> JOI 神瀟に向かう道に沿っお<i>N</i> 個の倜店が開かれおいるそれぞれの倜店には1 から<i>N</i> たでの番号が順番に぀いおおり遊んだ時の楜しさず遊ぶのにかかる時間がそれぞれ敎数で決たっおいる倜店<i>i</i> で遊んだ時の楜しさは<i>A<sub>i</sub></i> で倜店<i>i</i> で遊ぶのにかかる時間は<i>B<sub>i</sub></i> である </p> <p> たた倏祭りのむベントずしお花火倧䌚があり時刻<i>S</i...
p02151
<h1>Problem C: Phone Number</h1> <h2>Problem</h2> <p> 株匏䌚瀟りクニキアの電話番、デンさんは毎日ずおも長い電話番号を電話に入力しおいたす。<br> ある日䜙りにも疲れたデンさんは、疲れからか驚くべき考えに至りたした。<br> 「電話のボタンの配眮を䞊べ替えたら少しでも楜できるのでは」<br> <br> 電話には$3 \times 3$で等間隔に区切られた正方圢があり、9個のマスには䞊べ替えるこずのできる1から9たでのボタンがそれぞれ1぀ず぀぀いおいたす。<br> 電話番号を打぀際、デンさんは片手だけを䜿っお、次の二぀の操䜜を行うこずができたす。<br> </p> <ul> ...
p00029
<H1>English Sentence</H1> <p> Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters. </p> <p> The text includes only alphabetical characters and spaces. A word i...
p02014
<h1>Problem K. Rough Sorting</h1> <!-- Time Limit: 2 sec Memory Limit: 512 MB --> <p> For skilled programmers, it is very easy to implement a sorting function. Moreover, they often avoid full sorting to reduce computation time if it is not necessary. Here, we consider "rough sorting" which sorts an array except for...
p00479
<H1>タむル (Tile)</H1> <h2>問題</h2> <p> JOI 高校では 1 &times; 1 の正方圢のタむルを䜿っお N &times; N の正方圢の壁画を䜜り文化祭で展瀺するこずになったタむルの色は赀青黄の 3 皮類である壁画のデザむンは次の通りであるたず最も倖偎の呚に赀のタむルを貌りその内偎の呚に青のタむルを貌るさらにその内偎の呚に黄色のタむルを貌るこれを N &times; N の正方圢が埋め尜くされるたで繰り返す甚いるタむルの色は䞀番倖偎の呚から順番に赀青黄赀青黄 である </p> <p> 文化祭が近づいおきたある日壁画のうち K 枚のタむルがは...
p02444
<h1>Rotate</h1> <p> Write a program which reads a sequence of integers $A = \{a_0, a_1, ..., a_{n-1}\}$ and rotate specified elements by a list of the following operation: </p> <ul> <li>rotate($b, m, e$): For each integer $k$ ($0 \leq k < (e - b)$), move element $b + k$ to the place of element $b + ((k + (e - m)...
p00183
<H1>䞉目䞊べ</H1> <p> 3 &times; 3 の盀面の䞉目䞊べを考えたしょう。䞉目䞊べは 2 人で行う察戊ゲヌムです。先攻埌攻を決め、䞀人は黒石、䞀人は癜石を打ちたす。盀面に石を亀互に䞀぀ず぀眮いおいき、瞊暪斜めのいずれかの方向に先に 3 ぀自分の石を䞊べた人が勝ちずなりたす。 </p> <p> 盀面の情報を入力ずし、勝敗の刀定を行い、黒が勝ちの堎合は「b」、癜が勝ちの堎合は「w」、どちらもそろっおいない堎合は「NA」ず出力するプログラムを䜜成しおください。 盀面の情報は、3行3列の文字列で構成されたす。「b」は黒石、「w」は癜石、「+」(半角プラ ス)は䜕も眮かれおいない状況を衚したす。ただし、同時...
p02917
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>There is an integer sequence <var>A</var> of length <var>N</var> whose values are unknown.</p> <p>Given is an integer sequence <var>B</var> of length <var>N-1</var> which is known to satisfy the followi...
p03605
<span class="lang-en"> <p>Score : <var>100</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>It is September <var>9</var> in Japan now.</p> <p>You are given a two-digit integer <var>N</var>. Answer the question: Is <var>9</var> contained in the decimal notation of <var>N</var>?</p> </section> <...
p01638
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [['\\(','\\)']] } }); </script> <script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> <h1 class="ndoc-heading1">Problem E: Pie Chart is as easy as pie.</h...
p03255
<span class="lang-en"> <p>Score : <var>700</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Snuke has decided to use a robot to clean his room.</p> <p>There are <var>N</var> pieces of trash on a number line. The <var>i</var>-th piece from the left is at position <var>x_i</var>. We would like t...
p01268
<h1><font color="#000">Problem B:</font> Matsuzaki Number</h1> <p> Matsuzaki 教授は宇宙の真理を研究しおいる科孊者である人生宇宙すべおの答えは 42 であるず蚀われおいるがMatsuzaki 教授はこれだけでは宇宙の真理を解明するには䞍十分であるず考えおいるMatsuzaki 教授は宇宙の真理は 2 ぀のパラメヌタからなる関数で衚されるず考えおおり42 はその 1 ぀に過ぎないずいうのである </p> <p> Matsuzaki 教授の定矩した関数 M(<i>N</i>, <i>P</i>) は<i>N</i> より倧きい玠数を...
p00880
<H1><font color="#000">Problem G:</font> Malfatti Circles</H1> <p> The configuration of three circles packed inside a triangle such that each circle is tangent to the other two circles and to two of the edges of the triangle has been studied by many mathematicians for more than two centuries. Existence and uniqueness...
p01792
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script> </script> <h2>Problem C Casino</h2> <p> Tar...
p00750
<h1><font color="#000000">Problem E:</font> The Most Powerful Spell</h1> <!-- end en only --> <!-- begin en only --> <p> Long long ago, there lived a wizard who invented a lot of "magical patterns." In a room where one of his magical patterns is drawn on the floor, anyone can use magic by casting magic spells! Th...
p01842
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"> </script> <h2>D - むンビゞブル</h2> <h3>Problem Statement</h3> <...
p02297
<H1>Area</H1> <br/> <p> For a given polygon <var>g</var>, computes the area of the polygon. </p> <p> <var>g</var> is represented by a sequence of points <var>p<sub>1</sub></var>, <var>p<sub>2</sub></var>,..., <var>p<sub>n</sub></var> where line segments connecting <var>p<sub>i</sub></var> and <var>p<sub>i+1</sub></v...
p00300
<h1>有益氏のオヌディオルヌム</h1> <p> 数孊者である有益氏の趣味は音楜鑑賞で、家に念願のオヌディオルヌムを䜜りたした。完成したオヌディオルヌムで、友人を招いおお披露目䌚を開きたいず考えおいたす。党員にできるだけ良い音で聎いおもらいたいので、郚屋の䞭の䜕か所かで音を蚈枬し、友人たちの䜍眮での音の質を蚈算する぀もりです。 </p> <p> 蚈枬点は、䞋の図の円匧ず線分の亀点である 1 番から 35 番たでの点から遞択したす。぀の線分䞊にある点は、オヌディオシステムからの距離が 100から 500たで 100ず぀離れお䞊んでいたす。぀の円匧状にある点は、もっずも右のもの1 番から 5 番たでの点か...
p01141
<!-- begin en only --> <h3><U>Lifeguard in the Pool</U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U>プヌルの監芖員</U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> Horton Moore はプヌルの監芖員ずしお働いおい...
p03486
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>You are given strings <var>s</var> and <var>t</var>, consisting of lowercase English letters. You will create a string <var>s'</var> by freely rearranging the characters in <var>s</var>. You will also c...
p01511
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <H1>Three-way Branch</H1> <p> There is a grid that consists of <var>W \times H</var> cells. The upper-left-most cell is <var>(1, 1)</var>. You are standing on the cell of <var>(1,1)</var> and you are going to move to cell of <var>(W, H)</var>. You can only...
p01004
<h1>Problem F: Ballon Contest</h1> <h2>Problem</h2> <p>空の様子がい぀もず違う。色ずりどりの倚圩な熱気球が空を芆っおいた。今日は熱気球の倧䌚だ。<!--倧䌚の䌚堎に行っおみるず、熱気球を䜿ったレクリ゚ヌションが開催されおいた。-->熱気球から萜ずされた埗点付きボヌルを参加者党員で取り合うらしい。<!--残念ながら申し蟌み期限が切れおしたっおいたが、-->せっかくなので優勝者を予想しおみるこずにした。</p> <ul> <li>レクリ゚ヌションにはN人参加する。</li> <li><var> N </var>人の参加者はそれぞれ自分の䜍眮が䞎えられる。耇数の参加者に同じ䜍...
p03039
<span class="lang-en"> <p>Score : <var>500</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>We have a grid of squares with <var>N</var> rows and <var>M</var> columns. Let <var>(i, j)</var> denote the square at the <var>i</var>-th row from the top and <var>j</var>-th column from the left. We wi...
p03193
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>There are <var>N</var> rectangular plate materials made of special metal called AtCoder Alloy. The dimensions of the <var>i</var>-th material are <var>A_i \times B_i</var> (<var>A_i</var> vertically and...
p01454
<H1>Problem H: ねこ鍋改造蚈画仮</H1> <p> あなたは、自宅にたくさんのねこを飌っおいる。そんなあなたの日課は、飌っおいるねこが土鍋の䞭 に入っお昌寝しおいる様子通称ねこ鍋を撮圱するこずだ。䜕匹かのねこが、鍋の䞭でいっしょ に䞞くなっお眠る姿は、実に愛くるしい。 </p> <p> それぞれのねこには、「重さ」<i>m<sub>i</sub></i> ず「Cute」<i>c<sub>i</sub></i> が定矩されおいる。Cute ずは、そのねこ1 匹だけを芋たずきの、愛らしさ・あどけなさ・しなやかさ・やわらかさ・ういういしさ、などを総合的に評䟡した数倀であり、倧きければ倧きいほどそのねこは魅...
p03469
<span class="lang-en"> <p>Score : <var>100</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>On some day in January <var>2018</var>, Takaki is writing a document. The document has a column where the current date is written in <code>yyyy/mm/dd</code> format. For example, January <var>23</var>, <...
p02628
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>A shop sells <var>N</var> kinds of fruits, Fruit <var>1, \ldots, N</var>, at prices of <var>p_1, \ldots, p_N</var> yen per item, respectively. (Yen is the currency of Japan.)</p> <p>Here, we will choose...
p00615
<h1><font color="#000000">Problem A:</font> Traffic Analysis</h1> <p> There are two cameras which observe the up line and the down line respectively on the double lane (please see the following figure). These cameras are located on a line perpendicular to the lane, and we call the line 'monitoring line.' (the red lin...
p01907
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]} }); </script> <script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <h1>C: Fractal Tree</h1> <h2>問題</h2> <p> AORむカちゃんは、フラクタルな(自己盞䌌的な...
p02782
<span class="lang-en"> <p>Score : <var>600</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Snuke is standing on a two-dimensional plane. In one operation, he can move by <var>1</var> in the positive <var>x</var>-direction, or move by <var>1</var> in the positive <var>y</var>-direction.</p> <p...
p03890
<span class="lang-en"> <p>Score : <var>100</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p><em>Kode Festival</em> is an anual contest where the hardest stone in the world is determined. (Kode is a Japanese word for "hardness".)</p> <p>This year, <var>2^N</var> stones participated. The hardnes...
p02278
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"> </script> <H1>Minimum Cost Sort</H1> <p>...
p00245
<H1>タむムセヌル</H1> <p> より良い物を、より安く。今日もどこかのスヌパヌマヌケットで行われるタむムセヌルでは、激しい闘いが繰り広げられおいたす。ここ䌚接にある「LL堂」もそんなスヌパヌマヌケットのひず぀で、他のチェヌン店ず察抗すべく、少し倉わったタむムセヌルを実斜しおいたす。䞀般的なタむムセヌルでは耇数の商品が同じ時間に安くなるものですが、LL堂では察象ずなる商品によっお、タむムセヌルを開始する時間が別々に蚭定されおいたす。 </p> <p> 坂井家はLL堂をよく利甚する家庭の䞀぀です。そんな坂井家では、奥様䞻導のもず、次の日曜に行われるタむムセヌルに向けお䜜戊䌚議を開き、どのような順番で買い物をすれば倀匕きが...
p02556
<span class="lang-en"> <p>Score : <var>500</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>There are <var>N</var> points on the 2D plane, <var>i</var>-th of which is located on <var>(x_i, y_i)</var>. There can be multiple points that share the same coordinate. What is the maximum possible Man...
p00091
<H1>Blur</H1> <p> 図 1 のような 10×10 のマス目の「垃」があり、12のようにX座暙・Y座暙の倀の察でマス目を瀺すこずにしたす。座暙倀は 0 から始たる敎数ずしたす。䟋えば、図 1 の◎の座暙は (1, 2) です。 この「垃」に染料を少しず぀たらしお染物を䜜りたす。たらす染料の滎には「倧」「䞭」「小」の 3 サむズがあり、染料の滎の萜ちたマス目を䞭心に図 1 のように呚囲も色が぀きたす。図 1 で☆が䞭心、○が色のにじむ範囲です。 </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_19...
p02106
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"> </script> <h1>Problem I: Tree-Light</h1> <h2>Problem</h2> <p>あなたはツリヌラむトずいうツリヌ状の照明噚具を買っおきた。</p> <p>この照明噚具には<var>n</var>個の接点があり、それぞれ<var>0</var>から<var>n&minus;1</var>たでの番号が぀いおいる。各接点は10段階...
p03347
<span class="lang-en"> <p>Score : <var>700</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>There is a sequence <var>X</var> of length <var>N</var>, where every element is initially <var>0</var>. Let <var>X_i</var> denote the <var>i</var>-th element of <var>X</var>.</p> <p>You are given a sequ...
p00992
<h1>Problem C : War</h1> <p> A囜ずB囜ずいう぀の囜が戊争をしおいる。A囜の軍人であるあなたは<i>n</i>人の兵士を率いお、B囜の領土を占領する事になった。 </p> <p> B囜の領土は次元グリッドで衚されおいる。あなたが最初に占領する堎所は二次元グリッド䞊のあるマスである。 あなたが率いおいる兵士たちは、それぞれh_iの䜓力を持っおいる。 それぞれの兵士は䜓力を1を消費しお移動するこずができる。 珟圚いるマスを(a,b)ずするず、(a+1,b),(a-1,b),(a,b+1),(a,b-1)の4方向を移動先ずしお遞ぶこずが可胜である。 兵士は䜓力が0になったらそこから動くこずができ...
p01680
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <h3>Problem Statement</h3> <p>&...
p00838
<H1><font color="#000">Problem C:</font> Colored Cubes</H1> <p> There are several colored cubes. All of them are of the same size but they may be colored differently. Each face of these cubes has a single color. Colors of distinct faces of a cube may or may not be the same. </p> <p> Two cubes are said to be <i>identi...
p02805
<span class="lang-en"> <p>Score : <var>600</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Given are <var>N</var> points <var>(x_i, y_i)</var> in a two-dimensional plane.</p> <p>Find the minimum radius of a circle such that all the points are inside or on it.</p> </section> </div> <div class=...
p03717
<span class="lang-en"> <p>Score : <var>800</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>There are <var>N</var> squares arranged in a row. The squares are numbered <var>1</var>, <var>2</var>, <var>...</var>, <var>N</var>, from left to right.</p> <p>Snuke is painting each square in red, gree...
p03202
<span class="lang-en"> <p>Score : <var>700</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>There are <var>N</var> strings arranged in a row. It is known that, for any two adjacent strings, the string to the left is lexicographically smaller than the string to the right. That is, <var>S_1&lt;S...
p01395
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <h1><font color="#000">問題 H </font>あばれうなぎ</h1> <h2>問題文</h2> <p>き぀ねのしえるはうなぎを食べるのが奜きである</p> <p><var>2T+1</var> 枚の鉄板が連続しお䞊んでおり順番に <var>-T, -T+1, ..., T</var> の番号が付いおいるしえるはこれらの鉄板に熱を加え生きたうなぎを焌こうずしおいるうなぎを焌く手順は以䞋のようなものである</p> <ul> <li>たず時刻 <var>t=-1</...
p02940
<span class="lang-en"> <p>Score : <var>800</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>We have <var>3N</var> colored balls with IDs from <var>1</var> to <var>3N</var>. A string <var>S</var> of length <var>3N</var> represents the colors of the balls. The color of Ball <var>i</var> is red i...
p03652
<span class="lang-en"> <p>Score : <var>700</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Takahashi is hosting an sports meet. There are <var>N</var> people who will participate. These people are conveniently numbered <var>1</var> through <var>N</var>. Also, there are <var>M</var> options of...
p02413
<H1>Spreadsheet</H1><br> <p> Your task is to perform a simple table calculation. </p> <p> Write a program which reads the number of rows <var>r</var>, columns <var>c</var> and a table of <var>r</var> &times; <var>c</var> elements, and prints a new table, which includes the total sum for each row and column. </p...
p00584
<h1>コむン集め(Coin Collecting)</h1> <p> JOI 氏のコレクションルヌムには非垞に倧きな机がありその䞊には䜕枚もの貎重なコむンがある机の掃陀をするためにJOI 氏はコむンを敎理しお䞊べるこずにした </p> <p> 机は2 000 000 001 $\times$ 2 000 000 001 のマス目になっおいる列には巊から順に-1 000 000 000 から1 000 000 000たでの番号が぀けられおおり行には䞋から順に-1 000 000 000 から1 000 000 000 たでの番号が぀けられおいる列の番号が$x$行の番号が$y$ であるマスを($x, y$)...
p02043
<h1>G: むルミネヌション</h1> <h2>問題</h2> <p> $1 \leq x \leq h , 1 \leq y \leq w$ をみたす栌子点 $(x,y)$ に電球がある. </p> <p> 電源装眮は座暙 $(i+0.5,j+0.5) (1 \leq i < h,1 \leq j < w, i+j$ は偶数に蚭眮されおいる(14:21修正). 座暙 $(i+0.5,j+0.5)$ に蚭眮されおいる電源装眮をオンにするず, 座暙 $(i,j),(i+1,j),(i,j+1),(i+1,j+1)$ に存圚する $4$ ぀の電球が光る. </p> <p> $(i,j...
p03081
<span class="lang-en"> <p>Score : <var>500</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3> <p>There are <var>N</var> squares numbered <var>1</var> to <var>N</var> from left to right. Each square has a character written on it, and Square <var>i</var> has a letter <var>s_i</var>. Besides, there i...
p01546
<h1>Sports Days 2.0</h1> <p> 䌚接倧孊附属小孊校䌚接倧小は日本有数の競技プログラマヌ逊成校ずしお有名である。 もちろん、運動䌚に参加しおいるずきでさえアルゎリズムの修行を欠かせない。 競技プログラミング郚郚長のあなたはもちろんこの倧䌚でも勝利したい。 今回はある競技に泚目する。 </p> <p> ある競技ずは䌚接倧小で行われおいる䌝統的な競技だ。 校庭にコヌンが<var>V</var>個眮いおある。 コヌンのいく぀かのペアは癜線で描かれた矢印で結ばれおいる。 矢印の先は片偎だけに぀いおおり、敎数が䜵蚘されおいる。 同じコヌンのペアがの耇数の矢印に結ばれおいる堎合もある。 </p> <p> 競技者は...
p01116
<h3>For Programming Excellence</h3> <!-- end en only --> <!-- begin en only --> <p> A countless number of skills are required to be an excellent programmer. Different skills have different importance degrees, and the total programming competence is measured by the sum of products of levels and importance deg...
p02690
<span class="lang-en"> <p>Score : <var>400</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Give a pair of integers <var>(A, B)</var> such that <var>A^5-B^5 = X</var>. It is guaranteed that there exists such a pair for the given integer <var>X</var>.</p> </section> </div> <div class="part"> <s...
p03982
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"><section> <h3>Problem Statement</h3> <p> Kyoto University decided to build a straight wall on the west side of the university to protect against gorillas that attack the university from the west every night. Since it i...
p00357
<H1>Trampoline</H1> <p> A plurality of trampolines are arranged in a line at 10 m intervals. Each trampoline has its own maximum horizontal distance within which the jumper can jump safely. Starting from the left-most trampoline, the jumper jumps to another trampoline within the allowed jumping range. The jumper wan...
p00707
<H1>The Secret Number</H1> <P> Your job is to find out the secret number hidden in a matrix, each of whose element is a digit ('0'-'9') or a letter ('A'-'Z'). You can see an example matrix in Figure 1. </P> <CENTER> <DIV style="margin-bottom: 5mm"><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_sec...
p01815
<h2>Escape</h2> <p> 頂点に正の倀を持぀無向グラフが䞎えられる。 頂点には 1 から <var>N</var> の番号が぀いおおり、<var>i</var> 番目の頂点は <var>w_i</var> の倀を持っおいる。 1 番目の頂点からスタヌトし、盎前に通った蟺を通るこずができないずいう制玄のもずでグラフ䞊を移動するこずができる。 各頂点では初めお蚪れた時に限りその頂点が持぀倀の点数を埗られる。 </p> <p> 取埗できる点数の総和の最倧倀を求めよ。 </p> <h3>Constraints</h3> <ul> <li><var>1 &le; N &le; 100000</var></li...
p03828
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>You are given an integer <var>N</var>. Find the number of the positive divisors of <var>N!</var>, modulo <var>10^9+7</var>.</p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <l...
p00212
<H1> 高速バス</H1> <p> A 君は高校の䌑みを利甚しお、高速バス(以䞋、「バス」 )で䞀人旅をする蚈画を立おおいたす。たず、A 君は䞀番行っおみたい町を遞んでそこを目的地にしたした。次に出発地から目的地たでバスを乗り継いでいくルヌトを決めなければなりたせん。乗り継ぎをするずきは、バスを降りおから別のバスに乗り換えるので、それぞれのバスの乗車刞が必芁になりたす。 </p> <p> A 君は芪戚のおじさんからバスの割匕刞を䜕枚かもらいたした。 この刞を 1 枚䜿うず乗車刞 1 枚を半額で賌入できたす。䟋えば、図 1 の出発地5から目的地1ぞ行く堎合には、5→4→6→2→1ず5→3→1の二぀の経路が考えられたす...
p00642
<H1><font color="#000000">Problem F:</font> Ben Toh</H1> <p> As usual, those who called wolves get together on 8 p.m. at the supermarket. The thing they want is only one, a box lunch that is labeled half price. Scrambling for a few discounted box lunch, they fiercely fight every day. And those who are blessed by hung...
p01950
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }}); </script> <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config...
p02385
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"> </script> <h1>Dice III</h1><br> <p> Wr...
p01403
<h2> Problem F: Farey Sequence </h2> <p> slipは数字を眺めるのが奜きである。 ファむルをダりンロヌドしおいるずきの、残り時間を眺めおいるだけで、時間を朰せるほどである。 そんなslipが友人から面癜い数列を教えられた。 その数列の定矩は以䞋のずおりである。 </p> <p> 䞀般項を<i>F<sub>n</sub></i>ず衚わす。 <i>F<sub>n</sub></i>ずは、<i>n</i>以䞋の分母を持぀0以䞊1以䞋のすべおの玄分された分数(既玄分数)を小さな順から䞊べたものである。 ただし、敎数0、1はそれぞれ分数0/1、1/1ずしお扱われる。 </p> <p> ぀た...
p01053
<h1>Lucky Number</h1> <h2>Problem</h2> <p> 0 から <var>N</var>-1 たでの数字がありたす。 <var>M</var>+1日間のラッキヌナンバヌを以䞋の方法で遞びたいず思いたす。 最初の日にラッキヌナンバヌをランダムに決めたす。 <var>i</var>日埌のラッキヌナンバヌを <var>A</var> 、<var>i</var>+1日埌のラッキヌナンバヌを <var>B</var> ずするず、 </p> <pre> <var>B</var> = ( <var>A</var> + <var>j</var> ) % <var>N</var> ただし <var>j<...
p03594
<span class="lang-en"> <p>Score : <var>700</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>We have a grid with <var>H</var> rows and <var>W</var> columns of squares. We will represent the square at the <var>i</var>-th row from the top and <var>j</var>-th column from the left as <var>(i,\ j)</...
p03701
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>You are taking a computer-based examination. The examination consists of <var>N</var> questions, and the score allocated to the <var>i</var>-th question is <var>s_i</var>. Your answer to each question w...
p02813
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>We have two permutations <var>P</var> and <var>Q</var> of size <var>N</var> (that is, <var>P</var> and <var>Q</var> are both rearrangements of <var>(1,~2,~...,~N)</var>).</p> <p>There are <var>N!</var> ...
p01696
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <!-- begin en only --> <!--<h3...
p00984
<h2>Halting Problem</h2> <p> A unique law is enforced in the Republic of Finite Loop. Under the law, programs that never halt are regarded as viruses. Releasing such a program is a cybercrime. So, you want to make sure that your software products always halt under their normal use. </p> <p> It is widely known tha...
p03351
<span class="lang-en"> <p>Score : <var>100</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Three people, A, B and C, are trying to communicate using transceivers. They are standing along a number line, and the coordinates of A, B and C are <var>a</var>, <var>b</var> and <var>c</var> (in meter...
p02110
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"> </script> <h1>Problem M: Settler</h1> <h2>Problem</h2> <p> 二次元平面䞊に<var>N</var>個の空き地がある。空き地にはそれぞれ1から<var>N</var>たでの番号が割り振られおいる。どの空き地もずおも小さいので、点ずみなすこずができる。<var>i</var>番目の空き地は(<var>x<sub>...
p00087
<H1>未熟者の数匏</H1> <p>博士 : ピヌタヌ君、぀いにやったよ。</p> <p>ピヌタヌ : たたですか。今床はどんなくだらない発明ですか。</p> <p>博士 : ぀いに数匏を蚈算機で凊理する画期的な方法を思い぀いたんだ。この衚をみおごらん。 </p> <center> <table border=1> <tr><td width=200 align=center>通垞の蚘法</td><td width=200 align=center>博士の「画期的な」蚘法</td></tr> <tr><td>1 + 2</td><td>1 2 +</td></tr> <tr><td>3 * 4 + 7</td><td>...
p02540
<span class="lang-en"><p>Score : <var>300</var> points</p><div class="part"><section><h3>Problem Statement</h3><p>There are <var>N</var> cities on a 2D plane. The coordinate of the <var>i</var>-th city is <var>(x_i, y_i)</var>. Here <var>(x_1, x_2, \dots, x_N)</var> and <var>(y_1, y_2, \dots, y_N)</var> are both permua...
p02055
<h2>D: Two Colors Sort</h2> <h3>問題</h3> <p>umg 君は散歩䞭に <var> 1,2, ... ,N </var> を䞊び倉えおできる長さ <var>N</var> の数列 <var> P_1, P_2, ..., P_N </var> を芋぀けたした。</p> <p>umg 君は䞍思議な力を䜿うこずで、同じ色に塗られた異なる数を二぀遞んで堎所を亀換するこずができたす。</p> <p>umg 君は、数列に含たれる数のうち <var>R</var> 個を赀に、残りの <var>N-R</var> 個を青に塗るこずで数列を昇順に䞊び替えられるようにしたいず考えたした。</p> <p>um...
p00068
<H1>茪ゎム</H1> <p> <var>n</var> 本の釘を平板䞊の座暙 <var>P<sub>1</sub></var> (<var>x<sub>1</sub></var>, <var>y</sub>1</sub></var>), <var>P<sub>2</sub></var> (<var>x<sub>2</sub></var>, <var>y<sub>2</sub></var>), <var>P<sub>3</sub></var> (<var>x<sub>3</sub></var>, <var>y<sub>3</sub></var>),..., <var>P<sub>n</sub></var> (<var>x<...
p00592
<H1>Boring Commercial</H1> <p> Now it is spring holidays. A lazy student has finally passed all final examination, and he decided to just kick back and just watch TV all day. Oh, his only source of entertainment is watching TV. And TV commercial, as usual, are a big nuisance for him. He can watch any thing on ...
p02405
<H1>Print a Chessboard</H1> <p> Draw a chessboard which has a height of <var>H</var> cm and a width of <var>W</var> cm. For example, the following figure shows a chessboard which has a height of 6 cm and a width of 10 cm. </p> <pre> #.#.#.#.#. .#.#.#.#.# #.#.#.#.#. .#.#.#.#.# #.#.#.#.#. .#.#.#.#.# </pre> <p> Note ...
p00438
<H1>通孊経路</H1> <h2>問題</h2> <p> 倪郎君の䜏んでいるJOI垂は南北方向にたっすぐに䌞びる a 本の道路ず東西方向にたっすぐに䌞びる b 本の道路により碁盀の目の圢に区分けされおいる </p> <p> 南北方向の a 本の道路には西から順に 1, 2, ... , a の番号が付けられおいるたた東西方向の b 本の道路には南から順に 1, 2, ... , b の番号が付けられおいる西から i 番目の南北方向の道路ず南から j 番目の東西方向の道路が亀わる亀差点を (i, j) で衚す </p> <p> 倪郎君は亀差点 (1, 1) の近くに䜏んでおり亀差点 (a, b) ...
p01679
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script> <h3>Problem Statement</h3> <p>Y...
p03644
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Takahashi loves numbers divisible by <var>2</var>.</p> <p>You are given a positive integer <var>N</var>. Among the integers between <var>1</var> and <var>N</var> (inclusive), find the one that can be di...
p02956
<span class="lang-en"> <p>Score : <var>600</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>We have a set <var>S</var> of <var>N</var> points in a two-dimensional plane. The coordinates of the <var>i</var>-th point are <var>(x_i, y_i)</var>. The <var>N</var> points have distinct <var>x</var>-c...
p01383
<div> <h1 class="title">問題 H : キャッシュ戊略</h1> <p>今G○○gle Code Jam の地区倧䌚が始たろうずしおいる 斜め右前の垭に座っおいる男の ID は lyrically ず蚀うらしい 東京倧孊時代の蚘憶に䌌たような ID の仲間が居た芚えがあるが僕の仲間は䞀人残さず矎少女だったはずだ</p> <p>僕の蚘憶の䞭の lyrically はアルゎリズムの力や実装の力もさながら 気合で問題に正解するこずにも定評があった 䟋えば蚈算量が倚少悪いプログラムでも䞊手な実装をするこずで高速にし 正解ずするようなこずも埗意ずしおいた</p> <p>プログラムを高速に...
p01229
<h1><font color="#000">Problem G:</font>゚ナゞヌ・トランスポヌタヌ</h1> <p> ずある研究所で ゚ネルギヌ䌝達甚の媒䜓の開発をしおいた この媒䜓は図3に瀺すような特殊な物質からなる ポリマヌ構造をなしおいる </p> <center> <table> <tr> <td> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_energy" alt="゚ネルギヌ䌝達甚媒䜓の構造"> </td> </tr> <tr> ...
p03214
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3> <p>Niwango-kun is an employee of Dwango Co., Ltd.<br/> One day, he is asked to generate a thumbnail from a video a user submitted.<br/> To generate a thumbnail, he needs to select a frame of the video acc...
p01803
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]} }); </script> <script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <!-- begin en only --> <h3><u>Airport Codes</u></h3> ...
p00711
<H1><font color="#000">Problem B:</font> Red and Black</H1> <P> There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can't move on red tiles, he can move only on black tiles...
p00341
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }}); </script> <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script> <H1>棒で䜜る盎方䜓</H1> <p> アむヅ攟送協䌚の教育番組(教育)では...
p03994
<span class="lang-en"> <p>Score : <var>400</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Mr. Takahashi has a string <var>s</var> consisting of lowercase English letters. He repeats the following operation on <var>s</var> exactly <var>K</var> times.</p> <ul> <li>Choose an arbitrary letter on...
p02686
<span class="lang-en"> <p>Score : <var>600</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>A <strong>bracket sequence</strong> is a string that is one of the following:</p> <ol> <li>An empty string;</li> <li>The concatenation of <code>(</code>, <var>A</var>, and <code>)</code> in this order, ...
p01100
<h3>Gift Exchange Party</h3> <p> A gift exchange party will be held at a school in TKB City. </p> <p> For every pair of students who are close friends, one gift must be given from one to the other at this party, but not the other way around. It is decided in advance the gift directions, that is, which student of ea...
p01550
<h1>問題名</h1> <p>今 <var>n</var> 枚の数字が曞かれたカヌドがありたす。これらの䞀郚たたは党郚を適圓に䞊べお数字を䜜るこずを考えたす。この時䜜られる数字を党お足した数を求めお䞋さい。 </p> <p>䟋えば、 1 ず 2 があったら、䜜られる数字は 1, 2, 12, 21 の 4 ぀なので、党お足した数は 36 になりたす。䞊べた結果同じ数字が出来おも違う䞊べ方だずしたら別々に足したす。たずえば、 1 ずいうカヌドず 11 ずいうカヌドがあったら䞊べお 111 になる䞊べ方が2通りありたすがそれぞれ別のものずしお足し合わせたす。カヌドの䞭にリヌディングれロのカヌドはありたせんし、リヌディングれロになる...
p03097
<span class="lang-en"> <p>Score : <var>800</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>You are given integers <var>N,\ A</var> and <var>B</var>. Determine if there exists a permutation <var>(P_0,\ P_1,\ ...\ P_{2^N-1})</var> of <var>(0,\ 1,\ ...\ 2^N-1)</var> that satisfies all of the fol...
p03582
<span class="lang-en"> <p>Score : <var>1600</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>For a string <var>S</var>, let <var>f(S)</var> be the lexicographically smallest cyclic shift of <var>S</var>. For example, if <var>S = </var><code>babca</code>, <var>f(S) = </var><code>ababc</code> be...
p03078
<span class="lang-en"> <p>Score: <var>400</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3> <p>The Patisserie AtCoder sells cakes with number-shaped candles. There are <var>X</var>, <var>Y</var> and <var>Z</var> kinds of cakes with <var>1</var>-shaped, <var>2</var>-shaped and <var>3</var>-shaped ...
p01045
<h1>Problem I: Hopping Mind</h1> <h2>Problem</h2> <p> チ゚ノずカカオは同じ喫茶店で働く姉効である。2人はずおも仲が良く、ある日、ずあるテヌブルゲヌムで遊ぶこずになった。 </p> <p> ゲヌムは<var>R</var>マス&times;<var>C</var>マスの盀面ず、駒ずしおうさぎのTPを甚いる。盀面の各マスは癜か黒の色が塗られおいる。最初にTPを盀面の右䞋(<var>R</var>,<var>C</var>)におき、2人で次の行動を亀互に行う。TPの珟圚の䜍眮を(<var>a</var>,<var>b</var>)ずするず、そこからゞャンプ可胜な䜍眮(<var>...
p03428
<span class="lang-en"> <p>Score : <var>600</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>There are <var>N</var> holes in a two-dimensional plane. The coordinates of the <var>i</var>-th hole are <var>(x_i,y_i)</var>.</p> <p>Let <var>R=10^{10^{10^{10}}}</var>. Ringo performs the following ope...
p01415
<H1>I: Starting Line</H1> <p> ICPC で良い成瞟を収めるには修行が欠かせないうさぎは ICPC で勝ちたいので今日も修行をするこずにした </p> <p> 今日の修行は䞀盎線䞊の道を走っお䜓力ず刀断力を逊おうずいうものであるうさぎは今スタヌトラむンに立っお長い長い道を芋枡しおいる </p> <p> 道の途䞭にはいく぀かニンゞンが眮かれおおりうさぎはニンゞンを食べるず加速するこずができる加速しおいないずきのうさぎの走る速さは毎秒 <i>U</i> メヌトルであるがニンゞンを食べるこずで最埌のニンゞンを食べおから <i>T</i> 秒埌たでは速さが毎秒 <i>V</i> メヌ...
p02393
<H1>Sorting Three Numbers</H1> <p> Write a program which reads three integers, and prints them in ascending order. </p> <H2>Input</H2> <p> Three integers separated by a single space are given in a line. </p> <H2>Output</H2> <p> Print the given integers in ascending order in a line. Put a single space betwe...