question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p00594 | <H1>What Color Is The Universe?</H1>
<table>
<tr>
<td valign="top">
<p>
On a clear night, a boy, Campanella looked up at the sky, there were many stars which have different colors such as red, yellow, green, blue, purple, etc. He was watching the stars and just lost track of time. Presently, he wondered,
</p>
</td>
<t... |
p02053 | <h2>B: Hokkaido University Hard</h2>
<h3>注意</h3>
<p> 問題設定は A 問題と同一のものですが、制約のみが異なりますのでご注意ください。</p>
<h3>物語</h3>
<p> 北海道大学に合格し、新たな生活の始まりに心を躍らせるほむらちゃん。しかし彼女の前には、とてつもなく広いキャンパスが待ち受けていた...。</p>
<p> 「え...次の授業に間に合わないんだけど...」</p>
<h3>問題</h3>
<p> 北海道大学札幌キャンパスは異常に広いことで有名です。札幌キャンパスは縦に <var>H</var> マス、横に <var>W</var> マス並んだ長方形のマス... |
p02403 | <H1>Print a Rectangle</H1>
<p>
Draw a rectangle which has a height of <var>H</var> cm and a width of <var>W</var> cm. Draw a 1-cm square by single '#'.
</p>
<H2>Input</H2>
<p>
The input consists of multiple datasets. Each dataset consists of two integers <var>H</var> and <var>W</var> separated by a single space.
<... |
p01106 |
<h3><u>Folding a Ribbon</u></h3>
<p>
Think of repetitively folding a very long and thin ribbon. First,
the ribbon is spread out from left to right, then it is creased at
its center, and one half of the ribbon is laid over the other. You
can either fold it from the left to the right, picking up the left
en... |
p03091 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a simple connected undirected graph consisting of <var>N</var> vertices and <var>M</var> edges.
The vertices are numbered <var>1</var> to <var>N</var>, and the edges are numbered <var>1</v... |
p01556 |
<h1>Convex-Cut</h1>
<p>N個の頂点からなる凸多角形が与えられる。各頂点の座標は反時計周りに(X<sub>1</sub>, Y<sub>1</sub>), (X<sub>2</sub> ,Y<sub>2</sub>), ……, (X<sub>N</sub>, Y<sub>N</sub>)で表わされる。
点Pを通るどのような直線で凸多角形を切断しても、切断後に得られる2つの凸多角形の面積が等しいような点Pの座標を求めよ。
</p>
<h2>Input</h2>
<p>入力は以下の形式で与えられる。
</p><blockquote>
N<br>X<sub>1</sub> Y<sub>1</sub><br>X<s... |
p01805 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<!-- begin en only -->
<h3><u>Alternate Escape</u></h... |
p03838 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a calculator. It has a display and two buttons.</p>
<p>Initially, the display shows an integer <var>x</var>.
Snuke wants to change this value into another integer <var>y</var>, by pressing the... |
p00717 |
<h1><font color="#000">Problem B:</font> Polygonal Line Search</h1>
<p>
Multiple polygonal lines are given on the <i>xy</i>-plane.
Given a list of polygonal lines and a template,
you must find out polygonal lines
which have the same shape as the template.
</p>
<p>
A polygonal line consists of several line segments ... |
p03992 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>This contest is <code>CODE FESTIVAL</code>.
However, Mr. Takahashi always writes it <code>CODEFESTIVAL</code>, omitting the single space between <code>CODE</code> and <code>FESTIVAL</code>.</p>
<p>So he... |
p02680 | <span class="lang-en">
<p>Score: <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>There is a grass field that stretches infinitely.</p>
<p>In this field, there is a negligibly small cow. Let <var>(x, y)</var> denote the point that is <var>x\ \mathrm{cm}</var> south and <var>y\ \mathr... |
p00347 |
<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>
信夫くんと静夫くんは長方形の島で領地を取り合うゲ... |
p01940 |
<h2>C: たったひとつの部分列 - Unique Subsequence -</h2>
<h3>問題</h3>
<p>ある日えびちゃんは、机の上に長さ <var>n</var> のテキスト文字列 <var>T</var> と長さ <var>m</var> のパターン文字列 <var>P</var> (<var>m \leq n</var>) が置かれていることに気づきました。えびちゃんは、文字列に現れる「たったひとつの部分列」が大好きであるため、 <var>P</var> が <var>T</var> のたったひとつの部分列であるかどうかをすぐに調査し始めました。</p>
<p><var>P</var> が <... |
p00652 |
<H1>Problem F: Cutting a Chocolate</H1>
<p>
Turtle Shi-ta and turtle Be-ko decided to divide a chocolate.
The shape of the chocolate is rectangle. The corners of the chocolate are put on (0,0), (<i>w</i>,0), (<i>w</i>,<i>h</i>) and (0,<i>h</i>).
The chocolate has lines for cutting.
They cut the chocolate only along so... |
p02395 |
<H1>Print Many Hello World</H1>
<p>
Write a program which prints 1000 "Hello World".
</p>
<H2>Input</H2>
<p>
There is no input for this problem.
</p>
<H2>Output</H2>
<p>
The output consists of 1000 lines. Print "Hello World" in each line.
</p>
<H2>Sample Input</H2>
<pre>
No input
</pre>
<H2>Sample Output</H2>
... |
p00202 |
<h1>上司のおごり</h1>
<p>
会津太郎さんの会社には、割り切れない事が大嫌いな上司がいます。太郎さんがその上司と食事に行くときは、割り勘で会計をしているのですが、支払金額が参加人数で割り切れないときは、いつも上司がおごってくれています。
</p>
<p>
ある日、太郎さんは食事会の幹事になりました。お金の少ない太郎さんは、その上司を誘ってなんとかおごってもらえるように出来ないか考えました。もう料理屋に注文をしなければならないのですが、まだ何人参加するかは分からないので、どんな人数が参加してもおごってもらえるような注文をしておきたいようです。太郎さんの同期で、同じく食事会に参加する予定のあなたは、太郎さんに協力し... |
p01043 |
<h1>Problem G: Yu-kun Likes a Treasure</h1>
<h2>Background</h2>
<p>
会津大学付属幼稚園はプログラミングが大好きな子供が集まる幼稚園である。園児の一人であるゆう君は、プログラミングと同じくらい財宝が大好きだ。ゆう君は今日も財宝を探すため洞窟を探索する予定だ。そこでゆう君は洞窟の地図から、洞窟を全て見て回る際に歩く距離を求めるプログラムを書くことにした。
</p>
<h2>Problem</h2>
<p>
洞窟の情報とゆう君の初期位置が与えられる。Fig.1のように、 洞窟は2次元平面上の多角形で表される部屋が、1つ以上繋がった集合で構成される。部屋が別の... |
p03584 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><em>Seisu-ya</em>, a store specializing in non-negative integers, sells <var>N</var> non-negative integers. The <var>i</var>-th integer is <var>A_i</var> and has a <em>utility</em> of <var>B_i</var>.
Th... |
p01413 |
<H1>G: Quest of Merchant</H1>
<p>
ICPC で良い成績を収めるには修行が欠かせない.うさぎは ICPC で勝ちたいので,今日も修行をすることにした.
</p>
<p>
今日の修行は,街を駆け回り交易を行うことで,商売の力を手にしようというものである.
</p>
<p>
今後の修行のためにも,できるだけ多くの資金を稼ぎたい.
</p>
<p>
この世界は,東西南北方向の道路が等間隔に並んでいて,碁盤状になっている.唯一存在する市場の位置を (0, 0),街には <i>x</i> 座標,<i>y</i> 座標が定まっている (座標が整数値の点が交差点に対応する).うさぎは道路に沿ってのみ移動するこ... |
p03300 | <span class="lang-en">
<p>Score : <var>1600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a string <var>S</var> of length <var>2N</var>, containing <var>N</var> occurrences of <code>a</code> and <var>N</var> occurrences of <code>b</code>.</p>
<p>You will choose some of the cha... |
p01297 |
<H1><font color="#000">Problem E:</font> Safe Area</H1>
<p>
Nathan O. Davis is challenging a kind of shooter game. In this game, enemies emit laser beams
from outside of the screen. A laser beam is a straight line with a certain thickness. Nathan
moves a circular-shaped machine within the screen, in such a way it doe... |
p03750 | <span class="lang-en">
<p>Score : <var>2000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> cards. The two sides of each of these cards are distinguishable.
The <var>i</var>-th of these cards has an integer <var>A_i</var> printed on the front side, and another integer <... |
p02842 | <span class="lang-en">
<p>Score: <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Takahashi bought a piece of apple pie at ABC Confiserie. According to his memory, he paid <var>N</var> yen (the currency of Japan) for it.</p>
<p>The consumption tax rate for foods in this shop is <var>... |
p00486 |
<H1>歩くサンタクロース(Walking Santa) </H1>
<p>
昨年末,サンタクロースはJOI 村の子供たちにクリスマスプレゼントを渡すのを忘れてしまった.そこで,お詫びの気持ちとして子供たちにチョコレートケーキを届けることにした.届けるべき日は明日に迫っているので,そろそろ移動計画を考えなければならない.
</p>
<p>
JOI 村は,南北方向にまっすぐに伸びる<i>W</i> 本の道路と,東西方向にまっすぐに伸びる<i>H</i> 本の道路により,碁盤の目の形に区分けされている. 南北方向の<i>W</i> 本の道路には,西から順に1, 2, ... , <i>W</i> の番号が付けられており,... |
p02141 | <h1>Problem E: Donut Hole</h1>
<h2>Problem</h2>
<p>
あなたはACPCのために横$W$縦$H$の長方形で平べったく、穴のないドーナツを持参しました。<br>
このドーナツを$2$次元平面上の座標$(0,0)$にドーナツの中心を重ね、長さがHの辺と$y$軸が平行になるように置きます。<br>
</p>
<p>
ACPC$1$日目にあなたは座標($x$,$y$)を中心に横$w$縦$h$の範囲に存在するドーナツを食べました。<br>
$2$日目と$3$日目に食べる量を等しくしたいあなたは、座標$(0,0)$を通る直線でドーナツを分割し、直線の片側の領域にあるドーナツの面積の総和が... |
p00469 |
<H1>カード並べ</H1>
<h2>問題</h2>
<p>
花子さんは n 枚(4 ≤ n ≤ 10)のカードを並べて遊んでいる.
それぞれのカードには 1 以上 99 以下の整数が 1 つずつ書かれている.
花子さんは,これらのカードの中から k 枚(2 ≤ k ≤ 4)を選び,
横一列に並べて整数を作ることにした.
花子さんは全部で何種類の整数を作ることができるだろうか.
</p>
<p>
例えば,1, 2, 3, 13, 21 の 5 枚のカードが与えられ,そこから 3 枚を選び整数を作ることを考える.
2, 1, 13 をこの順に並べると,整数 2113 を作ることができる.
また,21,... |
p02454 | <h1>Equal Range</h1>
<p>
For a given sequence $A = \{a_0, a_1, ..., a_{n-1}\}$ which is sorted by ascending order, print a pair of the lower bound and the upper bound for a specific value $k$ given as a query.
</p>
<ul>
<li>
lower bound: the place pointing to the first element greater than or equal to a specific v... |
p00193 |
<H1>コンビニ</H1>
<table>
<tr>
<td style="vertical-align:top">
<p>
コンビニエンスストア・デブンイレブンは事業を広げるため若松市に一店舗目をオープンしようと考えています。若松市には既に他のたくさんのコンビニエンスストアがあるので、新店舗をオープンする場所が成功の鍵を握ることになりそうです。デブンイレブンは「お客さんは自分の住んでいる地域から最も近いコンビニを利用する」という前提の下、「多くのお客さんが利用するであろう地点」に出店することにしています。
</p>
</td>
<td>
<img src="https://judgeapi.u-aizu.ac.jp/re... |
p00039 |
<H1>ローマ数字</H1>
<p>
古代ローマでは数を数えることは難しい仕事でした。アラビア数字の 0,1,2,3,…, 9 はまだ流布していませんでした。その代わり次のような記号が使われていました。
</p>
<center>
<table border=1>
<tr>
<td bgcolor="#EEFFFF" width="100">アラビア数字</td><td width="100">ローマ数字</td><td bgcolor="#EEFFFF" width="100">アラビア数字</td><td width="100">ローマ数字</td><td bgcolor="#EEFFFF" width="10... |
p02004 | <h1>Problem A. GuruGuru</h1>
<!--
Time Limit: 2 sec
Memory Limit: 512 MB
-->
<p>
You are playing a game called <i>Guru Guru Gururin</i>. In this game, you can move with the vehicle called Gururin. There are two commands you can give to Gururin: '<span>R</span>' and '<span>L</span>'. When '<span>R</span>' is sent, G... |
p03245 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is introducing a <strong>robot arm</strong> with the following properties to his factory:</p>
<ul>
<li>The robot arm consists of <var>m</var> <strong>sections</strong> and <var>m+1</var> <strong>j... |
p01278 |
<H1><font color="#000">Problem F:</font> Voronoi Island</H1>
<p>
Some of you know an old story of Voronoi Island. There were N liege lords and they are always involved
in territorial disputes. The residents of the island were despaired of the disputes.
</p>
<p>
One day, a clever lord proposed to stop the disputes and... |
p01782 |
<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>C - Decoding Ancient Messages</... |
p00890 |
<H1><font color="#000">Problem G:</font> Test Case Tweaking</H1>
<p>
You are a judge of a programming contest. You are preparing a dataset for a graph problem to seek for the cost of the minimum cost path. You've generated some random cases, but they are not interesting. You want to produce a dataset whose answer is ... |
p03615 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given <var>N</var> points <var>(x_i,y_i)</var> located on a two-dimensional plane.
Consider a subset <var>S</var> of the <var>N</var> points that forms a convex polygon.
Here, we say a set of po... |
p01628 |
<h1>Problem B: あみだくじ</h1>
<h2>Problem Statement</h2>
<p>
会津合宿に参加予定の高槻さんは、家が貧乏であり、いつも紙をなるべく節約して使うようにしている。彼女は、会津合宿のチーム決めのために、他の参加者の人達とあみだくじをすることになった。
</p>
<p>
この合宿のあみだくじの作り方は次のようなものである。まず、紙にN本の縦棒を平行に書く。そして、M本の横棒を上から順番に、縦棒と垂直になるように、かつ横棒の高さが全て異なるように書いていく。例えば、Sample Input 1のあみだは、図1のようになる。
</p>
<p>
ここで、高槻さん、ちょっと不満げな表情。こ... |
p02907 | <span class="lang-en">
<p>Score : <var>1600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke found a random number generator.
It generates an integer between <var>0</var> and <var>N-1</var> (inclusive).
An integer sequence <var>A_0, A_1, \cdots, A_{N-1}</var> represents the probability ... |
p00310 |
<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>
選手のみなさん、パソコン甲子園にようこそ。パソコン甲... |
p01852 |
<h1 id="a-指折り数えて-finger-counting">A : 指折り数えて / Finger Counting</h1>
<h2 id="問題文">問題文</h2>
<p>肉西くんは指の数を増やしたり減らしたりできる.<br />肉西くんの前には <var>n</var> 個のまんじゅうがある.<br />肉西くんは指を折ってまんじゅうの個数を数えようとしている.<br />肉西くんの指が取れる形は折れているか折れていないかの <var>2</var> つしか無い.<br />肉西くんは <a href="http://www.asahi-net.or.jp/~ax2s-kmtn/ref/bdh.html">... |
p00740 |
<h1><font color="#000000">Problem A:</font> Next Mayor</h1>
<p>
One of the oddest traditions of the town of Gameston may be that even
the town mayor of the next term is chosen according to the result of a game.
When the expiration of the term of the mayor approaches, at least
three candidates, including the mayor of ... |
p02287 |
<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>Complete Binary Tree</H1>
... |
p01501 |
<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 G:
Shelter
</h2>
<p>
... |
p01151 |
<H1><font color="#000">Problem D:</font> Divisor is the Conqueror</H1>
<p>
<i>Divisor is the Conquerer</i> is a solitaire card game. Although this simple game itself is a great
way to pass one’s time, you, a programmer, always kill your time by programming. Your task
is to write a computer program that automatically ... |
p03496 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has an integer sequence, <var>a</var>, of length <var>N</var>. The <var>i</var>-th element of <var>a</var> (<var>1</var>-indexed) is <var>a_{i}</var>.</p>
<p>He can perform the following operation... |
p03183 | <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> blocks, numbered <var>1, 2, \ldots, N</var>.
For each <var>i</var> (<var>1 \leq i \leq N</var>), Block <var>i</var> has a weight of <var>w_i</var>, a solidness of <var>s_i</var> a... |
p01444 |
<H1><font color="#000">Problem H:</font> Sky Jump</H1>
<p>
Dr. Kay Em, a genius scientist, developed a new missile named "Ikan-no-i." This missile has <i>N</i> jet engines. When the <i>i</i>-th engine is ignited, the missile's velocity changes to (<i>vx<sub>i</sub></i>, <i>vy<sub>i</sub></i>) immediately.
</p>
<p>
Y... |
p03479 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>As a token of his gratitude, Takahashi has decided to give his mother an integer sequence.
The sequence <var>A</var> needs to satisfy the conditions below:</p>
<ul>
<li><var>A</var> consists of integers... |
p01014 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<h1>Problem I: Rolling Block</h1>
<h2>Problem</h2>
<p>
Rolling Blockは直方体の金属体を回転させつつ移動させ、ゴールの穴に落とすゲームである。<br/>
このゲームのクリア条件は金属体をゴールに落とすことである。<br/>
<br/>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_ACPC2013Aizu_aizuicpc_image0" width="500" ... |
p03029 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>A</var> apples and <var>P</var> pieces of apple.</p>
<p>We can cut an apple into three pieces of apple, and make one apple pie by simmering two pieces of apple in a pan.</p>
<p>Find the max... |
p03880 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><style>
#nck {
width: 30px;
height: auto;
}
</style>
<p>A cheetah and a cheater are going to play the game of Nim.
In this game they use <var>N</var> piles of stones.
Initially the <var>i... |
p02792 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Given is a positive integer <var>N</var>.<br/>
Find the number of pairs <var>(A, B)</var> of positive integers not greater than <var>N</var> that satisfy the following condition:</p>
<ul>
<li>When <var... |
p02268 |
<H1>Search II</H1>
<p>
You are given a sequence of <i>n</i> integers S and a sequence of different <i>q</i> integers T. Write a program which outputs C, the number of integers in T which are also in the set S.
</p>
<H2>Input</H2>
<p>
In the first line <i>n</i> is given. In the second line, <i>n</i> integers are gi... |
p00255 |
<H1>パイプつなぎ職人の給料</H1>
<p>
ぼくはパイプつなぎ職人です。パイプをつなぐジョイントとパイプさえもらえれば、どんなパイプだってつないでみせます。ぼくは毎日、親方からパイプとジョイントを渡されて、それをつないで親方に渡します。でも、パイプの数が多すぎるときは、1日でそれを全部つなげることはできません。そんなときでも親方はにっこり笑って、ぼくに給料を渡してくれます。
</p>
<p>
ところで、あるとき変なことに気がつきました。全部のパイプをつなげられたときより、つなげられなかったときの方が給料が多いことがしょっちゅうあるんです。あんまり変なので、ある日、親方が来たときに、給料の計算方法が書いてあるメモをこっ... |
p01917 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath2017.js" charset="UTF-8"></script>
<h2>B: だんすなうwww - Dance Now! -</h2>
<h3>物語</h3>
<p>
前回のラボライフ!ダイガクイン!!
マスターアイドルたちが競う最大の大会「ラボライフ」の前哨戦ともいえるイベント「マスターアイドルワールド」で9位を取ってしまったドサンコスノー。
... |
p02638 | <span class="lang-en">
<p>Score : <var>2000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given are integers <var>N</var> and <var>K</var>, and a prime number <var>P</var>. Find the number, modulo <var>P</var>, of directed graphs <var>G</var> with <var>N</var> vertices that satisfy below. H... |
p00605 |
<H1><font color="#000000">Problem A:</font> Vampirish Night</H1>
<p>
There is a vampire family of <i>N</i> members. Vampires are also known as extreme gourmets. Of course vampires' foods are human blood. However, not all kinds of blood is acceptable for them. Vampires drink blood that <i>K</i> blood types of ones... |
p00412 | <h1>ガソリンスタンド</h1>
<p>
白虎サービスエリアのガソリンスタンドには、$1$から$N$の番号が割り当てられた$N$個のレーンがあります。各レーンの先頭の車が給油を行うことができます。
</p>
<p>
ガソリンスタンドに入場した車は、並んでいる車が最も少ないレーンを選び列の末尾に並びます。そのようなレーンが複数ある場合は、番号が最も小さいレーンを選びます。給油が終わるとその車はレーンから出ていき、その後ろの車が給油を行います。一度レーンを選んだら、他のレーンに移ることはできません。また、レーンに並んでいる車の順番が変わることはありません。
</p>
<p>
レーンの数、入場した車と給油が終了したレーン... |
p00042 |
<H1>泥棒</H1>
<p>
宝物がたくさん収蔵されている博物館に、泥棒が大きな風呂敷を一つだけ持って忍び込みました。盗み出したいものはたくさんありますが、風呂敷が耐えられる重さが限られており、これを超えると風呂敷が破れてしまいます。そこで泥棒は、用意した風呂敷を破らず且つ最も価値が高くなるようなお宝の組み合わせを考えなくてはなりません。
</p>
<p>
風呂敷が耐えられる重さ <var>W</var>、および博物館にある個々のお宝の価値と重さを読み込んで、重さの総和が <var>W</var> を超えない範囲で価値の総和が最大になるときの、お宝の価値総和と重さの総和を出力するプログラムを作成してください。ただし、価... |
p02585 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi will play a game using a piece on an array of squares numbered <var>1, 2, \cdots, N</var>. Square <var>i</var> has an integer <var>C_i</var> written on it. Also, he is given a permutation of <... |
p01203 |
<H1><font color="#000">Problem B:</font> Compress Files</H1>
<p>
Your computer is a little old-fashioned. Its CPU is slow, its memory is not enough, and its hard drive is
near to running out of space. It is natural for you to hunger for a new computer, but sadly you are not so
rich. You have to live with the aged com... |
p04001 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a string <var>S</var> consisting of digits between <code>1</code> and <code>9</code>, inclusive.
You can insert the letter <code>+</code> into some of the positions (possibly none) between... |
p01653 |
<h2>Problem Statement</h2>
<p>
A magician lives in a country which consists of <var>N</var> islands and <var>M</var> bridges.
Some of the bridges are magical bridges, which are created by the magician.
Her magic can change all the lengths of the magical bridges to the same non-negative integer simultaneously.
</p>
... |
p00941 |
<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 G
Do Geese See God?</h... |
p03394 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Nagase is a top student in high school. One day, she's analyzing some properties of special sets of positive integers. </p>
<p>She thinks that a set <var>S = \{a_{1}, a_{2}, ..., a_{N}\}</var> of <stro... |
p03681 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has <var>N</var> dogs and <var>M</var> monkeys. He wants them to line up in a row.</p>
<p>As a Japanese saying goes, these dogs and monkeys are on bad terms. <em>("ken'en no naka", literally "the ... |
p02993 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>The door of Snuke's laboratory is locked with a security code.</p>
<p>The security code is a <var>4</var>-digit number. We say the security code is <em>hard to enter</em> when it contains two consecuti... |
p01346 |
<H1><font color="#000">Problem H: </font> Ropeway</H1>
<p>
On a small island, there are two towns Darkside and Sunnyside, with steep mountains between them. There’s a company Intertown Company of Package Conveyance; they own a ropeway car between Darkside and Sunnyside and are running a transportation business. They ... |
p01716 |
<h1>問題 E : Pattern Language</h1>
<h2>問題文</h2>
<p>
<var>m</var> 個の相異なるアルファベット <var>var_0,  var_1,   … ,  var_{m-1}</var> がある.
<var>0,   1,   … ,   9,   var_0,   var_1,   … ,   var_{m-1}</var> の <var>10+m</var> 種類の文字からなる,長さ <va... |
p00804 |
<H1><font color="#000">Problem B:</font> e-Market</H1>
<p>
The city of Hakodate recently established a commodity exchange market. To participate in the market, each dealer transmits through the Internet an order consisting of his or her name, the type of the order (buy or sell), the name of the commodity, and the quo... |
p02839 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a grid with <var>H</var> horizontal rows and <var>W</var> vertical columns. Let <var>(i,j)</var> denote the square at the <var>i</var>-th row from the top and the <var>j</var>-th column from the... |
p02090 |
<h2>C: Shuttle Run</h2>
<h3>Story</h3>
<p>
University H has a unique physical fitness test program, aiming to grow the mindset of students.
Among the items in the program, shuttle run is well-known as especially eccentric one. Surprisingly, there are yokans (sweet beans jellies) on a route of the shuttle run. Greedy ... |
p00557 |
<h1>尾根 (Ridge)</h1>
<h2>問題</h2>
<p>
JOI カルデラは景観の良さが多くの登山家に愛される美しい地形である.
特に,尾根と呼ばれる場所からの景観は絶景である.
</p>
<p>
JOI カルデラの土地は南北 H キロメートル,東西 W キロメートルの長方形である.
南北,東西に 1 キロメートルごとに JOI カルデラの土地を分け,これら H×W 個の領域を区域と呼ぶ.
すべての区域において,その中では標高は等しい.また,異なる区域の標高は異なる.
</p>
<p>
ある区域に雨が降ると,雨水はその区域に東西南北に隣り合う最大で 4 つの区域のうち,
標高がその区域より低いような区域のす... |
p00107 |
<H1>Carry a Cheese</H1>
<p>
Jerry is a little mouse. He is trying to survive from the cat Tom. Jerry is carrying a parallelepiped-like piece of cheese of size <i>A</i> × <i>B</i> × <i>C</i>. It is necessary to trail this cheese to the Jerry's house. There are several entrances in the Jerry's house. Each... |
p03402 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given two integers <var>A</var> and <var>B</var>.</p>
<p>Print a grid where each square is painted white or black that satisfies the following conditions, in the format specified in Output secti... |
p01595 |
<h2>Problem E: Laser Puzzle</h2>
<p>An explorer John is now at a crisis! He is entrapped in a <var>W</var>
times <var>H</var> rectangular room with a embrasure of laser beam. The
embrasure is shooting a deadly dangerous laser beam so that he cannot cross or
touch the laser beam. On the wall of this room, there are st... |
p03052 | <span class="lang-en">
<p>Score : <var>1200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a simple connected undirected graph <var>G</var> consisting of <var>N</var> vertices and <var>M</var> edges.
The vertices are numbered <var>1</var> to <var>N</var>, and the edges are numb... |
p02213 | <span class="lang">
<span class="lang-ja">
<h1>B: サイコロを転がさないで</h1>
<div class="part">
<section>
<h3>問題文</h3><p>$H$ 行 $W$ 列からなるグリッドがあります。以降、グリッド上の $i$ 行目 $j$ 列目のマスを $(i, j)$ のマスと書きます。</p>
<p>グリッドの各マスには、$1$ 以上 $6$ 以下の数字か、あるいは <code>#</code> の文字が $1$ つずつ書かれています。<span style="font-weight: bold;">ただし、$i$ と $j$ がともに偶数であるような ... |
p00384 | <h1>Dungeon 2</h1>
<p>
Bob is playing a game called "Dungeon 2" which is the sequel to the popular "Dungeon" released last year. The game is played on a map consisting of $N$ rooms and $N-1$ roads connecting them. The roads allow bidirectional traffic and the player can start his tour from any room and reach any ot... |
p03951 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is interested in strings that satisfy the following conditions:</p>
<ul>
<li>The length of the string is at least <var>N</var>.</li>
<li>The first <var>N</var> characters equal to the string <var>... |
p02643 | <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> infants registered in AtCoder, numbered <var>1</var> to <var>N</var>, and <var>2\times 10^5</var> kindergartens, numbered <var>1</var> to <var>2\times 10^5</var>.
Infant <var>i</v... |
p02356 |
<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>The Number of Windows</H1>
<p>
For a giv... |
p01983 | <h3>知識の証明</h3>
<!-- begin ja only -->
<p>あなたが住んでいる集合住宅の入口のドアには,パスワード式のロックがかけられている.このパスワードはちょうど 4 桁の 0 から 9 の範囲の数字で構成されており,あなたはいつも,集合住宅の管理人から伝えられたパスワード <i>P</i> を使って,このドアのロックを解除している.</p>
<p>ある日,あなたは集合住宅の住民全員が,自分と同じパスワード <i>P</i> を使っているのかどうか気になり,同じ集合住宅に住む友人に尋ねることにした.あなたとあなたの友人は,自分のパスワードを互いに伝えあうことで,同じパスワードを使っているのかどうか確かめ... |
p00691 |
<H1>
Fermat's Last Theorem
</H1>
<p>
In the 17th century, Fermat wrote that he proved for any integer $n \geq 3$,
there exist no positive integers $x$, $y$, $z$ such that
$x^n + y^n = z^n$.
However he never disclosed the proof. Later, this claim was named
Fermat's Last Theorem or Fermat's Conjecture.
</p>
<p>
If Fe... |
p01829 |
<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>Change a Password</h2>
<p>
Pa... |
p03814 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has decided to construct a string that starts with <code>A</code> and ends with <code>Z</code>, by taking out a substring of a string <var>s</var> (that is, a consecutive part of <var>s</var>).</p... |
p02706 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has <var>N</var> days of summer vacation.</p>
<p>His teacher gave him <var>M</var> summer assignments. It will take <var>A_i</var> days for him to do the <var>i</var>-th assignment.</p>
<p>He ... |
p03547 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In programming, hexadecimal notation is often used.</p>
<p>In hexadecimal notation, besides the ten digits <var>0, 1, ..., 9</var>, the six letters <code>A</code>, <code>B</code>, <code>C</code>, <code>... |
p01080 |
<h1>Problem I: Traffic Tree</h1>
<h2>Problem</h2>
<p>
それぞれ1から<var>N</var>までの番号が付いた<var>N</var>個の頂点が、<var>N</var>-1本の無向辺によって繋がれたグラフが与えられる。各頂点について、その頂点からスタートしてすべての頂点を訪れるための最短のステップ数を出力せよ。
</p>
<p>
ただし、ある頂点から1本の辺をたどって別の頂点に移動することを1ステップとする。
</p>
<h2>Input</h2>
<p>
入力は以下の形式で与えられる。
</p>
<pre>
<var>N</var>
<var>u<s... |
p03117 | <span class="lang-en">
<p>Score : <var>2000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has <var>R</var> red balls and <var>B</var> blue balls.
He distributes them into <var>K</var> boxes, so that no box is empty and no two boxes are identical.
Compute the maximum possible value of ... |
p03639 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a sequence of length <var>N</var>, <var>a = (a_1, a_2, ..., a_N)</var>.
Each <var>a_i</var> is a positive integer.</p>
<p>Snuke's objective is to permute the element in <var>a</var> so that the ... |
p01604 |
<h2>goto busters</h2>
<h2>Problem Statement</h2>
<p>あなたは謎のプログラムのソースコードを見つけた.<br />
さっそくコンパイルして実行してみたが,いつまで待っても処理が終わらない.<br />
どうやら,プログラムが無限ループしてしまっているようである.</p>
<p>ソースコードを詳しく見てみたところ,以下のようなことがわかった.<br /></p>
<p>ソースコードは <var>N</var> 行からなり,各行はラベル文か goto 文のいずれかである.<br />
ラベル文と goto 文はそれぞれ次のようなフォーマットに従っている.<br /></p>
... |
p00916 |
<H1><font color="#000">Problem C: </font>Count the Regions</H1>
<p>
There are a number of rectangles on the <i>x-y</i> plane. The four sides of the rectangles are parallel to either the <var>x</var>-axis or the <i>y</i>-axis, and all of the rectangles reside within a range specified later. There are no other constrai... |
p03793 | <span class="lang-en">
<p>Score : <var>1300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are developing a robot that processes strings.
When the robot is given a string <var>t</var> consisting of lowercase English letters, it processes the string by following the procedure below:</p>
<... |
p02881 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi is standing on a multiplication table with infinitely many rows and columns.</p>
<p>The square <var>(i,j)</var> contains the integer <var>i \times j</var>. Initially, Takahashi is standing at ... |
p03269 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given an integer <var>L</var>. Construct a directed graph that satisfies the conditions below. The graph may contain multiple edges between the same pair of vertices. It can be proved that such ... |
p01254 |
<H1><font color="#000">Problem E:</font> Reverse a Road</H1>
<p>
Andrew R. Klein resides in the city of Yanwoe, and goes to his working place in this city every weekday.
He has been totally annoyed with the road traffic of this city. All the roads in this city are one-way, so he
has to drive a longer way than he thin... |
p00015 |
<H1>National Budget</H1>
<p>
A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647.
</p>
<p>
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of... |
p02028 | <h2>N: 通販 (Mail Order)</h2>
<p>胡桃沢さんは、魔界通販で積み木のおもちゃを買った。</p>
<p>積み木は一辺の長さが1の立方体の形をしており、縦に $H$ 個、横に $W$ 個に分割されたマス目の上に積まれている。</p>
<p>真横から見ると、左から順に、$A_1, A_2, A_3, \dots, A_H$ 個のブロックが積まれて見えた。</p>
<p>正面から見ると、左から順に、$B_1, B_2, B_3, \dots, B_W$ 個のブロックが積まれて見えた。</p>
<p>胡桃沢さんは偉大なので、これらの情報だけからブロックの総数を当てようと考えた。</p>
<p>小さい数を答えて間違え... |
p02182 | <h2>A: 間違い探し</h2>
<h3>問題</h3>
<p>縦に <var>N</var> マス、横に <var>M</var> マスある長方形の盤面 <var>A</var>, <var>B</var> が与えられます。各盤面について、それぞれのマスは白または黒で塗られています。</p>
<p>盤面 <var>X</var> の <var>i</var> 行 <var>j</var> 列目のマスの色を <var>C(i, j, X)</var> と表記することにします。</p>
<p>以下の条件を満たす整数の組 <var>(i, j)</var> がいくつあるか数えてください。</p>
<ul>
<li> <var... |
p00445 |
<H1> JOIとIOI </H1>
<h2>問題</h2>
<p>
与えられた文字列内の連続する3文字が,JOIまたはIOIという並びになっている個所がそれぞれ何個所あるのかを数え上げるプログラムを作成せよ.文字列はアルファベットの大文字だけからなる.例えば下図の「JOIOIOI」という文字列にはJOIが1個所,IOIが2個所に含まれている.
</p>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_joiioi">
<br>
<h2>入力</h2>
<p>
入力は複数のデータセットからなる.各データセットは1行であり,10000文字以下... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.