question_id
stringlengths
6
6
content
stringlengths
1
27.2k
p00899
<H1><font color="#000">Problem F: </font>City Merger</H1> <p> Recent improvements in information and communication technology have made it possible to provide municipal service to a wider area more quickly and with less costs. Stimulated by this, and probably for saving their not sufficient funds, mayors of many citi...
p00030
<H1>敎数の和</H1> <p> 0 から 9 の数字から異なる <var>n</var> 個の数を取り出しお合蚈が <var>s</var> ずなる組み合わせの数を出力するプログラムを䜜成しおください。<var>n</var> 個の数はおのおの 0 から 9 たでずし、぀の組み合わせに同じ数字は䜿えたせん。たずえば、<var>n</var> が 3 で <var>s</var> が 6 のずき、3 個の数字の合蚈が 6 になる組み合わせは、<br/> <br/> 1 + 2 + 3 = 6<br/> 0 + 1 + 5 = 6<br/> 0 + 2 + 4 = 6<br/> <br/> の 3 通りずなりたす。 </p...
p00460
<H1> ビンゎ</H1> <h2>問題</h2> <p> あるプログラミングコンテストでは,競技埌の懇芪䌚でビンゎゲヌムをする習わしがあるしかし,このビンゎゲヌムで䜿うビンゎカヌドは少々特殊で,以䞋の条件に埓っお䜜成される </p> <ul> <li> ビンゎカヌドは N 行 N 列のマス目に区切られおおり各マス目には正敎数が぀ず぀曞かれおいるそれらの敎数は党お異なる</li> <li> マス目に曞かれおいる敎数は 1 以䞊 M 以䞋である</li> <li> ビンゎカヌドに曞かれおいるN×N個の敎数の合蚈は S である</li> <li> どの列を芋たずきも䞊から䞋に...
p00175
<H1>進数</H1> <p> 10 進数は珟圚䜿われおいる䞀般的な蚘数法で、0、1、2、3、4、5、6、7、8、9 の10 個の蚘号を甚いお党おの数字を衚したす。 </p> <p> 2 進数はコンピュヌタの䞖界でよく䜿われる蚘数法で、0 ず1 の二぀の蚘号を甚いお党おの数字を衚したす。 </p> <p> 4 進数で甚いられるのは 0、1、2、3 の 4 ぀の数字だけです。4 進数では 0 から順に数を増やしおいったずきに 4 たで来たら次の䜍に桁䞊がりしたす。そのため、10 進数の 4 は桁䞊がりしお「10」ずいう衚珟になりたす。 </p> <center> <table> <tr> <td width="80...
p02148
<h1>Problem L: Tousa Tree</h1> <h2>Problem</h2> <p>君は䞀昚日、友人のトりサから䞀぀、頌み事をされた。なんでも、朚に等差数列を食っお誕生日パヌティヌに䜿いたいのだが、朚が倧きすぎお䞀人ではずおもできないのだずいう。そこで、優秀なプログラマである君に、効率的に朚に等差数列を食るプログラムを曞いおもらいたいそうだ。君ずトりサは旧知の芪友である。君はトりサの頌み事を受けるこずにした。</p> <p>食り付けをする$N$ノヌドの朚が䞎えられる。朚のノヌドには$0$から$N-1$たでの番号が振られおいる。最初、朚のノヌドの点数は党お$0$である。プログラムは、以䞋の二぀のク゚リに察応しなけれ...
p00525
<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> 切り取り線(Cutting) </H1> <br...
p00876
<H1><font color="#000">Problem C:</font> Swimming Jam</H1> <p> Despite urging requests of the townspeople, the municipal office cannot afford to improve many of the apparently deficient city amenities under this recession. The city swimming pool is one of the typical examples. It has only two swimming lanes. The Muni...
p03759
<span class="lang-en"> <p>Score : <var>100</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Three poles stand evenly spaced along a line. Their heights are <var>a</var>, <var>b</var> and <var>c</var> meters, from left to right. We will call the arrangement of the poles <em>beautiful</em> if th...
p01764
<h1>E : Sigma / Σ</h1> <h1>Problem</h1> <p>小孊生のづあい君は同じ足し算にも埗意䞍埗意があり、 0 以䞊の敎数 <em>X</em>, <em>Y</em> に察しお、<em>X</em> + <em>Y</em> を蚈算するのにかかる時間(秒)が次のように決たる。</p> <ul> <li>1 の䜍から順番に蚈算しおいく。</li> <li>10 進数衚蚘で 10<sup><em>i</em></sup> 䜍の蚈算には <em>x<sub>i</sub></em> × <em>y<sub>i</sub></em> + <em>c<sub>i</sub></em> 秒かかる。 <ul...
p03309
<span class="lang-en"> <p>Score : <var>300</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 freely choose an integer <var>b</var>. Here, he will get sad if <var>A_i</var> and <var>b+i</var> are far from each othe...
p01334
<h1><font color="#000">Problem B:</font> Let's JUMPSTYLE</h1> <h2>Description</h2> <p>螊りの奜きなFはずあるダンスホヌルでJUMPSTYLEず呌ばれるハヌドコアな螊りの緎習をするこずにした</p> <p>フロアはN×Nの栌子状にタむルが敷き詰められおいる 螊りの緎習をサポヌトするため各タむルには次のステップに飛び移るべきタむルの座暙が曞かれおいるFは日々の緎習によっお匷靭な運動神経を持っおおりフロア内の任意のタむルぞ飛び移るこずができる</p> <p>Fは十分に長い時間この螊りを続けおいけばい぀か定垞状態に入り同じル...
p01123
<!--<h2>Problem G</h2>--> <!-- begin en only --> <h3>Let's Move Tiles!</h3> <!-- end en only --> <!-- begin en only --> <p> You have a framed square board forming a grid of square cells. Each of the cells is either empty or with a square tile fitting in the cell engraved with a Roman character. You can tilt the boar...
p01573
<H1><font color="#000">Problem C:</font> Complex Integer Solutions</H1> <p> Let <i>f</i>(<i>x</i>) = <i>a</i><sub>0</sub> + <i>a</i><sub>1</sub><i>x</i> + <i>a</i><sub>2</sub><i>x</i><sup>2</sup> + ... + <i>a<sub>d</sub>x<sup>d</sup></i> be the function where each <i>a<sub>i</sub></i> (0 &le; <i>i</i> &le; <i>d</i>) ...
p01089
<h2>Deadlock Detection</h2> <p> In concurrent processing environments, a deadlock is an undesirable situation where two or more threads are mutually waiting for others to finish using some resources and cannot proceed further. Your task is to detect whether there is any possibility of deadlocks when multiple threads...
p00732
<h1><font color="#000000">Problem E:</font> Twirl Around</h1> <!-- begin en only --> <p> Let's think about a bar rotating clockwise as if it were a twirling baton moving on a planar surface surrounded by a polygonal wall (see Figure 1). </p> <!-- end en only --> <!-- <img src="https://judgeapi.u-aizu.ac.jp/resources...
p01820
<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> <h3>Problem B: Vector Field</h3> ...
p00362
<!--<H1>Network Charging System</H1>--> <h1>Charging System for Network</h1> <p> There is a network consisting of <var>N</var> machines (sequentially numbered from 0 to <var>N</var>-1) interconnected through <var>N</var>-1 bidirectional communication cables. Any two machines can perform bidirectional communication t...
p00698
<H1> Missing Numbers </H1> <P> Toshizo is the manager of a convenience store chain in Hakodate. Every day, each of the stores in his chain sends him a table of the products that they have sold. Toshizo's job is to compile these figures and calculate how much the stores have sold in total. </P> <P> The type of a t...
p00677
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <h1>Make KND So Fat</h1> <h2>Problem</h2> <p>KND君は䌚接倧孊に圚籍する孊生プログラマである。圌の隣人はずおも迷惑なこずで知られおいる。隣人は圌が甘党であるこずを知り、必芁以䞊に甘味を差し入れお圌を倪らせようず画策しおいる。そのために、圓の隣人であるあなたは友人からずある甘味凊を玹介しおもらった。</p> <p>しかし、その甘味凊での商品の販売の仕方は少し倉わっおいる。その販売方法ずは、甘味セットず呌ばれる甘味の組を日替わりで販売するずいうものだ。予算内であればその日...
p01965
<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...
p03958
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>There are <var>K</var> pieces of cakes. Mr. Takahashi would like to eat one cake per day, taking <var>K</var> days to eat them all.</p> <p>There are <var>T</var> types of cake, and the number of the cak...
p00227
<H1>お客様倧感謝祭</H1> <p> 悪倩候が続き野菜の䟡栌が高隰する䞭、セブンマヌトではお客様に野菜のたずめ買いセヌルを実斜しおいたす。 日ごろなかなか店頭に䞊ばない野菜もお手頃䟡栌で手に入るずあっお、 店内はずおも賑わっおいたす。 </p> <p> ある日、束長団地に䜏む仲良し 3 人組がセブンマヌトの広告を手に話に花を咲かせおいたした。今回のセヌルは「お客様倧感謝祭」ず銘打っただけに、袋詰めした野菜の䞭で最も安いものが無料になるのが目玉ずなっおいたす。広告を読んでみるず、どうやら以䞋のようなセヌルのようです。 </p> <ul> <li> 1 ぀の袋には <var>m</var> 個たで野菜...
p01066
<h1>Reflection Warp Machine</h1> <h2>Problem</h2> <p> ずある宇宙では、2次元の栌子点䞊に<var>n</var>個の星が存圚し、宇宙人達はReflection Warp Machineを䜿い、星間を移動しおいる。<br> この装眮は、任意の䜍眮、角床で盎線を匕くこずができる。<br> この盎線を察称軞ずしお、珟圚いる座暙から線察称の座暙に移動するこずができる。<br> ただし、星が存圚しない座暙に移動するこずはできない。<br> 䞀床匕いた盎線は䜕床でも利甚できる。<br> 珟圚、(<var>x<sub>0</sub></var>,<var>y<sub>0</sub></...
p01436
<script type="text/javascript" src="./varmath.js" charset="UTF-8"></script> <h2>問題文</h2> <p> <i>キュゥべえ</i>はなかなか契玄を結んでくれない<i>鹿目たどか</i>にしびれを切らせお゜りルゞェムゲヌムず称しお<i>䜐倉杏子</i>ず<i>矎暹さやか</i>の゜りルゞェムの䞭身 (魂) を <var>W</var> 列 <var>H</var> 段のロッカヌの䞭に隠しおしたったそこで<i>たどか</i>は<i>杏子</i>ず<i>さやか</i>を助け出したいしかし契玄を結ばずに助けるにはロッカヌボックスの壁を操䜜しお <v...
p02133
<h1>Problem J: Matrix</h1> <h2>Problem</h2> <p> 長さ$H$の数列$A$ず長さ$W$の数列$B$が䞎えられる。<br><br> $H$行$W$列からなる行列$C$を以䞋のように定矩する。<br> $ C_{i,j} = A_i \times B_j (1 \leq i \leq H, 1 \leq j \leq W) $ <br><br> 以䞋の四皮類のク゚リを合蚈$Q$回凊理せよ。<br> <br>ク゚リ1<br> $1$ $a$ $b$ $v$<br> $ A_i ( a \leq i \leq b) $に$v$を加える <br> <b...
p02099
<h1>Problem B: GPA JANKEN</h1> <h2>Problem</h2> <p> GPAずは「Galaxy Point of Aizu」の略で、0から4たでの実数倀を取る。<br> GPAじゃんけんは二人で行うゲヌムである。各々が「じゃんけん、ぜんほい」の合図で互いにグヌ、チョキ、パヌのどれか奜きな手を出した埌、GPAが高い人が勝者ずなり、䜎い人が敗者ずなる。同じ堎合は匕き分けずなる。 </p> <p> <var>N</var> 人のGPAのデヌタが䞎えられるので、総圓たり戊をした時のそれぞれの勝ち点を出力せよ。<br> ただし、勝ち点は勝ちの時3、匕き分けの時1、負けの時0ずする。 </p> <p...
p02563
<span class="lang-en"> <p>Score : <var>100</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>You are given two integer arrays <var>a_0, a_1, ..., a_{N - 1}</var> and <var>b_0, b_1, ..., b_{M - 1}</var>. Calculate the array <var>c_0, c_1, ..., c_{(N - 1) + (M - 1)}</var>, defined by <var>c_i = \...
p02830
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Given are strings <var>s</var> and <var>t</var> of length <var>N</var> each, both consisting of lowercase English letters.</p> <p>Let us form a new string by alternating the characters of <var>S</var> a...
p03722
<span class="lang-en"> <p>Score : <var>400</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>There is a directed graph with <var>N</var> vertices and <var>M</var> edges. The <var>i</var>-th edge <var>(1≀i≀M)</var> points from vertex <var>a_i</var> to vertex <var>b_i</var>, and has a weight <var...
p03688
<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> cats. We number them from <var>1</var> through <var>N</var>.</p> <p>Each of the cats wears a hat. Cat <var>i</var> says: "there are exactly <var>a_i</var> different colors among t...
p03372
<span class="lang-en"> <p>Score : <var>500</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>"Teishi-zushi", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is <var>C</var> meters. Customers cannot go inside the counter.</p> <p>Na...
p00948
<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 Distribution Center ...
p02975
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Snuke has <var>N</var> hats. The <var>i</var>-th hat has an integer <var>a_i</var> written on it.</p> <p>There are <var>N</var> camels standing in a circle. Snuke will put one of his hats on each of the...
p03667
<span class="lang-en"> <p>Score : <var>1000</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>There are <var>N</var> balls in a row. Initially, the <var>i</var>-th ball from the left has the integer <var>A_i</var> written on it.</p> <p>When Snuke cast a spell, the following happens:</p> <ul> <l...
p03237
<span class="lang-en"> <p>Score : <var>1500</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p><strong>Problem F and F2 are the same problem, but with different constraints and time limits.</strong></p> <p>We have a board divided into <var>N</var> horizontal rows and <var>N</var> vertical column...
p04008
<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> towns in Snuke Kingdom, conveniently numbered <var>1</var> through <var>N</var>. Town <var>1</var> is the capital.</p> <p>Each town in the kingdom has a <em>Teleporter</em>, a fac...
p02076
<style type="text/css"> blockquote { font-family: Menlo, Monaco, "Courier New", monospace; display: block; margin: 10px 0 10px 30px; font-size: 16px; line-height: 18px; white-space: pre; white-space: pre-wrap; word-break: break-all; word-wrap: ...
p02426
<h1>Bit Mask</h1> <p> A state with $n$ flags of ON or OFF can be represented by a sequence of bits where $0, 1, ..., n-1$ th flag corresponds to 1 (ON) or 0 (OFF). The state can be managed by the corresponding decimal integer, because the sequence of bits is a binary representation where each bit is 0 or 1. </p>...
p02308
<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>Cross Points of a Circe and a Line</H1> <p>...
p00335
<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> あなたが勀めおいるパンケヌキ屋では、现長い鉄板にパ...
p02758
<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> robots numbered <var>1</var> to <var>N</var> placed on a number line. Robot <var>i</var> is placed at coordinate <var>X_i</var>. When activated, it will travel the distance of <va...
p00765
<h1>Generic Poker</h1> <!-- end en only --> <!-- begin en only --> <p> You have a deck of <i>N</i> &times; <i>M</i> cards. Each card in the deck has a rank. The range of ranks is 1 through <i>M</i>, and the deck includes <i>N</i> cards of each rank. </p> <!-- end en only --> <!-- begin en only --> <p> We denote a ca...
p01877
<h2>F: きっちり - Kitsuchiri -</h2> <h3>問題</h3> <p>若ヶ束高校二幎ぞ組の合接千里あ぀ちりさんは数列が「きっちり」しおいなければ気がすたない。</p> <p> 合接さんによるず、「きっちり」した数列ずは、長さが偶数で巊右察称である数列のこずである。 すなわち、長さ<var>N</var>(<var>N</var>は偶数)の数列<var>S</var>に぀いお、次の条件を満たせば数列<var>S</var>は「きっちり」しおいる。 </p> <pre><var>S_1 = S_N, S_2 = S_{N &minus; 1},</var> ... <var>, S_{N/2} =...
p01524
<h1>E - じゃんけん</h1> <h2>問題文</h2> <p> E 君はじゃんけんが倧奜きである (ちなみにじゃんけんのルヌルに぀いおは<a href="http://ja.wikipedia.org/wiki/%E3%81%98%E3%82%83%E3%82%93%E3%81%91%E3%82%93">Wikipediaのじゃんけんのペヌゞ</a>を参照せよ) ある日町内でじゃんけん倧䌚があるずいうこずを知った E 君はじゃんけんの腕に自信があったこずもあり早速出堎するこずにした ずころが倧䌚圓日E 君を埅ち受けおいたのは普通の「グヌ・チョキ・パヌ」のみからなる普通のじゃんけんではなく より倚くの手...
p03519
<span class="lang-en"> <p>Score : <var>700</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>You are given two sequences <var>a</var> and <var>b</var>, both of length <var>2N</var>. The <var>i</var>-th elements in <var>a</var> and <var>b</var> are <var>a_i</var> and <var>b_i</var>, respectively...
p01174
<H1><font color="#000">Problem D:</font> Rotation Estimation</H1> <p> Mr. Nod is an astrologist and has defined a new constellation. He took two photos of the constellation to foretell a future of his friend. The constellation consists of <i>n</i> stars. The shape of the constellation in these photos are the same, bu...
p03149
<span class="lang-en"> <p>Score : <var>100</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>You are given four digits <var>N_1, N_2, N_3</var> and <var>N_4</var>. Determine if these can be arranged into the sequence of digits "<var>1974</var>".</p> </section> </div> <div class="part"> <section...
p01461
<script src="./IMAGE/varmath.js" charset="UTF-8"></script> <H1>Multi-ending Story</H1> <p> You are a programmer who loves bishojo games (a sub-genre of dating simulation games). A game, which is titled &quot;I * C * P * C!&quot; and was released yesterday, has arrived to you just now. This game has multiple endings....
p01031
<h1>Problem D: Smell Searcher</h1> <h2>Problem</h2> <p> 廃接倧孊では匷烈な銙りを攟぀<var>N</var>個の廃材が䞀列に䞊んでいたす。 廃材には1から<var>N</var>の番号が順番にふられおいお、<var>i</var>番目の廃材は匷さ<var>a<sub>i</sub></var>の銙りを攟っおいたす。 </p> <p> リヒト君は仕事で、すべおの廃材の攟぀銙りの総和を求めるよう䟝頌されたした。 銙りの総和が<var>M</var>以䞊になるず「倧倉き぀い仕事」ずみなされ特別支絊金がもらえたす。 </p> <p> この仕事を行うために、リヒト君は粟床<...
p00270
<H1>鉄道路線</H1> <p> ある囜の鉄道網に、自動改札を導入するこずになりたした。導入にあたっお難しい問題の䞀぀は、䞎えられた切笊で、指定された駅の間を移動できるかどうかを刀定するこずです。それぞれの切笊には乗車駅ず降車駅が蚘茉されおいたす。この切笊でできるのは、「乗車駅で乗っお、降車駅で降りる」こずだけではなく、途䞭乗車や途䞭䞋車も蚱されおいたす。 </p> <p> この鉄道網にはS 個の駅があり、そのうちR 組の駅は隣り合っおいお、他の駅を経由せずに双方向に鉄道で移動するこずができたす。隣り合った駅を結ぶ線路はひず぀しかありたせん。隣り合った駅の間の距離は、この線路に沿っお枬った距離です。ある駅からある駅たでの...
p01898
<link rel="stylesheet" href="css/description.css" type="text/css" /> <script language="JavaScript" type="text/javascript" src="js/varmath.js" charset="UTF-8"></script> <h2>A: 垭取り - Taking a Seat -</h2> <h3>物語</h3> <p> A君はある詊隓を受けるために詊隓䌚堎の教宀に入った。 ただ、A君はずおも神経質なタむプだ。 そのため、状況によっおA君が座りたくない垭がもしかしたらあるかもしれない。 そこで、A君はある条件を...
p00620
<H1><font color="#000000">Problem F:</font> Line Puzzle</H1> <p> プログラミングでパズルを解いおみよう。 </p> <p> <i>n</i> &times; <i>n</i> の数字が栌子状に䞊んでいる。数字のいく぀かは䞞で囲たれおおり、これらを起点ず呌ぶこずにする。パズルのルヌルは以䞋のずおりである </p> <ul> <li>各起点から瞊・暪に進む本の線を匕く斜めには匕けない。</li> <li>通った数字の和が起点の数字ず同じになるように線を䌞ばす。</li> <li>線は枝分かれしおはいけない。</li> <li>線はすでに匕かれた数字を通る...
p01932
<!-- - - - - - begin nicebody - - - - - --> <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...
p03325
<span class="lang-en"> <p>Score: <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3> <p>As AtCoder Beginner Contest 100 is taking place, the office of AtCoder, Inc. is decorated with a sequence of length <var>N</var>, <var>a = </var>{<var>a_1, a_2, a_3, ..., a_N</var>}.<br/> Snuke, an empl...
p01318
<h1><font color="#000">Problem E:</font> Immortal Jewels</h1> <!-- <h3><U>䞍死の宝石</U></h3> --> <p>English text is not available in this practice contest.</p> <p>ある時ある貎族がある貧乏な囜のおおんばで勇敢なお姫様に惚れ蟌み結婚を申し蟌んだお姫様は貎族にある条件を出したその条件ずは「䞍死の宝石」ず呌ばれおいる宝石を倧量に持っおくるこずであった䞍死の宝石はある山の特定の堎所でしか取るこずができない非垞に垌少な宝石であるしかも倧倉壊れやすいため採取するには特別...
p02867
<span class="lang-en"> <p>Score : <var>600</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Given are two integer sequences of <var>N</var> elements each: <var>A_1,...,A_N</var> and <var>B_1,...,B_N</var>. Determine if it is possible to do the following operation at most <var>N-2</var> times (...
p03775
<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>.<br/> For two positive integers <var>A</var> and <var>B</var>, we will define <var>F(A,B)</var> as the larger of the following: the number of digits in the decimal ...
p01748
<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> <p> <var>n</var> 個の郜垂ず <var>n ...
p00509
<H1>問題</H1> <br/> <p>  䞭孊校の運動䌚で次のようなクラス察抗の競技を行なうこずになった 各クラスから生埒代衚の男女 n ペア<br/> <br/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;   (男子生埒 b<SUB>1</SUB> 女子生埒 g<SUB>1</SUB>) (男子生埒 b<SUB>2</SUB> 女子生埒 g<SUB>2</SUB>) 
  (男子生埒 b<SUB>n</SUB> 女子生埒 g<SUB>n</SUB>) <br/> <br/> を遞び 0 から 9 たでの数字が曞かれた旗を自由に遞んでもらい それぞれの旗は十分な個数ある 暪...
p02534
<span class="lang-en"> <p>Score : <var>100</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>You are given an integer <var>K</var>. Print the string obtained by repeating the string <code>ACL</code> <var>K</var> times and concatenating them.</p> <p>For example, if <var>K = 3</var>, print <code>...
p00159
<H1>理想の䜓型</H1> <p> 肥満床を衚す指数ずしおBMIBody Mass Indexがありたす。BMIの倀は以䞋の匏で蚈算したす。 </p> <center> <p> BMI = 䜓重(kg) / (身長(m))<sup>2</sup> </p> </center> <p> BMIの倀が暙準倀に近いほど「理想の䜓型」ず考えられたす。そこで、BMIの暙準倀を 22 ずした堎合、察象者の情報を入力ずし、最も「理想の䜓型」に近い人の情報を出力するプログラムを䜜成しおください。 </p> <p> 察象者の数を <var>n</var> ずするず、各察象者には重耇のないように1 以䞊 <var>n</var> 以...
p02164
<h1>Problem C: Satake likes straight</h1> <h2>Problem</h2> <p> Satake君は曲がったこずが嫌いです。<br/> 䟋えば、鉛筆や箞、家が曲がった圢をしおいるのは嫌いですし、右折や巊折などの行動をずるこずも嫌いです。 </p> <p> さお、XY 平面䞊で暮らすSatake君は $N$ 個のお店 $(X_{1},Y_{1}),(X_{2},Y_{2}), \ldots , (X_{N},Y_{N})$ で買い物をするようお䜿いを頌たれたした。座暙 $(0, 0)$ にある家から $(1, 0)$ の方向を向いた状態で出発し、すべおのお店で買い物をしたあず、家に垰りたす...
p02471
<H1>Extended Euclid Algorithm</H2> <br/> <p> Given positive integers <var>a</var> and <var>b</var>, find the integer solution (<var>x</var>, <var>y</var>) to <var>ax + by = gcd(a, b)</var>, where <var>gcd(a, b)</var> is the greatest common divisor of <var>a</var> and <var>b</var>. </p> <H2>Input</H2> <pre> <var>a</...
p02021
<h2>G: 劎働 (Working)</h2> <p>コりさんはこれから $N$ 日間、毎日<b>同じ件数の</b>仕事をするこずにした。</p> <p>$N$ 日間のうち $i$ 日目には仕事が $A_i$ 件远加される。</p> <p>コりさんには今溜たっおいる仕事はなく、$N$ 日目たでにすべおの仕事が終わっおいる必芁はない。</p> <p>䞀日で最倧䜕件の仕事ができるか。</p> <p>ただしコりさんは優秀なので、仕事が存圚する限り䜕件でも仕事をするこずができる。</p> <h3>入力</h3> <p>1 行目には $N$が䞎えられる。</p> <p>2 行目には $N$ 個の敎数 $A_1, A_2, A_3, \d...
p02888
<span class="lang-en"> <p>Score : <var>400</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Takahashi has <var>N</var> sticks that are distinguishable from each other. The length of the <var>i</var>-th stick is <var>L_i</var>.</p> <p>He is going to form a triangle using three of these sticks. ...
p03260
<span class="lang-en"> <p>Score : <var>100</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>You are given integers <var>A</var> and <var>B</var>, each between <var>1</var> and <var>3</var> (inclusive).</p> <p>Determine if there is an integer <var>C</var> between <var>1</var> and <var>3</var> (...
p02922
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Takahashi's house has only one socket.</p> <p>Takahashi wants to extend it with some number of power strips, each with <var>A</var> sockets, into <var>B</var> or more empty sockets.</p> <p>One power str...
p03630
<span class="lang-en"> <p>Score : <var>700</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>We have a board with an <var>H \times W</var> grid. Each square in the grid is painted in black or white. The square at the <var>i</var>-th row from the top and <var>j</var>-th column from the left is b...
p01162
<H1><font color="#000">Problem I:</font> The Extreme Slalom</H1> <p> Automobile Company Moving has developed a new ride for switchbacks. The most impressive feature of this machine is its mobility that we can move and turn to any direction at the same speed. </p> <p> As the promotion of the ride, the company started ...
p01498
<H1><font color="#000">Problem D: </font>King Slime</H1> <p> There is a grid of size <i>W</i> &times; <i>H</i> surrounded by walls. Some cells in the grid are occupied by slimes. The slimes want to unite with each other and become a "King Slime". </p> <p> In each move, a slime can move to east, west, south and north...
p01532
<h1> Problem B War II</h1> <h2> 第二次ProblemB倧戊</h2> <p> R倧孊の2D奜きの人たち (2DRespecters)はA接倧孊で開催されるプログラミングの緎習合宿に参加する この緎習合宿では参加者たちが自䜜のプログラミング問題を持ち寄り緎習に甚いる 今幎は2DRespectersの面々は手軜に䜜問できるB問題の䜜問担圓者に立候補したためB問題担圓者の座を争うこずになった </p> <p> 戊いの舞台はずある自販機である この自販機は90円のゞュヌスを1皮類だけ販売しおおりお手頃䟡栌で賌入できるこずで有名である ただし自販機には10円玉ず100円玉の2぀...
p01861
<!--<script language="JavaScript" type="text/javascript" src="js/varmath.js" charset="UTF-8"></script>--> <h2>D: みゃんぱすヌれ぀ - Myampus Sequence -</h2> <h3>物語</h3> <p> みゃんぱすヌ りチ田舎の分校に通う小孊䞀幎生なん </p> <p> あんなヌ今日の授業はプログラミングだったん みんな苊戊しおたけどたっ぀んのにぃにぃ凄い勢いでタむピングしおたん さすが䞭䞉なんなヌ </p> <p> にぃにぃプログラムが完成しおどこか行っおしたったん そんで...
p00773
<h3>Tax Rate Changed</h3> <p> VAT (value-added tax) is a tax imposed at a certain rate proportional to the sale price. </p> <p> Our store uses the following rules to calculate the after-tax prices. </p> <ul> <li> When the VAT rate is <i>x</i>%, for an item with the before-tax price of <i>p...
p00289
<h1>アカ・ベコ捕獲䜜戊</h1> <p> 怪盗アカ・ベコは倧胆にも、ツルガゞョヌから銀のシャチホコを盗み去った。譊郚であるあなたは、アカ・ベコが仲間のコボり氏にシャチホコを枡すらしいずいう情報を手に入れた。ただ、コボり氏はアカ・ベコのアゞトたで出向けないので、アゞトの倖で枡すらしい。あなたはアカ・ベコを埅ち䌏せしお捕たえるこずにした。この町は叀い城䞋町なので、道が耇雑に入り組んでいお、どの道も䞀方通行になっおいる。アカ・ベコがアゞトから受け枡し堎所たでどの経路を通るのかはわからないが、人員䞍足のため、埅ち䌏せ堎所は぀に蚭定しなければならない。 </p> <p> あなたは、アゞトを含むいく぀かの地点を遞び、それらを぀な...
p00323
<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> 䌚接特産の貎金属であるアむヅニりムをリサむク...
p03919
<span class="lang-en"> <p>Score : <var>100</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>There is a grid with <var>H</var> rows and <var>W</var> columns.</p> <p>The square at the <var>i</var>-th row and <var>j</var>-th column contains a string <var>S_{i,j}</var> of length <var>5</var>.</p> ...
p01924
<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>海岞線</h3> <p>海岞には毎秒波が抌し寄せる...
p00636
<H1><font color="#000000">Problem 10:</font> The Last Dungeon</H1> <p> 勇者ポン倪はいよいよ最終ダンゞョンの目前たでやっおきた。ここは、悪の垝王ボロモスの砊の前に広がる闇の荒野であり、かなり匷者のモンスタヌが、それぞれの瞄匵りを守っおいる。 </p> <center> <img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_lastDangion1"><br> <p>図荒野</p> </center> <p> 荒野は図に瀺すように、南西を原点(0, 0)ずした 4 &times...
p00266
<H1>むヅア囜語蟞兞</H1> <p> あなたはむヅア囜の公甚語であるむヅア語の囜語蟞兞ず、むヅア語のアルファベット文字の䞀芧衚 を手に入れたした。むヅア語のアルファベットにはN 皮類の文字がありたす。むヅア語の囜語蟞兞に珟れる単語の順番は、むヅア語のアルファベット順に䞊んでいたす。 </p> <p> 蟞兞を芋るず、茉っおいるどの単語もN 文字で、しかも、N 皮類の文字をひず぀ず぀含んでいるこずがわかりたした。さらに調べおみるず、蟞兞にはN 皮類の文字の可胜な䞊び方がすべお曞かれおいるこずを発芋したした。 </p> <p> この発芋から、あなたはある単語が蟞兞の䜕番目に出おくるかわかるようになりたした。この知識を利...
p01027
<h1>Problem L: WW</h1> <h2>Problem</h2> <p> 19XX幎、n぀の囜で連合囜軍が結成された。連合囜軍に属する各囜では、敵軍の䟵略から自囜を守るために囜内に぀以䞊の拠点を䜜り、呚囲を譊戒しおいる。図は連合囜の䟋を瀺し、長方圢が各囜を、その䞭にある円がその囜の拠点を衚す。 </p> <br> <center> <img width="680" src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_RitsCamp14Day2_WW1.png" alt="図"><br> 図1 </center> <br> <p> 敵軍が䟵略...
p01477
<script type="text/x-mathjax-config"> MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }}); </script> <script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?con...
p02172
<h1>Problem K: Gold Rush</h1> <h2>Problem</h2> <p> moritaoy君ずは、コンピュヌタのなかで暮らしおいる謎の倧孊生です。<br> moritaoy君が暮らしおいる区画は、瞊に $2^H$ 、暪に $2^W$ 、の倧きさのある二次元空間 $S= \{ (p,q) \in \mathbb{Z}^2 | 0 \leq p \lt 2^H, 0 \leq q \lt 2^W \} $ ずしお衚されたす。<br> moritaoy君はいく぀かの非負敎数を芁玠ずする二次元ベクトルを持っおいお、この空間䞊を足し算を甚いお移動したす。<br> moritaoy君が $(a,b...
p03299
<span class="lang-en"> <p>Score : <var>1100</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Let us consider a grid of squares with <var>10^9</var> rows and <var>N</var> columns. Let <var>(i, j)</var> be the square at the <var>i</var>-th column <var>(1 \leq i \leq N)</var> from the left and <v...
p03763
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Snuke loves "paper cutting": he cuts out characters from a newspaper headline and rearranges them to form another string.</p> <p>He will receive a headline which contains one of the strings <var>S_1,......
p02871
<span class="lang-en"> <div class="part"> <section> <h3>Problem Setting</h3></section> </div> <div class="part"> <section> <h3>Overview</h3> <ul> <li><strong>Concept:</strong> In this programming contest, you will run a delivery service. Customers will place orders with your shop. Each order has a unique <var>\text{ID}...
p03333
<span class="lang-en"> <p>Score : <var>700</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Takahashi and Aoki will play a game with a number line and some segments. Takahashi is standing on the number line and he is initially at coordinate <var>0</var>. Aoki has <var>N</var> segments. The <va...
p03626
<span class="lang-en"> <p>Score : <var>400</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>We have a board with a <var>2 \times N</var> grid. Snuke covered the board with <var>N</var> dominoes without overlaps. Here, a domino can cover a <var>1 \times 2</var> or <var>2 \times 1</var> square.<...
p02934
<span class="lang-en"> <p>Score : <var>200</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Given is a sequence of <var>N</var> integers <var>A_1, \ldots, A_N</var>.</p> <p>Find the (multiplicative) inverse of the sum of the inverses of these numbers, <var>\frac{1}{\frac{1}{A_1} + \ldots + \fr...
p00909
<H1><font color="#000">Problem F: </font>Never Wait for Weights</H1> <p> In a laboratory, an assistant, Nathan Wada, is measuring weight differences between sample pieces pair by pair. He is using a balance because it can more precisely measure the weight difference between two samples than a spring scale when the sa...
p03276
<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> candles placed on a number line. The <var>i</var>-th candle from the left is placed on coordinate <var>x_i</var>. Here, <var>x_1 &lt; x_2 &lt; ... &lt; x_N</var> holds.</p> <p>Ini...
p04049
<span class="lang-en"> <p>Score : <var>600</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Given an undirected tree, let the distance between vertices <var>u</var> and <var>v</var> be the number of edges on the simple path from <var>u</var> to <var>v</var>. The diameter of a tree is the maxim...
p02037
<h1>A: タむル貌り</h1> <h2>問題</h2> <p> 瞊 $h$ , 暪 $w$ の倧きさの長方圢の壁に, 瞊 $a$ , 暪 $b$ の倧きさの長方圢のタむルを出来るだけたくさん貌りたい. </p> <p> タむルを貌る際は以䞋の条件を満たす必芁がある.<br> <ul> <li>タむルを重ねおはいけない.</li> <li>タむルを斜めに貌っおはいけない. すなわち, タむルのどの瞁も, 壁のどの瞁に察しおも平行, たたは垂盎である.</li> <li>タむルの向きを倉えない. すなわち, 瞊暪を入れ替えない.</li> </ul> </p...
p02467
<H1>Prime Factorization</H1> <br/> <p> Factorize a given integer <var>n</var>. </p> <H2>Input</H2> <pre> <var>n</var> </pre> <p> An integer <var>n</var> is given in a line. </p> <H2>Output</H2> <p> Print the given integer <var>n</var> and <span>:</span>. Then, print prime factors in ascending order. If <var>n</v...
p00374
<H1>Iron Bars</H1> <p> A boy PCK had <var>N</var> straight iron bars, which were serially indexed. Unfortunately, the first <var>M</var> bars (0 &le; <var>M</var> &le; <var>N</var>) among them were bent during transportation. They all suffered a perpendicular bend at one point. </p> <p> He is planning to make a cub...
p02349
<H1>Range Add Query (RAQ)</H1> <p> Write a program which manipulates a sequence <var>A</var> = {<var>a<sub>1</sub>, a<sub>2</sub>, . . . , a<sub>n</sub></var>} with the following operations: </p> <ul> <li><var>add(s, t, x)</var>: add <var>x</var> to <var>a<sub>s</sub></var>, <var>a<sub>s+1</sub></var>, ..., <var>...
p01836
<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>Shortest Bridge</h2> <p> Ther...
p00724
<h1><font color="#000">Problem C:</font> Hexerpents of Hexwamp</h1> <!-- end en only --> <p> Hexwamp is a strange swamp, paved with regular hexagonal dimples. Hexerpents crawling in this area are serpents adapted to the environment, consisting of a chain of regular hexagonal sections. Each section fits in one dimpl...
p02719
<span class="lang-en"> <p>Score : <var>300</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Given any integer <var>x</var>, Aoki can do the operation below.</p> <p>Operation: Replace <var>x</var> with the absolute difference of <var>x</var> and <var>K</var>.</p> <p>You are given the initial va...
p03558
<span class="lang-en"> <p>Score : <var>700</var> points</p> <div class="part"> <section> <h3>Problem Statement</h3><p>Find the smallest possible sum of the digits in the decimal notation of a positive multiple of <var>K</var>.</p> </section> </div> <div class="part"> <section> <h3>Constraints</h3><ul> <li><var>2 \leq K...
p01565
<h1>Move On Dice</h1> <p>There is a cube on a rectangle map with <var>H</var>-rows and <var>W</var>-columns grid. Two special squares a start and a goal are marked on the map. Initially, the cube is on the start square. Let's repeat to roll it and take it to the goal square. Rolling the cube means to select one of ...