question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p00291 |
<h1>お財布メタボ診断</h1>
<p>
4月に消費税が8%になってから、お財布が硬貨でパンパンになっていませんか。同じ金額を持ち歩くなら硬貨の枚数を少なくしたいですよね。硬貨の合計が1000円以上なら、硬貨をお札に両替して、お財布のメタボ状態を解消できます。
</p>
<p>
お財布の中の硬貨の枚数が種類ごとに与えられたとき、硬貨をお札に両替できるかどうかを判定するプログラムを作成してください。
</p>
<h2>入力</h2>
<p>
入力は以下の形式で与えられる。
</p>
<pre>
<var>c1</var> <var>c5</var> <var>c10</var> <var>c50</var> <var>c... |
p02306 | <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>Incircle of a Triangle</H1>
<p>
Write a pro... |
p03147 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In a flower bed, there are <var>N</var> flowers, numbered <var>1,2,......,N</var>. Initially, the heights of all flowers are <var>0</var>.
You are given a sequence <var>h=\{h_1,h_2,h_3,......\}</var> as... |
p01480 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<h1> Unequal Dice</h1>
<p>
Time Limit: 8 sec / Memory Limit: 64 MB
</p>
<h2> B: 不揃いなサイコロ</h2>
<p>
パチンコや競馬などの賭け事にお金を使いすぎて,借金まみれになったあなたは,
T愛グループの地下監獄に収容されてしまった.
ここであなたは,借金を返すまで奴隷のように働かな... |
p03517 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Ringo has an undirected graph <var>G</var> with <var>N</var> vertices numbered <var>1,2,...,N</var> and <var>M</var> edges numbered <var>1,2,...,M</var>.
Edge <var>i</var> connects Vertex <var>a_{i}</va... |
p00012 |
<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>A Point in a Triangle</H1>
<p>
There is a ... |
p00442 |
<H1>最悪の記者 </H1>
<h2>問題</h2>
<p>
あなたは JOI 新聞社の記者であり,スポーツ記事を担当している.
</p>
<p>
昨日までに,クロアチアでは,n 個のサッカーチームによる総当りのリーグ戦が行われた.大会実行委員会は,試合結果と規定に基づき各チームに 1 位から n 位までの順位をつけたようである.あなたには,一部の試合の勝敗とともに,次の情報が伝えられた.
<br/>
<b>情報 1</b> 引き分けの試合はなかった.<br/>
<b>情報 2</b> 全てのチームに異なる順位がついた.<br/>
<b>情報 3</b> 全ての 1 ≤ a < b ≤ n に対し,a 位... |
p02185 | <h2>D: Many Decimal Integers</h2>
<h3>問題</h3>
<p>数字 (<var>0</var> から <var>9</var>) のみからなる文字列 <var>S</var> と、数字 と <code>?</code> のみからなる文字列 <var>T</var> が与えられます。<var>S</var> と <var>T</var> は同じ長さです。</p>
<p>
<var>T</var> 内に存在するそれぞれの <code>?</code> について、<var>0</var> から <var>9</var> までの数字のいずれか <var>1</var> つに変更し、数字のみからなる文字... |
p01603 |
<h2>さんぽ</h2>
<h2>Problem Statement</h2>
<p>ねこのそらは散歩が大好きだ.道を歩くと新しい発見がある.</p>
<p>そらの住む町は <var>N</var> 個の広場と <var>N-1</var> 本の道からなる.<br />
道はちょうど二つの広場をつないでおり,枝分かれしたり道どうしが交わったりしない.</p>
<p>道には,歩くのにかかる時間 <var>t</var>,得られる発見の個数の上限 <var>m</var>,および,発見一つあたりの価値 <var>v</var> が指定されている.<br />
道を一方の端からもう一方の端まで歩いたとき,<var>m</var... |
p00911 |
<H1><font color="#000">Problem H: </font>Company Organization</H1>
<p>
You started a company a few years ago and fortunately it has been highly successful. As the growth of the company, you noticed that you need to manage employees in a more organized way, and decided to form several groups and assign employees to th... |
p01253 |
<H1><font color="#000">Problem D:</font> Deadly Dice Game</H1>
<p>
T.I. Financial Group, a world-famous group of finance companies, has decided to hold an evil gambling
game in which insolvent debtors compete for special treatment of exemption from their debts.
</p>
<p>
In this game, each debtor starts from one cell ... |
p04051 | <span class="lang-en">
<p>Score : <var>1400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is having another barbeque party.</p>
<p>This time, he will make one serving of <em>Skewer Meal</em>.</p>
<p>He has a stock of <var>N</var> <em>Skewer Meal Packs</em>. The <var>i</var>-th Skewer ... |
p03794 | <span class="lang-en">
<p>Score : <var>1800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a tree <var>T</var> with <var>N</var> vertices, numbered <var>1</var> through <var>N</var>.
For each <var>1 ≤ i ≤ N - 1</var>, the <var>i</var>-th edge connects vertices <var>a_i</var> and <va... |
p02886 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>It's now the season of TAKOYAKI FESTIVAL!</p>
<p>This year, <var>N</var> takoyaki (a ball-shaped food with a piece of octopus inside) will be served. The <em>deliciousness</em> of the <var>i</var>-th ta... |
p03281 | <span class="lang-en">
<p>Score: <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>The number <var>105</var> is quite special - it is odd but still it has eight divisors.
Now, your task is this: how many odd numbers with exactly eight positive divisors are there between <var>1</var> a... |
p01746 |
<p>
すぬけ君は,初期状態では動くことはできない.<var>i</var> 番目のチケットの値段は <var>p<sub>i</sub></var> であり,これを買うと任意の <var>(x, y)</var> と任意の非負実数 <var>t</var> に対し<var>(x, y)</var> から<var>(x + ta<sub>i</sub>, y + tb<sub>i</sub>)</var> に移動することができるようになる.すぬけ君が平面上の任意の二点間を(いくつかのチケットを組み合わせて) 移動できるようになるために買わなければならないチケットの合計金額の最小値を求めよ.
</p>
<h2>Constrain... |
p00854 |
<H1><font color="#000">Problem A:</font> And Then There Was One</H1>
<p>
Let’s play a stone removing game.
</p>
<p>
Initially, <i>n</i> stones are arranged on a circle and numbered 1, ... , <i>n</i> clockwise (Figure 1). You are also given two numbers <i>k</i> and <i>m</i>. From this state, remove stones one by one ... |
p02869 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given are positive integers <var>N</var> and <var>K</var>.</p>
<p>Determine if the <var>3N</var> integers <var>K, K+1, ..., K+3N-1</var> can be partitioned into <var>N</var> triples <var>(a_1,b_1,c_1), ... |
p01316 |
<h1><font color="#000000">Problem C:</font> Differential Pulse Code Modulation</h1>
<!--
<h3><U>差分パルス符号変調</U></h3>
-->
<p>差分パルス符号変調は主に音声信号を圧縮する際に用いられる圧縮手法の一つである.</p>
<p>音声信号は計算機上では整数列(インパルス列)として扱われる.整数列は入力信号を一定時間間隔で標本化(サンプリング)し,振幅を記録したものである.一般にこの整数列は前後の値が近いという傾向がある.これを利用し,前後の値の差分を符号化し,圧縮率を向上させるのが差分パルス符号変調である.</p>... |
p00157 |
<H1>マトリョーシカ</H1>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_russianDolls">
</center>
<p>
マトリョーシカとは女性像をかたどった木製の人形で、ロシアの代表的な民芸品です。マトリョーシカは、大きな人形の中にそれより小さな人形が入っている入れ子構造になっており、大きさの異なる複数の人形で構成されています。このような入れ子構造にするため、各人形の胴体は上下で分割できる筒状の構造になっています。マトリョーシカは職人の手で手作りされるため、一つ一つの人形は世界に一つしかない非常に貴重なも... |
p00507 |
<H1>問題 3</H1>
<br/>
<p>
入力ファイルの1行目に正整数 n (n≧3)が書いてあり,
つづく n 行に異なる正整数 a<sub>1</sub>, ..., a<sub>n</sub> が
1つずつ書いてある.
a<sub>1</sub>, ..., a<sub>n</sub> から異なる2個を選んで作られる
順列を(数として見て)小さい順に並べたとき,
3番目に来るものを出力せよ.
</p>
<p>
ただし,
例えば,a<sub>1</sub> = 1,a<sub>4</sub> = 11 のような場合も,
a<sub>1</sub>a<sub>4</sub> と a<sub>4</sub>a<... |
p02214 | <span class="lang">
<span class="lang-ja">
<h1>C: サボテンクエリ</h1>
<div class="part">
<section>
<h3>問題文</h3><p>単純無向グラフで、任意の辺が高々 $1$ つの単純閉路にしか含まれないようなものをサボテングラフと呼ぶことにします。</p>
<p>$N$ 頂点 $M$ 辺の連結なサボテングラフ $G$ が与えられます。</p>
<p>各頂点は $1$ から $N$ まで番号が付いています。</p>
<p>また、$i$ 個目の辺は頂点 $a_i$ と頂点 $b_i$ を結んでおり、コストは $c_i$ です。</p>
<p>グラフ $G... |
p00229 |
<H1>大当たり!</H1>
<p>
あいづ学園大学附属高校の大阿足あたる君は、スロットマシーンで遊ぶことにしました。
</p>
<p>
このマシーンは、メダルを投入すると、3 つのリールが回転を始め、各リールが自動的に止まります。通常の1ゲーム(通常ゲーム)は 3 枚のメダルを投入し、図柄が揃うと、その図柄に応じて次のとおりメダルが得られます。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_bighit"><br/>
<br/>
</center>
<p>
図柄の揃い方によっては特別なサービスが開始され... |
p03956 | <span class="lang-en">
<p>Score : <var>1700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a grid with <var>N</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>).</p>
<p>Initially, <var>M</var> of... |
p02644 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke, a water strider, lives in a rectangular pond that can be seen as a grid with <var>H</var> east-west rows and <var>W</var> north-south columns. Let <var>(i,j)</var> be the square at the <var>i</va... |
p00679 |
<h1>KND Warp</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマだ。彼はその優秀な頭脳をもってワープ装置を開発したことで有名である。ワープ装置とは便利なもので、ある場所から別の場所まで瞬時に移動することができる。彼はこれから地球上に点在するワープ装置を用いて様々な場所を可能な限り早くめぐる旅を計画している。</p>
<p>彼の隣人であるあなたの仕事は3次元空間 (xyz直交座標系) 上に存在する<var>N</var>個のワープ装置をうまく使用して、1から<var>M</var>までの番号がふられた<var>M</var>個の点を順に通って、<var>M</var>番目の点... |
p00383 | <h1>Points on a Straight Line</h1>
<p>
The university of A stages a programming contest this year as has been the case in the past. As a member of the team in charge of devising the problems, you have worked out a set of input data for a problem, which is an arrangement of points on a 2D plane in the coordinate sys... |
p01438 |
<H1><font color="#000">Problem B:</font> Butterfly</H1>
<p>
Claire is a man-eater. She's a real man-eater. She's going around with dozens of guys. She's dating all the time. And one day she found some conflicts in her date schedule. D'oh!
</p>
<p>
So she needs to pick some dates and give the others up. The dates are... |
p03405 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have an undirected weighted graph with <var>N</var> vertices and <var>M</var> edges.
The <var>i</var>-th edge in the graph connects Vertex <var>U_i</var> and Vertex <var>V_i</var>, and has a weight o... |
p01068 |
<h1>Equivalent Vertices</h1>
<h2>Background</h2>
<p>
会津大学付属幼稚園はプログラミングが大好きな子供が集まる幼稚園である。
園児の一人であるゆう君は,プログラミングと同じくらいお絵描きが大好きだ。
これまでゆう君は丸と六角形と矢印で沢山絵を書いてきた。
ある日ゆう君はこれらの絵がグラフであることを知る。
丸と六角形は頂点と呼ばれ,矢印は辺と呼ばれているらしい。
ゆう君は2つの頂点間を結ぶようにして矢印を描き、更にその上に0か1を書く。
このように,辺に重み(0または1)があり有向な辺からなるグラフは重み付き有向グラフと呼ばれる。
また,頂点と数字<var>x</var>... |
p03055 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi and Aoki will play a game on a tree.
The tree has <var>N</var> vertices numbered <var>1</var> to <var>N</var>, and the <var>i</var>-th of the <var>N-1</var> edges connects Vertex <var>a_i</var... |
p01592 |
<h2>Problem B: Blame Game</h2>
<p>Alice and Bob are in a factional dispute. Recently a big serious problem
arised in a project both Alice and Bob had been working for. This problem was
caused by lots of faults of Alice's and Bob's sides; those faults are closely
related.</p>
<p>Alice and Bob started to blame each oth... |
p01087 |
<h2>ICPC Calculator</h2>
<p>
In mathematics, we usually specify the order of operations by using
parentheses.
For example, 7 × (3 + 2) always means multiplying 7 by the result of 3 + 2 and never means adding 2 to the result of 7 × 3.
However, there are people who do not like parentheses.
International Counter of Par... |
p03540 | <span class="lang-en">
<p>Score : <var>1600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In some place in the Arctic Ocean, there are <var>H</var> rows and <var>W</var> columns of ice pieces floating on the sea.
We regard this area as a grid, and denote the square at the <var>i</var>-th ro... |
p03110 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi received <em>otoshidama</em> (New Year's money gifts) from <var>N</var> of his relatives.</p>
<p>You are given <var>N</var> values <var>x_1, x_2, ..., x_N</var> and <var>N</var> strings <var>u... |
p01984 | <h3>短歌数</h3>
<!-- begin ja only -->
<p>願はくは 花の下にて 春死なむ そのきさらぎの 望月のころ</p>
<p>これは,西行法師が詠んだとされる,有名な短歌の一つである.
短歌は,日本において古くから親しまれている和歌の一種であり,その多くは 5・7・5・7・7 の五句三十一音からなる.</p>
<p>ところで,57577 という数は,5 と 7 の二種類の数字からなる.
このような,十進表記がちょうど二種類の数字からなる正の整数を,短歌数と呼ぶことにする.
例えば,10, 12, 57577, 25252 などは短歌数であるが,5, 11, 123, 20180701 などは短歌数ではな... |
p00696 |
<h1>
Multi-column List
</h1>
<P>Ever since Mr. Ikra became the chief manager of his office,
he has had little time for his favorites, programming and debugging.
So he wants to check programs in trains to and from his office
with program lists.
He has wished for the tool that prints source programs
as multi-column l... |
p02351 |
<H1>RSQ and RAQ</H1>
<p>
Write a program which manipulates a sequence <var>A</var> = {<var>a<sub>1</sub>, a<sub>2</sub>, . . . , a<sub>n</sub></var>} with the following operations:
</p>
<ul>
<li><var>add(s, t, x)</var>: add <var>x</var> to <var>a<sub>s</sub></var>, <var>a<sub>s+1</sub></var>, ..., <var>a<sub>t</s... |
p03813 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Smeke has decided to participate in AtCoder Beginner Contest (ABC) if his current rating is less than <var>1200</var>, and participate in AtCoder Regular Contest (ARC) otherwise.</p>
<p>You are given Sm... |
p02701 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You drew lottery <var>N</var> times. In the <var>i</var>-th draw, you got an item of the kind represented by a string <var>S_i</var>.</p>
<p>How many kinds of items did you get?</p>
</section>
</div>
<d... |
p04006 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke lives in another world, where slimes are real creatures and kept by some people.
Slimes come in <var>N</var> colors. Those colors are conveniently numbered <var>1</var> through <var>N</var>.
Snuke... |
p03239 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>When Mr. X is away from home, he has decided to use his smartwatch to search the best route to go back home, to participate in ABC.</p>
<p>You, the smartwatch, has found <var>N</var> routes to his home.... |
p01204 |
<H1><font color="#000">Problem C:</font> Save the Energy</H1>
<p>
You were caught in a magical trap and transferred to a strange field due to its cause. This field is three-
dimensional and has many straight paths of infinite length. With your special ability, you found where
you can exit the field, but moving there ... |
p03393 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Gotou just received a dictionary. However, he doesn't recognize the language used in the dictionary. He did some analysis on the dictionary and realizes that the dictionary contains all possible <strong... |
p03669 | <span class="lang-en">
<p>Score : <var>1200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> irregular jigsaw pieces. Each piece is composed of three rectangular parts of width <var>1</var> and various heights joined together. More specifically:</p>
<ul>
<li>The <var>i</va... |
p01654 |
<h2>Problem Statement</h2>
<p>
Chelsea is a modern artist. She decided to make her next work with ladders. She wants to combine some ladders and paint some beautiful pattern.
</p>
<p>
A ladder can be considered as a graph called <i>hashigo</i>. There are <var>n</var> <i>hashigos</i> numbered from 0 to <var>n-1</var... |
p00946 |
<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 A
Rearranging a Sequen... |
p00415 | <h1>デジットK</h1>
<p>
アイヅ赤べこ店では、デジットKと呼ばれるユニークな「くじ」を販売しています。各くじには、左から右へ向かって1列に$N$個の数字が並んでいます。ただし、書かれているのは1から9までの数字です。
</p>
<p>
くじの購入者は、これらの数字から$K$個の数字を消去し、残った$N-K$個の数字を左から順番に並べてできる数をポイントとして獲得することができます。たとえば$K=3$のとき、くじに$1414213$と書かれていれば、左から$1$、$1$、$2$を選択して消去することで$4413$ポイントを獲得することができます。
</p>
<p>
数字の列と整数$K$が与えられたとき、獲得でき... |
p02428 | <h1>Enumeration of Subsets II</h1>
<p>
You are given a set $T$, which is a subset of $U$. The set $U$ consists of $0, 1, ... n-1$.
Print all sets, each of which is a subset of $U$ and includes $T$ as a subset.
Note that we represent $0, 1, ... n-1$ as 00...0001, 00...0010, 00...0100, ..., 10...0000 in binary ... |
p02582 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have weather records at AtCoder Town for some consecutive three days. A string of length <var>3</var>, <var>S</var>, represents the records - if the <var>i</var>-th character is <code>S</code>, it me... |
p00045 |
<H1>Sum and Average</H1>
<p>
販売単価と販売数量を読み込んで、販売金額の総合計と販売数量の平均を出力するプログラムを作成してください。
</p>
<H2>Input</H2>
<p>
入力は以下の形式で与えられます。
</p>
<pre>
販売単価,販売数量
販売単価,販売数量
:
:
</pre>
<p>
カンマで区切られた販売単価と販売数量の組が、複数行に渡って与えられます。入力される値はすべて 0 以上 1,000 以下で、販売単価と販売数量の組の数は 100 を超えません。
</p>
<H2>Output</H2>
<p>
1行目に販売金額の総合計(整数)、2行目に販売数量の平均... |
p02078 | <h1>A: Undo Swapping</h1>
<h2>問題文</h2>
<p>$N$ 行 $N$ 列のマス目の上に $N$ 個の石が置いてあります。
$i$ 番目の石は $R_i$ 行 $C_i$ 列にあります。同じマスに複数の石が置かれていることはありません。</p>
<p>あなたは次の2種類の操作を任意の順で任意の回数行うことができます。</p>
<ol>
<li>2つの行を選び、それらを交換する</li>
<li>2つの列を選び、それらを交換する。</li>
</ol>
<p>$N$ 個の石を、マス目の左上から右下にかけての対角線上に並べることが出来るかを判定するプログラムを作成してください。
可能な場合は必要な最小の操... |
p00550 |
<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>
<h2>鉄道運賃(Train Fare)</h2>
<p>
JOI 国には $N$ 個の都... |
p02097 |
<h2>J: Horizontal-Vertical Permutation</h2>
<h3>Problem Statement</h3>
<p>You are given a positive integer <var>N</var>. Your task is to determine if there exists a square matrix <var>A</var> whose dimension is <var>N</var> that satisfies the following conditions and provide an example of such matrices if it exists. ... |
p00100 |
<H1>Sale Result</H1>
<p>
There is data on sales of your company. Your task is to write a program which identifies good workers.
</p>
<p>
The program should read a list of data where each item includes the employee ID <i>i</i>, the amount of sales <i>q</i> and the corresponding unit price <i>p</i>. Then, the program ... |
p01341 |
<H1><font color="#000">Problem C: </font> Save your cats</H1>
<p>
Nicholas Y. Alford was a cat lover. He had a garden in a village and kept many cats in his garden. The cats were so cute that people in the village also loved them.
</p>
<p>
One day, an evil witch visited the village. She envied the cats for being lov... |
p03686 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>M</var> chairs arranged in a line. The coordinate of the <var>i</var>-th chair <var>(1 ≤ i ≤ M)</var> is <var>i</var>.</p>
<p><var>N</var> people of the Takahashi clan played too much ga... |
p02994 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You have <var>N</var> apples, called Apple <var>1</var>, Apple <var>2</var>, Apple <var>3</var>, ..., Apple <var>N</var>. The <em>flavor</em> of Apple <var>i</var> is <var>L+i-1</var>, which can be nega... |
p01711 |
<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... |
p00803 |
<H1><font color="#000">Problem A:</font> Starship Hakodate-maru</H1>
<p>
The surveyor starship Hakodate-maru is famous for her two fuel containers with unbounded capacities. They hold the same type of atomic fuel balls.
</p>
<p>
There, however, is an inconvenience. The shapes of the fuel containers <i>#</i>1 and <i>#... |
p01506 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Digit</H1>
<p>
For a positive integer <var>a</var>, let <var>S(a)</var> be the sum of the digits in base <var>l</var>.
Also let <var>L(a)</var> be the minimum <var>k</var> such that <var>S^k(a)</var> is less than or equal to <var>l-1</var>.
Find the mini... |
p03491 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>For strings <var>s</var> and <var>t</var>, we will say that <var>s</var> and <var>t</var> are <em>prefix-free</em> when neither is a prefix of the other.</p>
<p>Let <var>L</var> be a positive integer. A... |
p01156 |
<H1><font color="#000">Problem B:</font> Hyper Rock-Scissors-Paper</H1>
<p>
Rock-Scissors-Paper is a game played with hands and often used for random choice of a person for some
purpose. Today, we have got an extended version, namely, <i>Hyper Rock-Scissors-Paper</i> (or Hyper RSP
for short).
</p>
<p>
In a game of Hy... |
p00317 |
<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>
古代国家イワシロの遺跡から無数の石版が発見された。研究者の... |
p02280 | <H1>Binary Tree</H1>
<p>
A rooted binary tree is a tree with a root node in which every node has at most two children.
</p>
<p>
Your task is to write a program which reads a rooted binary tree <i>T</i> and prints the following information for each node <i>u</i> of <i>T</i>:
</p>
<ul>
<li>node ID of <i>u</i></li>
<l... |
p01855 |
<h1 id="d-市松模様-checkered-pattern">D : 市松模様 / Checkered Pattern</h1>
<h2 id="問題文">問題文</h2>
<p>縦横の長さが <var>h, w</var> の長方形があり, 内部には一辺の長さが <var>1</var> の正方形のマスが敷き詰められている. 最も左上のマスを <var>(0,0)</var> とし, <var>(0,0)</var> の <var>i</var> 個下で <var>j</var> 個右のマスを <var>(i,j)</var> のように表すことにすると, <var>(i,j)</var> は <var>i+j</va... |
p03868 | <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>There are <var>N</var> computers and <var>N</var> sockets in a one-dimensional world.
The coordinate of the <var>i</var>-th compute... |
p00747 |
<!-- begin en only -->
<h1><font color="#000000">Problem B:</font> Amazing Mazes</h1>
<!-- end en only -->
<!-- begin en only -->
<p>
You are requested to solve maze problems. Without passing through
these mazes, you might not be able to pass through the domestic
contest!
</p>
<!-- end en only -->
<!-- begin en o... |
p00252 |
<H1>乗車券</H1>
<p>
新幹線に乗るためには、「乗車券」「特急券」の2枚の切符が必要です。経路の一部で新幹線を利用しない場合があるため、これらは別々の切符となっていますが、新幹線のみを利用する経路では、1枚で乗車券と特急券を兼ねる「乗車・特急券」が発行されることもあります。
</p>
<p>
自動改札機では、これらの切符を読み込んで、正しい切符が投入されたときだけゲートを開けなければなりません。「乗車券」と「特急券」それぞれ1枚、または、その両方、または、「乗車・特急券」が1枚投入されたかどうかを判定し、自動改札機の扉の開閉を判断するプログラムを作成して下さい。
</p>
<h2>入力</h2>
<p>
... |
p03887 | <span class="lang-en">
<p>Score : <var>1500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><style>
#nck {
width: 30px;
height: auto;
}
</style>
<p>Consider all integers between <var>1</var> and <var>2N</var>, inclusive.
Snuke wants to divide these integers into <var>N</var> pa... |
p02795 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a grid with <var>H</var> rows and <var>W</var> columns, where all the squares are initially white.</p>
<p>You will perform some number of painting operations on the grid.
In one operation, you c... |
p01910 |
<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: カードゲーム</h1>
<h2>問題</h2>
<p>
カードを使ったゲームを $Q$ 回行います。
カードには ... |
p00602 |
<H1><font color="#000000">Problem H:</font> Fibonacci Sets</H1>
<p>
Fibonacci number <i>f</i>(<i>i</i>) appear in a variety of puzzles in nature and math, including packing problems, family trees or Pythagorean triangles. They obey the rule <i>f</i>(<i>i</i>) = <i>f</i>(<i>i</i> - 1) + <i>f</i>(<i>i</i> - 2), where w... |
p01443 |
<H1><font color="#000">Problem G:</font> Number Sorting</H1>
<p>
Consider sets of natural numbers. Some sets can be sorted in the same order numerically and lexicographically. {2, 27, 3125, 9000} is one example of such sets; {2, 27, 243} is not since lexicographic sorting would yield {2, 243, 27}.
</p>
<p>
Your task... |
p03184 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a grid with <var>H</var> 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 t... |
p01013 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<h1> Problem H: Cone Cut</h1>
<h2> Problem </h2>
<p>
この問題では3次元空間上のある点<var>X </var>とある点<var>Y </var>を通るような直線を直線<var>XY </var>と書く。
</p>
<p>
3次元空間上に円錐とその円錐内部の点<var>P </var>が与えられる。点<var>P </var>を通り円錐の底面に垂直な直線と円錐の底面との交点を点<var>Q </var>とする。この時、円錐の... |
p02146 | <h1>Problem J: Averaging</h1>
<h2>Problem</h2>
<p>
アイヅ国には$N$個の島と$N-1$個の橋があり、各島はそれぞれ$1$から$N$までの番号が割り振られている。
$i$番目の橋は島$u_i$と島$v_i$を双方向に結んでおり、島民は橋を用いて島と島とを行き来することができる。また、橋以外に島と島を行き来する方法はない。
どの島からどの島へもいくつかの橋を渡ることで到達することができる。
</p>
<p>
現在、島$i$には$X_i$人の島民がいる。
各島の環境への負荷を分散させるためにアイヅ国は何人かの国民に別の島へ引越してもらうことにした。
島$a$に住ん... |
p00481 |
<H1>チーズ (Cheese)</H1>
<h2>問題</h2>
<p>
今年も JOI 町のチーズ工場がチーズの生産を始め,ねずみが巣から顔を出した.JOI 町は東西南北に区画整理されていて,各区画は巣,チーズ工場,障害物,空き地のいずれかである.ねずみは巣から出発して全てのチーズ工場を訪れチーズを 1 個ずつ食べる.
</p>
<p>
この町には,N 個のチーズ工場があり,どの工場も1種類のチーズだけを生産している.チーズの硬さは工場によって異なっており,硬さ 1 から N までのチーズを生産するチーズ工場がちょうど 1 つずつある.
</p>
<p>
ねずみの最初の体力は 1 であり,チーズを 1 ... |
p03307 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a positive integer <var>N</var>.
Find the minimum positive integer divisible by both <var>2</var> and <var>N</var>.</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><... |
p03757 | <span class="lang-en lang-child hidden-lang">
<div id="task-statement">
Max Score: <var>1450</var> Points <br/>
<section>
<h3>Problem Statement</h3>
There are <var>N</var> workers in Atcoder company. Each worker is numbered <var>0</var> through <var>N - 1</var>, and the boss for worker <var>i</var> is <var>p_i... |
p00878 |
<H1><font color="#000">Problem E:</font> Origami Through-Hole</H1>
<p>
Origami is the traditional Japanese art of paper folding. One day, Professor Egami found the
message board decorated with some pieces of origami works pinned on it, and became interested
in the pinholes on the origami paper. Your mission is to sim... |
p02845 | <span class="lang-en">
<p>Score: <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p><var>N</var> people are standing in a queue, numbered <var>1, 2, 3, ..., N</var> from front to back. Each person wears a hat, which is red, blue, or green.</p>
<p>The person numbered <var>i</var> says:<... |
p01290 |
<H1><font color="#000">Problem H:</font> Queen's Case</H1>
<p>
A small country called Maltius was governed by a queen. The queen was known as an oppressive ruler.
People in the country suffered from heavy taxes and forced labor. So some young people decided to form
a revolutionary army and fight against the queen. No... |
p01785 |
<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>F - Polygon Guards</h2>
<h3>Pr... |
p00897 |
<H1><font color="#000">Problem D: </font>Long Distance Taxi </H1>
<p>
A taxi driver, Nakamura, was so delighted because he got a passenger who wanted to go to a
city thousands of kilometers away. However, he had a problem. As you may know, most taxis in
Japan run on liquefied petroleum gas (LPG) because it is cheaper... |
p03242 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Cat Snuke is learning to write characters.
Today, he practiced writing digits <code>1</code> and <code>9</code>, but he did it the other way around.</p>
<p>You are given a three-digit integer <var>n</va... |
p03612 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a permutation <var>p_1,p_2,...,p_N</var> consisting of <var>1</var>,<var>2</var>,..,<var>N</var>.
You can perform the following operation any number of times (possibly zero):</p>
<p>Operat... |
p02900 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given are positive integers <var>A</var> and <var>B</var>.</p>
<p>Let us choose some number of positive common divisors of <var>A</var> and <var>B</var>.</p>
<p>Here, any two of the chosen divisors must... |
p00194 |
<H1>運送会社</H1>
<table>
<tr>
<td style="vertical-align:top">
<p>
白虎運送は会津若松市を代表する運送会社です。昨今の原油価格の高騰は運送会社にも多大なダメージを与え、運送会社各社では、できるだけ少ないガソリンで荷物を運ぶことが課題となっています。
</p>
</td>
<td>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_byakkoDelivery1">
</td>
</tr>
</table>
<p>
白虎運送では、重い荷物を積んだトラックは、その走りだしに多くのエネルギー... |
p02453 | <h1>Lower Bound</h1>
<p>
For a given sequence $A = \{a_0, a_1, ..., a_{n-1}\}$ which is sorted by ascending order, find the lower 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 value, or $n$ if there is ... |
p02003 | <h1>H: 板</h1>
<h2>問題</h2>
<p>
$R * C$ のマスが与えられます.各マスは何もないマスか,穴が開いているマスのどちらかです.
与えられるマスは以下の条件を満たします。
</p>
<ul>
<li> 穴の開いたマス同士は連結である.(穴の開いたマスを十字方向につたって任意の穴の開いたマスに移動することができる)</li>
<li> 何もないマス同士は連結である.</li>
</ul>
<p>
あなたは幅が $1$ の任意長の長方形型のタイルを生成することができます.
このタイルを複数枚設置して全ての穴のあるマスを埋めたいです.タイルを設置するとき,以下の制約を守る必要があり... |
p01802 |
<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>Koto Municipal Subway</u>... |
p00710 |
<h1>
<font color="#000">Problem A:</font> Hanafuda Shuffle
</h1>
<p>
There are a number of ways to shuffle a deck of cards. Hanafuda
shuffling for Japanese card game 'Hanafuda' is one such example.
The following is how to perform Hanafuda shuffling.
</p>
<p>
There is a deck of <I>n</I> cards. Starting from the <... |
p00340 |
<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>
アイヅ放送協会の教育番組(AHK教育)では、子ど... |
p03995 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a grid with <var>R</var> rows and <var>C</var> columns.
We call the cell in the <var>r</var>-th row and <var>c</var>-th column (<var>r,c</var>).</p>
<p>Mr. Takahashi wrote non-negative integers... |
p02687 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>AtCoder Inc. holds a contest every Saturday.</p>
<p>There are two types of contests called ABC and ARC, and just one of them is held at a time.</p>
<p>The company holds these two types of contests alter... |
p01101 |
<h3><u>Taro's Shopping</u></h3>
<p>
Mammy decided to give Taro his first shopping experience.
Mammy tells him to choose any two items he wants from those
listed in the shopping catalogue,
but Taro cannot decide which two, as all the items look attractive.
Thus he plans to buy the pair of two items with
the highest pr... |
p01551 |
<h1>問題名 DNA</h1>
<p>遺伝子は、<code>A</code>, <code>T</code>, <code>G</code>, <code>C</code> からなる文字列です。
この世界の遺伝子は奇妙なことに、ある構文規則に従うことが知られています。
</p>
<p>構文規則は、次のような形で与えられます。
</p><pre>非終端記号1: 記号1_1 記号1_2 ... 記号1_n1
非終端記号2: 記号2_1 記号2_2 ... 記号2_n2
...
非終端記号m: 記号m_1 記号m_2 ... 記号m_nm
</pre>
<p>記号は非終端記号または終端記号のどちらかです。
非終端記号は小文字文字列で... |
p03096 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> stones arranged in a row. The <var>i</var>-th stone from the left is painted in the color <var>C_i</var>.</p>
<p>Snuke will perform the following operation zero or more times:</p>... |
p03583 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given an integer <var>N</var>.</p>
<p>Find a triple of positive integers <var>h</var>, <var>n</var> and <var>w</var> such that <var>4/N = 1/h + 1/n + 1/w</var>.</p>
<p>If there are multiple solu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.