question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p03548 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a long seat of width <var>X</var> centimeters.
There are many people who wants to sit here. A person sitting on the seat will always occupy an interval of length <var>Y</var> centimeters.</p>
<p... |
p01575 |
<H1><font color="#000">Problem E:</font> Dungeon Master</H1>
<p>
Once upon a time, in a fantasy world far, far away, monsters dug caves and dungeons for adventurers. They put some obstacles in their caves so it becomes more difficult and more exciting for the adventurers to reach the goal.
</p>
<p>
One day, Emils, o... |
p01060 |
<h1>Product Sale Lines</h1>
<h2>Problem</h2>
<p>
ウニクロ卯月さんと目黒凛さんはSEARIGHT LIVE FESの物販に来ている。下図のように、物販列は二列からなり、横に<var>W</var>人、縦に<var>H</var>人並べる大きさでコの字の形をしている。列の先頭の人は買い物をした後に列からはけ、同じ列の後ろの人々はそれぞれ一人分ずつ列を詰める。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_UAPC2016Spring_B1" alt="picture o... |
p01430 |
<script type="text/javascript" src="./varmath.js" charset="UTF-8"></script>
<h2>問題文</h2>
<p>ハコの魔女 H.N.ELLY はとある動画サイトの熱狂的なファンである.ハコの魔女の強さはその時々のその動画サイトからの転送速度に応じて変化するのではないかと<i>美樹さやか</i>は考えた.そこで動画サイトからハコの魔女の持つコンピュータまでの過去の転送速度 (=単位時間あたりのデータの転送量) を調べたい.</p>
<p>初期のインターネットのネットワークの構造とそれ以降のネットワークの構造の変化を表すクエリが与えられるので,各変化について変化... |
p00671 |
<h1>Problem C: Live Schedule</h1>
<p>
YOKARI TAMURAは全国的に有名なアーティストである。今月YOKARIは D 日間にわたってライブツアーを行う。ツアーのスケジュールの決定においてこの国を C 種類の地域でわける。YOKARIがある地域でライブを行うことにより利益を得られ、これは正の整数で表される。YOKARIは原則として 1 日に最大 1 つまでライブを行う。ただし、ある地域でライブを行った後、隣接する地域でライブを行える場合はその地域で同じ日に再びライブを行うことができる。この条件を満たす限り、地域を移動しながら何度もライブを行うことができる。また、同じ日に同じ地域でライブを... |
p01963 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... |
p00221 |
<H1>FizzBuzz</H1>
<p>
「Fizz Buzz」と言われる数字を使ったゲームがあります。このゲームは複数のプレイヤーで数字を1 から順にひとつずつ数え上げていくもので、各プレイヤーは直前のプレイヤーが発言した次の数字をひとつだけ発言します。その時、3 で割り切れる場合は 「Fizz」, 5 で割り切れる場合は 「Buzz」、両者で割り切れる場合は「FizzBuzz」と数の代わりに発言しなければなりません。例えば、最初の 16 までの発言は以下のようになります。
</p>
<p>
1, 2, Fizz, 4, Buzz, Fizz, 7, 8, Fizz, Buzz, 11, Fizz, 13, 14... |
p02836 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Takahashi loves palindromes. Non-palindromic strings are unacceptable to him. Each time he hugs a string, he can change one of its characters to any character of his choice.</p>
<p>Given is a string <v... |
p01719 |
<p>長年の研究の末、イクタ君は未来予知能力を手に入れた! 彼がこの研究に費やした時間や金銭は莫大なものであったが、ついに報われる時がやってきたのだ。手始めに金銭を取り戻すため、イクタ君は株式投資を始めることにした。
</p>
<p>
イクタ君は現在株式は全く保有しておらず、 <var>x</var> 円を所持している。彼が投資対象に定めた株式は <var>n</var> 種類で、それらについて今日から <var>d</var> 日分の株価を予知することに成功した。その結果、驚くべきことに今日から <var>d</var> 日間は日中の株価変動が全くないことが判明した。つまり、今日を1日目としたときの <var>i </va... |
p03724 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi is not good at problems about trees in programming contests, and Aoki is helping him practice.</p>
<p>First, Takahashi created a tree with <var>N</var> vertices numbered <var>1</var> through <... |
p01349 |
<H1>Problem A: Ennichi</H1>
<p>
縁日に来たうさぎが, ある出店のゲームの景品がキャロットケーキであるのを見つけた. このゲームのルールは以下の通りである.
</p>
<p>
縦h マス× 横w マスの格子状のフィールドがあり, 各マスにつき高々1 個のブロックが置かれる. 各ブロックにはアルファベット大文字(‘A’ - ‘Z’) のいずれかで表される色がついている. 同色のブロックが縦または横に一直線上にn 個以上連続して並ぶと, それらのブロックは消滅する.
</p>
<p>
参加者は横に隣り合う2 つのマスを選んで, それらの状態を互いに入れ替える操作ができる. ブロックの入... |
p03374 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>"Teishi-zushi", a Japanese restaurant, is a plain restaurant with only one round counter. The outer circumference of the counter is <var>C</var> meters. Customers cannot go inside the counter.</p>
<p>Na... |
p02135 | <h1>Problem L: Tree Fragments</h1>
<h2>Problem</h2>
<p>あいちゃんは、$N$個の頂点と$N-1$本の辺からなる木$T$を持っている。各頂点には$1$から$N$までの番号と、正の整数の重みがついている。</p>
<p>次の$Q$回のクエリに順に答えよ。</p>
<p>
<ul>
<li>$1 \le a_i,b_i \le N$($a_i \ne b_i$)が与えられるので、$T$の$a_i$-$b_i$パス上の頂点とそれに接続する辺を取り除いてできる、いくつかの連結成分の中で、重みが最大となる連結成分の重みを出力する。そのような連結成分が1つもない場合、0と出力する。<... |
p00108 |
<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>
有限数列の変換操作に出現頻度操作というものがありま... |
p02565 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Consider placing <var>N</var> flags on a line. Flags are numbered through <var>1</var> to <var>N</var>.</p>
<p>Flag <var>i</var> can be placed on the coordinate <var>X_i</var> or <var>Y_i</var>.
For any... |
p00558 |
<h1>ヘビの JOI 君 (Snake JOI)</h1>
<h2>問題</h2>
<p>
ヘビの JOI 君は,ある大きな屋敷に迷い込んでしまった.屋敷の住人に見つかる前に,屋敷を脱出しなければならない.
</p>
<p>
この屋敷には部屋が N 個あり,1, 2, ..., N の番号が付けられている.また,廊下が M 本あり,i 本目の廊下 (1 ≦ i ≦ M) は部屋 A<sub>i</sub> と部屋 B<sub>i</sub> を結んでいる.JOI 君はこれらの廊下をどちらの向きにも通ることができ,廊下 i を通るのには D<sub>i</sub> 分かかる.部屋と部屋の間を廊下を通る以外の手段で移動する... |
p02070 | <style type="text/css">
blockquote {
font-family: Menlo, Monaco, "Courier New", monospace;
display: block;
margin: 10px 0 10px 30px;
font-size: 16px;
line-height: 18px;
white-space: pre;
white-space: pre-wrap;
word-break: break-all;
word-wrap: ... |
p02420 | <H1>Shuffle</H1><br>
<p>
Your task is to shuffle a deck of <var>n</var> cards, each of which is marked by a alphabetical letter.
</p>
<p>
A single shuffle action takes out <var>h</var> cards from the bottom of the deck and moves them to the top of the deck.
</p>
<p>
The deck of cards is represented by a string... |
p02973 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a sequence with <var>N</var> integers: <var>A = \{ A_1, A_2, \cdots, A_N \}</var>.
For each of these <var>N</var> integers, we will choose a color and paint the integer with that color. He... |
p03661 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke and Raccoon have a heap of <var>N</var> cards. The <var>i</var>-th card from the top has the integer <var>a_i</var> written on it.</p>
<p>They will share these cards.
First, Snuke will take some n... |
p03231 | <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> of length <var>N</var> and another string <var>T</var> of length <var>M</var>.
These strings consist of lowercase English letters.</p>
<p>A string <var>X</var> is cal... |
p01522 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<h1>C - ソーシャル</h1>
<h2>問題文</h2>
<p>
うさぎが <var>N</var> 匹おり,ボートを使って川を渡ろうとしている.ボートは <var>K</var> 個あり,誰がどのボートに乗るかを適当に決めて乗ることにした.
</p>
<p>
ところでうさぎというのは互いの仲の良し悪しに敏感であり,狭い空間に仲の悪いうさぎと一緒に閉じ込められると気分を悪くしてしまう.
この <var>N</var> 匹のうさぎについても何組かのうさぎは仲が悪いということが分かっており,今の割り当て... |
p01172 |
<H1><font color="#000">Problem B:</font> Headstrong Student</H1>
<p>
You are a teacher at a cram school for elementary school pupils.
</p>
<p>
One day, you showed your students how to calculate division of fraction in a class of mathematics.
Your lesson was kind and fluent, and it seemed everything was going so well ... |
p01488 |
<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 C:
TransferTrain
</h2... |
p00333 |
<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>
会津県では人口増加のためにニュータウンを作ること... |
p00763 |
<h1>Railway Connection</h1>
<!-- end en only -->
<!-- begin en only -->
<p>
Tokyo has a very complex railway system.
For example, there exists a partial map of lines and stations
as shown in Figure D-1.
</p>
<!-- end en only -->
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_1182_1" align... |
p01871 |
<!-- - - - - - begin nicebody - - - - - -->
<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>G: 塗るだけ... |
p00299 |
<h1>学食</h1>
<p>
今日はZ大学のオープンキャンパスです。毎年この日の昼休みには、大勢の高校生たちが学食に列をつくります。そこでZ大学の事務局は、行列の長さが最大でどのくらいの距離になるかを予測することにしました。事前調査の結果で、以下のことが分かっています。
</p>
<ul>
<li> 行列にはそれぞれ 1 から <var>N</var> までの番号が振られた <var>N</var> 人が並びます。</li>
<li> <var>C</var> 個の高校生のペア (<var>a<sub>i</sub></var>, <var>b<sub>i</sub></var>) それぞれについて、以下の2種類の制約が... |
p00276 |
<H1>陣形</H1>
<p>
プログラマー養成校であるアカベ高校では、チーム戦の競技プログラマーの役割を以下の3タイプに分けています。<br>
<table style="margin-left:24px">
<tr>
<td>C:</td>
<td>コーダー</td>
<td>言語を熟知しており、コーディングを行う。</td>
</tr>
<tr>
<td>A:</td>
<td>アルゴリズマー</td>
<td>論理的思考が得意であり、アルゴリズムを考える。</td>
</tr>
<tr>
<td>N:</td>
<td>ナビゲーター</td>
<td>読解力に長けており、問題の分析・デバッグをする。</... |
p00626 |
<H1><font color="#000000">Problem F:</font> Chocolate with Heart Marks</H1>
<p>
太郎君はチョコレートが大好きで, 学校から帰るとハートマークが描かれたお気に入りの板チョコを食べます, 最近の楽しみは, すべてのハートマークのブロックを最後まで残すように食べることです. 太郎君は, すべてのハートマークのブロックがつながったまま, できるだけ多くのハートマークのないブロックを食べようとします.
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1... |
p03909 | <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> rows and <var>W</var> columns.</p>
<p>The square at the <var>i</var>-th row and <var>j</var>-th column contains a string <var>S_{i,j}</var> of length <var>5</var>.</p>
... |
p01934 |
<!-- - - - - - begin nicebody - - - - - -->
<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>D: 次元旅行</h1>
<h... |
p01467 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?con... |
p01037 |
<h1>Problem A: A White Wall</h1>
<h2>Background</h2>
<p>
とある都市に住むA氏の家の敷地は、真っ白な壁に囲まれている。壁に物足りなさを感じたA氏は、近所の子供たちを呼んで、壁を自由に塗ってもらうことにした。子供達にはそれぞれ壁の好きな区間を選んで色を塗ってもらう。 さて、壁はどのように塗られただろうか。
</p>
<h2>Problem</h2>
<p>
0〜<var>N</var>-1の区画で構成される以下のような円型の白い壁がある。
</p>
<br>
<left>
<img width="480" src="https://judgeapi.u-aizu.... |
p02162 | <h1>Problem A: AOJ50M</h1>
<h2>Problem</h2>
<p>
AliceとBobが50m走で勝負しています。<br>
しかし、この世界においてはAOJのレートが高い方が偉いので、AOJのレートが高い方が勝ちます。<br>
どちらか一方でもAOJのレートが無い場合は比べようが無いので、仕方なく50m走のタイムで勝負します。この場合はタイムが短い方を勝ちとします。<br>
AOJのレートが同じ場合は引き分け、50m走のタイムで勝負しなければならない場合はタイムが同じなら引き分けです。<br>
</p>
<h2>Input</h2>
<p>入力は以下の形式で与えられる。</p>
<p... |
p03323 | <span class="lang-en">
<p>Score: <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>E869120's and square1001's <var>16</var>-th birthday is coming soon.<br/>
Takahashi from AtCoder Kingdom gave them a round cake cut into <var>16</var> equal fan-shaped pieces.</p>
<p>E869120 and square1... |
p03289 | <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>. Each character of <var>S</var> is uppercase or lowercase English letter.
Determine if <var>S</var> satisfies all of the following conditions:</p>
<ul>
<li>The initia... |
p02861 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> towns in a coordinate plane. Town <var>i</var> is located at coordinates (<var>x_i</var>, <var>y_i</var>). The distance between Town <var>i</var> and Town <var>j</var> is <var>\sq... |
p03773 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.<br/>
In this country, 24-hour clock is used. For example, <var>9:00</var> p.m. is referred to as "<var>21</var> o'cl... |
p03266 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given integers <var>N</var> and <var>K</var>. Find the number of triples <var>(a,b,c)</var> of positive integers not greater than <var>N</var> such that <var>a+b,b+c</var> and <var>c+a</var> are... |
p02924 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>For an integer <var>N</var>, we will choose a permutation <var>\{P_1, P_2, ..., P_N\}</var> of <var>\{1, 2, ..., N\}</var>.</p>
<p>Then, for each <var>i=1,2,...,N</var>, let <var>M_i</var> be the remain... |
p00919 |
<H1><font color="#000">Problem F: </font>Directional Resemblance</H1>
<p>
Vectors have their directions and two vectors make an angle between them. Given a set of three-dimensional vectors, your task is to find the pair among them that makes the smallest angle.
</p>
<H2>Input</H2>
<p>
The input is a sequence of dat... |
p03636 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>The word <code>internationalization</code> is sometimes abbreviated to <code>i18n</code>.
This comes from the fact that there are <var>18</var> letters between the first <code>i</code> and the last <cod... |
p02477 | <h2>Multiplication of Big Integers II</h2>
<p>
Given two integers $A$ and $B$, compute the product, $A \times B$.
</p>
<h3>Input</h3>
<p>
Two integers $A$ and $B$ separated by a space character are given in a line.
</p>
<h3>Output</h3>
<p>
Print the product in a line.
</p>
<h3>Constraints</h3>
<ul>
<li>$... |
p02027 | <h2>M: プレゼント (Presents)</h2>
<p>白羽さんは、とある悪魔にサプライズプレゼントとして次のような集合を用意した。</p>
<ul>
<li>$N$ 以下の異なる $K$ 個の自然数からなる</li>
<li>どの 2 つの値の組を集合から選んでも、片方の数がもう片方の数で割り切れる</li>
</ul>
<p>実はこのような集合には悪魔の力を奪う性質があり、このままだと力を失ってしまう。</p>
<p>悪魔を助けるために、このような集合がいくつあるか計算せよ。</p>
<h3>入力</h3>
<p>2 つの整数 $N, K$ が空白区切りで与えられる。</p>
<h3>出力</h3>... |
p01867 |
<!-- - - - - - begin nicebody - - - - - -->
<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>C: 足し... |
p02748 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>You are visiting a large electronics store to buy a refrigerator and a microwave.</p>
<p>The store sells <var>A</var> kinds of refrigerators and <var>B</var> kinds of microwaves. The <var>i</var>-th re... |
p00775 |
<h3>Vampire</h3>
<p>
Mr. C is a vampire. If he is exposed to the sunlight directly, he turns
into ash.
Nevertheless, last night, he attended to the meeting of Immortal and
Corpse Programmers
Circle, and he has to go home in the near dawn.
Fortunately, there are many tall buildings around Mr. C's home, and
while th... |
p02318 |
<H1>Edit Distance (Levenshtein Distance)</H1>
<br/>
<p>
Find the edit distance between given two words <var>s1</var> and <var>s2</var>.
</p>
<p>
The disntace is the minimum number of single-character edits required to change one word into the other. The edits including the following operations:
</p>
<ul>
<li><strong... |
p00325 |
<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>
皆さんは、苦労して作ったプログラムを実行し... |
p01164 |
<H1><font color="#000">Problem B:</font> Sort the Panels</H1>
<p>
There was an explorer Henry Nelson traveling all over the world. One day he reached an ancient
building. He decided to enter this building for his interest, but its entrance seemed to be locked
by a strange security system.
</p>
<p>
There were some bla... |
p03159 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>The server in company A has a structure where <var>N</var> devices numbered <var>1, 2, ..., N</var> are connected with <var>N - 1</var> cables.
The <var>i</var>-th cable connects Device <var>U_i</var> a... |
p01534 |
<h1> Anipero 2012</h1>
<h2> D: アニペロ2012</h2>
<p>
アニペロサマーライブ,通称アニペロは,さまざまなアニメソングアーティストたちが集結する,日本国内最大のアニメソングライブイベントである.アニソンが大好きな2D君は,昨年に引き続き,今年もアニペロに行くことにした.
</p>
<p>
彼は,アニペロを楽しむために,すでにサイリウムを<i>m</i>本購入している.サイリウムとは,折ると化学反応で光るスティックである.リズムに合わせてサイリウムを振ることで,ライブを盛り上げることができ,自分の満足度も上昇する.今回,彼が購入した全てのサイリウムは,次のような性質を持つ.
</p>
<ul... |
p03509 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Ringo Kingdom Congress is voting on a bill.</p>
<p><var>N</var> members are present, and the <var>i</var>-th member <var>(1 ≤ i ≤ N)</var> has <var>w_i</var> white ballots and <var>b_i</var> blue ballot... |
p01021 |
<h1>Problem F: Remainder Zero</h1>
<h2>Problem</h2>
<p>
整数の集合A,Bについて,次の条件を満たす整数 <var>x</var>がいくつ存在するか答えよ。
</p>
<p>
<var>A<sub>i</sub></var> mod <var>x</var> = 0 かつ <var>x</var> mod <var>B<sub>j</sub></var> = 0 がすべての <var>i</var> (1 ≤ <var>i</var> ≤ N), <var>j</var> (1 ≤ <var>j</var> ≤ M) について成り立つ。
</p>... |
p01471 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?conf... |
p01922 |
<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>G: 恋のジュンレツRun!Run!Run! - Love Permutation, Run run run! -</h2>
<h3>物語</h3>
<p>
おおきなジュンレツ らんらんらんでぶー♪
Hello, 星空蘭にゃ!
好きなデータ構造は Starry Sky Tre... |
p00630 |
<H1><font color="#000000">Problem P04:</font> CamelCase</H1>
<p>
プログラミングにおける識別子(変数や関数)の命名では、
単語を連結した複合語が使われる。
しかし、そのまま連結すると単語の区切りがわからなくなるため、
一般的に以下の命名規則の中から統一するものを選び適用する:
</p>
<ul>
<li>Upper CamelCase にする<br>
単語を直接連結し複合語とし、各単語の先頭文字のみを大文字にする。<br>
例: GetUserName
</li>
<li>Lower CamelCase にする<br>
単語を直接連結し複合語とし、各単語の... |
p00260 |
<H1>ねこまっしぐら</H1>
<p>
あるところに、高い塀に囲まれた大きなお屋敷がありました。そのお屋敷の主人は猫がとても大好きで、時折やってくる猫たちのために、いつもおいしいごはんを用意していました。お腹を空かせた猫たちは、高い塀をひょいと飛び越え、お屋敷の至る所に置いてあるごはんにまっしぐらに駆け寄るのでした。
</p>
<p>
ある日主人は、屋敷の中で何匹かの猫が倒れているのを見つけました。猫たちはごはんを探して屋敷の中を縦横無尽に走り回ったので、ぶつかったり転んだりしてしまったのです。主人は猫たちの安全を考えて、ごはんの置き場所を工夫することにしました。
</p>
<center>
<img src="htt... |
p01888 |
<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>Multisect</h2>
<p>
We are dev... |
p03765 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let us consider the following operations on a string consisting of <code>A</code> and <code>B</code>:</p>
<ol>
<li>Select a character in a string. If it is <code>A</code>, replace it with <code>BB</code... |
p01758 |
<p>
閉路のない連結な有向グラフが与えられる.(有向グラフが連結であるとは,これを無向グラフとした時に連結であるという事である.)
</p>
<p>
このグラフに対して一つの頂点を選んで首都 <var>s</var> を定めたい.
</p>
<p>
<var>T(v) =</var> "<var>v</var> から全ての点を到達可能にするために必要な「辺の反転」操作の回数の最小値"とする.
</p>
<p>
ただし,「辺の反転」とは,頂点 <var>v, u</var> に関して <var>(v, u)</var> に張られていた有向辺を削除して <var>(u, v)</var> に張り直すことである.
</p>... |
p02877 | <span class="lang-en">
<p>Score : <var>1400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a sequence of <var>N</var> integers <var>x_1,x_2,\cdots,x_N</var>.
Initially, all the elements are <var>0</var>.</p>
<p>He can do the following two kinds of operations any number of times in ... |
p03335 | <span class="lang-en">
<p>Score : <var>1500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi loves walking on a tree.
The tree where Takahashi walks has <var>N</var> vertices numbered <var>1</var> through <var>N</var>.
The <var>i</var>-th of the <var>N-1</var> edges connects Vertex <... |
p01308 |
<h1><font color="#000">Problem F:</font> 天使の階段</h1>
<p>
なつめの住んでいる街の上に浮かんでいる雲には、天使が住んでいる。その天使はなつめと同じくねこ好きで、しばしばねこと遊びに地上に降りてくる。地上に降りるために、天使は雲から地上へ繋がる長い長い階段を作った。しかし、毎回毎回ただ降りていくだけではつまらないと思った天使は、階段に細工をして、段を踏むと音が出るようにした。これを使って、音楽を奏でながら降りていくのだ。
</p>
<p>
音楽は12種類の音を使って奏でるものである。今回、音のオクターブは無視することにして、 C, C#, D, D#, E, F, F#, G... |
p00149 |
<H1>視力検査</H1>
<p>
視力検査の検査結果データを入力とし、下記の視力判定表に基づいて各判定に当てはまる人数を、左右の視力別に出力するプログラムを作成してください。
</p>
<center>
<table>
<tr><td width="80">判定</td><td>視力</td></tr>
<tr><td>A</td><td>1.1 以上</td></tr>
<tr><td>B</td><td>0.6 以上 1.1 未満</td></tr>
<tr><td>C</td><td>0.2 以上 0.6 未満</td></tr>
<tr><td>D</td><td>0.2 未満</td></tr>
</table... |
p02174 |
<h1>Problem M: Power Subsequences</h1>
<h2>Problem</h2>
<p>
添字が $1$ から始まり、長さが有限の数列を引数とする関数 $f$ を以下のように定義する。<br><br>
$\displaystyle f(\{a_1, a_2, \ldots, a_n\}) = \sum_{i=1}^n {a_i}^i$<br><br>
長さ $N$ の数列 $X = \{ x_1, x_2, \ldots, x_N \}$ が与えられるので、空の列を除く全ての部分列 $X'$ に対して $f(X')$ を求め、その総和を $998244353$ で割ったあまりを出力せよ。... |
p00519 |
<H1>問題 5: タクシー (Taxis)
</H1>
<br/>
<h2>問題</h2>
<p>
IOI 国は町 1 から町 N までの N 個の町からなり,町と町とは道路で結ばれている.IOI 国には K 本の道路があり,すべての道路は異なる 2 つの町を結んでいる.車は道路を双方向に自由に移動できるが,道路以外を通ってある町から別の町に行くことはできない.
</p>
<p>
IOI 国の町 1 に住む JOI 君は,町 N に住む祖母の家までタクシーで行くことにした.IOI 国にはタクシー会社 1 からタクシー会社 N までの N 個のタクシー会社がある.IOI 国のタクシー会社には次のような少々特殊な規則がある... |
p02031 | <h2>B: 括弧を語る数 / Parentheses Number</h2>
<h3>問題</h3>
<p>以下のように 正しい括弧列 を定めます。</p>
<ul>
<li> 空文字列は正しい括弧列である</li>
<li> 正しい括弧列 <var>S</var> に対して <code>(</code> <var>S</var> <code>)</code> は正しい括弧列である</li>
<li> 正しい括弧列 <var>S</var>, <var>T</var> に対して <var>ST</var> は正しい括弧列である</li>
</ul>
<p>ここで、正しい括弧列に対して以下のような規則で順列を対応付けます。<... |
p02461 | <h1>Map: Range Search</h1>
<p>
For a dictionary $M$ that stores elements formed by a pair of a string key and an integer value, perform a sequence of the following operations. Note that <u>each key in $M$ must be unique</u>.
</p>
<ul>
<li>insert($key$, $x$): Insert an element formed by a pair of $key$ and $x$ to ... |
p03620 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You have two strings <var>A = A_1 A_2 ... A_n</var> and <var>B = B_1 B_2 ... B_n</var> of the same length consisting of <var>0</var> and <var>1</var>.</p>
<p>You can transform <var>A</var> using the fo... |
p02932 | <span class="lang-en">
<p>Score: <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Find the number of sequences of <var>N</var> non-negative integers <var>A_1, A_2, ..., A_N</var> that satisfy the following conditions:</p>
<ul>
<li><var>L \leq A_1 + A_2 + ... + A_N \leq R</var></li>
... |
p02898 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p><var>N</var> friends of Takahashi has come to a theme park.</p>
<p>To ride the most popular roller coaster in the park, you must be at least <var>K</var> centimeters tall.</p>
<p>The <var>i</var>-th fr... |
p03270 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi throws <var>N</var> dice, each having <var>K</var> sides with all integers from <var>1</var> to <var>K</var>. The dice are NOT pairwise distinguishable.
For each <var>i=2,3,...,2K</var>, find ... |
p01563 |
<h1>Connect</h1>
<p>You are playing a solitaire puzzle called "Connect", which uses several letter tiles.
</p>
<p>There are <var>R × C</var> empty cells.
For each <var>i</var> <var>(1 ≤ i ≤ R)</var>, you must put a string <var>s<sub>i</sub></var> <var>(1 ≤ |s<sub>i</sub>| ≤ C)</var> in the ... |
p01099 |
<h3>Warp Drive</h3>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ICPCDomestic2016_G_airplane" width="30%" align="right">
<p>
The <b>warp drive</b> technology is reforming air travel, making the travel times drastically shorter.
Aircraft reaching above the <b>warp fields</b> built on the ground su... |
p01133 |
<h1><font color="#000000">Problem C:</font> Dragon Fantasy</h1>
<p>
永遠に続くと思われていた平和は突然終わりを告げた。 はるか昔に封印されていた魔王がついに復活を遂げたのである。 だが、今まさに世界が闇に覆われようとしているとき、1 人の勇者が現れた。 そしてその勇者は、世界各地に散らばっている伝説のクリスタルを集める旅に出た。 伝説によると、全てのクリスタルを集めることができたならば、どのような願いでもかなえられるという伝説の龍神を呼び出すことができると伝えられている。 その龍神の力を借りれば魔王を倒すことも可能なはずだ。
</p>
... |
p00372 | <H1>Party</H1>
<p>
The students in a class in Akabe high-school define the relation “acquaintance” as:
</p>
<ul>
<li>If A and B are friends, then A is acquainted with B.</li>
<li>If A and B are friends and B is acquainted with C, then A is acquainted with C.</li>
</ul>
<p>
They define the relation “companion” a... |
p00688 |
<h1>
Factorization of Quadratic Formula</h1>
<p>As the first step in algebra, students learn quadratic formulas and
their factorization. Often, the factorization is a severe burden
for them. A large number of students cannot master the factorization;
such students cannot be aware of the elegance of advanced algebra... |
p01830 |
<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>Delete Files</h2>
<p>
You are... |
p00722 |
<h1><font color="#000">Problem A:</font> Dirichlet's Theorem on Arithmetic Progressions</h1>
<p>
Good evening, contestants.
</p>
<p>
If <i>a</i> and <i>d</i> are relatively prime positive integers,
the arithmetic sequence beginning with <i>a</i>
and increasing by <i>d</i>, i.e.,
<i>a</i>,
<i>a</i> + <i>d</i>,
<i>a</... |
p00237 |
<H1>最後の扉</H1>
<p>
秘境の地"ナラマンダ地方"<br>
この奥深い洞窟に眠る黄金の伝説を求め、探検家ボブとマイクは様々な困難に立ち向かいました。ようやくたどり着いた最後の扉。この先には夢に見た黄金が待っています。
</p>
<p>
その扉には多数の三角形が描かれていました。試しにマイクがその 1 つに触れてみると、その三角形は光を放ちました。光は三角形の底辺から垂直に頂点方向へ長方形を描きながら伸びていき、その先にある別の三角形に触れました。すると、光に触れた三角形も同じように光を放ち、それを繰り返していきました。
</p>
<p>
扉の三角形は全て二等辺三角形(正三角形は含まない)で、どれも同じ... |
p01975 | <h1>B: 写像</h1>
<h2>問題</h2>
<p>
AORイカちゃんは集合 $S = \{a_1, ..., a_N\}$ と写像 $f: S→S$を作った。$f(a_i) = b_i$ である。
集合 $S$ の任意の要素 $x$ について、$g(f(x)) = h(f(x))$ を満たす全ての写像 $g, h: S→S$ が、$g(x) = h(x)$ を満たすかどうか判定し、満たさない場合は反例を一つ構成せよ。
</p>
<h2>制約</h2>
<ul>
<li>$1 \le N \le 10^5$</li>
<li>$1 \le a_i,b_i \le N$</li>
<li>$a_i \neq a_j \ ... |
p03948 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> towns located in a line, conveniently numbered <var>1</var> through <var>N</var>. Takahashi the merchant is going on a travel from town <var>1</var> to town <var>N</var>, buying a... |
p00667 |
<H1>Problem I: 11224111122411</H1>
<p>
腕が引っかかって抜けない。
</p>
<p>
机の裏に転がり込んでしまったものを拾おうとして、懐中電灯代わりに携帯の画面で照らしながら腕を挿し込んでみたが、うっかり何かに引っかかって抜けなくなってしまった。無理に動かすと痛い。
</p>
<p>
どうしよう。どうすれば脱出できるのだろう。大声で助けを呼ぶか。恥ずかしいので却下したいが、独力で脱出するのは難しそうだ。いや、声の届く範囲には誰もいなかったはずだ。焦る気持ちを押さえて辺りを見渡す。あのパソコンに手が届けばメールで助けを呼べるのだが、あいにく遠すぎる。やはり偶然誰かが通りかかるのを待つし... |
p01426 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Vector Compression</H1>
<p>
You are recording a result of a secret experiment, which consists of a large set of <var>N</var>-dimensional vectors.
Since the result may become very large, you are thinking of
compressing it. Fortunately you already have ... |
p01076 |
<h1>Problem E: Graph Making</h1>
<h2>Problem</h2>
<p>
どの頂点とも連結でない<var>n</var>個の頂点がある。<br>
各頂点間に無向辺を張っていく。<br>
直径が<var>d</var>になるようにしたとき、最大何本の辺を張ることができるか求めよ。<br>
<!--
直径とは各頂点と連結の頂点との最短距離のうち最大を表す。<br>
-->
直径とは、2つの頂点間の最短距離のうち最大のものを表す。<br>
ここで、最短距離は頂点間を移動するために必要な辺の数の最小値である。<br>
多重辺、自己ループは認めない。
</p>
<h2>Input</h2>
<pre... |
p02089 |
<h2>B: AddMulSubDiv</h2>
<h3>Problem Statement</h3>
<p>You have an array <var>A</var> of <var>N</var> integers. <var>A_i</var> denotes the <var>i</var>-th element of <var>A</var>.</p>
<p>You have to process one of the following queries <var>Q</var> times:</p>
<ul>
<li> Query 1: The query consists of non-negative i... |
p02573 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> persons called Person <var>1</var> through Person <var>N</var>.</p>
<p>You are given <var>M</var> facts that "Person <var>A_i</var> and Person <var>B_i</var> are friends." The sam... |
p02123 |
<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>Problem M: Fissure Puzzle... |
p03698 | <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> consisting of lowercase English letters. Determine whether all the characters in <var>S</var> are different.</p>
</section>
</div>
<div class="part">
<section>
<h3>Co... |
p03362 | <span class="lang-en">
<p>Score: <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Print a sequence <var>a_1, a_2, ..., a_N</var> whose length is <var>N</var> that satisfies the following conditions:</p>
<ul>
<li><var>a_i</var> <var>(1 \leq i \leq N)</var> is a prime number at most <v... |
p03732 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You have <var>N</var> items and a bag of strength <var>W</var>.
The <var>i</var>-th item has a weight of <var>w_i</var> and a value of <var>v_i</var>.</p>
<p>You will select some of the items and put th... |
p02820 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>At an arcade, Takahashi is playing a game called <em>RPS Battle</em>, which is played as follows:</p>
<ul>
<li>The player plays <var>N</var> rounds of Rock Paper Scissors against the machine. (See Notes... |
p03227 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a string <var>S</var> of length <var>2</var> or <var>3</var> consisting of lowercase English letters. If the length of the string is <var>2</var>, print it as is; if the length is <var>3</... |
p04018 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let <var>x</var> be a string of length at least <var>1</var>.
We will call <var>x</var> a <em>good</em> string, if for any string <var>y</var> and any integer <var>k (k \geq 2)</var>, the string obtaine... |
p03677 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is buying a lamp.
The light of the lamp can be adjusted to <var>m</var> levels of brightness, represented by integers from <var>1</var> through <var>m</var>, by the two buttons on the remote contr... |
p00958 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... |
p02965 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a sequence of <var>N</var> integers: <var>x=(x_0,x_1,\cdots,x_{N-1})</var>.
Initially, <var>x_i=0</var> for each <var>i</var> (<var>0 \leq i \leq N-1</var>).</p>
<p>Snuke will perform the follow... |
p02436 | <h1>Queue</h1>
<p>
Queue is a container of elements that are inserted and deleted according to FIFO (First In First Out).
</p>
<p>
For $n$ queues $Q_i$ ($i = 0, 1, ..., n-1$), perform a sequence of the following operations.
</p>
<ul>
<li>enqueue($t$, $x$): Insert an integer $x$ to $Q_t$.</li>
<li>front($t$): R... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.