question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p03673 | <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_n</var>.
Let us consider performing the following <var>n</var> operations on an empty sequence <var>b</var>.</p>
<p>The <var>i<... |
p02432 | <h1>Deque</h1>
<p>
For a dynamic array $A = \{a_0, a_1, ...\}$ of integers, perform a sequence of the following operations:
</p>
<ul>
<li>push($d$, $x$): Add element $x$ at the begining of $A$, if $d = 0$. Add element $x$ at the end of $A$, if $d = 1$.</li>
<li>randomAccess($p$): Print element $a_p$.</li>
<l... |
p02598 | <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> logs of lengths <var>A_1,A_2,\cdots A_N</var>.</p>
<p>We can cut these logs at most <var>K</var> times in total. When a log of length <var>L</var> is cut at a point whose distance f... |
p02062 | <h2>C: 短絡評価</h2>
<h3>問題</h3>
<p>
直大くんと北大くんはゲームをしています。
北大くんは、まず以下の BNF で表される論理式を生成します。
</p>
<pre>
<formula> ::= <or-expr>
<or-expr> ::= <and-expr>
| <or-expr> "|" <and-expr>
<and-expr> ::= <term>
| <and-expr> "&" <term>
<term... |
p02577 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>An integer <var>N</var> is a multiple of <var>9</var> if and only if the sum of the digits in the decimal representation of <var>N</var> is a multiple of <var>9</var>.</p>
<p>Determine whether <var>N</v... |
p02127 | <h1>Problem D: AABABCAC</h1>
<h2>Problem</h2>
<p>
文字列$s$,$t$が与えられる。<br>
最初、文字列集合$A=${$s$},$B=\phi$とする。<br>
このとき、次の操作をできるだけたくさん行いたい。
</p>
<h3>操作</h3>
<p>
<h4>step1</h4>
全ての $u ∊ A$ について、以下の処理を行う。
</p>
<ol>
<li>$u$の全ての部分列(連続でなくてもよい)から、$t$と等しいものを任意に1つ選ぶ。選んだ部分列の$u$に対応するインデックスをそれぞれ$z_1$, $z_2$, …, $... |
p03366 | <span class="lang-en">
<p>Score : <var>1200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> apartments along a number line, numbered <var>1</var> through <var>N</var>.
Apartment <var>i</var> is located at coordinate <var>X_i</var>.
Also, the office of AtCoder Inc. is lo... |
p00819 |
<H1><font color="#000">Problem A:</font> Unreliable Messengers</H1>
<p>
The King of a little Kingdom on a little island in the Pacific Ocean frequently has childish
ideas. One day he said, “You shall make use of a message relaying game when you inform me
of something.” In response to the King’s statement, six servant... |
p02824 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><var>N</var> problems are proposed for an upcoming contest. Problem <var>i</var> has an initial integer score of <var>A_i</var> points.</p>
<p><var>M</var> judges are about to vote for problems they lik... |
p03736 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> squares in a row. The squares are numbered <var>1, 2, ..., N</var> from left to right.</p>
<p>You have two pieces, initially placed on square <var>A</var> and <var>B</var>, respec... |
p00233 |
<H1>図書整理</H1>
<p>
数の表わし方には色々な種類があり、私たちが普段使っている 10 進数は一つの代表的なものでしかありません。コンピュータ関連の知識がある人には、2 進数、16 進数あたりはとても身近なものです。
</p>
<p>
N さんは司書資格を活かして司書の仕事に就きました。最初の仕事は図書整理です。この図書館では、一冊ごとに一貫して番号が与えられており、それに従って本を整理しています。
</p>
<p>
この図書館では本の番号をマイナス十進数で表すことになっています。
</p>
<p>
マイナス十進数は、<var>a<sub>n</sub>a<sub>n−1</sub>a<su... |
p00663 |
<H1>Problem E: SAT-EN-3</H1>
<p>
彼女は悩んでいた。成績が良くないのだ。両親に無理を言って全寮制の学校に入学したものの、彼女の才能は一向に開花することはなかった。あるいは才能など元々なかったのかもしれないが、それはできるだけ考えたくない可能性だった。
</p>
<p>
そこで彼女が頼ったのは、インターネット上で見つけた怪しげな脳力トレーニングの教材だった。SAT-EN-3 (SATisifiability problem for Enhancement of Neuron: version 3) と銘打つその学習メソッドによると、充足可能性問題のようなもののインスタンスをひたすら手で解くことに... |
p01971 | <h2>E: Broccoli or Cauliflower</h2>
<h3>Problem</h3>
<p>The input is a rooted tree <var>T = (V, E)</var> with <var>n</var> vertices. Note that <var>n</var> is odd and the vertex with index <var>1</var> is the root of <var>T</var>. In addition, we give a label <var>G</var> or <var>W</var> for each vertex. Let <var>T_v ... |
p00399 | <h1>柴犬の数</h1>
<p>
イヅア公園には、夕方になると柴犬と散歩する人たちがたくさん来ます。柴犬には毛の色によって赤柴、黒柴、白柴、胡麻柴という種類があります。柴犬がたくさんいるとうれしいトモエちゃんは、それぞれの毛色の柴犬が何頭いるかがんばって数えましたが、まだ足し算ができないので柴犬が全部で何頭いるかわかりません。
</p>
<p>
それぞれの毛色の柴犬の数が与えられたときに、柴犬の総数を計算するプログラムを作成せよ。
</p>
<h2>入力</h2>
<p>
入力は以下の形式で与えられる。
</p>
<pre>
$R$ $B$ $W$ $G$
</pre>
<p>
1行に赤柴の数$R$ ($1 ... |
p01422 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Beautiful Currency</H1>
<p>
KM country has <var>N</var> kinds of coins and each coin has its value <var>a_i</var>.
</p>
<p>
The king of the country, Kita_masa, thought that the current currency system is poor,
and he decided to make it <i>beautiful</i... |
p01072 |
<h1>Problem A: Plants</h1>
<h2>Problem</h2>
<p>がっちょ君は横<var>W</var>個×縦<var>H</var>個のマスで区切られた畑を所有している。<var>x</var>列目<var>y</var>行目のマスをマス <var>(x, y)</var> と呼ぶことにする。いくつかのマスの土地には高さ0cmの植物が1本だけ植えてあり、その他のマスの土地には何も植えられていない。
</p>
<p>
がっちょ君はある時刻に畑に肥料をまく。肥料がまかれたマスに植物が植えられているとき、その植物の高さが1cm伸びる。植物が植えられていないときは、何もおこらない。植物が伸... |
p01588 |
<H1><font color="#000">Problem H:</font> Round Table</H1>
<p>
You are the owner of a restaurant, and you are serving for <i>N</i> customers seating in a round table.
</p>
<p>
You will distribute <i>M</i> menus to them. Each customer receiving a menu will make the order of plates, and
then pass the menu to the custom... |
p01567 |
<h1>Presentation</h1>
<p>You are a researcher investigating algorithms on binary trees.
Binary tree is a data structure composed of branch nodes and leaf nodes.
Every branch nodes have left child and right child, and each child is either a branch node or a leaf node.
The root of a binary tree is the branch node whic... |
p01137 |
<!-- begin en only -->
<h3><U>Space Coconut Crab</U></h3>
<!-- end en only -->
<!-- begin ja only -->
<h3><U>宇宙ヤシガニ</U></h3>
<!-- end ja only -->
<!-- begin en only -->
<p>
English text is not available in this practice contest.
</p>
<!-- end en only -->
<!-- begin ja only -->
<p>
ケン・マリンブルーは,宇宙ヤシガニを求めて全銀河を旅するスペース... |
p00376 | <h1>Red Dragonfly</h1>
<p>
It’s still hot every day, but September has already come. It’s autumn according to the calendar. Looking around, I see two red dragonflies at rest on the wall in front of me. It’s autumn indeed.
</p>
<p>
When two red dragonflies’ positional information as measured from the end of the w... |
p00726 |
<h1><font color="#000">Problem E:</font> <u>The Genome Database of All Space Life</u></h1>
<!-- end en only -->
<p>
In 2300, the Life Science Division of Federal Republic of Space starts
a very ambitious project to complete the genome sequencing of all
living creatures in the entire universe and develop the genomic
... |
p01834 |
<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>Cube Dividing</h2>
<p>
Pablo ... |
p03809 | <span class="lang-en">
<p>Score : <var>700</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>Curren... |
p00008 |
<H1>Sum of 4 Integers</H1>
<p>
Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 ≤ <var>a, b, c, d</var> ≤ 9) which meet the following equality:<br>
<br>
<var>a + b + c + d = n</var><br>
<br>
For example, for <var>n</var> = ... |
p02035 |
<h2>F: 赤黒そーるじぇむ / Red-Black Soul Gem</h2>
<h3>問題</h3>
<p>
ほむちゃんは、そーるじぇむを赤色や黒色に変化させたり、 異なる <var>2</var> つのそーるじぇむ間を魔法の糸で接続したりする不思議な力を持っています。
この力を使うことで、ほむちゃんは、そーるじぇむによる魔方陣を作ることができます。
</p>
<p>ほむちゃんは、 <var>1</var> から <var>N</var> で番号付けられた <var>N</var> 個のそーるじぇむがあるとき、以下の条件が成り立つ異なる魔方陣がいくつあるのか気になりました。</p>
<ul>
<li> どの <var... |
p00458 |
<H1>薄氷渡り</H1>
<h2>問題</h2>
<p>
冬の寒いある日,JOI太郎君は広場にはった薄氷を割って遊ぶことにした.広場は長方形で,東西方向に m 個,南北方向に n 個,つまり, m × n の区画に区切られている.また,薄氷が有る区画と無い区画がある. JOI太郎君は,次のルールにしたがって,薄氷を割りながら区画を移動することにした.
</p>
<ul>
<li> 薄氷があるどの区画からも薄氷を割り始めることができる.</li>
<li> 東西南北のいずれかの方向に隣接し, まだ割られていない薄氷のある区画に移動できる.</li>
<li> 移動した先の区画の薄氷をかな... |
p02465 | <h1>Set Difference</h1>
<p>
Find the difference of two sets $A = \{a_0, a_1, ..., a_{n-1}\}$ and $B = \{b_0, b_1, ..., b_{m-1}\}$, $A - B$.
</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>
Elements... |
p02936 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a rooted tree with <var>N</var> vertices numbered <var>1</var> to <var>N</var>.
The root is Vertex <var>1</var>, and the <var>i</var>-th edge <var>(1 \leq i \leq N - 1)</var> connects Vertex <v... |
p03624 | <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.
Find the lexicographically (alphabetically) smallest lowercase English letter that does not occur in <var>S</var>.
If every l... |
p01619 |
<h1>G: Computer Onesan / コンピュータおねえさん</h1>
<p>ある日,おねえさんは,子供たちに組合せの数え方について教えてあげることになりました.</p>
<p>そこで,おねえさんは,次のような問題を解いてみることにしました.</p>
<ul>
<li>縦幅 1 ,横幅 1 の正方形を縦幅 <em>N</em> ,横幅 <em>M</em> の長方形に敷き詰めたときに,長方形の左上の頂点から右下の頂点への通り方が何通りあるかを数える</li>
<li>敷き詰めた正方形の辺の上しか通れない</li>
<li>それぞれの通り... |
p03274 | <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> candles placed on a number line.
The <var>i</var>-th candle from the left is placed on coordinate <var>x_i</var>.
Here, <var>x_1 < x_2 < ... < x_N</var> holds.</p>
<p>Ini... |
p01249 |
<H1><font color="#000">Problem J:</font> Billion Million Thousand</H1>
<p>
A linguist, Nodvic Natharus Damenhof (commonly called <i>Dr. Usoperant</i>), invented an artificial language <i>Usoperant</i> in 2007. The word <i>usoperant</i> means ‘one which tires’. Damenhof’s goal was to create a complex and
pedantic lang... |
p02873 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a string <var>S</var> of length <var>N-1</var>.
Each character in <var>S</var> is <code><</code> or <code>></code>.</p>
<p>A sequence of <var>N</var> non-negative integers, <var>a_1,a_2,\... |
p03761 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke loves "paper cutting": he cuts out characters from a newspaper headline and rearranges them to form another string.</p>
<p>He will receive a headline which contains one of the strings <var>S_1,...... |
p03331 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has two positive integers <var>A</var> and <var>B</var>.</p>
<p>It is known that <var>A</var> plus <var>B</var> equals <var>N</var>.
Find the minimum possible value of "the sum of the digits o... |
p02170 | <h1>Problem I: Coin and Die</h1>
<h2>Problem</h2>
<p>
表と裏のあるコインと $1$ から $N$ までの目があるサイコロがある。Gachoくんはこれらを用いて以下のゲームをして遊ぶことにした。<br><br>
ゲームは最初に得点が $0$ の状態から始まり、以下の手順で進められる。<br>
</p>
<ol type="1">
<li>サイコロを $1$ 回振り、そのとき出た目の数を得点に加算する</li>
<li>現在の得点が $K$ 以上ならゲームクリアとなりゲームを終了する</li>
<li>現在の得点が $K$ 未満ならコインを投げ表が出れば1... |
p01025 | <h1>Problem J: Hanimon</h1>
<p>
ハニカムモンスターはハニカム模様の六角形状の不思議な生き物である。
</p>
<p>
ハニカムモンスターには様々なサイズのものがあり、一辺が<em>N</em>個の正六角形のマスから成るハニカムモンスターをサイズ<em>N</em>のハニカムモンスターとする。
</p>
<p>
一方、聖なる模様はハニカムモンスターと同じく、六角形として定義され1辺が<em>P</em>個の正六角形のマスから成る聖なる模様をサイズ<em>P</em>の聖なる模様とする。
</p>
<p>
ハニカムモンスターと聖なる模様の形の例を以下に示す。サイズは1辺の正六角形のマス... |
p03018 | <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> consisting of <code>A</code>, <code>B</code> and <code>C</code>.</p>
<p>Snuke wants to perform the following operation on <var>s</var> as many times as possible:</p>
... |
p01475 |
<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... |
p03448 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You have <var>A</var> <var>500</var>-yen coins, <var>B</var> <var>100</var>-yen coins and <var>C</var> <var>50</var>-yen coins (yen is the currency of Japan).
In how many ways can we select some of thes... |
p02609 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let <var>\mathrm{popcount}(n)</var> be the number of <code>1</code>s in the binary representation of <var>n</var>.
For example, <var>\mathrm{popcount}(3) = 2</var>, <var>\mathrm{popcount}(7) = 3</var>, ... |
p00634 |
<H1><font color="#000000">Problem 08:</font> Provident Housewife</H1>
<p>
主婦の琴子はこの不況のさなか食費を抑えることに闘志を燃やしていました。毎朝新聞広告を必ずチェック。買う物リストと最も安く売られているお店をしっかりリストアップして、お店をはしごしながら、エプロン・サンダルという戦闘スタイルで自転車をこぎこぎ買い物に行きます。
</p>
<p>
そこで夫のあなたは少しでも琴子の役に立とうと、得意のプログラミングで家計簿プログラムを作成することにしました。プログラムは、各スーパーに売っている品物の名前と値段(円)、琴子が必要な品物を入力し、全ての品物... |
p01926 |
<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>あなたは冒険ゲーム... |
p02259 |
<H1>Bubble Sort</H1>
<p>
Write a program of the Bubble Sort algorithm which sorts a sequence <i>A</i> in ascending order. The algorithm should be based on the following pseudocode:
</p>
<pre>
BubbleSort(A)
1 for i = 0 to A.length-1
2 for j = A.length-1 downto i+1
3 if A[j] < A[j-1]
4 swap A[j... |
p00264 |
<H1>風よ、私の梅の香りを届けておくれ!</H1>
<p>
引っ越しが決まり、この地を去ることになった。この土地自体に未練は無いが、1つだけ気になることがある。それは、庭に植えた梅の木のことだ。私は毎年、この梅が花を咲かすことを楽しみにしていた。ここを離れた後は春の楽しみが1つ減ってしまう。私の梅の香りだけでも風に乗って引っ越し先の家まで届き、春を楽しませてはくれないものか。
</p>
<p>
日本には春を象徴する3つの花がある。梅・桃・桜の3つだ。引っ越し先には、私の梅以外にも、これらの花の香りが届くだろう。しかし、私の梅の香りだけが届く日数が最も多い家に住みたい。
</p>
<center>
<img src="h... |
p00771 |
<h3>Anchored Balloon</h3>
<p>
A balloon placed on the ground is connected to one or more anchors on the ground with ropes.
Each rope is long enough to connect the balloon and the anchor.
No two ropes cross each other.
Figure E-1 shows such a situation.
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resou... |
p01863 |
<!--<script language="JavaScript" type="text/javascript" src="js/varmath.js" charset="UTF-8"></script>-->
<h2>F: みこみー文字列 - Miko Mi String -</h2>
<h3>物語</h3>
<p>みっこみっこみ〜!みんなのアイドル,田澤みこみこ!今日は〜,みこと一緒に〜,文字列アルゴリズムの練習,しよ☆</p>
<p>みこのとっておきの<s>キャラ作り</s>合言葉,「みっこみっこみ〜」は,ローマ字にすると “MikoMikoMi” になるみこ!つまり,<var>A=</var>“Mi”, <var... |
p00321 |
<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>
インターネット通販サイトでは、ユーザが現在見ている商... |
p01160 |
<H1><font color="#000">Problem F:</font> It Prefokery Pio</H1>
<p>
You are a member of a secret society named <i>Japanese Abekobe Group</i>, which is called J. A. G. for short.
Those who belong to this society often exchange encrypted messages. You received lots of encrypted
messages this morning, and you tried to de... |
p01530 |
<h1>K - XOR回廊</h1>
<h2>問題文</h2>
<p>
KU大学では一風変わったラリーゲームが人気である.
このゲームの舞台であるサーキットには,<var>N</var> 個の休憩所と <var>M</var> 個の道があり,<var>i</var> 番目の道は <var>f<sub>i</sub></var> 番目の休憩所と <var>t<sub>i</sub></var> 番目の休憩所の間にある.
すべての道にはチェックポイントが一つずつ存在し,道 <var>i</var> のチェックポイントを通過するとどちらの向きで通っても <var>p<sub>i</sub></var> の得点がXORで加算される... |
p03798 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke, who loves animals, built a zoo.</p>
<p>There are <var>N</var> animals in this zoo. They are conveniently numbered <var>1</var> through <var>N</var>, and arranged in a circle.
The animal numbered ... |
p03262 | <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> cities on a number line. The <var>i</var>-th city is located at coordinate <var>x_i</var>.</p>
<p>Your objective is to visit all these cities at least once.</p>
<p>In order to do ... |
p03632 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Alice and Bob are controlling a robot. They each have one switch that controls the robot.<br/>
Alice started holding down her button <var>A</var> second after the start-up of the robot, and released her... |
p02920 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have one slime.</p>
<p>You can set the <em>health</em> of this slime to any integer value of your choice.</p>
<p>A slime reproduces every second by spawning another slime that has strictly less healt... |
p02189 | <h2>Min Element</h2>
<p>数列<var>a_1,a_2,..,a_N</var>が与えられます。</p>
<p>この数列の最小値の番号を求めてください。</p>
<p>最小値が複数の場所にあるときは、番号の最も小さいものを答えてください。</p>
<h3>入力</h3>
<pre>
<var>N</var>
<var>a_1 a_2...a_N</var>
</pre>
<h3>出力</h3>
<p><var>a_i</var>が数列の最小値となるような<var>i</var>のうち、最も小さいものを出力せよ。</p>
<h3>制約</h3>
<ul>
<li><var>1 \leq N \leq 1... |
p02473 | <h2>Difference of Big Integers</h2>
<p>
Given two integers $A$ and $B$, compute the difference, $A - 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 difference in a line.
</p>
<h3>Constraints</h3>
<ul>
<li>$-1 \ti... |
p02023 | <h2>I: 破壊 (Ravage)</h2>
<p>サンタクロースは、街のイルミネーションに引っかかり、壊した。</p>
<p>イルミネーションにはN個の電球があり、$i$ 番目の電球は電圧が $A_i$ 以上 $B_i$ 以下のときにしか付かなくなってしまった。</p>
<p>電圧はイルミネーションのどこでも同じにする必要がある。</p>
<p>電圧を調節することで、最大いくつの電球を同時に光らせることができるか求めよ。</p>
<h3>入力</h3>
<p>1 行目には整数 $N$ が与えられる。</p>
<p>続く $N$ 行のうち $i$ 行目には $A_i, B_i$ が空白区切りで与えられる。</p>
<h3>出... |
p02536 | <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> cities numbered <var>1</var> through <var>N</var>, and <var>M</var> bidirectional roads numbered <var>1</var> through <var>M</var>.
Road <var>i</var> connects City <var>A_i</var> ... |
p02166 | <h1>Problem E: Cyclic Shift Sort</h1>
<h2>Problem</h2>
<p>
長さ $N$ の順列 $P = \{ P_1, P_2, \ldots, P_N \} $ と整数 $K$ が与えられる。<br>
以下の操作を $0$ 回以上任意の回数繰り返すことで、順列 $P$ を単調増加にすることができるかどうか判定せよ。
</p>
<ul>
<li>整数 $x \ (0 \le x \le N-K)$ を選ぶ。 $ P_{x+1}, \ldots, P_{x+K} $ を巡回右シフトする</li>
</ul>
<p>
ただし、部分列 $U=U_1, \ldots... |
p03327 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Decades have passed since the beginning of AtCoder Beginner Contest.</p>
<p>The contests are labeled as <code>ABC001</code>, <code>ABC002</code>, <var>...</var> from the first round, but after the <var>... |
p03777 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Two deer, AtCoDeer and TopCoDeer, are playing a game called <em>Honest or Dishonest</em>.
In this game, an honest player always tells the truth, and an dishonest player always tell lies.
You are given t... |
p02865 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>How many ways are there to choose two distinct positive integers totaling <var>N</var>, disregarding the order?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1 \le... |
p00858 |
<H1><font color="#000">Problem E:</font> Geometric Map</H1>
<p>
Your task in this problem is to create a program that finds the shortest path between two given
locations on a given street map, which is represented as a collection of line segments on a plane.
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/reso... |
p00272 |
<H1>チケットの売り上げ</H1>
<p>
今日は、アイヅ・エンターテインメント社イチオシのアイドルグループ「アカベコ&コボウシ」のチケット発売日です。チケットには以下の4種類があります。<br/>
<br/>
S席 6000円<br>
A席 4000円<br>
B席 3000円<br>
C席 2000円<br>
<br/>
販売責任者のあなたは、ドキドキしながら発売開始を待っています。いよいよ発売開始。売れ行き絶好調です!
</p>
<p>
発売開始からしばらく経ったところで、それまでの注文をまとめた表を受け取りました。表の各行には、それまでに売れたチケットの種類と枚数が書いてあります。ただし、チケットの種類がS,A,... |
p00788 |
<H1><font color="#000">Problem A:</font> Rational Irrationals</H1>
<p>
Rational numbers are numbers represented by ratios of two integers. For a prime number <i>p</i>, one of the elementary theorems in the number theory is that there is no rational number equal to √<i>p</i>. Such numbers are called irrational n... |
p01930 |
<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>Big Maze</h3>
<p>あなたは Jum... |
p00622 |
<H1><font color="#000000">Problem B:</font> Monster Factory</H1>
<p>
株式会社南天堂は, Packet Monster というゲームソフトを発売している. このゲームはモンスターを捕まえ, 育て, 戦わせるという趣旨のもので, 世界中で大人気のゲームであった.
</p>
<p>
このゲームには従来のゲームには無い特徴があった. このゲームには Red と Green という2つのバージョンがあり, それぞれのゲームで捕まえられるモンスターが異なるのだ. Red でしか捕まえられないモンスターを Green で入手するには, 通信交換というシステムを使う. ... |
p01463 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Runaway Domino</H1>
<p>
``Domino effect'' is a famous play using dominoes.
A player sets up a chain of dominoes stood.
After a chain is formed, the player topples one end of the dominoes.
The first domino topples the second domino, the second topples the... |
p01199 |
<H1><font color="#000"></font>Flame of Nucleus</H1>
<!-- Problem D -->
<p>
Year 20XX — a nuclear explosion has burned the world. Half the people on the planet have died. Fearful.
</p>
<p>
One city, fortunately, was not directly damaged by the explosion. This city consists of <i>N</i> domes (numbered 1
through <i>N</i>... |
p01033 | <h1>Problem F: Coupling</h1>
<h2>Problem</h2>
<p>
愛津大学では毎年大規模な合コンが行われています。<br>
今年は<var>N</var>人の男性と<var>M</var>人の女性が参加します。<br>
それぞれ男性は0から順に<var>N</var>−1までIDが割り振られおり、女性は0から順に<var>M</var>−1までIDが割り振られています。
</p>
<p>
この合コンでは自分の「大好きな人」と「そこそこ好きな人」のIDを提示します。<br>
男性はそれぞれ女性のIDを、女性はそれぞれ男性のIDを提示します。<br>
</p>
<p>
その... |
p01526 |
<h1>G - 村</h1>
<h2>問題文</h2>
<p>
きつねのしえるは,休暇でとある小さな村を訪れている.彼女が驚いたのは,その村の表札がもつ性質である.
</p>
<p>
村には <var>N</var> 個の家屋がある.ここでは簡単のため,村は 2 次元平面であるとし,家屋はこの平面上の点であると見なす.
それぞれの家屋には表札が 1 個設けられており,その家の苗字を表していた.しえるは村の中を訪問するにつれて,この村の表札が次のような性質を持っていることに気付いた.
</p>
<ul>
<li>ある実数 <var>R</var> が存在する.</li>
<li>もし 2 つの家屋の距離が <var>R... |
p01176 |
<H1><font color="#000">Problem F:</font> Controlled Tournament</H1>
<p>
National Association of Tennis is planning to hold a tennis competition among professional
players. The competition is going to be a knockout tournament, and you are assigned the task
to make the arrangement of players in the tournament.
</p>
<p>... |
p00337 |
<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>
会津国の若松平野に、集落が点在していました。い... |
p03848 | <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> people, conveniently numbered <var>1</var> through <var>N</var>.
They were standing in a row yesterday, but now they are unsure of the order in which they were standing.
However, ... |
p01875 |
<h2>D: Complex Oracle - Complex Oracle -</h2>
<h3>問題</h3>
<p>
※この問題はリアクティブ問題です.すなわち,サーバー側に用意されたプログラムと対話的に応答することで正答を導くプログラムを作成する必要があります.
また、サーバー側のプログラムも計算機資源を共有する関係上、サーバーだけで最大 3 sec程度の実行時間、最大 300 MB程度のメモリを使用する場合がありますので、TLE・MLEにお気をつけください。
</p>
<p>あいずにゃんは若ヶ松高校のプログラミングコンテスト部、通称ぷろこん部に所属する2年生である。見目麗しい。あいずにゃんはその小さな体も無限に存... |
p00767 |
<h3>Integral Rectangles</h3>
<p>
Let us consider rectangles whose height, <i>h</i>, and
width, <i>w</i>, are both integers. We call such rectangles <em>
integral rectangles</em>. In this problem, we consider only wide
integral rectangles, i.e., those with <i>w</i> > <i>h</i>.
</p>
<p>
We define the following orde... |
p02074 | <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: ... |
p00049 |
<H1>血液型</H1>
<p>
ある学級の生徒の出席番号と ABO 血液型を保存したデータを読み込んで、おのおのの血液型の人数を出力するプログラムを作成してください。なお、ABO 血液型には、A 型、B 型、AB 型、O 型の4種類の血液型があります。
</p>
<H2>Input</H2>
<p>
カンマで区切られた出席番号と血液型の組が、複数行に渡って与えられます。出席番号は 1 以上 50 以下の整数、血液型は文字列 "A", "B", "AB" または "O" のいずれかです。生徒の人数は 50 を超えません。
</p>
<H2>Output</H2>
<p>
1行目に A 型の人数<br/>
2行目に B... |
p02424 | <h1>Bit Operation II</h1>
<p>
Given two non-negative decimal integers $a$ and $b$, calculate their AND (logical conjunction), OR (logical disjunction) and XOR (exclusive disjunction) and print them in binary representation of 32 bits.
</p>
<h2>Input</h2>
<p>
The input is given in the following format.
</p>
<p... |
p00419 | <h1>山へ帰そう</h1>
<p>
近年イズア国では、山から街に降りてくる動物に悩まされている。あなたは動物を山へ帰そうと研究を重ね、以下のことを明らかにした。
</p>
<ul>
<li> それぞれの動物には固有の名前がついている。</li>
<li> 2体の動物について、一方の動物の名前のどこかの位置に1文字を挿入すると、もう一方の動物の名前と一致する場合、これらをペアにして山へ帰すことができる。</li>
<li> 一度山へ帰った動物が、再び街に降りてくることはない。</li>
</ul>
<p>
あなたは、街に降りてきた動物を、この方法でどのくらい山へ帰すことができるかを計算することにした。
</p>
<... |
p01658 |
<h2>C - チョコレート</h2>
<p>
目の前に <var>M \times N</var> 個のピースでできた板チョコがある.
ピースには甘いピースと辛いピースの2種類があり,できるだけ多くの甘いピースを食べたい.
</p>
<p>
しかし,板チョコの食べ方にはルールがあり,以下のルールを守らなければならない.
</p>
<ul>
<li> あるピースを食べるためには,そのピースの真上に隣接するピースが存在せず,加えてそのピースの少なくとも左右どちらかにはピースが存在しない必要がある. </li>
</ul>
<p>
例えば,図のよ... |
p03665 | <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> bags of biscuits. The <var>i</var>-th bag contains <var>A_i</var> biscuits.</p>
<p>Takaki will select some of these bags and eat all of the biscuits inside.
Here, it is also possi... |
p02977 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given an integer <var>N</var>. Determine if there exists a tree with <var>2N</var> vertices numbered <var>1</var> to <var>2N</var> satisfying the following condition, and show one such tree if t... |
p01208 |
<H1><font color="#000">Problem B:</font> Turn Left</H1>
<p>
Taro got a driver’s license with a great effort in his campus days, but unfortunately there had
been no opportunities for him to drive. He ended up obtaining a gold license.
</p>
<p>
One day, he and his friends made a plan to go on a trip to Kyoto with you. ... |
p03235 | <span class="lang-en">
<p>Score : <var>1400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given <var>P</var>, a permutation of <var>(1,\ 2,\ ...\ N)</var>.</p>
<p>A string <var>S</var> of length <var>N</var> consisting of <code>0</code> and <code>1</code> is a <em>good string</em> w... |
p03720 | <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> cities and <var>M</var> roads.
The <var>i</var>-th road <var>(1≤i≤M)</var> connects two cities <var>a_i</var> and <var>b_i</var> <var>(1≤a_i,b_i≤N)</var> bidirectionally.
There ma... |
p02832 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> bricks arranged in a row from left to right.</p>
<p>The <var>i</var>-th brick from the left <var>(1 \leq i \leq N)</var> has an integer <var>a_i</var> written on it.</p>
<p>Among th... |
p02998 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> dots in a two-dimensional plane. The coordinates of the <var>i</var>-th dot are <var>(x_i, y_i)</var>.</p>
<p>We will repeat the following operation as long as possible:</p>
<ul>
... |
p03370 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Akaki, a patissier, can make <var>N</var> kinds of doughnut using only a certain powder called "Okashi no Moto" (literally "material of pastry", simply called Moto below) as ingredient. These doughnuts ... |
p02131 | <h1>Problem H: Hth Number</h1>
<h2>Problem</h2>
<p>
長さ$N$の文字列$S$がある。$S$に含まれる文字はすべて0以上9以下の数字である。<br>
$S$のすべての部分文字列から作られる数を全列挙してできた項数$\frac{N\times(N+1)}{2}$の数列を作った時、
その数列の中で$H$番目に小さい値を求めよ。
</p>
<h2>Input</h2>
<p>入力は以下の形式で与えられる。</p>
<pre>
$N$ $H$
$S$
</pre>
<p>
入力はすべて整数で与えられる。<br>
1行目に$N$と$H$が空白区切りで与えられる。<br>
2行... |
p02561 | <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>.
Some of the squares contain an o... |
p03059 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>A biscuit making machine produces <var>B</var> biscuits at the following moments: <var>A</var> seconds, <var>2A</var> seconds, <var>3A</var> seconds and each subsequent multiple of <var>A</var> seconds ... |
p01064 |
<h1>Array Update 2</h1>
<h2>Problem</h2>
<p>
項数 <var>N</var> 、初項 <var>a</var> 、公差<var>d</var>の等差数列 <var>A</var> がある。
以下の形式で、数列を書き換える <var>M</var> 個の命令文が与えられるので、与えられた順序で <var>M</var> 回
数列 <var>A</var> を書き換えたときの数列 <var>A</var> の <var>K</var>項目の値を求めなさい。
</p>
<ul>
<li>
<var>i</var> 番目の命令文は3つの整数<var> x<s... |
p03409 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>On a two-dimensional plane, there are <var>N</var> red points and <var>N</var> blue points.
The coordinates of the <var>i</var>-th red point are <var>(a_i, b_i)</var>, and the coordinates of the <var>i<... |
p01434 |
<script type="text/javascript" src="./varmath.js" charset="UTF-8"></script>
<h2>問題文</h2>
<p>
委員長の魔女 PATRICIA は,蜘蛛のような糸を吐き結界の中で暮らしている.使い魔の MATHIEU は,委員長の魔女が吐いた糸を引っぱり自在に空を飛んでいる.糸は空間上の線分とみなすことにする.
</p>
<p>
<i>暁美ほむら</i>は委員長の魔女に対して攻撃を仕掛けようとし,爆弾と間違えて花火玉を投げ込んでしまった.その結果,それぞれの糸について,魔女から距離 <var>p_1, ..., p_M</var> の位置にある部分が切れる... |
p01967 | <h2>A:沢山の種類の林檎 (Many Kinds of Apples)</h2>
<h3>Problem Statement</h3>
<p>Apple Farmer Mon has two kinds of tasks: "harvest apples" and "ship apples".</p>
<p>There are <var>N</var> different species of apples, and <var>N</var> distinguishable boxes. Apples are labeled by the species, and boxes are also labeled, from ... |
p00675 |
<h1>Problem G: Sports Days</h1>
<p>
会津大学附属小学校(会津大小)は日本有数の競技プログラマー養成校として有名である。
もちろん、運動会に参加しているときでさえアルゴリズムの修行を欠かせない。
</p>
<p>
競技プログラミング部部長のあなたはもちろんこの大会でも勝利したい。
今回はある競技に注目する。
</p>
<p>
ある競技とは会津大小で行われている伝統的な競技だ。
校庭にコーンがn個置いてある。
コーンは4色用意されている。
コーンのいくつかのペアは白線で描かれた矢印で結ばれている。
矢印は片側だけについており、整数が併記されている。
</p>
<p>
競技者はk人1チームとして行動... |
p02648 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a rooted binary tree with <var>N</var> vertices, where the vertices are numbered <var>1</var> to <var>N</var>.
Vertex <var>1</var> is the root, and the parent of Vertex <var>i</var> (<var>i \geq... |
p00225 |
<H1>こぶたぬきつねこ</H1>
<p>
A子さんの家に親戚のB男君がやってきました。彼は3歳で歌が大好きです。彼は幼稚園でならった「こぶたぬきつねこ」(山本直純作詞・作曲)という歌を一生懸命に歌っています。この歌では、4つのことば「こぶた」 「たぬき」 「きつね」「ねこ」が順にしりとりになっていて、さらに最後の音と最初の音が同じになっています。B男君は、A子さんに、同じようなしりとりが、B男君が言った単語から作れるか教えて欲しいと言われました。
</p>
<p>
そこで、A子さんを助けるために、与えられた単語から、その単語をすべて使って、順にしりとりをつくり、その上で、 第1 の単語の最初の文字と最終の単... |
p02218 | <span class="lang">
<span class="lang-ja">
<h1>G: 一番遠い町</h1>
<div class="part">
<section>
<h3>問題文</h3><p>$N$ 個の町と $N-1$ 個の道があります。</p>
<p>すべての町と道にはそれぞれ $1$ から $N$, $1$ から $N-1$ の番号がついています。</p>
<p>道 $i$ は町 $a_i$ と町 $b_i$ を距離 $d_i$ で双方向につないでいます。</p>
<p>最初はすべての道が通行可能な状態であり、どの町からもいくつかの道を通ることですべての町に行くことができます。</p>
<p>すいばかくんは... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.