question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p01946 |
<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... |
p00654 |
<H1>Problem H: Squid Multiplication</H2>
<p>
Squid Eiko loves mathematics.
Especially she loves to think about integer.
One day, Eiko found a math problem from a website.
</p>
<p>
"A sequence <i>b</i> ={<i>a<sub>i</sub></i> + <i>a<sub>j</sub></i> | <i>i</i> < <i>j</i> } is generated from a sequence <i>a</i> ={<i>a... |
p02669 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You start with the number <var>0</var> and you want to reach the number <var>N</var>.</p>
<p>You can change the number, paying a certain amount of coins, with the following operations:</p>
<ul>
<li>Mult... |
p00204 |
<h1>UFO 撃墜作戦</h1>
<p>
40XX 年、地球は宇宙人の侵攻を受けていた!すでに地球のほとんどは宇宙人により制圧されており、残る防衛拠点は鶴ヶ城要塞のみになってしまった。その鶴ヶ城要塞にも、制圧部隊が次々に迫ってきている。<!--3 時間後には最初の戦闘が始まるだろう。このままでは地球最後の砦も制圧されてしまう。-->
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_ufo">
</center>
<br>
<p>
しかし、希望は残されている。防衛軍の最終兵器、超長距離貫通レーザー砲が完成... |
p02239 |
<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>Breadth First Search</H1>
... |
p02147 | <h1>Problem K: A Polygon And Circles</h1>
<h2>Problem</h2>
<p>$N$個の頂点からなる凸多角形と$M$個の円の中心座標が与えられる。すべての円の半径は$r$である。</p>
<p>以下の条件を満たす最小の実数$r$を求めたい。</p>
<p>条件: 凸多角形の内部のどの点も、少なくとも一つ以上の円に内包されている。</p>
<p></p>
<h2>Input</h2>
<p>入力は以下の形式ですべて整数で与えられる。</p>
<pre>
$N$
$px_1$ $py_1$
$px_2$ $py_2$
:
$px_N$ $py_N$
$M$
$cx_1$ $cy_1$
$... |
p00480 |
<H1>1年生 (A First Grader)</H1>
<h2>問題</h2>
<p>
JOI君は小学 1 年生である.JOI君は教わったばかりの足し算,引き算がとても好きで,数字が並んでいるのを見ると最後の 2 つの数字の間に「=」を入れ,残りの数字の間に必ず「+」または「-」を入れて等式を作って遊んでいる.例えば「8 3 2 4 8 7 2 4 0 8 8」から,等式「8+3-2-4+8-7-2-4-0+8=8」を作ることができる.
</p>
<p>
JOI 君は等式を作った後,それが正しい等式になっているかを計算して確かめる.ただし,JOI君はまだ負の数は知らないし,20 を超える数の計算はできない.したがって... |
p03306 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Kenkoooo found a simple connected graph.
The vertices are numbered <var>1</var> through <var>n</var>.
The <var>i</var>-th edge connects Vertex <var>u_i</var> and <var>v_i</var>, and has a fixed integer ... |
p03756 | <span class="lang-en lang-child hidden-lang">
<div class="part">
Max Score: <var>1150</var> Points <br/>
<font color="red">Task statement was updated.</font>
<section>
<h3>Problem Statement</h3>
There is a grid which size is $H \times W$. the upper-left cell is $(1,1)$ and the lower-right cell is $(H,W)$.<br/>... |
p02844 | <span class="lang-en">
<p>Score: <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>AtCoder Inc. has decided to lock the door of its office with a <var>3</var>-digit PIN code.</p>
<p>The company has an <var>N</var>-digit lucky number, <var>S</var>. Takahashi, the president, will erase ... |
p00879 |
<H1><font color="#000">Problem F:</font> Chemist's Math</H1>
<p>
You have probably learnt chemical equations (chemical reaction formulae) in your high-school
days. The following are some well-known equations.
</p>
<pre><font face="Times New Roman">
2H<sub>2</sub> + O<sub>2</s... |
p01291 | <H1><font color="#000">Problem I:</font> Wind Passages</H1>
<p>
Wind Corridor is a covered passageway where strong wind is always blowing. It is a long corridor of
width W, and there are several pillars in it. Each pillar is a right prism and its face is a polygon (not
necessarily convex).
</p>
<p>
In this problem, we... |
p01784 |
<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>E - Parentheses</h2>
<h3>Probl... |
p00896 |
<H1><font color="#000">Problem C: </font>Weaker than Planned </H1>
<p>
The committee members of the Kitoshima programming contest had decided to use crypto-graphic software for their secret communication. They had asked a company, Kodai Software,
to develop cryptographic software that employed a cipher based on highl... |
p03243 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Kurohashi has never participated in AtCoder Beginner Contest (ABC).</p>
<p>The next ABC to be held is ABC <var>N</var> (the <var>N</var>-th ABC ever held).
Kurohashi wants to make his debut in some ABC ... |
p03613 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given an integer sequence of length <var>N</var>, <var>a_1,a_2,...,a_N</var>.</p>
<p>For each <var>1≤i≤N</var>, you have three choices: add <var>1</var> to <var>a_i</var>, subtract <var>1</var> ... |
p02901 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> locked treasure boxes, numbered <var>1</var> to <var>N</var>.</p>
<p>A shop sells <var>M</var> keys. The <var>i</var>-th key is sold for <var>a_i</var> yen (the currency of Japan), ... |
p00195 |
<h1>人気の出店は?</h1>
<table>
<tr>
<td valign="top" style="vertical-align:top">
<p>
会津若松市では、毎年1月10日に「十日市」という初市があります。この十日市は、約600年の歴史があり会津地方最大の初市です。会津地方ではお馴染みの縁起物である、起き上がり小法師(おきあがりこぼし)が売られていることでもよく知られています。起き上がり小法師は、大きさ3cm 程度の重心が底にある張り子で、転がしてもすぐに起きあがることからこの名前が付きました。各家庭では、必ず家族より一個多く買って神棚に供えます。この一個は、 「家族が増えるように」や「厄を背負ってくれる」... |
p02452 | <h1>Includes</h1>
<p>
For given two sequneces $A = \{a_0, a_1, ..., a_{n-1}\}$ and $B = \{b_0, b_1, ..., b_{m-1}\}$, determine whether all elements of $B$ are included in $A$. Note that, elements of $A$ and $B$ are sorted by ascending order respectively.
</p>
<h2>Input</h2>
<p>
The input is given in the followi... |
p02002 | <h1>G: 式の切り取り</h1>
<h2>問題</h2>
<p>
長さ $N$ の数式 $S$ が与えられる。
数式は、以下の BNF で示される形式になっている。
</p>
<pre>
<expr> ::= <number> | <expr> <op> <expr> <br>
<op> ::= ‘^’ | ‘&’ | ‘|’ <br>
</pre>
<p>
<number> は、 $0$ 以上 $2^{31}-1$ 以下の整数を表す。
</p>
<p>
演算子、’^’ ‘&’ ‘|’ は、それぞれ排他的論理和、論理... |
p01507 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Dungeon Creation</H1>
<p>
The king demon is waiting in his dungeon to defeat a brave man.
His dungeon consists of <var>H \times W</var> grids.
Each cell is connected to four (i.e. north, south, east and west) neighboring cells and some cells are occupied... |
p03490 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>A robot is put at the origin in a two-dimensional plane.
Initially, the robot is facing in the positive <var>x</var>-axis direction.</p>
<p>This robot will be given an instruction sequence <var>s</var>.... |
p01157 |
<H1><font color="#000">Problem C:</font> Online Quizu System</H1>
<p>
ICPC (Internet Contents Providing Company) is working on a killer game named Quiz Millionaire Attack.
It is a quiz system played over the Internet. You are joining ICPC as an engineer, and you are responsible
for designing a protocol between client... |
p00316 |
<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>
A 高校の生徒会長である明は、A 高校の生徒がどの... |
p02281 |
<H1>Tree Walk</H1>
<p>
Binary trees are defined recursively. A binary tree <i>T</i> is a structure defined on a finite set of nodes that either
</p>
<ul>
<li>contains no nodes, or</li>
<li>is composed of three disjoint sets of nodes:<br>
- a root node.<br>
- a binary tree called its left subtree.<br>
- a binary ... |
p03869 | <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>Snuke received a triangle as a birthday present.
The coordinates of the three vertices were <var>(x_1, y_1)</var>, <var>(x_2, y_2)<... |
p01854 |
<h1 id="c-壺-pot">C : 壺 / Pots</h1>
<h2 id="問題文">問題文</h2>
<p>ここに <var>N</var> 個の不思議な形の壺がある. <var>i</var> 番目の壺は <var>K_i</var> 個の直円柱を下から順に鉛直に繋げた形状である. 繋がっている順番は変えることができない. A 氏は体積 <var>M</var> の水を持っている. この水をそれぞれの壺に好きな量ずつに分けて注ぐ. 水が全く入っていない壺が存在しても構わない. また,全ての壺が水で満たされたとき,それ以上水を注ぐ事はできない.それぞれの壺の水面の高さの総和の最大値を求めよ.</p>
<h2 id... |
p00746 |
<h1><font color="#000000">Problem A:</font> Pablo Squarson's Headache</h1>
<!-- begin en only -->
<p>Pablo Squarson is a well-known cubism artist. This year's theme for Pablo Squarson is "Squares". Today we are visiting his studio to see how his masterpieces are given birth.</p>
<!-- end en only -->
<!-- begin... |
p00253 |
<H1></H1>
<p>
家庭菜園に野菜を植えることにしました。n 粒の種があったので1日に1粒ずつ、n 日かけて n 粒の種をまきました。どの種からも芽が出て、すくすくと育っています。収穫の時期が待ち遠しいものです。
</p>
<p>
ある日、いつものように苗に水やりをしていると、おかしなことに気づきました。n 本の野菜の苗があるはずなのに、1本多いのです。雑草が生えてきてしまいました。直ちに引っこ抜きたいのですが、困ったことにどの苗もよく似ていて、野菜と雑草の見分けがつきません。
</p>
<p>
手がかりになるのは、野菜の成長速度です。この野菜は、種をまいてからずっと、1日に決まった長さだけ伸び続けるのです。しか... |
p03886 | <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>Construct an <var>N</var>-gon that satisfies the following conditions:</p>
<ul>
<li>The polygon is simple (see notes for the defin... |
p02794 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>We have a tree with <var>N</var> vertices numbered <var>1</var> to <var>N</var>.
The <var>i</var>-th edge in this tree connects Vertex <var>a_i</var> and Vertex <var>b_i</var>.<br/>
Consider painting e... |
p01911 |
<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: 雨降りバス乗り換え</h1>
<h2>背景</h2>
<p>
今日は AOR イカちゃんにとって初となるデートの日... |
p00603 |
<H1><font color="#000000">Problem I:</font> Riffle Shuffle</H1>
<p>
There are a number of ways to shuffle a deck of cards. Riffle shuffle is one such example. The following is how to perform riffle shuffle.
</p>
<p>
There is a deck of <i>n</i> cards. First, we divide it into two decks; deck A which consists of t... |
p01442 |
<H1><font color="#000">Problem F:</font> Mysterious Maze</H1>
<p>
A robot in a two-dimensional maze again. The maze has an entrance and an exit this time, though.
</p>
<p>
Just as in the previous problem, the maze is made up of <i>H</i> × <i>W</i> grid cells, its upper side faces north, and each cell is either... |
p03185 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> stones, numbered <var>1, 2, \ldots, N</var>.
For each <var>i</var> (<var>1 \leq i \leq N</var>), the height of Stone <var>i</var> is <var>h_i</var>.
Here, <var>h_1 < h_2 < \... |
p01012 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<h1>Planarian Regeneration</h1>
<h2>Problem</h2>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_ACPC2013Aizu_aizuicpc_planarian" width="250"><br/>
<p>
皆さん、「プラナリア」って知っていますか?<br/>
プラナリアとは、日本では川の上流の石や枯葉などの裏に張り付いて生息している水生生物です。<br/>
プラナリアの最も優れた能... |
p04007 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke and Ciel went to a strange stationery store. Each of them got a transparent graph paper with <var>H</var> rows and <var>W</var> columns.</p>
<p>Snuke painted some of the cells red in his paper. He... |
p01205 |
<H1><font color="#000">Problem D:</font> Goofy Converter</H1>
<p>
Nathan O. Davis is a student at the department of integrated systems. He is now taking a class in in-
tegrated curcuits. He is an idiot. One day, he got an assignment as follows: design a logic circuit that
takes a sequence of positive integers as inpu... |
p03238 | <span class="lang-en">
<p>Score: <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>In <var>2020</var>, AtCoder Inc. with an annual sales of more than one billion yen (the currency of Japan) has started a business in programming education.<br/>
One day, there was an exam where a one-y... |
p03392 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a string <var>S</var> consisting of <code>a</code>,<code>b</code> and <code>c</code>. Find the number of strings that can be possibly obtained by repeatedly performing the following operat... |
p01655 |
<h2>Problem Statement</h2>
<p>
You bought 3 ancient scrolls from a magician. These scrolls have a long string, and the lengths of the strings are the same. He said that these scrolls are copies of the key string to enter a dungeon with a secret treasure.
However, he also said, they were copied so many times by hand, ... |
p03668 | <span class="lang-en">
<p>Score : <var>1100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a tree with <var>N</var> vertices numbered <var>1, 2, ..., N</var>.
The edges of the tree are denoted by <var>(x_i, y_i)</var>.</p>
<p>On this tree, Alice and Bob play a game against each othe... |
p00947 |
<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 B
Quality of Check Dig... |
p02429 | <h1>Enumeration of Subsets III</h1>
<p>
You are given a set $T$, which is a subset of $S$. The set $S$ consists of $0, 1, ... n-1$.
Print all subsets of $T$.
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 s... |
p00414 | <h1>へびの脱皮</h1>
<p>
セアブリ高原で発見された新種のへびは、頭から尾にかけて1列に並んだマル(o)とバツ(x)からなる模様が特徴です。下図に例を示しますが、へびの模様は個体により様々です。
</p>
<pre>
xxoooxxxoox
</pre>
<p>
このへびは脱皮のときに、2つのマルが並んだ部分の間すべてが伸びることで成長します。新たに加わった箇所にはマル、バツ、マルが並んだ模様が付きます。
</p>
<p>
たとえば、長さ3のへび<span>ooo</span>が1回脱皮すると、左から1番目と2番目、2番目と3番目のマルの間にマル、バツ、マルが並んだ模様が加わるので、脱皮後のへびは<span>ooxo... |
p02583 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have sticks numbered <var>1, \cdots, N</var>. The length of Stick <var>i</var> <var>(1 \leq i \leq N)</var> is <var>L_i</var>.</p>
<p>In how many ways can we choose three of the sticks with different... |
p02079 | <h1>B: Spent Fuel Disposal</h1>
<h2>問題文</h2>
<p>$N$ 個の下水処理施設が $M$ 本のパイプで繋がっており、$i$ 番目のパイプは $u_i$ 番目と $v_i$ 番目の施設を繋いでいます。
パイプは全て、毎秒最大 $1$ リットルの液体を流すことができます、 </p>
<p>今、$S$ 番目の施設から $T$ 番目の施設へ工業廃水を、 $U$ 番目の施設から $V$ 番目の施設へ純水を流したいです。$S$ 番目および $U$ 番目の施設は、それぞれ工業廃水および純水を十分な量有しており、パイプで繋がっている別の施設へこれらの液体を好きに送ることができます。
また、各施設では、送ら... |
p00044 |
<H1>素数 II</H1>
<p>
素数というのは、1 よりも大きくそれ自身か 1 でしか割りきれない整数をいいます。例えば、2 は、2 と 1 でしか割り切れないので素数ですが、12 は、12 と 1 のほかに、2, 3, 4, 6 で割りきれる数なので素数ではありません。
</p>
<p>
整数 <var>n</var> を入力したとき、<var>n</var> より小さい素数のうち最も大きいものと、<var>n</var> より大きい素数のうち最も小さいものを出力するプログラムを作成してください。
</p>
<H2>Input</H2>
<p>
複数のデータセットが与えられます。各データセットに <var>n... |
p00551 |
<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>縄張り(Territory)</h2>
<p>
あなたは南北方向にとても長く伸びた... |
p02096 |
<h2>I: Add</h2>
<h3>Problem Statement</h3>
<p>Mr. T has had an integer sequence of <var>N</var> elements <var>a_1, a_2, ... , a_N</var> and an integer <var>K</var>. Mr. T has created <var>N</var> integer sequences <var>B_1, B_2, ... , B_N</var> such that <var>B_i</var> has <var>i</var> elements.</p>
<ul>
<li> <var>B... |
p00101 |
<H1>Aizu PR</H1>
<p>
An English booklet has been created for publicizing Aizu to the world.
When you read it carefully, you found a misnomer (an error in writing) on the last name of Masayuki Hoshina, the lord of the Aizu domain. The booklet says "Hoshino" not "Hoshina".
</p>
<p>
Your task is to write a program whic... |
p01340 |
<H1><font color="#000">Problem B: </font> Kaeru Jump</H1>
<p>
There is a frog living in a big pond. He loves jumping between lotus leaves floating on the pond. Interestingly, these leaves have strange habits. First, a leaf will sink into the water after the frog jumps from it. Second, they are aligned regularly as if... |
p03687 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke can change a string <var>t</var> of length <var>N</var> into a string <var>t'</var> of length <var>N - 1</var> under the following rule:</p>
<ul>
<li>For each <var>i</var> (<var>1 ≤ i ≤ N - 1</var... |
p02995 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given four integers <var>A</var>, <var>B</var>, <var>C</var>, and <var>D</var>. Find the number of integers between <var>A</var> and <var>B</var> (inclusive) that can be evenly divided by neithe... |
p01710 |
<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... |
p00802 |
<H1><font color="#000">Problem G:</font> Telescope</H1>
<p>
Dr. Extreme experimentally made an extremely precise telescope to investigate extremely curi- ous phenomena at an extremely distant place. In order to make the telescope so precise as to investigate phenomena at such an extremely distant place, even quite a ... |
p00228 |
<H1>7 セグメント</H1>
<p>
電卓などでよく目にするデジタル数字を表示している画面は、デジタル数字が 7 つの部分(セグメン
ト)で構成されることから、「7セグメントディスプレイ」と呼ばれています。
</p>
<p>
ワカマツ社で新しく売り出す予定の製品は、<!--デジタル数字の表示が必須のため、-->7セグメントディスプレイを製品に組み込むことになり、社員であるあなたは、与えられた数字を 7 セグメントディスプレイに表示するプログラムを作成することになりました。
</p>
<p>
この7セグメントディスプレイは、次の切り替えの指示が送られてくるまで表示状態は変わりません。7 ビットからなるシグナルを... |
p02215 | <span class="lang">
<span class="lang-ja">
<h1>D: Xor Array</h1>
<div class="part">
<section>
<h3>問題文</h3><p>整数 $N$ と $X$ が与えられます。
以下の条件を満たす長さ $N$ の数列の個数を $998244353$ で割った余りを求めてください。</p>
<ul>
<li>数列は広義単調増加である。</li>
<li>数列の各要素は $0$ 以上 $X$ 以下である。</li>
<li>全ての要素の排他的論理和(xor)が $X$ である。</li>
</ul>
</section>
</div>
<div cl... |
p03957 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>This contest is <code>CODEFESTIVAL</code>, which can be shortened to the string <code>CF</code> by deleting some characters. </p>
<p>Mr. Takahashi, full of curiosity, wondered if he could obtain <code>... |
p00678 |
<h1>KND Runs for Sweets</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼は甘党であることで知られている。彼はとある市に1年間滞在することになり、その期間中に市内にある<var> N </var>箇所の甘味処をすべて回りたいと思っている。なのでこの1年間の住む場所は甘味処を回るのに一番適した場所がいいと考えている。彼の隣人であるあなたは、各甘味処への最悪の移動時間が最小になる場所を探す事になった。この甘味処がある市は簡単のため二次元平面で表すことにする。彼は目的の甘味処へのモチベーションの違いにより、単位時間あたりの移動距離が変化する。また、彼はどんな... |
p02645 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>When you asked some guy in your class his name, he called himself <var>S</var>, where <var>S</var> is a string of length between <var>3</var> and <var>20</var> (inclusive) consisting of lowercase Englis... |
p00382 | <h1>Taxi</h1>
<p>
PCK Taxi in Aizu city, owned by PCK company, has adopted a unique billing system: the user can decide the taxi fare. Today as usual, many people are waiting in a queue at the taxi stand in front of the station.
</p>
<p>
In front of the station, there are $N$ parking spaces in row for PCK taxis, e... |
p03404 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given two integers <var>A</var> and <var>B</var>.</p>
<p>Print a grid where each square is painted white or black that satisfies the following conditions, in the format specified in Output secti... |
p01439 |
<H1><font color="#000">Problem C:</font>Chinese Classics</H1>
<p>
Taro, a junior high school student, is working on his homework. Today's homework is to read Chinese classic texts.
</p>
<p>
As you know, Japanese language shares the (mostly) same Chinese characters but the order of words is a bit different. Therefore... |
p03054 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a rectangular grid of squares 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</... |
p01069 |
<h1>Sum of Sequences</h1>
<h2>Problem</h2>
<p>
<var>n</var>個の要素を持つ数列<var>A</var>、<var>m</var>個の要素を持つ数列<var>B</var>、
それぞれが整数<var>c</var>からなる<var>q</var>個のクエリが与えられる。
<br>
各クエリについて、<br>
数列<var>A</var>の[<var>l<sub>a</sub></var>,<var>r<sub>a</sub></var>]を全て足した数と数列<var>B</var>の[<var>l<sub>b</sub></var>,<var>r<sub>b</su... |
p01593 |
<h2>Problem C: Earn Big</h2>
<p>A group of <var>N</var> people is trying to challenge the following game
to earn big money.</p>
<p>First, <var>N</var> participants are isolated from each other. From this
point, they are not allowed to contact each other, or to leave any information
for other participants. The game o... |
p01086 |
<h2>Short Phrase</h2>
<p>
A <em>Short Phrase</em> (aka. Tanku) is a fixed verse, inspired by Japanese poetry Tanka and Haiku.
It is a sequence of words, each consisting of lowercase letters 'a' to 'z', and must satisfy the following condition:
</p>
<blockquote>
(The Condition for a Short Phrase)<br>
The sequence o... |
p03541 | <span class="lang-en">
<p>Score : <var>1600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><var>2^N</var> players competed in a tournament.
Each player has a unique ID number from <var>1</var> through <var>2^N</var>. When two players play a match, the player with the smaller ID always wins.<... |
p03111 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You have <var>N</var> bamboos. The lengths (in centimeters) of these are <var>l_1, l_2, ..., l_N</var>, respectively.</p>
<p>Your objective is to use some of these bamboos (possibly all) to obtain three... |
p01985 | <h3>分割統治</h3>
<!-- begin ja only -->
<p>太郎さんと花子さんと次郎さんは3人で JAG 王国を統治している.JAG 王国には <i>N</i> 個の街が存在し,いくつかの街は双方向の道路で繋がっている.どの街からも別のすべての街へ 1 本以上の道路を経由して必ず辿り着くことができる.</p>
<p>ある日太郎さんと花子さんはとうとう仲違いを起こしてしまい,3 人で街を分担して統治することに決めた.しかし,あまりにも仲が悪くなりすぎてしまったため,太郎さんが統治している街と花子さんが統治している街が 1 本の道路で直接繋がっていることすら嫌がっている.そこで,以下の条件を満たすように統治する街... |
p00697 |
<H1>
Jigsaw Puzzles for Computers
</H1>
<P>
Ordinary Jigsaw puzzles are solved with visual hints;
players solve a puzzle with the picture which the puzzle shows on finish,
and the diverse patterns of pieces.
Such Jigsaw puzzles may be suitable for human players,
because they require abilities of pattern recognitio... |
p02350 | <H1>RMQ and RUQ</H1>
<p>
Write a program which manipulates a sequence <var>A</var> = {<var>a<sub>0</sub>, a<sub>1</sub>, . . . , a<sub>n−1</sub></var>} with the following operations:
</p>
<ul>
<li><var>update(s, t, x)</var>: change <var>a<sub>s</sub></var>, <var>a<sub>s+1</sub></var>, ..., <var>a<sub>t</sub>... |
p03812 | <span class="lang-en">
<p>Score : <var>1600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a tree with <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 vertices <var>a_i</var> and <var>b_i</var>.</p>
<p>Curre... |
p02700 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi and Aoki will have a battle using their monsters.</p>
<p>The health and strength of Takahashi's monster are <var>A</var> and <var>B</var>, respectively, and those of Aoki's monster are <var>C<... |
p00013 |
<H1>Switching Railroad Cars</H1>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_switchingRailroadCars">
</center>
<br>
<p>
This figure shows railway tracks for reshuffling cars. The rail tracks end in the bottom and the top-left rail track is used for the entrace and the top-right rail trac... |
p00443 |
<H1>最軽量のモビール</H1>
<h2>問題</h2>
<p>
モビールは動く芸術品として広く親しまれている.IOI 日本委員会では,JOI を広報するためにモビールを作成することになった.JOI 広報用モビールは,棒,紐(ひも),錘(おもり)の 3 種類の要素を用いて,次のように構成される.
</p>
<ul>
<li> 棒の一方の端は青に,もう一方の端は赤に塗られている. </li>
<li> 棒は両端以外の 1 箇所を支点として紐でつるされる.</li>
<li> 支点から赤の端までの長さも支点から青の端までの長さも正整数である.</li>
<li> 棒の両端には,紐で錘か他の棒をつるす.</l... |
p02184 | <h2>C: カニサル暗号</h2>
<h3>問題</h3>
<p>えびちゃんは、ある非負整数 <var>D</var> を「カニサル暗号」で暗号化して得られた文字列 <var>C</var> を与えられました。この暗号は、非負整数を <var>10</var> 進法で表したときの各数字をある(元と異なるとは限らない)決められた数字で置き換えるものです。異なる数字が同じ数字に置き換えられたり、同じ数字が出現位置によって異なる数字に書き換えられることはありません。</p>
<p>たとえば、この暗号化方式によって <var>2646</var> が <var>0545</var> になることはありますが、<var>3456</var... |
p01602 |
<h2>()</h2>
<h2>Problem Statement</h2>
<p>文字列<var>S</var>がある.はじめ,<var>S</var>は空文字列である.<br />
以下の処理を<var>n</var>個順番に行う.</p>
<ul class="list1" style="padding-left:16px;margin-left:16px"><li><var>S</var>の末尾に<var>p_i</var>(="("または")")を<var>x_i</var>個追加する.</li></ul>
<p>処理を施した後,<var>S</var>がバランスのとれた... |
p00910 |
<H1><font color="#000">Problem G: </font>Let There Be Light</H1>
<p>
Suppose that there are some light sources and many spherical balloons. All light sources have sizes small enough to be modeled as point light sources, and they emit light in all directions. The surfaces of the balloons absorb light and do not reflec... |
p01252 |
<H1><font color="#000">Problem C:</font> Alice and Bob</H1>
<p>
Alice and Bob are in love with each other, but they have difficulty going out on a date - Alice is a very
busy graduate student at the ACM university.
</p>
<p>
For this reason, Bob came to the ACM university to meet her on a day. He tried to reach the me... |
p03795 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a favorite restaurant.</p>
<p>The price of any meal served at the restaurant is <var>800</var> yen (the currency of Japan), and each time a customer orders <var>15</var> meals, the restaurant ... |
p04050 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke got a present from his mother on his birthday.
The present was a pair of two sequences <var>a</var> and <var>b</var>, consisting of positive integers.
They satisfied all of the following properti... |
p02887 | <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> slimes lining up from left to right. The colors of these slimes will be given as a string <var>S</var> of length <var>N</var> consisting of lowercase English letters. The <var>i</... |
p03280 | <span class="lang-en">
<p>Score: <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>There is a farm whose length and width are <var>A</var> yard and <var>B</var> yard, respectively. A farmer, John, made a vertical road and a horizontal road inside the farm from one border to another, ... |
p01747 |
<p>
すなけ君は,(自己交差を持たない) <var>n</var> 個の頂点からなる折れ線の形をしている.最初に,すなけ君の <var>i</var> 番目の頂点は <var>(x<sub>i</sub>, y<sub>i</sub>)</var> にある.すなけ君は,平行移動や回転をして連続的に移動することはできるが,変形(折れ線の長さや二つの線分のなす角度を変える) することはできない.<var>y</var> = 0 は壁であり,(0, 0) に微小な穴が開いている.すなけ君がこの穴を通って全体が <var>y</var> < 0 をみたすように移動できるかどうか判定せよ.
</p>
<h2>Constraint... |
p02868 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> points numbered <var>1</var> to <var>N</var> arranged in a line in this order.</p>
<p>Takahashi decides to make an undirected graph, using these points as the vertices.
In the begin... |
p00855 |
<H1><font color="#000">Problem B:</font> Prime Gap</H1>
<p>
The sequence of <i>n</i> - 1 consecutive composite numbers (positive integers that are not prime and
not equal to 1) lying between two successive prime numbers <i>p</i> and <i>p</i> + <i>n</i> is called a <i>prime</i> gap of length <i>n</i>. For example, (24... |
p01317 |
<h2><font color="#000">Problem D:</font> Mr. Rito Post Office</h2>
<!--
<h3><U>Mr. リトー郵便局</U></h3>
-->
<p>あなたは離島の郵便局に勤めるプログラマである.あなたの住んでいる地域は,複数の島々からなる.各島には一つ以上の港町がある.それらに加えて他の町や村があるかもしない.ある島から別の島に向かうためには船を使わなければならない.一つの島の中を回るには陸路が使えるが,海路を利用した方が速いこともある.</p>
<p>近年行われた郵便局の民営化をきっかけに,経費削減に向けて郵便配達員の人員整理が全国的に行われた.離島の郵便局... |
p00156 |
<H1>城の堀</H1>
<p>
いま、忍者が城外から天守閣に忍び入ろうと計画を立てています。この忍者は地面を走ったり、堀の中を泳いだりすることは難なくできますが、堀から這い上がることはとても苦手なので、忍者は堀に入る回数をできるだけ少なくしたいと考えています。
</p>
<p>
お城の見取図を入力とし、城外から天守閣に至るまでに、堀から這い上がらなくてはならない最小回数を出力するプログラムを作成して下さい。お城の見取図は二次元格子として与えられます。見取り図に描かれた記号には、天守閣の位置を示す「&」と堀の位置を示す「#」の位置が記され、そのほかの地点には「.」(半角ピリオド)が記されています。なお、お城には天守閣は一つ... |
p00506 |
<H1> 問題 2</H1>
<br/>
<p>
入力ファイルの1行目に正整数 n が書いてあり,
2行目には半角空白文字1つを区切りとして,
n 個の正整数が書いてある.
n は 2 または 3 であり,
2行目に書かれているどの整数も値は 10<sup>8</sup> 以下である.
これら2個または3個の数の公約数をすべて求め,
小さい方から順に1行に1個ずつ出力せよ.
自明な公約数(「1」)も出力すること.
</p>
<p>
<!--入力ファイルの改行コードは CR+LF である.
また,-->
出力ファイルにおいては,
出力の最後行にも改行コードを入れること.
</p>
<h2>入出力例</h2>
<h... |
p03003 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given two integer sequences <var>S</var> and <var>T</var> of length <var>N</var> and <var>M</var>, respectively, both consisting of integers between <var>1</var> and <var>10^5</var> (inclusive).... |
p01194 |
<H1><font color="#000"></font>Web 0.5</H1>
<!-- Problem F-->
<p>
In a forest, there lived a spider named Tim. Tim was so smart that he created a huge, well-structured web.
Surprisingly, his web forms a set of equilateral and concentric <i>N</i>-sided polygons whose edge lengths
form an arithmetic sequence.
</p>
<cent... |
p03453 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a graph with <var>N</var> vertices and <var>M</var> edges, and there are two people on the graph: Takahashi and Aoki.</p>
<p>The <var>i</var>-th edge connects Vertex <var>U_i</var> and Vertex <v... |
p03900 | <span class="lang-en">
<p>Score : <var>1400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi found an integer sequence <var>(A_1,A_2,...,A_N)</var> with <var>N</var> terms. Since it was too heavy to carry, he decided to compress it into a single integer.</p>
<p>The compression takes ... |
p02612 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We will buy a product for <var>N</var> yen (the currency of Japan) at a shop.</p>
<p>If we use only <var>1000</var>-yen bills to pay the price, how much change will we receive?</p>
<p>Assume we use the ... |
p01897 |
<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: DAG トリオ / DAG Trio</h1>
<p>
この問題は D: DAG Trio (Easy) と制約の... |
p00785 |
<H1><font color="#000">Problem F:</font> Triangle Partition</H1>
<p>
Suppose that a triangle and a number of points inside the triangle are given. Your job is to find a partition of the triangle so that the set of the given points are divided into three subsets of equal size.
</p>
<p>
Let A, B and C denote the verti... |
p02242 |
<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>Single Source Shortest Path... |
p03845 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Joisino is about to compete in the final round of a certain programming competition.
In this contest, there are <var>N</var> problems, numbered <var>1</var> through <var>N</var>.
Joisino knows that it t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.