question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p00164 |
<H1>おはじき取り</H1>
<p>
一郎君と次郎君の兄弟は家でよくおはじき取りをして遊びます。おはじき取りは、一カ所に積まれた複数のおはじきを二人が交互にとっていくゲームです。一度に1〜4個のおはじきを好きな数だけ順に取り、相手に最後の1個を取らせた方が勝ちになります。二人はいつも 32 個のおはじきを使い、兄である一郎君の番からゲームを始めます。
</p>
<p>
これまでに何度も戦っている二人ですが、次郎君は兄の一郎君にどうしても勝つことができません。それもそのはず、一郎君はこのゲームの必勝法を知っているからです。一郎君は、残りのおはじきの数を <var>n</var> とすると、必ず (<var>n</var>... |
p01325 |
<h1><font color="#000">Problem E:</font> トーマス・ライトの憂鬱</h1>
<p>昨日の夕方の話。 普段通り大学での講義が終わり、日課であるキャンパスでの猫への餌付けを済ませた後、家に帰り着くと、作業着を着た人たちが僕の家の扉を取り替える工事をしていた。 それだけなら特に僕の頭痛の種を増やすような出来事ではないのだが、取り外されて去っていく慣れ親しんだ鍵とレバーがついている茶色の扉が非常に平凡であるのに対して、今からまさに取り付けられようとしている黒色の扉が非常に奇妙なもので、ああこれはまたうちの親父が何かを思いついてしまったのだなと容易に想像がついてしまうのであった。 その偏屈親父が言... |
p03318 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let <var>S(n)</var> denote the sum of the digits in the decimal notation of <var>n</var>.
For example, <var>S(123) = 1 + 2 + 3 = 6</var>.</p>
<p>We will call an integer <var>n</var> a <strong>Snuke numb... |
p01775 |
<h2>D: Rescue a Postal Worker / 郵便局員を救え</h2>
<h3>物語</h3>
<p>あなたは,この春に長年の夢だった郵便局に就職できました.担当する配達地域も決定し,ウキウキ気分で迎えた初仕事ですが,あまりに浮かれていたため郵便物を入れた袋に穴が空いているのに気づかず,入っていた郵便物を全部落としてしまいました.しかし,用意周到なあなたはすべての郵便物にGPSをつけていたため,どこに郵便物が落ちているかを知ることができます.</p>
<p>郵便物を拾いなおしていると予定していた配達時間を超えてしまうかもしれないので,あなたはできる限り短い時間で配達を終えたいと思っています.落としてしまっ... |
p03748 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Joisino has a lot of red and blue bricks and a large box.
She will build a tower of these bricks in the following manner.</p>
<p>First, she will pick a total of <var>N</var> bricks and put them into the... |
p00867 |
<H1><font color="#000">Problem D:</font> Digits on the Floor</H1>
<p>
Taro attempts to tell digits to Hanako by putting straight bars on the floor. Taro wants to
express each digit by making one of the forms shown in Figure 1.
</p>
<p>
Since Taro may not have bars of desired lengths, Taro cannot always make forms ex... |
p03898 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a tree with <var>N</var> vertices, numbered <var>1</var> through <var>N</var>.</p>
<p>The <var>i</var>-th of the <var>N-1</var> edges connects the vertices <var>p_i</var> and <var>q_i</var>.</p... |
p02270 |
<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>
You are given $n$ packag... |
p03932 | <span class="lang-en lang-child hidden-lang">
<div id="task-statement">
Max Score: $600$ Points <br/>
<section>
<h3>Problem Statement</h3>
Sigma and his brother Sugim are in the $H \times W$ grid. They wants to buy some souvenirs. <br/>
Their start position is upper-left cell, and the goal position is low... |
p02620 | <span class="lang-en">
<p>(Please read problem A first. The maximum score you can get by solving this problem C is 1, which will have almost no effect on your ranking.)</p>
<div class="part">
<section>
<h3>Beginner's Guide</h3><p>"Local search" is a powerful method for finding a high-quality solution.
In this method, i... |
p03461 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>AtCoDeer the deer wants a directed graph that satisfies the following conditions:</p>
<ul>
<li>The number of vertices, <var>N</var>, is at most <var>300</var>.</li>
<li>There must not be self-loops or m... |
p03031 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> switches with "on" and "off" state, and <var>M</var> bulbs. The switches are numbered <var>1</var> to <var>N</var>, and the bulbs are numbered <var>1</var> to <var>M</var>.</p>
<p>B... |
p03524 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a string <var>S</var> consisting of three kinds of letters: <code>a</code>, <code>b</code> and <code>c</code>.</p>
<p>He has a phobia for palindromes, and wants to permute the characters in <v... |
p01519 |
<!-- begin en only -->
<h3><u>Sister Ports
</u></h3>
<!-- end en only -->
<!-- begin ja only -->
<h3><u>姉妹港
</u></h3>
<!-- end ja only -->
<div>
<!-- begin en only -->
<p>
English text is not available in this practice contest.
</p>
<!-- end en only -->
<!-- begin ja only -->
<p>
ACM 国は正 n 角形の島国である.
n 個の角に港があり,ある角の港か... |
p03174 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> men and <var>N</var> women, both numbered <var>1, 2, \ldots, N</var>.</p>
<p>For each <var>i, j</var> (<var>1 \leq i, j \leq N</var>), the compatibility of Man <var>i</var> and Wo... |
p01149 |
<H1><font color="#000">Problem A:</font> Blackjack</H1>
<p>
Brian Jones is an undergraduate student at Advanced College of Metropolitan. Recently he was
given an assignment in his class of Computer Science to write a program that plays a dealer of
blackjack.
</p>
<p>
Blackjack is a game played with one or more decks... |
p00308 |
<h2>未知の病原菌</h2>
<p>
英世博士は未知の病原菌を発見しました。この病原菌は、アクダマキンとゼンダマキンと呼ばれる二種類の菌が、一直線に連なった鎖状の構造をしています。人類のために、この病原菌を無害化したいと考えています。
</p>
<p>この病原菌は、長さが2以下になると力が弱まり、免疫力によって無害化されることが分かっています。英世博士は、この病原菌を任意の場所で切断して、前半と後半の2つの鎖にすることができます。また、2つの鎖を連結して1つの鎖にすることもできます。
</p>
<p>
しかし注意しなければいけないのは、アクダマキンの数が多い鎖はきわめて有害だということです。ある鎖においてアクダマキンの数が... |
p02335 | <!--<h1>写像12相 その5:ボールに区別なし・箱に区別あり・箱の中身は1つ以下</h1>-->
<h1>Balls and Boxes 5</h1>
<table border="">
<tr><th>Balls</th><th>Boxes</th><th>Any way</th><th>At most one ball</th><th>At least one ball</th></tr>
<tr><th>Distinguishable</th><th>Distinguishable</th><td>1</td><td>2</td><td>3</td></tr>
<tr><th>Indistinguishab... |
p03877 | <span class="lang-en">
<p>Score : <var>1500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><style>
#nck {
width: 30px;
height: auto;
}
</style>
<p>Consider all integers between <var>1</var> and <var>2N</var>, inclusive.
Snuke wants to divide these integers into <var>N</var> pa... |
p00758 |
<h3><U>Watchdog Corporation</U></h3>
<!-- end en only -->
<div> <!-- please enclose each h3 level section with div -->
<!-- begin en only -->
<p>
In Northern Kyushu, you are running a company
which rents watchdogs in response to the customers' order.
The distinguishing point of your service is that you also
instal... |
p02765 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi is a member of a programming competition site, <em>ButCoder</em>.</p>
<p>Each member of ButCoder is assigned two values: <strong>Inner Rating</strong> and <strong>Displayed Rating</strong>.</p... |
p03800 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke, who loves animals, built a zoo.</p>
<p>There are <var>N</var> animals in this zoo. They are conveniently numbered <var>1</var> through <var>N</var>, and arranged in a circle.
The animal numbered ... |
p02712 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let us define the <strong>FizzBuzz sequence</strong> <var>a_1,a_2,...</var> as follows:</p>
<ul>
<li>If both <var>3</var> and <var>5</var> divides <var>i</var>, <var>a_i=\mbox{FizzBuzz}</var>.</li>
<li>... |
p01997 | <h1>B: 直角三角形</h1>
<h2>問題</h2>
<p>
直角三角形の斜辺でない $2$ 辺の長さ $A$ , $B$ が与えられる。
長さ $A$ の辺は $x$ 軸と重なっており、長さ $B$ の辺は $y$ 軸と重なっている。
</p>
<p>
次の操作を行う。
</p>
<p>
<ol>
<li>三角形を $x$ 軸周りに回転させる。</li>
<li>操作 $1$ を行ってできた図形を $y$ 軸周りに回転させる。</li>
</ol>
</p>
<p>
操作 $2$ を行ってできた図形の体積を求めよ。
</p>
<h2>制約</h2>
<ul>
... |
p00685 |
<H1>Board Arrangements for Concentration Games</H1>
<P>You have to organize a wedding party. The program of the
party will include a concentration game played by the
bride and groom. The arrangement of the concentration game
should be easy since this game will be played to make the
party fun.</P>
<P>We have a 4x4 b... |
p02342 | <!--<h1>写像12相 その12:ボールに区別なし・箱に区別なし・箱の中身は1つ以上</h1>-->
<h1>Balls and Boxes 12</h1>
<table border="">
<tr><th>Balls</th><th>Boxes</th><th>Any way</th><th>At most one ball</th><th>At least one ball</th></tr>
<tr><th>Distinguishable</th><th>Distinguishable</th><td>1</td><td>2</td><td>3</td></tr>
<tr><th>Indistinguish... |
p03103 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up <var>M</var> cans of energy drinks.</p>
<p>There are <var>N</var> stores that sell energy drinks. In the <var>i</va... |
p01094 |
<h3>Look for the Winner!</h3>
<p>
The citizens of TKB City are famous for their deep love in elections and vote counting.
Today they hold an election for the next chairperson of the electoral commission.
Now the voting has just been closed and the counting is going to start.
The TKB citizens have strong desire to kno... |
p03553 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> gemstones labeled <var>1</var> through <var>N</var>.</p>
<p>You can perform the following operation any number of times (possibly zero).</p>
<ul>
<li>Select a positive integer <var>... |
p03046 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Construct a sequence <var>a</var> = {<var>a_1,\ a_2,\ ...,\ a_{2^{M + 1}}</var>} of length <var>2^{M + 1}</var> that satisfies the following conditions, if such a sequence exists.</p>
<ul>
<li>Each inte... |
p01581 |
<H1><font color="#000">Problem A:</font> Cache Control</H1>
<p>
Mr. Haskins is working on tuning a database system. The database is a simple associative storage that contains key-value pairs. In this database, a key is a distinct identification (ID) number and a value is an object of any type.
</p>
<p>
In order to b... |
p03416 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Find the number of <em>palindromic numbers</em> among the integers between <var>A</var> and <var>B</var> (inclusive).
Here, a palindromic number is a positive integer whose string representation in base... |
p01978 | <h1>E: いたずらされたグラフ</h1>
<h2>問題</h2>
<p>
あなたはグラフのアルゴリズムとして典型であるフローの問題を解いていた。<br>
その問題で与えられるグラフは、頂点 $N$ 個、辺 $M$ 本であり、頂点 $x_i$ から 頂点 $y_i$ に容量 $z_i$ 、コスト $d_i$ の辺が張られている。
ところが、AORイカちゃんが入力ケースにいたずらした。
その結果、 $x_i, y_i, z_i$ の順序がシャッフルされ、頂点の情報と容量の情報が区別できなくなってしまった。
</p>
<p>
そこで、あなたは $s-t$ 間のフローを求めることを諦め、 $s-t$ 間の最短距離を求めることにした。... |
p03945 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Two foxes Jiro and Saburo are playing a game called <em>1D Reversi</em>. This game is played on a board, using black and white stones. On the board, stones are placed in a row, and each player places a ... |
p02657 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Compute <var>A \times B</var>.</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1 \leq A \leq 100</var></li>
<li><var>1 \leq B \leq 100</var></li>
<li>All values in i... |
p00390 | <h1>Round Table of Sages</h1>
<p>
$N$ sages are sitting around a round table with $N$ seats. Each sage holds chopsticks with his dominant hand to eat his dinner. The following happens in this situation.
</p>
<ul>
<li>If sage $i$ is right-handed and a left-handed sage sits on his right, a level of frustration $w_i$ o... |
p02207 | <h2>地震 (Earthquakes)</h2>
<p>E869120 君は地震が苦手です。</p>
<p>具体的には、ある作業をしている時に震度 $p$ の地震が発生した際、その作業のパフォーマンスが $10 \times p$ パーセント低下します。</p>
<p>昨日、$N$ 回地震が発生しました。より具体的に言うと、昨日の i 回目の地震は時刻 $T_i$ に発生し、その震度は $A_i$ でした。</p>
<p>ここで $Q$ 個の質問が与えられます。$i$ 個目の質問の内容は以下の通りです。</p>
<ul>
<li>E869120 君が時刻 $L_i$ から時刻 $R_i$ まで作業をした時、最終的な作業のパフォー... |
p01702 |
<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>
<meta http-equiv="X-UA-Compatibl... |
p00810 |
<H1><font color="#000">Problem H:</font> Super Star</H1>
<p>
During a voyage of the starship Hakodate-maru (see Problem A), researchers found strange synchronized movements of stars. Having heard these observations, Dr. Extreme proposed a theory of "super stars". Do not take this term as a description of actors or si... |
p01352 |
<H1>Problem D: Graph Construction</H1>
<p>
<i>n</i> 匹のうさぎがいて, 0 番から<i>n</i> − 1 番の番号がついた小屋に1 匹ずつ住んでいる.
</p>
<p>
あるとき, 秘密の組織によって地下通路の建設工事が行われる, という情報がうさぎたちのもとへ入った. 地下通路を使えば, うさぎたちは他のうさぎたちの小屋へ遊びに行けるようになって嬉しい.
</p>
<p>
通路は両方向に進むことができ, また通路同士は交わらない. 諸事情により, 一度建設された通路が破壊されてしまうこともある. 通路の建設や破壊の工事は1 本ずつ行われ, 各工事中はうさぎは自分の小屋... |
p03695 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In AtCoder, a person who has participated in a contest receives a <em>color</em>, which corresponds to the person's rating as follows: </p>
<ul>
<li>Rating <var>1</var>-<var>399</var> : gray</li>
<li>R... |
p02987 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a <var>4</var>-character string <var>S</var> consisting of uppercase English letters.
Determine if <var>S</var> consists of exactly two kinds of characters which both appear twice in <var>... |
p00113 |
<h1>循環小数</h1>
<p>
2 つの正の整数 <var>p</var>, <var>q</var> を入力し、 <var>p</var> / <var>q</var> を小数として正確に表現することを考えます。(ただし、0 < <var>p</var> < <var>q</var> < 10<sup>6</sup>とします。)
</p>
<p>
このとき、結果は
</p>
<ul>
<li> 有限の桁で正確に表現できる。</li>
<li>ある桁の範囲を繰り返す循環小数となる。</li>
</ul>
<p>
のいずれかとなります。筆算と同じ手順で1桁ずつ小数部を求めてい... |
p00543 |
<h1>ゼッケンの交換 (Swapping Bibs)</h1>
<h2> 問題</h2>
<p>
JOI 高校の N 人の生徒が東西に一列に並んでいる.列の西の端から i 番目の生徒が生徒 i である.それぞれの生徒は整数が 1 つ書かれたゼッケンを付けている.最初,生徒 i のゼッケンには整数 A<sub>i</sub> が書かれている.
</p>
<p>
バトンが M 個あり,バトンには 1 から M までの番号が付けられている.k = 1, 2, ..., M に対し,以下の操作を行う.バトン k (2 ≦ k ≦ M) に関する操作は,バトン k - 1 に関する操作が終わってから行う.
</p>
<ol ... |
p02084 |
<h1>G: Human Seperation</h1>
<h2>問題文</h2>
<p>単位円の上に人が $10^6$ 人、等間隔に立っています。
$t = \frac{2\pi}{10^6}$ として、$i$ 番目の人は 座標 $(\cos{(it)}, \sin{(it)})$ に立っています。</p>
<p>これら $10^6$ 人の中で、非常に仲が悪いペアが $N$ 組あります。
具体的には、$i = 1, \ldots, N$ について、人 $a_i$ と人 $b_i$ は仲が悪いです。</p>
<p>単位円の管理人である松崎くんは、壁を建設することによって仲の悪いペアを全て分断することにしました。
建設する壁は厚さが... |
p02591 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Inspired by the tv series <em>Stranger Things</em>, bear Limak is going for a walk between two mirror worlds.</p>
<p>There are two perfect binary trees of height <var>H</var>,
each with the standar... |
p00056 |
<H1>ゴールドバッハの予想</H1>
<p>
4 以上の偶数は 2 つの素数の和で表すことができるということが知られています。これはゴールドバッハ予想といい、コンピュータの計算によりかなり大きな数まで正しいことが確かめられています。例えば、10 は、7 + 3、5 + 5 の 2 通りの素数の和で表すことができます。
</p>
<p>
整数 <var>n</var> を入力し、<var>n</var> を 2 つの素数の和で表す組み合わせ数が何通りあるかを出力するプログラムを作成してください。ただし、<var>n</var> は 4 以上、50,000 以下とします。また、入力される <var>n</var> は偶数であ... |
p00406 | <h1>矢印</h1>
<p>
$L$個のマスが左右に一列に並んでいます。いくつかのマスの上に駒が置いてあります。駒には左向きか右向きの矢印が書いてあります。なお、一つのマスに二つ以上の駒を置くことはできません。
</p>
<p>
どのマスにいる駒も、駒が置かれていないマスに動かすことができます。ただし、一度に動けるのは隣のマスまでで、一度に動かせるのは一つの駒だけです。駒は、矢印の向きにかかわらず、左にも右にも動かすことができます。ただし、駒を矢印の方向に一回動かすと点数が1点もらえますが、矢印とは逆方向に一回動かすと1点減点されてしまいます。なお、どのような状況から始めたとしても、得られる点数には必ず最大値があるこ... |
p03380 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let <var>{\rm comb}(n,r)</var> be the number of ways to choose <var>r</var> objects from among <var>n</var> objects, disregarding order.
From <var>n</var> non-negative integers <var>a_1, a_2, ..., a_n</... |
p01647 |
<h2>Problem Statement</h2>
<p>
<i>Texas hold 'em</i> is one of the standard poker games, originated in Texas, United States.
It is played with a standard deck of 52 cards, which has 4 <i>suits</i> (spades, hearts, diamonds and clubs) and 13 <i>ranks</i> (A, K, Q, J and 10-2), without jokers.
</p>
<p>
With betting as... |
p00955 |
<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 J
Cover the Polygon wi... |
p02968 | <span class="lang-en">
<p>Score : <var>1800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is an integer <var>N</var>.
How many permutations <var>(P_0,P_1,\cdots,P_{2N-1})</var> of <var>(0,1,\cdots,2N-1)</var> satisfy the following condition?</p>
<ul>
<li>For each <var>i</var> <var>(0 ... |
p04015 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Tak has <var>N</var> cards. On the <var>i</var>-th <var>(1 \leq i \leq N)</var> card is written an integer <var>x_i</var>.
He is selecting one or more cards from these <var>N</var> cards, so that the av... |
p01217 |
<H1><font color="#000">Problem B:</font> Jaggie Spheres</H1>
<p>
Let <i>J</i>(<i>n</i>) be a three-dimensional body that
</p>
<ul>
<li> is a union of unit cubes whose all vertices lie on integer coordinates,</li>
<li> contains all points that are closer than the distance of √<i>n</i> to the origin, and... |
p01539 |
<h1>全探索お姉さんの休日</h1>
<p>
全探索お姉さんはとても優秀な女性である。
お姉さんは格子状の道の経路の数え上げを数千程度なら簡単に数え上げてしまう。
あなたと全探索お姉さんは今、六角形のタイルが敷き詰められた部屋にいる。
お姉さんは初めて見る六角形にとても興奮している様子である。
六角形の並びを座標に表すことに不慣れなお姉さんは図1のような座標系で部屋を表した。
</p>
<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE_rokkaku" height="305" width="247"></center>
<ce... |
p03504 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Joisino is planning to record <var>N</var> TV programs with recorders.</p>
<p>The TV can receive <var>C</var> channels numbered <var>1</var> through <var>C</var>.</p>
<p>The <var>i</var>-th program that... |
p01169 |
<H1><font color="#000">Problem G:</font> Turn Polygons</H1>
<p>
HCII, the health committee for interstellar intelligence, aims to take care of the health of every
interstellar intelligence.
</p>
<p>
Staff of HCII uses a special equipment for health checks of patients. This equipment looks like a
polygon-shaped room w... |
p03154 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a rectangular sheet of paper with height <var>H+1</var> and width <var>W+1</var>. We introduce an <var>xy</var>-coordinate system so that the four corners of the sheet are <var>(0, 0)</var>, <v... |
p01493 |
<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 H:
DisconnectedGame
<... |
p02315 |
<H1>0-1 Knapsack Problem</H1>
<br/>
<p>
You have <var>N</var> items that you want to put them into a knapsack. Item <var>i</var> has value <var>v<sub>i</sub></var> and weight <var>w<sub>i</sub></var>.
</p>
<p>
You want to find a subset of items to put such that:
</p>
<ul>
<li>The total value of the items is as large ... |
p00328 |
<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>
A大学は今年もプログラミングコンテストを開催する。作... |
p03857 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> cities. There are also <var>K</var> roads and <var>L</var> railways, extending between the cities.
The <var>i</var>-th road bidirectionally connects the <var>p_i</var>-th and <var... |
p02745 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a string <var>s</var>.
From this string, Anuke, Bnuke, and Cnuke obtained strings <var>a</var>, <var>b</var>, and <var>c</var>, respectively, as follows:</p>
<ul>
<li>Choose a non-empty (conti... |
p00778 |
<h3>A Die Maker</h3>
<p>
The work of die makers starts early in the morning.
</p>
<p>
You are a die maker.
You receive orders from customers, and make various kinds of dice every day.
Today, you received an order of a cubic die with six numbers
<i>t</i><sub>1</sub>, <i>t</i><sub>2</sub>, ..., <i>t</i><sub>6</sub> o... |
p00282 |
<h1>塵劫記</h1>
<p>
大きな数を表そうとすると、文字数も多くなるし、位取りがわからなくなってしまうので、なかなか面倒です。大きな数をわかりやすく表すために、人々は数の単位を使ってきました。江戸時代に書かれた「塵劫記」という本の中では、数の単位が次のように書かれています。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_PCK2013_jinkouki1" width="740">
</center>
<br>
<p>
たとえば、2の100乗のようなとても大きな数は、126穣7650(じょ)6002垓28... |
p01885 |
<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>Escape from the Hell</h2>
<p>
... |
p00797 |
<H1><font color="#000">Problem B:</font> Family Tree</H1>
<p>
A professor of anthropology was interested in people living in isolated islands and their history.
He collected their family trees to conduct some anthropological experiment. For the experiment,
he needed to process the family trees with a computer. For th... |
p02250 |
<H1>String Search</H1>
<p>
Determine whether a text <var>T</var> includes a pattern <var>P</var>. Your program should answer for given queries consisting of <var>P_i</var>.
</p>
<H2>Input</H2>
<p>
In the first line, a text <var>T</var> is given. In the second line, an integer <var>Q</var> denoting the number o... |
p03912 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi is playing with <var>N</var> cards.</p>
<p>The <var>i</var>-th card has an integer <var>X_i</var> on it.</p>
<p>Takahashi is trying to create as many pairs of cards as possible satisfying one ... |
p02600 | <span class="lang-en">
<p>Score: <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>M-kun is a competitor in AtCoder, whose highest rating is <var>X</var>.<br/>
In this site, a competitor is given a <em>kyu</em> (class) according to his/her highest rating. For ratings from <var>400</va... |
p01186 |
<H1><font color="#000">Problem F:</font> TV Watching</H1>
<p>
You are addicted to watching TV, and you watch so many TV programs every day. You have been in
trouble recently: the airtimes of your favorite TV programs overlap.
</p>
<p>
Fortunately, you have both a TV and a video recorder at your home. You can therefor... |
p03441 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a tree with <var>N</var> vertices.
The vertices are numbered <var>0</var> through <var>N - 1</var>, and the <var>i</var>-th edge (<var>0 ≤ i < N - 1</var>) comnnects Vertex <var>a_i</var> and... |
p03011 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are three airports A, B and C, and flights between each pair of airports in both directions.</p>
<p>A one-way flight between airports A and B takes <var>P</var> hours, a one-way flight between air... |
p00514 |
<H1>問題 5 </H1>
<br/>
<p>
IOI 宝飾店ではビーズのネックレスを売り出すことになった.
ビーズは n 色あり,
これらをそれぞれ m 個以上ずつ選んで r 個のビーズからなるネックレスとし,
1つずつ化粧箱に入れて販売したい.
色の組合せが違うものをすべて1つずつ用意したいが,
化粧箱を何個用意したらよいか店員の誰もわからない.
n, m, r によっては現実的でない個数の化粧箱が必要となるのではないかと店長は心配している.
IOI 宝飾店の店長に代わって,
必要な化粧箱の個数を出力するプログラムを作成しなさい.
n, m, r は整数で,0≦m<n≦r≦10000 である.
</p>
<p>
... |
p00144 |
<H1>パケット転送</H1>
<p>
インターネットでは、データはパケットに分割され、パケットごとにルータと呼ばれる中継機器を介して宛先に転送されます。各ルータはパケットに記載された宛先から次に転送すべきルータを判断します。さらに、無限にルータ間を転送され続けることを防ぐため、パケットには TTL(Time To Live) という値が付加されています。ルータは受け取ったパケットの TTL を 1 減算し、その結果が 0 ならそのパケットを破棄し、それ以外なら次のルータに転送します。
</p>
<p>
そこで、ネットワークの設計を手助けするプログラムを作ることになりました。ネットワークの接続情報と送信パケットの情報を入力... |
p02179 | <h1>E: モンスターバスター</h1>
<h2>問題</h2>
<p>
AORイカちゃんはモンスターバスターである.<br>
ある日, 道を歩いていると寝ているモンスターに出会った.
</p>
<p>
闘争心が強いAORイカちゃんは,モンスターに寝起きの一撃をお見舞いすることに決めた.
しかし, 現在のAORイカちゃんの攻撃力は $0$ であり, このままではまともな攻撃ができない.
</p>
<p>
... |
p03338 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a string <var>S</var> of length <var>N</var> consisting of lowercase English letters.
We will cut this string at one position into two strings <var>X</var> and <var>Y</var>.
Here, we would... |
p01305 |
<h1><font color="#000">Problem C:</font> カードゲーム</h1>
<p>
ねこのゲイツとジャッキーは、2人で遊ぶカードゲームのルールを考えた。そのルールとは次のようなものである。
</p>
<p>
まず、1から18の数字が書かれたカードをシャッフルし、それぞれのプレーヤーに9枚ずつ配る。両者は同時に1枚のカードを同時に出し、その値によってスコアを得る。値の大きいカードを出したプレーヤーは、大きい方の値と小さい方の値の和を自分のスコアに加える。その際、値の小さいカードを出したプレーヤーはスコアを得られない。また、一度場に出されたカードは二度と使うことはできない。カードをすべて使い終わっ... |
p03292 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You have three tasks, all of which need to be completed.</p>
<p>First, you can complete any one task at cost <var>0</var>.</p>
<p>Then, just after completing the <var>i</var>-th task, you can complete t... |
p03768 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Squid loves painting vertices in graphs.</p>
<p>There is a simple undirected graph consisting of <var>N</var> vertices numbered <var>1</var> through <var>N</var>, and <var>M</var> edges.
Initially, all ... |
p01755 |
<p>
盤面上にロボットと壁,ゴールが設置されており, ロボットの行動パターンを記述したプログラムが与えられる.
</p>
<p>
与えられるプログラムは以下のEBNF で表される.
</p>
<pre>
プログラム:= {文};
文:= if 文|while 文|動作文;
if 文:= "[", 条件, プログラム, "]";
while 文:= "{", 条件, プログラム, "}";
動作文:= "^"|"v"|"<"|">";
条件:= ["~"], "N"|"E"|"S"|"W"|"C"|"T";
</pre>
<p>
「プログラム」は0個以上の「文」からなり,1つ以上の文が存在する場合は 1 つ目の文から順... |
p00847 |
<H1><font color="#000">Problem C:</font> Cubic Eight-Puzzle</H1>
<p>
Let's play a puzzle using eight cubes placed on a 3 × 3 board leaving one empty square.
</p>
<p>
Faces of cubes are painted with three colors. As a puzzle step, you can roll one of the cubes to
the adjacent empty square. Your goal is to make t... |
p01240 |
<H1><font color="#000">Problem G:</font> Oil Company</H1>
<p>
Irving & Cohen Petroleum Corporation has decided to develop a new oil field in an area. A preliminary survey
has been done and they created a detailed grid map of the area which indicates the reserve of oil.
</p>
<p>
They are now planning to construct mini... |
p04042 | <span class="lang-en">
<p>Score : <var>1500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha has a sequence of <var>N</var> strings <var>s_1, s_2, ..., s_N</var>.</p>
<p>She will choose some (possibly all) strings from the sequence, then concatenate those strings retaining the relative o... |
p03787 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has received an undirected graph with <var>N</var> vertices, numbered <var>1</var>, <var>2</var>, ..., <var>N</var>.
The edges in this graph are represented by <var>(u_i, v_i)</var>.
There are... |
p02895 | <span class="lang-en">
<p>Score : <var>1500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>2N</var> points <em>generally positioned</em> on the circumference of a circle, numbered <var>1,\dots,2N</var> in counterclockwise order.
Here, a set of points is said to be generally po... |
p01610 |
<h2>Cube of Two</h2>
<h2>Problem Statement</h2>
<p>日本で販売されているルービックキューブの各面の配色が,
世界で標準的に採用されているものに合わせられたのはつい最近のことだ.<br />
これに慣れるため,まずは簡単な2x2x2のキューブをスクランブルして遊ぼう.</p>
<p>初期状態のルービックキューブは,各色が1つの面に集まるように揃えられており,
上面に赤色,正面に黄色,右側面に青色が見える.<br />
また,下面は橙色,背面は白色,左側面は緑色である.
展開図を用いると次のように表せる.</p>
<img src="https://judgeapi.u-ai... |
p00902 |
<H1><font color="#000">Problem I: </font>Encircling Circles</H1>
<p>
You are given a set of circles <i>C</i> of a variety of radii (radiuses) placed at a variety of positions, possibly overlapping one another. Given a circle with radius <i>r</i>, that circle may be placed so that it encircles all of the circles in th... |
p00451 |
<H1> 共通部分文字列 </H1>
<h2>問題</h2>
<p>
2 個の文字列が与えられたとき, 両方の文字列に含まれる文字列のうち最も長いものを探し, その長さを答えるプログラムを作成せよ.
</p>
<p>
ここで, 文字列 s が文字列 t に含まれるとは, t の中に s が連続して現れることをいう. 空文字列, すなわち長さ 0 の文字列は, どんな文字列にも含まれる. 例えば, 文字列 ABRACADABRA には次の文字列が含まれる: ABRA, RAC, D, ACADABRA, ABRACADABRA,空文字列など. 一方, 文字列 ABRACADABRA には次の文字列は含まれない: A... |
p02196 | <h2>Queries with Six Inequeties</h2>
<p>四つの整数の組<var>(a,b,c,d)</var>の集合が与えられます。</p>
<p><var>j</var>番目のクエリでは、<var>x_j < a_i < y_j < b_i</var>かつ<var>z_j < c_i < w_j < d_i</var>なる<var>i</var>が存在するか判定します。</p>
<h3>入力</h3>
<pre>
<var>N Q</var>
<var>a_1 b_1 c_1 d_1</var>
<var>a_2 b_2 c_2 d_2</var>
:
<var>a_n... |
p00001 |
<H1>List of Top 3 Hills</H1>
<p>
There is a data which provides heights (in meter) of mountains. The data is only for ten mountains.
</p>
<p>
Write a program which prints heights of the top three mountains in descending order.
</p>
<H2>Input</H2>
<pre>
Height of mountain 1
Height of mountain 2
Height of mountain 3... |
p00294 |
<h1>鉄道路線II</h1>
<p>
わたしの住む街には、図のような <var>N</var> 個の駅からなる円環状の鉄道路線があります。この路線の各駅には 0 から <var>N</var>-1 までの番号が順番に割り当てられていて、隣の駅まで100 円で移動することができます。移動はどちらの方向にでも可能です。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_PCK2014_railroad" width="240">
</center>
<br>
<p>
わたしはこの路線上のいくつかの駅で買い物をしたいと思... |
p02753 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In AtCoder City, there are three stations numbered <var>1</var>, <var>2</var>, and <var>3</var>.</p>
<p>Each of these stations is operated by one of the two railway companies, A and B. A string <var>S</... |
p03841 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given an integer sequence <var>x</var> of length <var>N</var>.
Determine if there exists an integer sequence <var>a</var> that satisfies all of the following conditions, and if it exists, constr... |
p02303 |
<H1>Closest Pair</H1>
<p>
For given <var>n</var> points in metric space, find the distance of the closest points.
</p>
<H2>Input</H2>
<pre>
<var>n</var>
<var>x<sub>0</sub></var> <var>y<sub>0</sub></var>
<var>x<sub>1</sub></var> <var>y<sub>1</sub></var>
:
<var>x<sub>n-1</sub></var> <var>y<sub>n-1</sub></var>
</pre>
... |
p01485 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<h1> Satan Attacks</h1>
<p>
Time Limit: 8 sec / Memory Limit: 64 MB
</p>
<h2> G: 魔王の襲撃</h2>
<p>
伝説の剣を破壊した魔王は,ついに勇者をある遺跡に追い詰めた.
既に勇者は袋の鼠であるが,相手は神々の加護を得た勇者である.
たとえ伝説の剣がなくとも,いかなる奇跡が奴に味方す... |
p03142 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a rooted tree (see Notes) with <var>N</var> vertices numbered <var>1</var> to <var>N</var>.
Each of the vertices, except the root, has a directed edge coming from its parent.
Note that the root... |
p03512 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Consider an infinite sequence <var>a_1,</var> <var>a_2,</var> <var>…</var> Initially, the values of all the terms are <var>0</var>, and from this state we will sequentially perform <var>Q</var> operatio... |
p03007 | <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> integers, <var>A_1, A_2, ..., A_N</var>, written on a blackboard.</p>
<p>We will repeat the following operation <var>N-1</var> times so that we have only one integer on the blackb... |
p03457 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>AtCoDeer the deer is going on a trip in a two-dimensional plane.
In his plan, he will depart from point <var>(0, 0)</var> at time <var>0</var>, then for each <var>i</var> between <var>1</var> and <var>N... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.