question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p01315 |
<h1><font color="#000">Problem B:</font> Moonlight Farm</h1>
<!--
<h3><U>ムーンライト牧場</U></h3>
-->
<p>あなたは大人気webゲーム「ムーンライト牧場」に熱中している.このゲームの目的は,畑で作物を育て,それらを売却して収入を得て,その収入によって牧場を大きくしていくことである.</p>
<p>あなたは速く畑を大きくしたいと考えた.そこで手始めにゲーム中で育てることのできる作物を,時間あたりの収入効率にもとづいて並べることにした.</p>
<p>作物を育てるには種を買わなければならない.ここで作物 <i>i</i> の種の名前は ... |
p00912 |
<H1><font color="#000">Problem I: </font>Beautiful Spacing</H1>
<p>
Text is a sequence of words, and a word consists of characters. Your task is to put words into a grid with <i>W</i> columns and sufficiently many lines. For the beauty of the layout, the following conditions have to be satisfied.
</p>
<ol>
<li>The w... |
p01600 |
<h2>Problem J: Tree Construction</h2>
<p>Consider a two-dimensional space with a set of points (<var>x<sub>i</sub></var>,
<var>y<sub>i</sub></var>) that satisfy <var>x<sub>i</sub></var> < <var>x<sub>j</sub></var>
and <var>y<sub>i</sub></var> > <var>y<sub>j</sub></var> for all <var>i < j</var>.
We want to have them al... |
p01250 |
<H1><font color="#000">Problem A:</font> Pi is Three</H1>
<p>
<i>π</i> (spelled pi in English) is a mathematical constant representing the circumference of a circle whose di-
ameter is one unit length. The name <i>π</i> is said to come from the first letter of the Greek words περιφέ... |
p02885 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>The window of Takahashi's room has a width of <var>A</var>. There are two curtains hung over the window, each of which has a horizontal length of <var>B</var>. (Vertically, the curtains are long enough ... |
p04052 | <span class="lang-en">
<p>Score : <var>2000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a permutation <var>P_1 ... P_N</var> of the set {<var>1</var>, <var>2</var>, ..., <var>N</var>}.</p>
<p>You can apply the following operation to this permutation, any number of times (pos... |
p03797 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke loves puzzles.</p>
<p>Today, he is working on a puzzle using <code>S</code>- and <code>c</code>-shaped pieces.
In this puzzle, you can combine two <code>c</code>-shaped pieces into one <code>S</co... |
p00011 |
<H1>Drawing Lots</H1>
<p>
Let's play Amidakuji.
</p>
<p>
In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines.
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1">
</center>
<br>
<p>... |
p00441 |
<H1>最古の遺跡 </H1>
<h2>問題</h2>
<p>
昔, そこには集落があり, 多くの人が暮らしていた. 人々は形も大きさも様々な建物を建てた. だが, それらの建造物は既に失われ, 文献と, 遺跡から見つかった柱だけが建造物の位置を知る手がかりだった.
</p>
<p>
文献には神殿の記述がある. 神殿は上から見ると正確に正方形になっており, その四隅には柱があった. 神殿がどの向きを向いていたかはわからない. また, 辺上や内部に柱があったかどうかもわからない. 考古学者たちは, 遺跡から見つかった柱の中で, 正方形になっているもののうち, 面積が最大のものが神殿に違いないと考えた.
</p>
<p... |
p02186 | <h2>E: 総和の切り取り</h2>
<h3>問題</h3>
<p>
えびちゃんは数列 <var>(a_1, a_2, ..., a_n)</var> を持っています。
えびちゃんは(空でもよい)部分配列の総和の最大値が気になるので、それを求めてください。
ここで、部分配列とは連続する部分列を指します。なお、空列の総和は <var>0</var> とします。
</p>
<p>さらに、えびちゃんがこの数列を <var>q</var> 回書き換えるので、各書き換えの直後にこの値を求めてください。</p>
<h3>入力形式</h3>
<pre>
<var>n</var> <var>q</var>
<var>a_1</var> <... |
p00695 |
<H1>
Get a Rectangular Field
</H1>
<P>
Karnaugh is a poor farmer who has a very small field.
He wants to reclaim wasteland in the kingdom to get a new field.
But the king who loves regular shape
made a rule that a settler can only get a rectangular land as his field.
Thus, Karnaugh should get the largest rectangular... |
p01987 | <h3>カジノ</h3>
<!-- begin ja only -->
<p>あなたの勤めている会社では新たなカジノゲームの開発をしている.今日は最近提案されたゲームについて考察してみることにした.</p>
<p>このゲームでは <i>N</i> 個のサイコロを同時に振って,出た目の合計が得点となる.プレイヤーは得点を大きくすることを目標としてプレーする.もし出た目が気に入らなければサイコロを振り直すことができるが,その時は <i>N</i> 個のサイコロ全てを同時に振り直さなければならない.また,サイコロを振ることのできる回数は最大で <i>M</i> 回である.十分に大きい目が出たと思ったのであれば,<i>M</i> 回より... |
p02352 | <H1>RMQ and RAQ</H1>
<p>
Write a program which manipulates a sequence $A$ = {$a_0, a_1, ..., a_{n-1}$} with the following operations:
</p>
<ul>
<li> $add(s, t, x)$ : add $x$ to $a_s, a_{s+1}, ..., a_t$.</li>
<li> $find(s, t)$ : report the minimum value in $a_s, a_{s+1}, ..., a_t$.</li>
</ul>
<p>
Note... |
p02702 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a string <var>S</var> consisting of digits from <code>1</code> through <code>9</code>.</p>
<p>Find the number of pairs of integers <var>(i,j)</var> (<var>1 ≤ i ≤ j ≤ |S|</var>) that satisfy the... |
p03810 | <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> integers written on a blackboard. The <var>i</var>-th integer is <var>A_i</var>, and the greatest common divisor of these integers is <var>1</var>.</p>
<p>Takahashi and Aoki will... |
p01084 |
<h1>Problem M: Dial</h1>
<h2>Problem</h2>
<p>
ダイヤル式の南京錠がある。この南京錠には、5つのダイヤルと、決定ボタンが用意されている。
</p>
<p>
5つあるダイヤルを回転させて16進数で5ケタの整数を作り、決定ボタンを押して入力すると、入力した値とパスワードが一致していれば開く仕組みになっている。5つのダイヤルそれぞれには<br><br>
0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,0,1,2, ...<br><br>
の順で文字が現れるように書かれている。
</p>
<p>
持ち主は... |
p03543 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We call a <var>4</var>-digit integer with three or more consecutive same digits, such as <var>1118</var>, <strong>good</strong>.</p>
<p>You are given a <var>4</var>-digit integer <var>N</var>. Answer th... |
p03113 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke participated in a magic show.</p>
<p>A magician prepared <var>N</var> identical-looking boxes.
He put a treasure in one of the boxes, closed the boxes, shuffled them, and numbered them <var>1</va... |
p03406 | <span class="lang-en">
<p>Score : <var>1100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>2^N</var> players, numbered <var>1, 2, ..., 2^N</var>.
They decided to hold a tournament.</p>
<p>The tournament proceeds as follows:</p>
<ul>
<li>Choose a permutation of <var>1, 2, ..., ... |
p03056 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><strong>Note the unusual memory limit.</strong></p>
<p>For a rectangular grid where each square is painted white or black, we define its <strong>complexity</strong> as follows:</p>
<ul>
<li>If all the ... |
p01591 |
<h2>Problem A: Approximate Circle</h2>
<p>Consider a set of <var>n</var> points (<var>x<sub>1</sub></var>, <var>y<sub>1</sub></var>),
..., (<var>x<sub>n</sub></var>,<var>y<sub>n</sub></var>) on a Cartesian space.
Your task is to write a program for regression to a circle <var>x<sup>2</sup></var>
+ <var>y<sup>2</sup><... |
p02217 | <span class="lang">
<span class="lang-ja">
<h1>F: ボタンの木</h1>
<div class="part">
<section>
<h3>問題文</h3><p>$N$ 頂点 $N-1$ 辺からなる木があり、$i$ 番目の辺は $u_i$ 番目の頂点と $v_i$ 番目の頂点を接続しています。</p>
<p>各頂点にはボタンが咲いており、$i$ 番目の頂点に咲いているボタンをボタン $i$ と呼ぶことにします。</p>
<p>はじめ、ボタン $i$ の美しさは $a_i$ です。</p>
<p>ボタン $i$ を押すたびに、ボタン $i$ の美しさを隣接するボタンに $1$ ずつ分け... |
p02647 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> bulbs arranged on a number line, numbered <var>1</var> to <var>N</var> from left to right.
Bulb <var>i</var> is at coordinate <var>i</var>.</p>
<p>Each bulb has a non-negative integ... |
p01968 | <h2>B: 階層的計算機 (Hierarchical Calculator)</h2>
<h3>Problem</h3>
<p>Ebi-chan has <var>N</var> formulae: <var>y = a_i x</var> for <var>i =1, ..., N</var> (inclusive). Now she considers a subsequence of indices with length <var>k</var>: <var>s_1</var>, <var>s_2</var>, <var>...</var>, <var>s_k</var>. At first, let <var>x... |
p03955 | <span class="lang-en">
<p>Score : <var>1500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a grid with <var>3</var> rows and <var>N</var> columns.
The cell at the <var>i</var>-th row and <var>j</var>-th column is denoted (<var>i</var>, <var>j</var>).
Initially, each cell (<var>i</var... |
p00380 | <h1>Bozosort</h1>
<p>
Bozosort, as well as Bogosort, is a very inefficient sort algorithm. It is a random number-based algorithm that sorts sequence elements following the steps as below:
</p>
<ol>
<li> Randomly select two elements and swap them.</li>
<li> Verify if all the elements are sorted in increasing or... |
p01342 |
<H1><font color="#000">Problem D: </font>Dungeon Wall</H1>
<p>
In 2337, people are bored at daily life and have crazy desire of having extraordinary experience. These days,“Dungeon Adventure” is one of the hottest attractions, where brave adventurers risk their lives to kill the evil monsters and save the world.
</p... |
p02997 | <span class="lang-en">
<p>Score: <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Does there exist an undirected graph with <var>N</var> vertices satisfying the following conditions?</p>
<ul>
<li>The graph is simple and connected.</li>
<li>The vertices are numbered <var>1, 2, ..., N<... |
p03685 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is playing a puzzle game.
In this game, you are given a rectangular board of dimensions <var>R × C</var>, filled with numbers. Each integer <var>i</var> from <var>1</var> through <var>N</var> is w... |
p00800 |
<H1><font color="#000">Problem E:</font> The Devil of Gravity</H1>
<p>
Haven't you ever thought that programs written in Java, C++, Pascal, or any other modern computer languages look rather sparse? Although most editors provide sufficient screen space for at least 80 characters or so in a line, the average number of... |
p01712 |
<h1>問題 A : Koto Distance</h1>
<h2>問題文</h2>
<p>
Koto は言わずと知れた碁盤の目の街である.
この街は東西方向に <var>W</var> メートル,南北方向に <var>H</var> メートルに伸びる長方形の領域によってできている.
この街の西端から <var>x</var> メートル,南端から <var>y</var> メートルの点は <var>(x,  y) </var> と記される.
ここの街に住む人は古くから伝わる独自の文化を重んじており,その一つにKoto距離という変わった距離尺度がある.
2つの点 <var>(x_1, y_1)</var>,... |
p00553 |
<h1>電子レンジ (Microwave)</h1>
<h2>問題</h2>
<p>
JOI 君は食事の準備のため,A ℃の肉を電子レンジで B ℃まで温めようとしている.
肉は温度が 0 ℃未満のとき凍っている.
また,温度が 0 ℃より高いとき凍っていない.
温度がちょうど 0 ℃のときの肉の状態は,凍っている場合と,凍っていない場合の両方があり得る.
</p>
<p>
JOI 君は,肉の加熱にかかる時間は以下のようになると仮定して,肉を温めるのにかかる時間を見積もることにした.
</p>
<ul>
<li>肉が凍っていて,その温度が 0 ℃より小さいとき: C 秒で 1 ℃温まる.
<li>肉が凍っていて,その温度... |
p02094 |
<h2>G: Toss Cut Tree</h2>
<h3>Problem Statement</h3>
<p>You are given two trees <var>T, U</var>. Each tree has <var>N</var> vertices that are numbered <var>1</var> through <var>N</var>. The <var>i</var>-th edge (<var>1 \leq i \leq N-1</var>) of tree <var>T</var> connects vertices <var>a_i</var> and <var>b_i</var>. Th... |
p00103 |
<H1>Baseball Simulation</H1>
<p>
Ichiro likes baseball and has decided to write a program which simulates baseball.</p>
<p>
The program reads events in an inning and prints score in that inning. There are only three events as follows:
</p>
<p>Single hit</p>
<ul>
<li>put a runner on the first base.</li>
<li>the runn... |
p00416 | <h1>2つの多角形</h1>
<p>
ヤエさんは3本以上の真っすぐな棒を繋げて多角形を作り、恋人のジョウ君にプレゼントすることにしました。棒はそれらの端点でのみ繋げることができます。端点はすべて同じ平面上に置きます。一つの接合点で繋がる棒は2本だけで、それらがなす角度は自由に決めることができます。
</p>
<p>
ヤエさんは、自分が持っている棒をすべて使って大きさが同じくらいの2つの多角形を作ろうとしています。
</p>
<p>
与えられたすべての棒を使って、2つの多角形を、それらの周囲の長さの差の絶対値が最小となるように作る。各棒の長さが与えられたとき、2つの多角形の周囲の長さの差の絶対値を求めるプログラムを作成せよ。2つ... |
p02581 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>3N</var> cards arranged in a row from left to right, where each card has an integer between <var>1</var> and <var>N</var> (inclusive) written on it. The integer written on the <var>i</var>-... |
p00046 |
<H1>標高差</H1>
<p>
今まで登ったことのある山の標高を記録したデータがあります。このデータを読み込んで、一番高い山と一番低い山の標高差を出力するプログラムを作成してください。
</p>
<H2>Input</H2>
<p>
入力は以下の形式で与えられます。
</p>
<pre class="exp">
山の高さ
...
...
</pre>
<p>
山の高さが複数行に渡って与えられます。入力される値はすべて 0 以上 1,000,000 以下の実数です。入力される山の高さの数は 50 以下です。
</p>
<H2>Output</H2>
<p>
一番高い山と一番低い山の標高差を実数で出力する。出力は0... |
p04005 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a rectangular parallelepiped of size <var>A×B×C</var>, built with blocks of size <var>1×1×1</var>. Snuke will paint each of the <var>A×B×C</var> blocks either red or blue, so that:</p>
<ul>
<li>... |
p01207 |
<H1><font color="#000">Problem A:</font> Hit and Blow</H1>
<p>
<i>Hit and blow</i> is a popular code-breaking game played by two people, one codemaker and one
codebreaker. The objective of this game is that the codebreaker guesses correctly a secret
number the codemaker makes in his or her mind.
</p>
<p>
The game is ... |
p03390 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><var>10^{10^{10}}</var> participants, including Takahashi, competed in two programming contests.
In each contest, all participants had distinct ranks from first through <var>10^{10^{10}}</var>-th.</p>
<... |
p00945 |
<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 K
Min-Max Distance Gam... |
p02978 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a stack of <var>N</var> cards, each of which has a non-negative integer written on it. The integer written on the <var>i</var>-th card from the top is <var>A_i</var>.</p>
<p>Snuke will repeat ... |
p01657 |
<h2>B - ライオン</h2>
<p>
あなたは動物園に来てライオンを見ている。
この動物園には<var>n</var>個のライオンのオリがある。
あなたはライオンが全部で何頭いるのか知りたくなったのだが、
一人で数えるのは大変だ。
そこで近くにいた動物園の来園者<var>m</var>人に協力してもらうことにした。
</p>
<p>
ライオンのオリは、それぞれ<var>1</var>番から<var>n</var>番までの数字がついており、
順番に並んでいる。
一つのオリには<var>0</var>頭以上<var>x</var>頭以下のライオンがいる。
</p>
<p>
<var>m</var>人の来園者で<var>i</... |
p01440 |
<H1><font color="#000">Problem D:</font> Revenge of Champernowne Constant</H1>
<p>
Champernowne constant is an irrational number. Its decimal representation starts with "0.", followed by concatenation of all positive integers in the increasing order.
</p>
<p>
You will be given a sequence <i>S</i> which consists of d... |
p03187 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi Lake has a perimeter of <var>L</var>. On the circumference of the lake, there is a residence of the lake's owner, Takahashi.
Each point on the circumference of the lake has a coordinate betwee... |
p01010 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<h1>Problem E: Light Source</h1>
<h2>Problem</h2>
<!--
<p>
<var>n</var>個の円状の光源がある。ある光源が光を受けた場合、その光源の中心点から扇状に光が放出される。光源が光を受けるとは、光となる扇形が光源となる円を完全に覆うことをいう。また、光源を覆う事によって光は遮られず、扇形に覆われていない円の部分が存在する場合、光を受けたと見なされない。光を受けた光源から放出される光の強さは、受けた光の強さと同じになる。円を全て囲うように受けた光が複数... |
p00251 |
<H1>10問解いたら何点取れる?</H1>
<p>
選手の皆さん、パソコン甲子園にようこそ。パソコン甲子園は今年で10周年になりますが、出題される問題数や合計得点は年によって異なります。各問題には難易度に応じて得点が決められています。問題数が10問で、それぞれの問題の得点が与えられるとき、それらの合計を出力するプログラムを作成して下さい。
</p>
<h2>入力</h2>
<p>
入力は以下の形式で与えられる。
</p>
<pre>
s<sub>1</sub>
s<sub>2</sub>
.
.
s<sub>10</sub>
</pre>
<p>
入力は10行からなり、i 行目に問題 i の得点を表す整数 s<s... |
p02796 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In a factory, there are <var>N</var> robots placed on a number line.
Robot <var>i</var> is placed at coordinate <var>X_i</var> and can extend its arms of length <var>L_i</var> in both directions, positi... |
p03884 | <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>Welcome to CODE FESTIVAL 2016!
In order to celebrate this contest, find a string <var>s</var> that satisfies the following conditi... |
p00601 |
<H1><font color="#000000">Problem G:</font> Dominating Set</H1>
<p>
What you have in your hands is a map of Aizu-Wakamatsu City. The lines on this map represent streets and the dots are street corners. Lion Dor Company is going to build food stores at some street corners where people can go to buy food. It is unneces... |
p01913 |
<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>I: Islands Survival</h1>
<h2>問題</h2>
<p>
$N$ 頂点 $M$ 辺の単純連結無... |
p02329 |
<H1>Coin Combination Problem</H1>
<p>
You have 4 bags A, B, C and D each of which includes <var>N</var> coins (there are totally <var>4N</var> coins). Values of the coins in each bag are <var>a<sub>i</sub></var>, <var>b<sub>i</sub></var>, <var>c<sub>i</sub></var> and <var>d<sub>i</sub></var> respectively.
</p>
<p>
... |
p00314 |
<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>
今年も白虎大学でプログラミングコンテ... |
p02283 | <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>Binary Search Tree I</H1>
<... |
p02779 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a sequence of integers <var>A_1, A_2, ..., A_N</var>.
If its elements are pairwise distinct, print <code>YES</code>; otherwise, print <code>NO</code>.</p>
</section>
</div>
<div class="part">
<... |
p00744 |
<h1><font color="#000000">Problem E:</font> Cards</h1>
<p>
There are many blue cards and red cards on the table.
For each card, an integer number greater than 1 is printed on its face.
The same number may be printed on several cards.
</p>
<p>
A blue card and a red card can be paired when both of the numbers
printe... |
p01856 |
<h1 id="e-台風-typhoon">E : 台風 / Typhoon</h1>
<h2 id="問題文">問題文</h2>
<p>南北方向に <var>H</var> ,東西方向に <var>W</var> の大きさの町がある. 町には一辺の長さが <var>1</var> の正方形の区画に隙間なく整備されており,全ての区画に <var>1</var> 軒ずつ家が建っている.</p>
<p>この町のある区画の上空で台風が発生し,被害を与えた後,ある区画の上空で温帯低気圧に変化した. 変化した後は被害を与えない. 下図のように,台風は高さ <var>3</var>, 幅 <var>3</var> の正方形であり, ★... |
p01505 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Billiards Sorting</H1>
<p>
Rotation is one of several popular pocket billiards games.
It uses 15 balls numbered from 1 to 15, and set them up as illustrated in the following figure at the beginning of a game.
(Note: the ball order is modified from... |
p03538 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Select any integer <var>N</var> between <var>1000</var> and <var>2000</var> (inclusive), and any integer <var>K</var> not less than <var>1</var>, then solve the problem below.</p>
<h4>Problem</h4>
<p>W... |
p03492 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a tree with <var>N</var> vertices. The vertices are numbered <var>1</var> through <var>N</var>. The <var>i</var>-th edge (<var>1 \leq i \leq N - 1</var>) connects Vertex <var>x_i</var> and <var... |
p01155 |
<H1><font color="#000">Problem A:</font> Ruins</H1>
<p>
In 1936, a dictator Hiedler who aimed at world domination had a deep obsession with <i>the Lost Ark</i>. A
person with this ark would gain mystic power according to legend. To break the ambition of the dictator,
ACM (the Alliance of Crusaders against Mazis) entr... |
p03168 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let <var>N</var> be a positive odd number.</p>
<p>There are <var>N</var> coins, numbered <var>1, 2, \ldots, N</var>.
For each <var>i</var> (<var>1 \leq i \leq N</var>), when Coin <var>i</var> is tossed,... |
p00197 |
<h1>最大公約数-ユークリッドの互除法</h1>
<p>
最大公約数は、コンピュータ上で扱う数学には欠かせない要素です。最大公約 数を使うことで、計算の効率が大きく変動することもあります。最大公約数を求めるアルゴリズムのひとつが「ユークリッドの互除法」です。その処理 の流れを以下に示します。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_gcd"><br/>
</center>
<br/>
<p>
例えば 1071 と 1029 の場合、1071 を <var>X</var> 、1029 を <var>Y</... |
p02450 | <h1>Permutation Enumeration</h1>
<p>
For given an integer $n$, print all permutations of $\{1, 2, ..., n\}$ in lexicographic order.
</p>
<h2>Input</h2>
<p>
An integer $n$ is given in a line.
</p>
<h2>Output</h2>
<p>
Print each permutation in a line in order. Separate adjacency elements by a space characte... |
p02000 | <h1>E: 凸凹数列</h1>
<h2>問題</h2>
<p>
長さ $N$ の数列 $A$ が与えられる。$A$ の $i$ 項目 は $A_i$ である。
あなたは、この数列に対して以下の操作を行うことができる。
</p>
<p>
<ul>
<li>$1 \leq i \leq N - 1$ なる整数 i を選ぶ。 $A_i$ の値と $A_{i + 1}$ の値を入れ替える。</li>
</ul>
</p>
<p>
$A$ を凸凹数列にするために必要な操作の最小回数を求めよ。
</p>
<p>
以下の条件を満たす長さ $N$ の数列を凸凹数列と定義する。
<ul>
<... |
p00894 |
<H1><font color="#000">Problem A: </font> Gift from the Goddess of Programming </H1>
<p>
The goddess of programming is reviewing a thick logbook, which is a yearly record of visitors
to her holy altar of programming. The logbook also records her visits at the altar.
</p>
<p>
The altar attracts programmers from all ... |
p01786 |
<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>G - Proportional Representation... |
p03241 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given integers <var>N</var> and <var>M</var>.</p>
<p>Consider a sequence <var>a</var> of length <var>N</var> consisting of positive integers such that <var>a_1 + a_2 + ... + a_N</var> = <var>M</... |
p02903 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a square grid with <var>H</var> rows and <var>W</var> columns.
Snuke wants to write <var>0</var> or <var>1</var> in each of the squares.
Here, all of the following conditions have to be satisfie... |
p03611 | <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 sequence of length <var>N</var>, <var>a_1,a_2,...,a_N</var>.</p>
<p>For each <var>1≤i≤N</var>, you have three choices: add <var>1</var> to <var>a_i</var>, subtract <var>1</var> ... |
p03304 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let us define the <em>beauty</em> of a sequence <var>(a_1,... ,a_n)</var> as the number of pairs of two adjacent elements in it whose absolute differences are <var>d</var>.
For example, when <var>d=1</v... |
p01339 |
<H1><font color="#000">Problem A: </font>Alien's Counting</H1>
<p>
Natsuki and her friends were taken to the space by an alien and made friends with a lot of aliens. During the space travel, she discovered that aliens’ hands were often very different from humans’. Generally speaking, in a kind of aliens, there are <i... |
p02846 | <span class="lang-en">
<p>Score: <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Takahashi and Aoki are training for long-distance races in an infinitely long straight course running from west to east.</p>
<p>They start simultaneously at the same point and moves as follows <strong>t... |
p03754 | <span class="lang-en lang-child hidden-lang">
<div class="part">
Max Score: $800$ Points <br/>
<section>
<h3>Problem Statement</h3>
There is an undirected connected graph with $N$ vertices and $N-1$ edges. The <var>i</var>-th edge connects <var>u_i</var> and <var>v_i</var>.<br/>
<br/>
E869120 the coder mo... |
p01769 |
<h1 id="d-hopping-hearts-こころぴょんぴょん">D : Hopping Hearts / こころぴょんぴょん</h1>
<h2 id="問題文">問題文</h2>
<p><var>N</var> 羽のうさぎが長さ <var>L−1</var> の平均台の上にいる。 <var>i</var> 番目のうさぎの初期位置は整数 <var>x_i</var>であり、 <var>0 ≤ x_{i} \lt x_{i+1} ≤ L−1</var> を満たす。座標は右に進むほど大きくなる。任意の <var>i</var> 番目のうさぎは、任意の回数だけ、ちょうど距離 <var>a_i... |
p01293 |
<H1><font color="#000">Problem A:</font> Whist</H1>
<p>
<i>Whist</i> is a game played by four players with a standard deck of playing cards. The players seat
around a table, namely, in north, east, south, and west. This game is played in a team-play
basis: the players seating opposite to each other become a team. In ... |
p00528 |
<h2>現代的な屋敷(Modern Mansion)</h2>
<p>
あなたは,ある大きな屋敷に迷い込んでしまった.この屋敷は正方形の部屋が東西南北に格子状に,東西方向に <var>M</var> 列,南北方向に <var>N</var> 行の合計 <var>M × N</var> 個並んだ構造をしている.西から <var>x</var> 列目(1 ≤ <var>x</var> ≤ <var>M</var>),南から <var>y</var> 行目(1 ≤ <var>y</var> ≤ <var>N</var>) にある部屋を(<var>x</var>, <var>y</var>) で表... |
p00178 |
<H1>テトリス</H1>
<p>
テトリスは、落ちてくるブロックを盤面上に並べて消すゲームです。ここでは、それを少しアレンジしたゲームを考えましょう。
</p>
<p>
このゲームの盤面の大きさは横 5 コマで、出現するブロックがすべて入るだけの高さがあります。落ちてくるブロックは直線状で、横向き、縦向きの 2 種類があり、長さは 1 から 5 までの 5 種類です。
</p>
<p>
以下に例を示します。Step(イ) からStep(ホ)までの図はブロックが落ちて消えていく様子を表したものです。
Step(イ)から順にStep(ロ)、Step(ハ)と順に進んでいきます。
</p>
<p>
ブロックを落とすときに... |
p02145 | <h1>Problem I: Shiritori</h1>
<h2>Problem</h2>
<p>
ここに文字列のリストがある。息抜きに、しりとりをして遊ぶことにしよう。しりとりは、以下のルールで行われる。
</p>
<ol>
<li>まず最初に、リストの中から好きな文字列を一つ選び、その文字列をリストから除外する。</li>
<li>続いて、一つ前に選んだ文字列の最後の一文字が、最初の一文字である文字列をリストから一つ選ぶ。</li>
<li>選んだ文字列をリストから除外する。</li>
</ol>
<p>
この後、2., 3.を交互に繰り返すことになる。</p>
<p>
さて、... |
p00482 |
<H1>JOI 旗 (JOI Flag)</H1>
<h2>問題</h2>
<p>
情報オリンピック日本委員会では,今年の日本情報オリンピック (JOI) を宣伝するために, JOI のロゴをモチーフにした旗を作ることになった.旗は「良い旗」でなければならない.「良い旗」とは,アルファベットの J, O, I のいずれかの文字を,縦 M 行,横 N 列の長方形状に並べたもので, J, O, I が以下の図のように (すなわち,J の右隣に O が,その J の下隣に I が) 並んでいる箇所が旗の少なくとも 1 か所にあるものである.
</p>
<center>
<img src="https://judge... |
p02391 |
<H1>Small, Large, or Equal</H1>
<p>
Write a program which prints small/large/equal relation of given two integers <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Two integers <var>a</var> and <var>b</var> separated by a single space are given in a line.
</p>
<H2>Output</H2>
<p>
For given two integers <v... |
p00656 |
<h1>Problem J: BD Shelf</h1>
<p>
Remember the boy called Jack. He likes anime, especially programs broadcasting in midnight or early morning. In his room, there is a big shelf and it is kept organized well. And there are anime BD/DVDs which he watched or gave up because of overlapping of broadcasting time with other a... |
p01944 |
<h2>G: ほぼ無限グリコ - Almost Infinite Glico</h2>
<h3>問題</h3>
<p><var>N</var> 個のマスが円環状に並んでいるフィールドがあります。 <var>i</var> 番目 <var>(1 \leq i \leq N-1)</var> のマスの <var>1</var> つ先は、 <var>i+1</var> 番目のマスになります。ただし、 <var>i = N</var> の場合、その <var>1</var> つ先は <var>1</var> 番目のマスになります。</p>
<p>あなたが最初にいるマスは <var>1</var> 番目のマスです。そこから以下... |
p03979 | <span class="lang-en">
<p>Score : <var>150</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>
There are some goats on a grid with <var>H</var> rows and <var>W</var> columns.
Alice wants to put some fences at some cells where goats do not exist so that no goat can get outside the grid.
... |
p00206 |
<H1>旅行はいつ?</H1>
<p>
あなたは友人と旅行に行きたいと考えています。ところが、浪費癖のある友人はなかなか旅行費用を貯めることができません。友人が今の生活を続けていると、旅行に行くのはいつになってしまうか分かりません。そこで、早く旅行に行きたいあなたは、友人が計画的に貯蓄することを助けるプログラムを作成することにしました。
</p>
<p>
友人のある月のお小遣いを <var>M</var> 円、その月に使うお金を <var>N</var> 円とすると、その月は (<var>M</var> - <var>N</var>) 円貯蓄されます。毎月の収支情報 <var>M</var> 、 <var>N</v... |
p03580 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><var>N</var> cells are arranged in a row.
Some of them may contain tokens.
You are given a string <var>s</var> that consists of <code>0</code>s and <code>1</code>s.
If the <var>i</var>-th character of <... |
p01047 |
<h1>Problem K: Manhattan Warp Machine 2</h1>
<h2>Problem</h2>
<p>
とある宇宙では、3次元の格子点上に星が存在し、宇宙人達はマンハッタンワープ装置という装置を使い、星間を移動している。<br>
このワープ装置には、<var>N</var>個のボタンが付いており、ボタン<var>i</var>を押すと、現在いる星からのマンハッタン距離が<var>d<sub>i</sub></var>である任意の星にワープすることができる。<br>
ワープ装置は改良され、コストがかからずに移動出来る。<br>
今、(0, 0, 0)の星にいるある宇宙人がある<var>M</var>個の... |
p01417 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Calender Colors</H1>
<p>
Taro is a member of a programming contest circle.
In this circle, the members manage their schedules in the system called <i>Great Web Calender</i>.
</p>
<p>
Taro has just added some of his friends to his calendar so that he c... |
p01102 |
<h3><u>Almost Identical Programs</u></h3>
<p>
The programming contest named
<i>Concours de Programmation Comtemporaine Interuniversitaire</i> (CPCI)
has a judging system similar to that of ICPC;
contestants have to submit correct outputs for two different inputs
to be accepted as a correct solution.
Each of the subm... |
p01552 |
<h1>問題名 YAML</h1>
<p>YAML (YAML Ain't Markup Language)とは、オブジェクトを文字列で表現する形式の一つです。
</p>
<p>YAMLのサブセットで表されたオブジェクトと、プロパティを指定するクエリが与えられるので、指定されたプロパティの値を答えてください。
</p>
<h3>YAMLのサブセット</h3>
<p>YAML のサブセットは、次のような拡張 BNF 記法で表される構文規則に従います。
</p><pre>yaml: mapping(0)
mapping(n): mapping-item(n) | mapping-item(n) mapping(n)
mappin... |
p03095 | <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>.
Among its subsequences, count the ones such that all characters are different, modulo <var>10^9+7</var>. Two subsequences are considered diffe... |
p00713 |
<H1>
<font color="#000">Problem D:</font> Circle and Points
</H1>
<P>
You are given <i>N</i> points in the <i>xy</i>-plane. You have a
circle of radius one and move it on the <i>xy</i>-plane, so as to
enclose as many of the points as possible. Find how many points can be
simultaneously enclosed at the maximum. A po... |
p01801 |
<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 L
Wall Making Game</h2... |
p00343 |
<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>必勝7並べ </H1>
<p>
トランプを使ったゲームに「7並べ」があります... |
p02684 | <span class="lang-en">
<p>Score: <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>The Kingdom of Takahashi has <var>N</var> towns, numbered <var>1</var> through <var>N</var>.</p>
<p>There is one teleporter in each town. The teleporter in Town <var>i</var> <var>(1 \leq i \leq N)</var>... |
p03996 | <span class="lang-en">
<p>Score : <var>1200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> arrays.
The length of each array is <var>M</var> and initially each array contains integers <var>(1,2,...,M)</var> in this order.</p>
<p>Mr. Takahashi has decided to perform <var... |
p00969 | <h2>Arithmetic Progressions</h2>
<p>
An arithmetic progression is a sequence of numbers $a_1, a_2, ..., a_k$ where the difference of consecutive members $a_{i+1} - a_i$ is a constant ($1 \leq i \leq k-1$). For example, the sequence 5, 8, 11, 14, 17 is an arithmetic progression of length 5 with the common difference ... |
p02954 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a string <var>S</var> consisting of <code>L</code> and <code>R</code>.</p>
<p>Let <var>N</var> be the length of <var>S</var>. There are <var>N</var> squares arranged from left to right, and the... |
p03646 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a sequence of length <var>N</var> consisting of non-negative integers. Consider performing the following operation on this sequence until the largest element in this sequence becomes <var>N-1</v... |
p01381 |
<div>
<h1 class="title">問題 F : 全域木</h1>
<p>今,G○○gle Code Jam の地区大会が始まろうとしている.
左の席に座っている男の ID は wata と言うらしい.
東京大学時代の記憶に,似たような ID の仲間が居た覚えがある.
しかし,僕の仲間は一人残さず美少女だったはずだ.</p>
<p>僕の記憶の中の wata は,マトロイドが好きだった.
特に,マトロイド交差が大好きで,
様々なマトロイド達を交差させることに一種の興奮すら覚えると言う少し変わった奴だった.</p>
<p>マトロイドの理論の力を使えば,
与えられたグラフ上で辺を共有しない複数の全域木を求めることはと... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.