question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p00474 |
<H1>つらら</H1>
<h2> 問題</h2>
<p>
カナダに住む JOI 君の家の軒下には,立派なつららが出来ている.せっかくなので,JOI 君はつららについて調べてみることにした.
</p>
<p>
JOI 君の家の軒下には N 本(2 ≤ N ≤ 100000 = 10<sup>5</sup> )のつららが出来ている.これらのつららは一直線上に並んでおり,軒下の左端から i cm(1 ≤ i ≤ N )の位置に i 本目のつららが出来ている.i 本目のつららの長さは最初 ai cm(ai は 1 以上の整数)である.これらのつららは,次のような規則によって伸びていく:
</p>
<ul>... |
p02449 | <h1>Permutation</h1>
<p>
For given a sequence $A = \{a_0, a_1, ..., a_{n-1}\}$, print the previous permutation and the next permutation in lexicographic order.
</p>
<h2>Input</h2>
<p>
A sequence is given in the following format.
</p>
<pre>
$n$
$a_0 \; a_1 \; ... \; a_{n-1}$
</pre>
<h2>Output</h2>
<p>
Print... |
p00024 |
<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>Physical Experiments</H1>
<p>
Ignoring the ... |
p02019 | <h2>E-修行</h2>
<p>ねねさんはプログラミングの修行のため、$N$ 個の整数 $V_1, V_2, V_3, \cdots, V_N$ について調べるプログラムを作っている。</p>
<p>指導役のうみこさんに言われて、ねねさんは 2, 3, 6 の倍数の個数を調べるプログラムを書いた。</p>
<p>2 の倍数は $A$ 個、3 の倍数は $B$ 個、6 の倍数は $C$ 個だった。</p>
<p>うみこさんは、次は「2 の倍数でも 3 の倍数でもない数」の個数を調べるようにと言った。</p>
<p>しかし、ねねさんは疲れたので、答えだけを求めてごまかすことにした。</p>
<p></p>
<p>$N, A, B, ... |
p03521 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><em>ButCoder Inc.</em> is a startup company whose main business is the development and operation of the programming competition site "<em>ButCoder</em>".</p>
<p>There are <var>N</var> members of the co... |
p03171 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Taro and Jiro will play the following game against each other.</p>
<p>Initially, they are given a sequence <var>a = (a_1, a_2, \ldots, a_N)</var>.
Until <var>a</var> becomes empty, the two players perfo... |
p02330 |
<H1>Coin Combination Problem II</H1>
<p>
You have <var>N</var> coins each of which has a value <var>a<sub>i</sub></var>.
Find the number of combinations that result when you choose <var>K</var> different coins in such a way that the total value of the coins is greater than or equal to <var>L</var> and less than or... |
p02760 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a bingo card with a <var>3\times3</var> grid. The square at the <var>i</var>-th row from the top and the <var>j</var>-th column from the left contains the number <var>A_{i, j}</var>.</p>
<p>The ... |
p03872 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><style>
#nck {
width: 30px;
height: auto;
}
</style>
<p>There are <var>N</var> cities in a two-dimensional plane.
The coordinates of the <var>i</var>-th city is <var>(x_i, y_i)</var>.
In... |
p02275 |
<H1>Counting Sort</H1>
<p>
Counting sort can be used for sorting elements in an array which each of the n input elements is an integer in the range 0 to k. The idea of counting sort is to determine, for each input element x, the number of elements less than x as C[x]. This information can be used to place element x d... |
p00248 |
<H1>魔法陣</H1>
<p>
人里離れた森の奥深くに、マリーという名の魔女が住んでいました。彼女は魔女なので、食料・水・燃料など、生活に必要なものを魔法によってまかなっています。
</p>
<p>
彼女の魔法は、魔力を込めたいくつかの石と紐を使って、魔法陣を描くことによって発動します。この魔法陣は、石を設置し、いくつかの石のペアを紐で繋ぐことで描かれます。ただし、紐は弛んでいてはいけません。さらに、どの紐も、(両端を除いて) 他の紐や石に触れてはいけません。もちろん、同じ場所に複数の石を置くこともできません。この制約が守られる限り、石と石の位置関係や紐の長さに制限はありません。また、石は十分小さいので点として扱うことが... |
p02625 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Count the pairs of length-<var>N</var> sequences consisting of integers between <var>1</var> and <var>M</var> (inclusive), <var>A_1, A_2, \cdots, A_{N}</var> and <var>B_1, B_2, \cdots, B_{N}</var>, that... |
p00618 |
<H1><font color="#000000">Problem D:</font> Course Planning for Lazy Students</H1>
<p>
会津大学では2009年度より、授業履修に関する新しい制度を開始した。新制度では必修科目を撤廃し、それぞれの進路を考慮して科目を自由に選択できるようになった。
</p>
<p>
しかし、どの科目も無条件で履修できるわけではなく、特定の科目を履修するためには、先修条件を満たしている必要がある。下図に履修計画表の一部の例を示す:
</p>
<br>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/reso... |
p03937 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><style>
#nck {
width: 30px;
height: auto;
}
</style>
<p>We have a grid of <var>H</var> rows and <var>W</var> columns. Initially, there is a stone in the top left cell. Shik is trying to m... |
p01459 |
<H1>A Light Road</H1>
<p>
There is an evil creature in a square on N-by-M grid (<var>2 \leq N, M \leq 100</var>),
and you want to kill it using a laser generator located in a different square.
Since the location and direction of the laser generator are fixed,
you may need to use several mirrors to reflect laser beams... |
p03464 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>An adult game master and <var>N</var> children are playing a game on an ice rink.
The game consists of <var>K</var> rounds.
In the <var>i</var>-th round, the game master announces:</p>
<ul>
<li>Form gro... |
p01009 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<h1>Problem D: Room of Time and Spirit</h1>
<h2>Problem</h2>
<p>
20XX年、とある科学者がバイオテクノロジーによって強力な人造人間を開発してしまった。この人造人間はコンピュータにより、戦闘の達人たちの細胞を組み合わせて作られているため非常に強力である。
<br/>
<br/>
このままでは地球は人造人間に支配されてしまうので、 <var>N</var> 人の戦士たちは人造人間と戦うことにした。しかし今の戦士たちでは到底人造人間に敵わない... |
p03034 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is an infinitely large pond, which we consider as a number line.
In this pond, there are <var>N</var> lotuses floating at coordinates <var>0</var>, <var>1</var>, <var>2</var>, ..., <var>N-2</var> ... |
p01584 |
<H1><font color="#000">Problem D:</font> Divide the Water</H1>
<p>
A scientist Arthur C. McDonell is conducting a very complex chemical experiment. This experiment requires a large number of very simple operations to pour water into every column of the vessel at the predetermined ratio. Tired of boring manual work, h... |
p03043 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a fair <var>N</var>-sided die that shows the integers from <var>1</var> to <var>N</var> with equal probability and a fair coin. He will play the following game with them:</p>
<ol>
<li>Throw th... |
p03413 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You have an integer sequence of length <var>N</var>: <var>a_1, a_2, ..., a_N</var>.</p>
<p>You repeatedly perform the following operation until the length of the sequence becomes <var>1</var>:</p>
<ul>
... |
p00395 | <h1> Maze & Items</h1>
<p>
Maze & Items is a puzzle game in which the player tries to reach the goal while collecting items. The maze consists of $W \times H$ grids, and some of them are inaccessible to the player depending on the items he/she has now. The score the player earns is defined according to the ord... |
p02652 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a string <var>S</var>, where each character is <code>0</code>, <code>1</code>, or <code>?</code>.</p>
<p>Consider making a string <var>S'</var> by replacing each occurrence of <code>?</code> wi... |
p03940 | <span class="lang-en">
<p>Score : <var>1200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><style>
#nck {
width: 30px;
height: auto;
}
</style>
<p>Imagine a game played on a line. Initially, the player is located at position <var>0</var> with <var>N</var> candies in his posses... |
p02202 | <h2>ギャグ (Gag)</h2>
<p>Segtree 君は $N$ 個の「ギャグ」を持っていて、それぞれに「できばえ」 $V_i$ という値が定まっています。</p>
<p>Segtree 君は自由な順番で全てのギャグを公開することにしました。</p>
<p>ここで、 $i$ 番目のギャグを $j$ 番目に公開した時に得られる「うれしさ」は $V_i - j$ と表されます。</p>
<p>Segtree 君が得られる「うれしさ」の和の最大値を求めてください。</p>
<h3>入力</h3>
<p>入力は以下の形式で標準入力から与えられる。</p>
<pre>
$N$
$V_1$ $V_2$ $\ldots$ $V_N$
</... |
p02717 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>We have three boxes <var>A</var>, <var>B</var>, and <var>C</var>, each of which contains an integer.<br/>
Currently, the boxes <var>A</var>, <var>B</var>, and <var>C</var> contain the integers <var>X</... |
p03805 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given an undirected unweighted graph with <var>N</var> vertices and <var>M</var> edges that contains neither self-loops nor double edges.<br/>
Here, a <em>self-loop</em> is an edge where <var>a_... |
p01838 |
<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>Optimal Tournament</h2>
<p>
I... |
p02347 |
<H1>Range Search (kD Tree)</H1>
<p>
The range search problem consists of a set of attributed records <var>S</var> to determine which records from <var>S</var> intersect with a given range.
</p>
<p>
For <var>n</var> points on a plane, report a set of points which are within in a given range. Note that you do not nee... |
p00680 |
<h1>KND Factory</h1>
<h2>Problem</h2>
<p>
KND君は会津大学に在籍する学生プログラマである。彼の住む町の周辺には<var> N </var>個の町がある。彼は生クリームが大好きなので毎日生クリームを食べるためにある町に工場を建設した。その工場では毎日<var> F </var>リットルの生クリームが製造される。生クリームは運ぶたびに、移動元の町の気温と移動先の町の気温の絶対差だけ傷んでしまう。困ったことにこの近辺の町の気温は寒暖計によって計測できない。しかしながら調査によって、それぞれの町の気温を変数とした<var> N </var>個の一次方程式からなる<var> N </var... |
p01992 | <h2>D: しりとり圧縮 (Shiritori Compression)</h2>
<h3>問題</h3>
<p>えびちゃんとかにちゃんの二人はしりとりをしました。えびちゃんはしりとりで出た単語のメモを見ています。</p>
<p>えびちゃんは、この単語列 <var>w_1</var>, <var>w_2</var>, <var>...</var>, <var>w_N</var> から冗長な連続部分列を、存在しなくなるまで取り除きたいと思っています。えびちゃんの思う冗長な連続部分列とは以下のように定義されます。</p>
<ul>
<li>以下を満たす <var>i</var>, <var>j</var> が存在したとき、連続部... |
p03106 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given positive integers <var>A</var> and <var>B</var>.</p>
<p>Find the <var>K</var>-th largest positive integer that divides both <var>A</var> and <var>B</var>.</p>
<p>The input guarantees that ... |
p03556 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Find the largest square number not exceeding <var>N</var>. Here, a <em>square number</em> is an integer that can be represented as the square of an integer.</p>
</section>
</div>
<div class="part">
<sec... |
p01091 |
<h2>Complex Paper Folding</h2>
<p>
Dr. G, an authority in paper folding and one of the directors of
Intercultural Consortium on Paper Crafts,
believes complexity gives figures beauty.
As one of his assistants, your job is to find the way to fold a paper
to obtain the most complex figure.
Dr. G defines the complexity... |
p00053 |
<H1>素数の和</H1>
<p>
<var>p(i)</var> を小さい方から <var>i</var> 番目の素数とします。例えば、7 は、2, 3, 5, 7 と小さい方から 4 番目の素数なので、<var>p(4) = 7</var> です。
</p>
<p>
<var>n</var> が与えられたとき、<var>i = 1</var> から <var>n</var> までの <var>p(i)</var> の和 <var>s</var><br/>
<br/>
<var>s = p(1) + p(2) +</var> .... <var>+ p(n)</var><br/>
<br/>
を出力するプログラムを作成し... |
p02594 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You will turn on the air conditioner if, and only if, the temperature of the room is <var>30</var> degrees Celsius or above.</p>
<p>The current temperature of the room is <var>X</var> degrees Celsius. W... |
p00403 | <h1>ねこのあな</h1>
<p>
あなたの家の近所には多くの猫が出入りする横穴があります。中は行き止まりで通り抜けることはできませんが、近所の猫が全部入れるくらいの奥行きがあります。穴の幅は猫がちょうど収まるくらいなので、先に入った猫を後から入った猫が押しのけて奥に向かうことはできません。また、先に入った猫が、後から入ってきた猫を押しのけて出口から出ることもできません。
</p>
<p>
猫好きのあなたは横穴に出入りする猫を順番に記録していきました。記録をはじめたときは横穴の中には一匹も猫はいませんでしたが、やがて猫たちは横穴への出入りを始めました。同じ猫が何度も出入りすることもありました。
</p>
<p>
... |
p00950 |
<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 E
Infallibly Crack Per... |
p01642 |
<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 I: Reverse Game</h1>
<p class="ndoc... |
p03385 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a string <var>S</var> of length <var>3</var> consisting of <code>a</code>, <code>b</code> and <code>c</code>. Determine if <var>S</var> can be obtained by permuting <code>abc</code>.</p>
<... |
p01212 |
<H1><font color="#000">Problem F:</font> Mysterious Dungeons</H1>
<p>
The Kingdom of Aqua Canora Mystica is a very affluent and peaceful country, but around the
kingdom, there are many evil monsters that kill people. So the king gave an order to you to kill
the master monster.
</p>
<p>
You came to the dungeon where t... |
p04010 | <span class="lang-en">
<p>Score : <var>2200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given an undirected graph with <var>N</var> vertices and <var>M</var> edges.
Here, <var>N-1≤M≤N</var> holds and the graph is connected.
There are no self-loops or multiple edges in this graph.<... |
p02828 | <span class="lang-en">
<p>Score : <var>2000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let us consider a grid of squares with <var>N</var> rows and <var>N</var> columns.
Arbok has cut out some part of the grid so that, for each <var>i = 1, 2, \ldots, N</var>, the bottommost <var>h_i</var... |
p00815 | <H1><font color="#000">Problem E:</font> Map of Ninja House</H1>
<p>
An old document says that a Ninja House in Kanazawa City was in fact a defensive fortress, which was designed like a maze. Its rooms were connected by hidden doors in a complicated manner, so that any invader would become lost. Each room has at least... |
p01707 |
<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... |
p02982 | <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> points in a <var>D</var>-dimensional space.</p>
<p>The coordinates of the <var>i</var>-th point are <var>(X_{i1}, X_{i2}, ..., X_{iD})</var>.</p>
<p>The distance between two point... |
p03690 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a sequence of length <var>N</var>: <var>a = (a_1, a_2, ..., a_N)</var>.
Here, each <var>a_i</var> is a non-negative integer.</p>
<p>Snuke can repeatedly perform the following operation:</p>
<u... |
p01357 |
<H1>Problem I: Lapin Noir</H1>
<p>
ここは, 地面が正六角形を敷き詰めたマス目になっている街である. 各マスは, 下の図のように2 つの整数で表される.
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_lapin1">
</center>
<p>
ねこは(0, 0) のマスへ行こうとしている. いたずら好きの黒うさぎはこのことを知って, ねこの邪魔をしようと考えた.
</p>
<p>
黒うさぎはねこがいるマスへ跳び, その周りの6 マスのうち1 つまたは隣り合う2 つをブロックす... |
p00116 |
<H1>長方形探索</H1>
<p>
縦に <var>H</var> 行、横に <var>W</var> 列並べられた、合計 <var>W × H</var> のマス目があります。いくつかのマス目には印がついています。各マス目の印の状態を読み込み、印のついていないマス目だけからなる最大の長方形の面積を出力するプログラムを作成してください。
</p>
<p>
入力データは 1 行 <var>W</var> 文字から構成され、<var>H</var> 行が与えられます。たとえば以下のようなデータが与えられます。
</p>
<pre>
..*....**.
..........
**....***.
....*... |
p02081 | <h1>D: Nose And Lung</h1>
<h2>問題文</h2>
<p>あなたは謎の敵対的なエイリアンについて研究しています。</p>
<p>エイリアンには鼻の穴が $N$ 個あり、肺が $1$ 個以上あります。
しかし、肺がいくつあるか、および、どの鼻の穴とどの肺が繋がっているかが分かっていません。</p>
<p>あなたはエイリアンに関して、以下の仮説を立てました:</p>
<ul>
<li>それぞれの肺は $1$ 個以上の鼻の穴につながっている</li>
<li>それぞれ鼻の穴は $0$ 個以上の肺につながっている</li>
<li>全ての肺に対して酸素が供給されないと死んでしまう。すなわち、ある肺につながっている... |
p00546 |
<h1>ゾンビ島 (Zombie Island)</h1>
<h2> 問題</h2>
<p>
JOI 君が住んでいる島がゾンビに侵略されてしまった.JOI 君は島で一番安全な避難場所として設定されているシェルターに逃げ込むことにした.
</p>
<p>
JOI 君が住んでいる島は町 1 から町 N までの N 個の町からなり,町と町とは道路で結ばれている.島には M 本の道路があり,すべての道路は異なる 2 つの町を結んでいる.JOI 君は道路を双方向に自由に移動できるが,道路以外を通って町から別の町に行くことはできない.
</p>
<p>
いくつかの町はゾンビに支配されており,訪れることが出来ない.ゾンビに支配されて... |
p00268 |
<H1>ねこまっしぐら2 </H1>
<p>
あるところに大きな古いお屋敷があり、1匹のねこが住み着いていました。図のように、お屋敷は上空から見ると凸多角形になっており、まっすぐな壁で囲まれたいくつかの部屋で造られています。1枚の壁はその両端にある柱によって支えられています。お屋敷はとても古いため、どの壁にもねこが通ることができるくらいの穴が1つ空いています。ねこは壁の穴を通ってお屋敷の部屋と部屋または部屋と外を行き来することができます。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_catsGoingStraig... |
p02255 |
<H1>Insertion Sort</H1>
<p>
Write a program of the Insertion Sort algorithm which sorts a sequence A in ascending order. The algorithm should be based on the following pseudocode:
</p>
<pre>
for i = 1 to A.length-1
key = A[i]
/* insert A[i] into the sorted sequence A[0,...,j-1] */
j = i - 1
while j >... |
p00792 |
<H1><font color="#000">Problem E:</font> Mirror Illusion</H1>
<p>
A rich man has a square room with mirrors for security or just for fun. Each side of the room is eight meters wide. The floor, the ceiling and the walls are not special; however, the room can be equipped with a lot of mirrors on the walls or as vertica... |
p01880 |
<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>Best Matched Pair</h2>
<p>
You... |
p00638 |
<H1><font color="#000000">Problem B:</font> Old Bridges</H1>
<p>
Long long ago, there was a thief. Looking for treasures, he was running about all over the world. One day, he heard a rumor that there were islands that had large amount of treasures, so he decided to head for there.
</p>
<p>
Finally he found <i>n</i> ... |
p02605 | <span class="lang-en">
<p>Score: <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>M-kun is a brilliant air traffic controller.</p>
<p>On the display of his radar, there are <var>N</var> airplanes numbered <var>1, 2, ..., N</var>, all flying at the same altitude.<br/>
Each of the airp... |
p03917 | <span class="lang-en">
<p>Score : <var>1900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a grid with <var>H</var> rows and <var>W</var> columns. The square at the <var>i</var>-th row and <var>j</var>-th column contains a character <var>S_{i,j}</var>.</p>
<p>He can perform the fol... |
p03444 | <span class="lang-en">
<p>Score : <var>2000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a rooted tree with <var>N</var> vertices.
The vertices are numbered <var>0, 1, ..., N-1</var>.
The root is Vertex <var>0</var>, and the parent of Vertex <var>i</var> <var>(i = 1, 2, ..., ... |
p01479 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<h1> Chicken or the Egg</h1>
<p>
Time Limit: 8 sec / Memory Limit: 64 MB
</p>
<h2> A: 卵が先か鶏が先か</h2>
<p>
2012/2/8 <br/>
卵が先か鶏が先かという問題はいまだかつて誰もわからなかった.
しかし今回の琵琶湖遺跡で発掘で獲得した文書にはその答えが記されて... |
p01183 |
<H1><font color="#000">Problem C:</font> Tetrahedra</H1>
<p>
Peter P. Pepper is facing a difficulty.
</p>
<p>
After fierce battles with the Principality of Croode, the Aaronbarc Kingdom, for which he serves, had
the last laugh in the end. Peter had done great service in the war, and the king decided to give him a
big... |
p03014 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a grid with <var>H</var> horizontal rows and <var>W</var> vertical columns, and there are obstacles on some of the squares.</p>
<p>Snuke is going to choose one of the squares not occupied by an... |
p01029 |
<h1>Problem B: Yu-kun Likes Letters in the English Alphabet</h1>
<h2>Background</h2>
<p>
会津大学付属幼稚園はプログラミングが大好きな子供が集まる幼稚園である。園児の一人であるゆう君は、プログラミングと同じくらい英小文字が大好きだ。
そんなゆう君は紙と丸と線、そして英小文字を使う新しい遊びを考え、その採点用プログラムを書くことにした。
</p>
<h2>Problem</h2>
<p>初期状態として、紙に <var>V</var> 個の丸と <var>E</var> 本の線が書かれている。丸には0から昇順に番号がつけられており、各丸の中には... |
p03501 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are parking at a parking lot. You can choose from the following two fee plans:</p>
<ul>
<li>Plan <var>1</var>: The fee will be <var>A×T</var> yen (the currency of Japan) when you park for <var>T</va... |
p01496 |
<H1><font color="#000">Problem A: </font>Bicube</H1>
<p>
Mary Thomas has a number of sheets of squared paper. Some of squares are painted either in black or some <i>colorful</i> color (such as red and blue) on the front side. Cutting off the unpainted part, she will have eight opened-up unit cubes. A unit cube here r... |
p03151 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>A university student, Takahashi, has to take <var>N</var> examinations and pass all of them.
Currently, his <em>readiness</em> for the <var>i</var>-th examination is <var>A_{i}</var>, and according to h... |
p02310 |
<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>Tangent to a Circle</H1>
<p>
Find the ta... |
p00287 |
<h1>壁</h1>
<p>
2XXX年、突然出現した天敵の侵入を防ぐために、人類は壁を作りその中に逃げ込んだ。その結果、人類の活動領域はその壁で囲まれた範囲に限定されてしまった。この領域は、上空から見ると <var>W</var> × <var>H</var> の長方形である。領域内部には <var>x</var> 軸あるいは <var>y</var> 軸に対して平行な壁がいくつか設置されている。活動領域の例を下図に示す。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_PCK2013_wall1" wi... |
p02740 | <span class="lang-en">
<p>Score : <var>2100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> jewelry shops numbered <var>1</var> to <var>N</var>.</p>
<p>Shop <var>i</var> (<var>1 \leq i \leq N</var>) sells <var>K_i</var> kinds of jewels.
The <var>j</var>-th of these jewe... |
p03852 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given a lowercase English letter <var>c</var>, determine whether it is a vowel. Here, there are five vowels in the English alphabet: <code>a</code>, <code>e</code>, <code>i</code>, <code>o</code> and <c... |
p02890 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Takahashi has <var>N</var> cards. The <var>i</var>-th of these cards has an integer <var>A_i</var> written on it.</p>
<p>Takahashi will choose an integer <var>K</var>, and then repeat the following ope... |
p04047 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having a barbeque party.</p>
<p>At the party, he will make <var>N</var> servings of <em>Skewer Meal</em>.</p>
<div style="text-align: center;">
<img src="https://agc001.contest.atcoder.jp/img/a... |
p03782 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>AtCoDeer the deer has <var>N</var> cards with positive integers written on them. The number on the <var>i</var>-th card <var>(1≤i≤N)</var> is <var>a_i</var>.
Because he loves big numbers, he calls a sub... |
p01245 |
<H1><font color="#000">Problem C:</font> Magical Dungeon</H1>
<p>
Arthur C. Malory is a wandering valiant fighter (in a game world).
</p>
<p>
One day, he visited a small village and stayed overnight. Next morning, the village mayor called on him. The
mayor said a monster threatened the village and requested him to de... |
p03278 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let <var>N</var> be an even number.</p>
<p>There is a tree with <var>N</var> vertices.
The vertices are numbered <var>1, 2, ..., N</var>.
For each <var>i</var> (<var>1 \leq i \leq N - 1</var>), the <var... |
p00907 |
<H1><font color="#000">Problem D: </font> Find the Outlier</H1>
<p>
Professor Abacus has just built a new computing engine for making numerical tables. It was designed to calculate the values of a polynomial function in one variable at several points at a time. With the polynomial function <i>f</i>(<i>x</i>) = <i>x</... |
p01615 |
<h1>C: Project Management / プロジェクト管理</h1>
<p>あなたは凄腕のプロジェクトマネージャである. 今回は超大規模なプロジェクトのマネジメントを請け負った.</p>
<div align="center">
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_Rits_Camp13_Day3_C_C_fig_arrow" alt="C_fig_arrow.png" />
<p><strong>図1:</strong> アローダイアグラム</p>
</d... |
p03628 | <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.<... |
p02193 | <h2>Range Min of Max Query</h2>
<p>整数の組の列<var>(a_1,b_1), (a_2,b_2),..,(a_N,b_N)</var>が与えられます。</p>
<p>二種類のクエリを処理してください。</p>
<p>一種類目のクエリでは、<var>a_L,a_{L+1},..,a_R</var>に<var>X</var>を加算します。</p>
<p>二種類目のクエリでは、<var>max(a_L,b_L),max(a_{L+1},b_{L+1}),..,max(a_R,b_R)</var>の最小値を求めます。</p>
<h3>入力</h3>
<pre>
<var>N Q</var>
<var>a... |
p02469 |
<H1>Least Common Multiple</H1>
<br/>
<p>
Find the least common multiple (LCM) of given <var>n</var> integers.
</p>
<H2>Input</H2>
<pre>
<var>n</var>
<var>a<sub>1</sub></var> <var>a<sub>2</sub></var> ... <var>a</var><sub><var>n</var></sub>
</pre>
<p>
<var>n</var> is given in the first line. Then, <var>n</var> integ... |
p00454 |
<H1> ペンキの色 </H1>
<h2>問題</h2>
<p>
情報オリンピックの宣伝のために,長方形のベニヤ板にペンキを塗り看板を制作したい.ベニヤ板には色を塗りたくないところにあらかじめ何枚かの長方形のマスキングテープが貼られている.そこでマスキングテープで区切られた領域ごとに別々の色を使いペンキを塗ることにした.例えば,図 5-1 の場合は 5 色のペンキを使う.
</p>
<br>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_penki1">
</center>
<br>
<p>
入力としてマスキングテープ... |
p02039 | <h1>C: オセロ</h1>
<h2>問題</h2>
<p>
オセロの盤面を用意する. 盤面は左上が $(1,1)$ , 右下が $(8,8)$ と表記する. ここで用意する盤面は, 以下のように, $(5,4)$ の黒の石がない.
</p>
<pre>
........
........
........
...ox...
....o...
........
........
........
</pre>
<p>
黒石:x 白石:o<br>
8x8の盤面<br>
この状態から, 黒が先手でオセロを開始する.
</p>
<p>
AORイカちゃんは, 以下のルールで... |
p00004 |
<H1>Simultaneous Equation</H1>
<p>
Write a program which solve a simultaneous equation:<br>
<br>
<var> ax + by = c</var><br>
<var> dx + ey = f</var><br>
<br>
The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 ... |
p00511 |
<H1>問題 2 </H1>
<br/>
<p>
加減乗除の計算をする電卓プログラムを作りなさい.
</p>
<p>
入力データの各行には数と記号 +, -, *, /, = のどれか1つが交互に書いてある.
1行目は数である.
演算 +, -, *, / の優先順位(乗除算 *, / を加減算 +, - よりも先に計算すること)は考えず,入力の順序で計算し,= の行になったら,計算結果を出力する.
入力データの数値は10<sup>8</sup>以下の正の整数とする.
計算中および計算結果は,0または負の数になることもあるが
-10<sup>8</sup>〜10<sup>8</sup> の範囲は超えない.
割り算は切... |
p00141 |
<H1>ぐるぐる模様</H1>
<p>
「ぐるぐる模様」を表示するプログラムを作成することにしました。「ぐるぐる模様」は以下のようなものとします。
</p>
<ul>
<li>1 辺の長さが <var>n</var> の場合、<var>n</var> 行 <var>n</var> 列の文字列として表示する。</li>
<li>左下隅を基点とし,時計回りに回転する渦状の模様とする。</li>
<li>線のある部分は #(半角シャープ)、空白部分は " "(半角空白)で表現する。</li>
<li>線と線の間は空白を置く。</li>
</ul>
<p>
整数 <var>n</var> を入力とし,1 辺の長さが <var>n... |
p01300 |
<H1><font color="#000">Problem H:</font> Eleven Lover</H1>
<p>
Edward Leven loves multiples of eleven very much. When he sees a number, he always tries
to find consecutive subsequences (or substrings) forming multiples of eleven. He calls such
subsequences as 11-sequences. For example, he can find an 11-sequence 781 ... |
p00842 |
<H1><font color="#000">Problem G:</font> Network Mess</H1>
<p>
Gilbert is the network admin of Ginkgo company. His boss is mad about the messy network
cables on the floor. He finally walked up to Gilbert and asked the lazy network admin to illustrate
how computers and switches are connected. Since he is a programmer,... |
p01750 |
<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>
すぬけ君は,誕生日プレゼントとして辺の長さが <va... |
p03297 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Ringo Mart, a convenience store, sells apple juice.</p>
<p>On the opening day of Ringo Mart, there were <var>A</var> cans of juice in stock in the morning.
Snuke buys <var>B</var> cans of juice here eve... |
p03002 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a sequence of positive integers of length <var>N</var>, <var>A=a_1,a_2,…,a_{N}</var>, and an integer <var>K</var>.
How many contiguous subsequences of <var>A</var> satisfy the following co... |
p01195 |
<H1><font color="#000"></font>Philosopher's Stone</H1>
<!-- Problem G-->
<p>
In search for wisdom and wealth, Alchemy, the art of transmutation, has long been pursued by people.
The crucial point of Alchemy was considered to find the recipe for <i>philosopher’s stone</i>, which will be a
catalyst to produce gold and s... |
p03452 | <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> people standing on the <var>x</var>-axis.
Let the coordinate of Person <var>i</var> be <var>x_i</var>.
For every <var>i</var>, <var>x_i</var> is an integer between <var>0</var> an... |
p03901 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Aoki is in search of Takahashi, who is missing in a one-dimentional world.
Initially, the coordinate of Aoki is <var>0</var>, and the coordinate of Takahashi is known to be <var>x</var>, but his coordin... |
p02613 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi is participating in a programming contest called AXC002, and he has just submitted his code to Problem A.</p>
<p>The problem has <var>N</var> test cases.</p>
<p>For each test case <var>i</var>... |
p01896 |
<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>F: 紙の折りたたみ / Folding Paper</h1>
<h2>問題文</h2>
<p>
高さ $H$ マス... |
p00784 |
<H1><font color="#000">Problem E:</font> Pipeline Scheduling</H1>
<p>
An <i>arithmetic pipeline</i> is designed to process more than one task simultaneously in an overlapping manner. It includes function units and data paths among them. Tasks are processed by <i>pipelining</i>: at each clock, one or more units are de... |
p02243 |
<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>Single Source Shortest Path... |
p01879 |
<h2>H: われわれの努力について - About Our Effort -</h2>
<h3>問題</h3>
<p>※この問題はおまけの問題と捉えていただけるとありがたく、<a href="http://birthday0410.contest.atcoder.jp/tasks/birthday0410_x">できれば先に他の問題のほうをお楽しみいただければと思っておりまして,ですので他の問題を通し終えて暇になり,かつその暇を</a>このコンテストで潰そうという気になってくれた方に挑戦していただければと思います。</p>
<p>
D問題のクエリが遅くてすみませんでした。
しかし我々といたしましても決してただ怠慢をしてい... |
p03844 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Joisino wants to evaluate the formula "<var>A</var> <var>op</var> <var>B</var>".
Here, <var>A</var> and <var>B</var> are integers, and the binary operator <var>op</var> is either <code>+</code> or <code... |
p02756 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has a string <var>S</var> consisting of lowercase English letters.</p>
<p>Starting with this string, he will produce a new one in the procedure given as follows.</p>
<p>The procedure consists ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.