question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p00725 |
<h1><font color="#000">Problem D:</font> Curling 2.0</h1><!-- end en only -->
<p>
On Planet MM-21, after their Olympic games this year, curling is getting popular.
But the rules are somewhat different from ours.
The game is played on an ice game board on which a square mesh is marked.
They use only a single stone.
T... |
p01564 |
<h1>Do use segment tree</h1>
<p>Given a tree with <var>n</var> <var>(1 ≤ n ≤ 200,000)</var> nodes and a list of <var>q</var> <var>(1 ≤ q ≤ 100,000)</var> queries,
process the queries in order and output a value for each output query.
The given tree is connected and each node on the tree has a weight <var>w... |
p03559 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>The season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he needs an altar, which consists of three parts, one in each of the th... |
p01134 |
<h1><font color="#000000">Problem D:</font> Area Separation</h1>
<p>
Mr. Yamada Springfield Tanaka は、国家区画整理事業局局長補佐代理という大任を任されていた。
現在、彼の国は大規模な区画整理の最中であり、この区画整理をスムーズに終わらせることができたならば彼の昇進は間違いなしであるとされている。
</p>
<p>
ところが、そんな彼の出世を快く思わない者も多くいるのだ。 そんな人間の 1 人に、Mr.Sato Seabreeze Suzuki がいた。
彼は、ことあるごとに Mr. Yam... |
p03109 | <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> as input. This represents a valid date in the year <var>2019</var> in the <code>yyyy/mm/dd</code> format. (For example, April <var>30</var>, <var>2019</var> is repres... |
p01421 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Reverse Roads</H1>
<p>
ICP city has an express company whose trucks run from the crossing <var>S</var> to the crossing <var>T</var>.
The president of the company is feeling upset because all the roads in the city are one-way, and are severely congested.
... |
p01071 |
<h1>Monochrome Tile</h1>
<h2>Problem</h2>
<p>
白い正方形のタイルが横方向に <var>W</var> 個、縦方向に <var>H</var> 個、合計 <var>W</var> × <var>H</var> 個敷き詰められている。
</p>
<p>
太郎君は、 <var>i</var> 日目の朝に、左から <var>ax<sub>i</sub></var> 番目で上から <var>ay<sub>i</sub></var> 番目のタイルを左上、
左から <var>bx<sub>i</sub></var> 番目で上から <var>by<sub>i</sub></... |
p00230 |
<H1>忍者のビル登り</H1>
<p>
忍者のあつしさんは、毎日朝早くから夜遅くまで忍者ビルの屋上から町を警備しています。この忍者ビルは、隣接する 2 つの同じ階数のビルであり、あつしさんは警備のために、ビルとビルの間をジャンプしながら屋上へ向かうことを日課としています。
</p>
<p>
この 2 つのビルは頻繁に清掃が行われるため、ビル登りの助けとなるはしごや障害となる滑りやすい部分があります。 しかも、はしごや滑りやすい部分の位置は毎日変わります。 そのためあつしさんは、屋上へ向かう方法を毎日考えなければいけません。<!--あつしさんは、何回のジャンプで屋上にたどり着けるでしょうか?-->
</p>
<... |
p01972 | <h2>F: 最短距離を伸ばすえびちゃん (Ebi-chan Lengthens Shortest Paths)</h2>
<h3>Problem</h3>
<p>
Ebi-chan loves directed graphs.
One day, a directed graph with <var>N</var> vertices and <var>M</var> edges dropped from somewhere in front of Ebi-chan!
The vertices and the edges of the graph is labeled with a number from <var>1</var>... |
p00660 |
<H1>Problem B: High & Low Cube</H1>
<p>
僕は近所の小学生たちと一緒に夏祭りに来ていた。有り体に言えば保護者役だが、出店の焼きそばやたこ焼きなんかが焼ける匂い、時折聞こえる打ち上げ花火の音などは、この歳になっても心が踊るものがある。が、好奇心旺盛な子供たちがはぐれないように、今日はしっかり見守っていないと。
</p>
<p>
子供たちはとある出店に興味を持ったようだった。覗き込んでみると、そこでは出店のおじさんとサイコロを使ったゲームをして、勝てば景品が貰えることになっていた。そのゲームは、 High & Low と呼ばれる単純なものだ。参加者とおじさんは1個ずつサイコロを振るが、その前... |
p02173 | <h1>Problem L: Space Travel</h1>
<h2>Story</h2>
<p>
遠い昔、はるかかなたの銀河系で。<br>
時は内乱の嵐が吹き荒れるさなか、凶悪な銀河帝国の軍勢が反乱軍の秘密基地を襲った。<br>
恐るべき帝国宇宙艦隊の追撃から逃れた、ウーク・スターウォーカーによって率いられる自由の戦士たちは、銀河の辺境に新たな秘密基地を築くことにした。<br>
反乱軍の一員であり、凄腕のプログラマーであるあなたにあたえられたミッションは、銀河系のそれぞれの惑星から最も離れた惑星を見つけることである。
</p>
<h2>Problem</h2>
<p>
銀河系には $N$ 個の惑星があり、$M$ 個の「橋」... |
p03298 | <span class="lang-en">
<p>Score : <var>600</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> consisting of lowercase English letters.</p>
<p>There are <var>2^{2N}</var> ways to color each character in <var>S</var> red or blue. Among th... |
p03762 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>On a two-dimensional plane, there are <var>m</var> lines drawn parallel to the <var>x</var> axis, and <var>n</var> lines drawn parallel to the <var>y</var> axis.
Among the lines parallel to the <var>x</... |
p02870 | <span class="lang-en">
<p>Score : <var>1400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In a two-dimensional plane, there is a square frame whose vertices are at coordinates <var>(0,0)</var>, <var>(N,0)</var>, <var>(0,N)</var>, and <var>(N,N)</var>.
The frame is made of mirror glass. A ra... |
p03332 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has a tower which is divided into <var>N</var> layers.
Initially, all the layers are uncolored. Takahashi is going to paint some of the layers in red, green or blue to make a beautiful tower.
... |
p03627 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> sticks with negligible thickness.
The length of the <var>i</var>-th stick is <var>A_i</var>.</p>
<p>Snuke wants to select four different sticks from these sticks and form a rectangl... |
p00908 |
<H1><font color="#000">Problem E: </font> Sliding Block Puzzle</H1>
<p>
In sliding block puzzles, we repeatedly slide pieces (blocks) to open spaces within a frame to establish a goal placement of pieces.
</p>
<p>
A puzzle creator has designed a new puzzle by combining the ideas of sliding block puzzles and mazes. T... |
p02935 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You have a pot and <var>N</var> ingredients. Each ingredient has a real number parameter called <em>value</em>, and the value of the <var>i</var>-th ingredient <var>(1 \leq i \leq N)</var> is <var>v_i</... |
p03277 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We will define the <strong>median</strong> of a sequence <var>b</var> of length <var>M</var>, as follows:</p>
<ul>
<li>Let <var>b'</var> be the sequence obtained by sorting <var>b</var> in non-decreasin... |
p04048 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
p02036 | <h2>G: Donuts Orientation</h2>
<h3>物語</h3>
<p>ほむちゃんの最近のマイブームはお菓子作りだ。たくさんお菓子を作っては、それを友達におすそ分けしているらしい。そんなほむちゃんは今回、ドーナツづくりに挑戦するようだ。</p>
<p>ドーナツづくりに大切なことはいくつもある。生地や味付けはもちろん、かわいい見た目にするためのデコレーションも外せない。試行錯誤を繰り返しているうちに、ほむちゃんのデコレーションへのこだわりに熱がこもってきたようだ。こだわりぬいたドーナツを多くの人に食べてもらいたいので、ほむちゃんはドーナツをたくさんつくりたいと考えている。</p>
<p>・・・ところで、こだ... |
p02466 | <h1>Set Symmetric Difference</h1>
<p>
Find the symmetric difference of two sets $A = \{a_0, a_1, ..., a_{n-1}\}$ and $B = \{b_0, b_1, ..., b_{m-1}\}$.
</p>
<h2>Input</h2>
<p>
The input is given in the following format.
</p>
<pre>
$n$
$a_0 \; a_1 \; ... \; a_{n-1}$
$m$
$b_0 \; b_1 \; ... \; b_{m-1}$
</pre>
<p>
... |
p01163 |
<H1><font color="#000">Problem A:</font> Space Coconut Crab II</H1>
<p>
A space hunter, Ken Marineblue traveled the universe, looking for the space coconut crab. The
space coconut crab was a crustacean known to be the largest in the universe. It was said that
the space coconut crab had a body of more than 400 meters ... |
p01499 |
<H1><font color="#000">Problem E: </font>Rabbit Game Playing</H1>
<p>
Honestly, a rabbit does not matter.
</p>
<p>
There is a rabbit playing a stage system action game. In this game, every stage has a difficulty level. The rabbit, which always needs challenges, basically wants to play more difficult stages than he h... |
p01533 |
<h1> Acrophobia</h1>
<h2> C: 高所恐怖症</h2>
<p>
高杉やよいは,超売れっ子アイドルである.
そんな彼女には,1つ苦手なものがある.
高いところだ・・・.彼女は,極度の高所恐怖症なのである.
彼女は今回,プロデューサーの不手際により,バラエティ番組で次のようなチャレンジに挑戦することになってしまった.
</p>
<p>
今回のロケは,とある忍者屋敷のとある一室で行われる.
この部屋の床には,正方形のタイルが敷き詰められており,いくつかのタイルが抜け落ちて穴になっている.
この穴から落ちると数メートル下の池にまっさかさまである.
やよいのチャレンジ内容は,この部屋の指定された場所からスタートし,... |
p01860 |
<!--<script language="JavaScript" type="text/javascript" src="js/varmath.js" charset="UTF-8"></script>-->
<h2>C: 買い出し - Shopping -</h2>
<h3>物語</h3>
<p>磯野の姉であるサゾエさんは,『あれ』や『あれ』で遊んでいる磯野と中島のために夕食を作ってあげることにしました.あいにく,冷蔵庫には食材が残り僅かしか無く,サゾエさんは買い出しに行くことにしました.幾つか食材を買おうとしているサゾエさんですが,大変陽気であるため一度に一品のみレジで会計してしまいます.このままでは遊んでいた磯野と... |
p00772 |
<h3>Rotate and Rewrite</h3>
<p>
Two sequences of integers
A: <i>A</i><sub>1</sub> <i>A</i><sub>2</sub> ... <i>A</i><sub><i>n</i></sub> and
B: <i>B</i><sub>1</sub> <i>B</i><sub>2</sub> ... <i>B</i><sub><i>m</i></sub> and
a set of <em>rewriting rules</em> of the form
"<i>x</i><sub>1</sub> <i>x</i><sub>2</sub> ... <... |
p00288 |
<h1>アルゴリズム検定試験</h1>
<p>
あなたはイズア地区におけるアルゴリズム検定試験を運営しており、運営費を最小にしたいと考えています。運営費は、会場使用料、バスの使用料、移動補助金の総和です。
</p>
<p>
今年は <var>N</var> 人の受験者登録があり、それぞれ <var>c<sub>i</sub></var> 人まで受け入れ可能な <var>M</var> 個の会場を確保しました。あなたは各受験者を必ずどこかの会場に割り当てなければなりません。1 人以上割り当てた会場については、人数にかかわらず <var>f<sub>i</sub></var> 円の会場使用料を支払う必要があります。
</p>
... |
p00322 |
<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>
足し算は筆算で簡単に計算できますが、もし、いくつかの... |
p01925 |
<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>
<h3>クイズ</h3>
<p>あなたはクイズ番組のディレ... |
p03918 | <span class="lang-en">
<p>Score : <var>2100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a board with an <var>N \times N</var> grid, and <var>N \times N</var> tiles.</p>
<p>Each side of a square that is part of the perimeter of the grid is attached with a socket.
That is, each si... |
p00637 |
<H1><font color="#000000">Problem A:</font> Citation Format</H1>
<p>
To write a research paper, you should definitely follow the structured format. This format, in many cases, is strictly defined, and students who try to write their papers have a hard time with it.
</p>
<p>
One of such formats is related to citation... |
p00267 |
<H1>寂しがり屋のついた嘘</H1>
<p>
パケットモンスターというゲームがあります。モンスターを捕まえ、育て、戦わせたり交換したりするゲームで、日本中で大流行しています。もちろん、わたしのクラスでも。だからわたしもこのゲームでみんなと遊べるようにモンスターを育てているけど、悲しいことに対戦する相手がいません。わたしは積極的に人に話しかけるのが得意なタイプではないからです。だから今日も、クラスメイトが誘ってくれるのを待ちながら、独り寂しくモンスターのレベルを上げています。
</p>
<p>
そしてついに、待ち望んでいた瞬間が訪れました。クラスメイトの一人が対戦しないかとわたしに話を持ちかけてきたのでした。彼女は自慢気に... |
p01026 | <h1>Problem K: Witch Craft Moves</h1>
<h2>Problem</h2>
<p>
会津魔法学校は、魔法を使える者が集る学校である。
会津魔法学校には1~<var>N</var>までの番号がついた教室と教室同士をつなぐ廊下がある。教室や廊下は何度でも通ることができる。また、会津魔法学校には任意の教室<var>u</var>,<var>v</var>間を0個以上の教室と廊下を一度ずつ通って移動することができるような経路がただ1つある。
各教室には魔法陣が設置してある。この魔方陣によって、教室に入る度に入った者の魔力が増減させられてしまうのだ。生徒の移動を助けるために以下の二つの質問に応えてほしい。
... |
p01476 |
<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... |
p01319 |
<h1><font color="#000">Problem F:</font> Canal: Water Going Up and Down</h1>
<!--
<h3><U>閘門式運河: 上下に動く水面</U></h3>
-->
<p>ACM国には中央を東西に流れる川がある.この川は西の隣国からACM国を通り東の隣国へと流れており,ACM国内の全長は <i>K</i> kmである.この川にいくつかの閘門を設置し,運河として利用することが計画されている.</p>
<p>閘門とは,異なる2つの水位間を船が移動するための仕組みである.閘門は上流側と下流側にそれぞれ水門を持ち,それらの間に閘室と呼ばれる小さな水域を持つ.この... |
p03324 | <span class="lang-en">
<p>Score: <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Today, the memorable AtCoder Beginner Contest 100 takes place. On this occasion, Takahashi would like to give an integer to Ringo.<br/>
As the name of the contest is AtCoder Beginner Contest 100, Ringo ... |
p02866 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is an integer sequence <var>D_1,...,D_N</var> of <var>N</var> elements. Find the number, modulo <var>998244353</var>, of trees with <var>N</var> vertices numbered <var>1</var> to <var>N</var> that... |
p01749 |
<p>
すぬけ君は,"<var>s</var> で<var>t</var> <var>t</var>" というダジャレを思いついたが,忘れてしまった.すぬけ君は以下のことを覚えている.
</p>
<ul>
<li> <var>s</var> の長さは <var>N</var> である.</li>
<li> <var>t</var> の長さは <var>M</var> である.</li>
<li> <var>t</var> は <var>s</var> の部分文字列である.(<var>s</var> の連続する <var>M</var> 文字で <var>t</var> と一致している部分が存在する.)</li>
</ul>
... |
p03774 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> students and <var>M</var> checkpoints on the <var>xy</var>-plane.<br/>
The coordinates of the <var>i</var>-th student <var>(1 \leq i \leq N)</var> is <var>(a_i,b_i)</var>, and the... |
p02535 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke likes integers that are greater than or equal to <var>A</var>, and less than or equal to <var>B</var>.
Takahashi likes integers that are greater than or equal to <var>C</var>, and less than or equ... |
p00508 |
<H1>問題 4</H1>
<br/>
<p>
平面上の n 個の点 P<sub>1</sub>, ..., P<sub>n</sub> が与えられたとき,
距離が最小の2点を求めたい.
</p>
<p>
入力ファイルの1行目には整数 n が書いてある.
2行目から n+1 行目のそれぞれには,
2つの正整数 x, y が1つの半角空白文字を区切りとして書いてある.
i+1 行目の x, y はそれぞれ P<sub>i</sub> の x 座標,
P<sub>i</sub> の y 座標である.
これら n 点の中から最も近い2点を選んだとき,
この2点間の距離の2乗を出力せよ.
</p>
<!--
<p>
た... |
p02165 | <h1>Problem D: Blaster</h1>
<h2>Problem</h2>
<p>
なんと、あなたは洞窟の中に閉じ込められてしまいました!<br>
壁が崩れたりでもしたのでしょうか、1つしかない出口にたどり着くまでには沢山の岩が邪魔をしています。<br>
<br>
しかしなんと、あなたのすぐ隣に爆弾の自動販売機があることに気がつきました。<br>
さらに、洞窟にはいくつかの「ブラスター」も落ちているようです。<br>
この2つの道具を活用すれば、出口まで脱出できそうです。<br>
</p>
<hr style="border:2px dotted #000000;">
<h4>アイテムの説明</h4>
<p>
洞窟内... |
p00158 |
<H1>コラッツの予想</H1>
<p>
正の整数 <var>n</var> に対し、
</p>
<ul>
<li><var>n</var> が偶数の時は 2 で割る。</li>
<li><var>n</var> が奇数の時は 3 倍し、1 を足す。</li>
</ul>
<p>
という操作を繰り返すと結果が 1 になります。任意の正の整数 <var>n</var> に対してこの操作を繰り返すと必ず 1 になるであろうというのが「コラッツの予想」と呼ばれる問題です。この問題は日本では、「角谷の問題」としても知られている未解決の問題です。コンピュータを利用して非常に大きな数 3 × 2<sup>53</sup>... |
p02470 |
<H1>Euler's Phi Function</H1>
<br/>
<p>
For given integer <var>n</var>, count the totatives of <var>n</var>, that is, the positive integers less than or equal to <var>n</var> that are relatively prime to <var>n</var>.
</p>
<H2>Input</H2>
<pre>
<var>n</var>
</pre>
<p>
An integer <var>n</var> (1 ≤ <var>n</var> &l... |
p02020 | <h2>F: 茶会 (Tea Party)</h2>
<p>ゆんさんは、会社でお茶会を開くことにした。</p>
<p>お店には $N$ セットのパンが売られていて、それぞれ $A_1, A_2, A_3, \dots, A_N$ 枚入っている。</p>
<p>ゆんさんは二つのパンを 1 組にしてをサンドウィッチを作ろうと考えた。</p>
<p>ゆんさんは几帳面なので、買ったパンが一枚も余らないようにしたい。</p>
<p>最大でいくつのサンドウィッチが作れるか計算せよ。</p>
<h3>入力</h3>
<p>1 行目には、整数 $N$ が与えられる。</p>
<p>2 行目には、$N$ 個の整数 $A_1, A_2, A_3, ... |
p02889 | <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> towns numbered <var>1</var> to <var>N</var> and <var>M</var> roads. The <var>i</var>-th road connects Town <var>A_i</var> and Town <var>B_i</var> bidirectionally and has a length ... |
p03261 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi is practicing <em>shiritori</em> alone again today.</p>
<p>Shiritori is a game as follows:</p>
<ul>
<li>In the first turn, a player announces any one word.</li>
<li>In the subsequent turns, a ... |
p02923 | <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> squares arranged in a row from left to right.</p>
<p>The height of the <var>i</var>-th square from the left is <var>H_i</var>.</p>
<p>You will land on a square of your choice, the... |
p03631 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a three-digit positive integer <var>N</var>.<br/>
Determine whether <var>N</var> is a <em>palindromic number</em>.<br/>
Here, a palindromic number is an integer that reads the same backwar... |
p00334 |
<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>
コンピュータグラフィクスでは、三次元の形状を... |
p02309 |
<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>Cross Points of Circles</H1>
<p>
For given... |
p00764 |
<h1>Chain-Confined Path</h1>
<!-- end en only -->
<!-- begin en only -->
<p>
There is a chain consisting of multiple circles on a plane.
The first (last) circle of the chain only intersects with the next (previous) circle,
and each intermediate circle intersects only with the two neighboring circles.
</p>
<!-- end e... |
p02759 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi wants to print a document with <var>N</var> pages double-sided, where two pages of data can be printed on one sheet of paper.</p>
<p>At least how many sheets of paper does he need?</p>
</secti... |
p01876 |
<h2>E: Arai's - Arai's -</h2>
<h3>問題</h3>
<p>スクールアイドル時代から、国民的人気を誇ってきた女性アイドルグループArai's。今では、たくさんの「あらい」さんが所属する大規模なグループとして、世界レベルで活躍している。そして今日、新たなるプロジェクトの始動が決定した。彼女たちは、小さなユニットをいくつか結成することで、さらなる売上の向上を試みることになったのである。</p>
<p>Arai'sには「荒井」さんが<var>A</var>人,「新井」さんが<var>B</var>人在籍しており、合計で<var>A+B</var>人の「あらい」さんからなる。新ユニットは、「荒井」さん... |
p03518 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a sequence <var>p</var>, which is a permutation of <var>(0,1,2, ...,N-1)</var>.
The <var>i</var>-th element (<var>0</var>-indexed) in <var>p</var> is <var>p_i</var>.</p>
<p>He can perform <var... |
p01525 |
<h1>F - Acceleration of Network</h1>
<p>
インターネットと言う広大な海は少しずつ黒く塗りつぶされていった。<br>
ボットの反乱、DDOS攻撃の嵐、ウィルスの蔓延、<br>
何度も何度も繰り返されたクラッカーとの戦争で、人もインターネットもボロボロになった。<br>
<br>
人の手では、インターネットはどうにもならない。<br>
だから人は、とんでもない時間をかけて<br>
インターネットを復旧できる「少女」を造った。<br>
<br>
少女は、インターネットの手当をはじめた。<br>
果てしなく広いインターネットの世界をどうにかしようと頑張った。<br>
<br>
まだ少女ひとり... |
p03148 | <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> pieces of sushi. Each piece has two parameters: "kind of topping" <var>t_i</var> and "deliciousness" <var>d_i</var>.
You are choosing <var>K</var> among these <var>N</var> pieces ... |
p01175 |
<H1><font color="#000">Problem E:</font> Optimal Rest</H1>
<p>
Music Macro Language (MML) is a language for textual representation of musical scores. Although there are various dialects of MML, all of them provide a set of commands to describe
scores, such as commands for notes, rests, octaves, volumes, and so forth.... |
p01460 | <script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Matrix Operation</H1>
<p>
You are a student looking for a job.
Today you had an employment examination for an IT company.
They asked you to write an efficient program to perform several operations.
First, they showed you an <var>N \times N</var> square... |
p01030 | <h1>Problem C: Changing Grids</h1>
<h2>Background</h2>
<p>
A君とB君は、『Changing Grids』というゲームに熱中している。このゲームは2人用で、プレイヤー1がステージを構成し、プレイヤー2がそのステージに挑戦しゴールを目指すというものである。
</p>
<p>
今、A君とB君はこのゲームを何度かプレイしているが、A君の連勝でB君は1度も勝つことができていない。そこであなたは、B君にこのゲームを攻略するためのヒントを教えてあげることにした。
</p>
<h2>Problem</h2>
<p>
時刻<var>T</var><sub>0</sub> = 0... |
p00271 |
<H1>気温の差</H1>
<p>
選手の皆さん、パソコン甲子園にようこそ。イベントに参加するには体調管理が大切です。気温が大きく変動する季節の変わり目には体に負担がかかり、風邪をひきやすいと言われています。一番気を付けなければいけない日は、最高気温と最低気温の差が最も大きい日です。1日の最高気温と最低気温が7日分与えられたとき、それぞれの日について最高気温から最低気温を引いた値を出力するプログラムを作成してください。
</p>
<h2>入力</h2>
<p>
入力データは以下の形式で与えられる。
</p>
<pre>
<var>a<sub>1</sub></var> <var>b<sub>1</sub></va... |
p01899 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath.js" charset="UTF-8"></script>
<h2>B: 山手線ゲーム - Yamanote-line Game -</h2>
<h3>豆(?)知識</h3>
<p>山手線は便利である。 なぜならば、130円払うだけで時間の許す限り何周でも乗っていられるからだ。ただし、切符で乗車する場合は、切符の有効時間に気をつけなければならない。... |
p00621 |
<H1><font color="#000000">Problem A:</font> Sleeping Cats </H1>
<p>
Jackは彼の住む家をとても気に入っていた. 彼の家の塀の上で毎日のように愛くるしいねこたちが昼寝をしているからだ. Jackはねこがとても好きだった.
</p>
<p>
Jackは, 夏休みの自由研究としてねこたちの観察日記を付けることにした. しばらく観察しているうちに, 彼はねこたちの面白い特徴に気付いた.
</p>
<p>
塀は W[尺] の幅があり, ここにねこたちは並んで昼寝をする. それぞれのねこたちは体の大きさが違うので, 昼寝に必要とする幅もまた異なる. 昼寝をしにきた... |
p01933 |
<!-- - - - - - 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>
<h... |
p02132 | <h1>Problem I: Explosion</h1>
<h2>Problem</h2>
<p>
大魔王めぐみんは地上に生存する$N$人の勇者を倒そうと考えている。<br>
めぐみんは$M$回まで爆発魔法を唱えることができる。<br>
爆発魔法は任意の座標を中心に半径$r$以内に存在している勇者を消滅させる魔法である。<br>
勇者はとても痩せているため大きさは考慮しなくてよい。<br>
$M$回の爆発魔法は全て同じ大きさの半径で唱えるものとする。<br>
勇者を全滅させるのに必要最小限の半径の魔法を使うことにした。<br>
爆発魔法の半径の大きさを最小化せよ。<br>
<h2>Input</h2>
<pre>
$N$ $... |
p02098 |
<h1>Problem A: The Mean of Angles</h1>
<h2>Problem</h2>
<p>
与えられた2つの角度<var>θ<sub>1</sub></var>,<var>θ<sub>2</sub></var> のちょうど間の角度を求めよ。ここで、ちょうど間の角度を、下図のように「<var>θ<sub>1</sub></var> + <var>t</var> = <var>θ<sub>2</sub></var> − <var>t</var> を満たす<var>t</var>のうち絶対値が最も小さいものを<var>t’</var>... |
p02562 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a grid of <var>N</var> rows and <var>M</var> columns. The square at the <var>i</var>-th row and <var>j</var>-th column will be denoted as <var>(i,j)</var>.
A nonnegative integer <var>A_{i,... |
p02831 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Takahashi is organizing a party.</p>
<p>At the party, each guest will receive one or more snack pieces.</p>
<p>Takahashi predicts that the number of guests at this party will be <var>A</var> or <var>B<... |
p03723 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi, Aoki and Snuke love cookies. They have <var>A</var>, <var>B</var> and <var>C</var> cookies, respectively. Now, they will exchange those cookies by repeating the action below:</p>
<ul>
<li>Eac... |
p03689 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given four integers: <var>H</var>, <var>W</var>, <var>h</var> and <var>w</var> (<var>1 ≤ h ≤ H</var>, <var>1 ≤ w ≤ W</var>).
Determine whether there exists a matrix such that all of the followin... |
p03373 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of ... |
p02974 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let us define the <em>oddness</em> of a permutation <var>p</var> = {<var>p_1,\ p_2,\ ...,\ p_n</var>} of {<var>1,\ 2,\ ...,\ n</var>} as <var>\sum_{i = 1}^n |i - p_i|</var>.</p>
<p>Find the number of pe... |
p00949 |
<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 D
Hidden Anagrams
</h2... |
p03666 | <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> squares in a row.
The leftmost square contains the integer <var>A</var>, and the rightmost contains the integer <var>B</var>. The other squares are empty.</p>
<p>Aohashi would lik... |
p03236 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><strong>Problem F and F2 are the same problem, but with different constraints and time limits.</strong></p>
<p>We have a board divided into <var>N</var> horizontal rows and <var>N</var> vertical column... |
p04009 | <span class="lang-en">
<p>Score : <var>1400</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.
The state of the cell at the <var>i</var>-th (<var>1≤i≤H</var>) row and <var>j</var>-th (<var>1≤j≤W</var>) column is represented by a let... |
p02077 | <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: ... |
p02427 | <h1>Enumeration of Subsets I</h1>
<p>
Print all subsets of a set $S$, which contains $0, 1, ... n-1$ as elements. Note that we represent $0, 1, ... n-1$ as 00...0001, 00...0010, 00...0100, ..., 10...0000 in binary respectively and the integer representation of a subset is calculated by bitwise OR of existing elements... |
p01122 | <!--<h2>Problem F</h2>-->
<!-- begin en only -->
<h3>Flipping Colors</h3>
<!-- end en only -->
<!-- begin en only -->
<p>
You are given an undirected complete graph.
Every pair of the nodes in the graph is connected by an edge,
colored either red or black.
Each edge is associated with an integer value called <em>pen... |
p01572 |
<H1><font color="#000">Problem B:</font> Artistic Art Museum</H1>
<p>
Mr. Knight is a chief architect of the project to build a new art museum. One day, he was struggling to determine the design of the building. He believed that a brilliant art museum must have an artistic building, so he started to search for a good... |
p01088 |
<h2>500-yen Saving</h2>
<p>
"500-yen Saving" is one of Japanese famous methods to save money. The
method is quite simple; whenever you receive a 500-yen coin in your
change of shopping, put the coin to your 500-yen saving box.
Typically, you will find more than one million yen in your saving box
in ten years.
</p>
... |
p00733 |
<h1><font color="#000000">Problem F: </font>Dr. Podboq or: How We Became Asymmetric</h1>
<p>
After long studying how embryos of organisms become asymmetric during
their development, Dr. Podboq, a famous biologist, has reached his new
hypothesis. Dr. Podboq is now preparing a poster for the coming
academic conferenc... |
p01821 |
<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 D:
Identity Function... |
p00363 | <!--<H1>Let’s Make a Flag</H1>-->
<h1>Flag</h1>
<p>
AHK Education, the educational program section of Aizu Broadcasting Cooperation, broadcasts a children’s workshop program called "Let's Play and Make." Today’s theme is "Make your own flag." A child writes his first initial in the center of their rectangular flag.
... |
p00699 |
<H1>
Nets of Dice
</H1>
<P>
In mathematics, some plain words have special meanings.
The word "<I>net</I>" is one of such technical terms.
In mathematics, the word "<I>net</I>" is sometimes used to
mean a plane shape
which can be folded into some solid shape.
</P>
<P>
The following are a solid shape (Figure 1) and... |
p00676 |
<h1>KND is So Sexy</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼の胸元はとてもセクシーなことで知られている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ACPC2012Day3_A">
</center>
<br/>
<p>
簡単のために胸元から見える肌の部分を図にある二等辺三角形ABCで表す。しかし服にはたるみが生じているため、長さが等しい2辺AC,BC(これらの長さを<var>l</var>とする)には実際にはさらに長さ<var>x</v... |
p03959 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Mountaineers Mr. Takahashi and Mr. Aoki recently trekked across a certain famous mountain range.
The mountain range consists of <var>N</var> mountains, extending from west to east in a straight line as ... |
p01964 |
<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... |
p00226 |
<H1>ヒットアンドブロー</H1>
<p>
太郎君と花子さんはヒットアンドブローで遊ぶことにしました。ヒットアンドブローのルールは、以下の通りです。
</p>
<ul>
<li> 出題者と回答者に分かれて行う。</li>
<li> 出題者は、重複した数を含まない 4 桁の数字(正解)を決める。</li>
<li> 回答者は、その 4 桁の数字(回答)を言い当てる。</li>
<li> 回答に対して、出題者はヒットとブローの数でヒントを与える。</li>
<li> 回答と正解を比べて、数と桁位置の両方が同じであることをヒットと呼び、数だけが同じで桁位置が異なることをブローと呼ぶ。たとえば、正解が 1... |
p01067 |
<h1>Circles and Ray</h1>
<h2>Problem</h2>
<p>
2次元平面上にそれぞれ互いに共通部分をもたない <var>N</var> 個の円が与えられる。
また、円にはそれぞれ1から <var>N</var> までの番号が割り振られている。
</p>
<p>
あなたは、端点が1番目の円の円周上にあるような半直線を任意の数だけ設置することができる。
どの円も1本以上の半直線との共通部分を持っているようにするためには、最低何本の半直線を設置しなければならないかを求めなさい。
</p>
<h2>Input</h2>
<p>
入力は以下の形式で与えられる。
</p>
<pre>
<var>N</... |
p01437 |
<H1><font color="#000">Problem A:</font>Infnity Maze</H1>
<p>
Dr. Fukuoka has placed a simple robot in a two-dimensional maze. It moves within the maze and never goes out of the maze as there is no exit.
</p>
<p>
The maze is made up of <i>H</i> × <i>W</i> grid cells as depicted below. The upper side of the maz... |
p00932 |
<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 I:
Sweet War
</h2>
<p>... |
p01620 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<!-- begin en only -->
<!--<h3><u>King's Inspection</u></h3>-->
<!-- end en only -->
<!-- begin ja only -->
<h1><u>王様の視察</u></h1>
<!-- end ja only -->
<!-- begin en only -->
<!--
<p>
English text is not available in this practice contest.
</p>
-->
<!-- end en... |
p01270 |
<h1><font color="#000">Problem D:</font> Restrictive Filesystem</h1>
<p>
あなたは新型記録媒体の開発チームに所属するプログラマーである.この記録媒体はデータの読み込み及び消去はランダムアクセスが可能である.一方,データを書き込むときは,常に先頭から順番にアクセスしていき,最初に見つかった空き領域にしか書き込むことができない.
</p>
<p>
あなたはこの記録媒体用のファイルシステムの構築を始めた.このファイルシステムでは,記録媒体の制限から,データは先頭の空き領域から順に書き込まれる.書き込みの途中で別のデータが存在する領域に至った場合は,残りのデータを... |
p00898 |
<H1><font color="#000">Problem E: </font>Driving an Icosahedral Rover</H1>
<p>
After decades of fruitless efforts, one of the expedition teams of ITO (Intersolar Tourism Organization) finally found a planet that would surely provide one of the best tourist attractions
within a ten light-year radius from our solar sys... |
p00031 |
<H1>Weight</H1>
<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_weight"></center>
<br/>
<p>
祖母が天秤を使っています。天秤は、二つの皿の両方に同じ目方のものを載せると釣合い、そうでない場合には、重い方に傾きます。10 個の分銅の重さは、軽い順に 1g, 2g, 4g, 8g, 16g, 32g, 64g, 128g, 256g, 512g です。
</p>
<p>
祖母は、「1kg くらいまでグラム単位で量れるのよ。」と言います。「じゃあ、試しに、ここにあるジュースの重さを量ってよ」... |
p00461 |
<H1> IOIOI </H1>
<h2>問題</h2>
<p>
整数 <i>n</i> (1 ≤ <i>n</i>) に対し, <i>n</i> + 1 個の <span>I</span> と <i>n</i> 個の <span>O</span> を <span>I</span> から始めて交互に並べてできる文字列を <i>P<sub>n</sub></I> とする.ここで <span>I</span> と <span>O</span> はそれぞれ英大文字のアイとオーである.
</p>
<br><center>
<table>
<tr><td width="40"><i>P</i><sub>1</sub></t... |
p02149 | <h1>Problem A: Lunch</h1>
<h2>Problem</h2>
<p>
ある日、川林くんは学食で昼食を食べようとしています。
学食にはAランチ、Bランチ、Cランチの3種類の日替わりのランチメニューがあります。<br>
川林くんは食いしん坊なので3種類の日替わりのランチメニューをすべて1つずつ食べたいと思っています。<br>
しかし、川林くんは健康に気を使って摂取するカロリーの合計が最小になるように1種類のランチメニューを我慢し、異なる2種類のランチメニューを食べることにしました。<br>
ある日のAランチ、Bランチ、Cランチのカロリーが与えられた時、川林くんが我慢することになるランチメニュ... |
p00174 |
<H1>バドミントン</H1>
<p>
A君、Bさん、C君で久しぶりに遊ぶことになりました。 A君とBさんがプレイヤー、C君が審判になりバドミントンのシングルスのゲームをしました。3人で決めたルールは以下の通りです。
</p>
<ul>
<li>3 ゲームを行います。</li>
<li>11 点を先取した人が、そのゲームの勝者となります。</li>
<li>第 1 ゲームの最初のサーブはA君から始まりますが、次のサーブは直前のポイントを取った人が行います。</li>
<li>第 2 ゲーム、第 3 ゲームは前のゲームを取った人が最初のサーブを行います。</li>
<li>10 - 10 になって以降は 2 点差をつけた人... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.