question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p03161 | <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>.</p>
<p>There is a frog who is ... |
p03531 | <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.<... |
p03862 | <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> boxes arranged in a row.
Initially, the <var>i</var>-th box from the left contains <var>a_i</var> candies.</p>
<p>Snuke can perform the following operation any number of times:</p... |
p02770 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a sequence of <var>k</var> numbers: <var>d_0,d_1,...,d_{k - 1}</var>.</p>
<p>Process the following <var>q</var> queries in order:</p>
<ul>
<li>The <var>i</var>-th query contains three integers <... |
p02320 |
<H1>Knapsack Problem with Limitations</H1>
<br/>
<p>
You have <var>N</var> items that you want to put them into a knapsack. Item <var>i</var> has value <var>v<sub>i</sub></var>, weight <var>w<sub>i</sub></var> and limitation <var>m<sub>i</sub></var>.
</p>
<p>
You want to find a subset of items to put such that:
</p>
... |
p03927 | <span class="lang-en">
<p>Score : <var>1900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a grid with <var>H</var> rows and <var>W</var> columns. The square at the <var>i</var>-th row and <var>j</var>-th column contains a character <var>S_{i,j}</var>.</p>
<p>He can perform the fol... |
p02635 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a string <var>S</var> consisting of <code>0</code> and <code>1</code>. Find the number of strings, modulo <var>998244353</var>, that can result from applying the following operation on <var>S</... |
p00608 |
<H1><font color="#000000">Problem D:</font> Indian Puzzle</H1>
<p>
In the Indian Puzzle, one is intended to fill out blanks with numbers and operators in a <i>n</i> by <i>n</i> grid in order to make equalities in the grid true (See Figure 1).
</p>
<br>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/image... |
p02265 |
<H1>Doubly Linked List</H1>
<p>
Your task is to implement a double linked list.
</p>
<p>
Write a program which performs the following operations:
</p>
<ul>
<li>insert x: insert an element with key x into the front of the list.</li>
<li>delete x: delete the first element which has the key of x from the list. If there... |
p00258 |
<H1>ビートパネル</H1>
<p>
遊太君は、近所のゲームセンターで人気のゲーム「ビートパネル」にはまっています。このゲームは図のようなグリッド状に並べられた 4×4 の計16個のパネル型のボタンからなります。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_beatPanel">
</center>
<br/>
<p>
図のように、左上から右下にボタン1, ボタン2, …, ボタン16の順にボタンが並んでいます。ゲームでは一定間隔でビート音が鳴り最後に終了音が鳴ります。ビート音が鳴ると同時に複数のボタンが光り... |
p01019 |
<h1>Problem D: Cheat Case</h1>
<h2>Problem</h2>
<p>
算数のテストを受けることになった俺達は、今から勉強しても赤点を取ってしまうことを確信し、カンニングで乗り切ることを決意した。
</p>
<p>
算数のテスト問題を作成するA先生はテスト用紙を手書きで作ることで知られている。彼がテスト問題を作成している時の筆跡情報を、近所の博士に作ってもらった筆跡盗聴鉛筆で盗み取る作戦だ。だが肝心の筆跡情報から問題を復元するプログラムは博士の技術では作ることができなかった。しかも、たとえ問題が復元できたとしても、俺達の頭脳では問題を解くことができない。どうすることもできなくなった俺達は、プログ... |
p03024 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi is competing in a sumo tournament.
The tournament lasts for <var>15</var> days, during which he performs in one match per day.
If he wins <var>8</var> or more matches, he can also participate ... |
p01449 |
<H1>Problem 3: 時空のスゴロク・ロード</H1>
<p>
全時空統一ディメンション・スゴロク・トーナメント。500 兆人を超える参加者の中から、ただ1人
のスゴロク絶対王者を決定するその大会に、あなたは21世紀の地球代表として参加している。
</p>
<p>
今あなたが挑戦している課題は、自分自身をコマとした1次元スゴロク。端のスタートマスから出発
して、1から6までの目が一つずつ書かれた巨大な6面ダイスを振って出た目の数だけ進むことを繰
り返す、あなたもよく知っている形式のスゴロクだ。スタートマスとは反対の端にあるゴールマスに
止まるとゴールとなる。もちろん、ゴールするまでにサイコロを振った回数が少なければ... |
p03474 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>The postal code in Atcoder Kingdom is <var>A+B+1</var> characters long, its <var>(A+1)</var>-th character is a hyphen <code>-</code>, and the other characters are digits from <code>0</code> through <cod... |
p01367 |
<H1><font color="#000">Problem I:</font> Operator</H1>
<p>
The customer telephone support center of the computer sales company called JAG is now in-
credibly confused. There are too many customers who request the support, and they call the
support center all the time. So, the company wants to figure out how many oper... |
p01737 |
<p>
Ciel, an idol whose appearance and behavior are similar to a fox, is participating in a rehearsal for the live concert which takes place in a few days.
To become a top idol, a large amount of effort is required!
</p>
<p>
The live stage can be expressed as a two-dimensional surface.
The live stage has <var>N</var>... |
p00825 |
<H1><font color="#000">Problem G:</font> Concert Hall Scheduling</H1>
<p>
You are appointed director of a famous concert hall, to save it from bankruptcy. The hall is very
popular, and receives many requests to use its two fine rooms, but unfortunately the previous
director was not very efficient, and it has been los... |
p02818 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has <var>A</var> cookies, and Aoki has <var>B</var> cookies.
Takahashi will do the following action <var>K</var> times:</p>
<ul>
<li>If Takahashi has one or more cookies, eat one of his cookie... |
p00576 | <h1>すごろくと駒 (Sugoroku and Pieces)</h1>
<!-- 時間制限 : 2sec / メモリ制限 : 256MB -->
<h2> 問題文</h2>
<p>
JOI 君はすごろくを持っている.このすごろくは <var>2019</var> 個のマスが横一列に並んだ形をしている.これらのマスには,左端のスタートマスから右端のゴールマスへと順に <var>1</var> から <var>2019</var> までの番号がついている.
</p>
<p>
現在このすごろくの上には,<var>N</var> 個の駒が置かれている.これらの駒には,スタートに近い順に <var>1</var> から <var... |
p00126 |
<h1>パズル</h1>
<p>
たろう君は 9 × 9 のマス目に 1〜9 の数字を配置するパズルで遊んでいます。このパズルでは以下の規則で数字を配置しなければいけません。
</p>
<ul>
<li>同じ列に 1 つの数字はちょうど 1 回だけ現われる</li>
<li>同じ行に 1 つの数字はちょうど 1 回だけ現われる</li>
<li>二重線で区切られた 3 × 3 の各範囲には、1 つの数字はちょうど 1 回だけ現われる</li>
</ul>
<p>
例えば、下の図 1 はそのような規則を満たした配置の一つです。しかしたろう君は、図 2 のようによく規則に反した配置を作... |
p00433 |
<H1>得点</H1>
<h2>問題</h2>
<p>
JOI高校の2人の生徒 A さんと B さんは,情報,数学,理科,英語の4教科の試験を受けた. A さんと B さんのこれら4教科の得点が与えられると, Aさんの合計点 S と Bさんの合計点 T のうち大きな方を出力するプログラムを作成せよ.ただし,同点の場合は S (= T) を出力せよ.
</p>
<H2>入力</H2>
<p>
<!--入力ファイルは2行からなる.-->
入力は2行からなる.
</p>
<p>
1行目は4つの整数が1つの空白を区切りとして書かれており,それぞれ順に, A さんの情報の得点,数学の得点,理科の得点,英語の得点を表している.
<... |
p00063 |
<H1>回文</H1>
<p>
半角アルファベット文字列からなる、1 行あたり 100 文字以内のデータがあります。いくつかの行は対称(左端から読んでも右端から読んでも同じ)です。このデータを読み込んで、その中の対称な文字列の数を出力するプログラムを作成してください。なお、1文字だけからなる行は対称であるとします。
</p>
<H2>Input</H2>
<p>
複数の文字列が複数行にわたって与えられます。各行に1つの文字列が与えられます。文字列の数は 50 を超えません。
</p>
<H2>Output</H2>
<p>
対称な文字列の数を1行に出力します。
</p>
<H2>Sample Input</H2>
... |
p00599 |
<H1><font color="#000000">Problem E:</font> Combinatorial Topology </H1>
<p>
It was long believed that a 2-dimensional place can not be filled with a finite set of polygons in aperiodic way. British mathematician, Sir Roger Penrose, developed an aperiodic tiling over the years and established a theory of what is know... |
p01222 |
<H1><font color="#000">Problem G:</font> Walk under a Scorching Sun</H1>
<p>
Edward R. Nelson is visiting a strange town for some task today. This city is built on a two-dimensional
flat ground with several vertical buildings each of which forms a convex polygon when seen from above
on it (that is to say, the buidlin... |
p04020 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a large collection of cards. Each card has an integer between <var>1</var> and <var>N</var>, inclusive, written on it.
He has <var>A_i</var> cards with an integer <var>i</var>.</p>
<p>Two card... |
p01672 |
<h2>F - Point Distance</h2>
<h3>Problem Statement</h3>
<p>
You work for invention center as a part time programmer. This center researches movement of protein molecules. It needs how molecules make clusters, so it will calculate distance of all pair molecules and will make a histogram.
Molecules’ positions are given... |
p00960 |
<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... |
p01388 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<h1><font color="#000">問題 A </font> KUPC</h1>
<h2>問題文</h2>
<p>とある学生が,Kyoto University Programming Contest (KUPC) を開こうと考えた.そこで彼は,看板を作って皆に宣伝することにした.今,手元にはアルファベット <var>1</var> 文字の書かれた板がいくつもある.これらの板から <tt>'K'</tt>,<tt>'U'</tt>,<tt>'P'</tt>,<tt>'C'</tt> という文字の書... |
p02377 |
<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>
<H1>Minimum Cost Flow</H1>
<p>
F... |
p01808 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<!-- begin en only -->
<h3><u>Kuru Kuru Door</u></h3>
<... |
p03835 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given two integers <var>K</var> and <var>S</var>.<br/>
Three variable <var>X, Y</var> and <var>Z</var> takes integer values satisfying <var>0≤X,Y,Z≤K</var>.<br/>
How many different assignments o... |
p02727 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are going to eat <var>X</var> red apples and <var>Y</var> green apples.<br/>
You have <var>A</var> red apples of deliciousness <var>p_1,p_2, \dots, p_A</var>, <var>B</var> green apples of deliciousn... |
p03566 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In the year 2168, AtCoder Inc., which is much larger than now, is starting a limited express train service called <em>AtCoder Express</em>.</p>
<p>In the plan developed by the president Takahashi, the ... |
p03136 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Determine if an <var>N</var>-sided polygon (not necessarily convex) with sides of length <var>L_1, L_2, ..., L_N</var> can be drawn in a two-dimensional plane.</p>
<p>You can use the following theorem:<... |
p03423 | <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> students in a school.</p>
<p>We will divide these students into some groups, and in each group they will discuss some themes.</p>
<p>You think that groups consisting of two or les... |
p03589 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given an integer <var>N</var>.</p>
<p>Find a triple of positive integers <var>h</var>, <var>n</var> and <var>w</var> such that <var>4/N = 1/h + 1/n + 1/w</var>.</p>
<p>If there are multiple solu... |
p03073 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><var>N</var> tiles are arranged in a row from left to right. The initial color of each tile is represented by a string <var>S</var> of length <var>N</var>.</p>
<p>The <var>i</var>-th tile from the left ... |
p02232 | <a href="https://onlinejudge.u-aizu.ac.jp/resources/icpcooc2018/A.pdf" target='_blank'>Problem is available from here.</a> |
p02398 |
<H1>How Many Divisors?</H2>
<p>
Write a program which reads three integers <var>a</var>, <var>b</var> and <var>c</var>, and prints the number of divisors of <var>c</var> between <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Three integers <var>a</var>, <var>b</var> and <var>c</var> are given in a line... |
p03970 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>CODE FESTIVAL 2016 is going to be held. For the occasion, Mr. Takahashi decided to make a signboard.</p>
<p>He intended to write <code>CODEFESTIVAL2016</code> on it, but he mistakenly wrote a different ... |
p02662 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given are a sequence of <var>N</var> positive integers <var>A_1</var>, <var>A_2</var>, <var>\ldots</var>, <var>A_N</var> and another positive integer <var>S</var>.<br/>
For a non-empty subset <var>T</va... |
p00130 |
<h1>列車</h1>
<p>
26 両以下の編成の列車があります。それぞれの車両には、英小文字の a から z までの識別記号が付いています。同じ記号が付いている車両はありません。ただし、車両を連結する順番は自由とします。列車の中を車掌が巡回します。車掌は、列車の中を行ったり来たりして巡回するので、同じ車両を何度も通ることがあります。ただし、すべての車両を最低一回は巡回するものとします。また、巡回をはじめる車両や巡回を終える車両が列車の一番端の車両とは限りません。
</p>
<p>
ある車掌が乗ったすべての列車の巡回記録があります。そこから分かる各列車の編成を先頭車両から出力するプログラムを作成してください。巡回記録は ... |
p00560 |
<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>Semiexpress</h1>
<p>
The JOI Railways is... |
p00833 |
<H1><font color="#000">Problem G:</font> Color the Map</H1>
<p>
You were lucky enough to get a map just before entering the legendary magical mystery world.
The map shows the whole area of your planned exploration, including several countries with
complicated borders. The map is clearly drawn, but in sepia ink only; ... |
p01721 |
<p>勇猛果敢なイクタ君はついに悪名高きビッグブリッジ伯爵を追い詰めた! 今やビッグブリッジ伯爵は幅 <var>w</var> メートル、奥行き <var>h</var> メートルの長方形の部屋に閉じ込められており、最期を待つばかりとなっている。
</p>
<p>部屋のある角を選び、幅方向を <var>x</var> 軸、奥行き方向を <var>y</var> 軸に、それぞれ部屋の内部が正の方向になるように座標系をとると、ビッグブリッジ伯爵は点 <var>(p, q)</var> にいる。点 <var>(x, y)</var> にイクタ君の最終兵器である衝撃波発射装置があり、ここから秒速 <var>v</var> メートルの... |
p01371 |
<!-- begin en only -->
<!--<h3><U>Fastest Route</U></h3>-->
<!-- end en only -->
<!-- begin ja only -->
<h3><U>最短ルート</U></h3>
<!-- end ja only -->
<div>
<!-- begin en only -->
<p>
English text is not available in this practice contest.
</p>
<!-- end en only -->
<!-- begin ja only -->
<p>
あなたの所属する知的プログラミングサークル (通称 I... |
p00999 |
<h1>Problem A: Rental DVD Shop NEO</h1>
<h2>Problem</h2>
<p>
僕はレンタルDVDショップ、「NEO」でアルバイトを始めた。まずはこの店の料金システムを勉強することになった。
</p>
<p>
レンタルDVDは旧作、準新作、新作の3種類存在し、1本のレンタル料金がそれぞれ<var> a </var>円、<var> b </var>円、<var> c </var>円である。
会計の際に以下に示すセットレンタルを複数回適用することができる。
</p>
<ul>
<li>まだセットレンタルを適用していないDVDを数本選ぶ。</li>
<li>選んだDVDの本数が<var> d... |
p00976 | <h2>Ranks</h2>
<p>
A <i>finite field</i> <b>F<sub>2</sub></b> consists of two elements: 0 and 1. Addition and multiplication on <b>F<sub>2</sub></b> are those on integers modulo two, as defined below.
</p>
<table align="center">
<tr>
<td>
<table>
<tr >
<td style="border-bottom:1px solid #000; border... |
p01664 |
<h2>I - σ</h2>
<p>
大きさ <var>N</var> の順列とは,数列 <var>(1, 2, 3, …, N)</var> の各要素を並べ替えたものである.
例えば <var>(5, 2, 1, 4, 3)</var> は大きさ <var>5</var> の順列だが,一方で <var>(1, 5, 1, 2, 3)</var> はそうではない.
</p>
<p>
この問題はリアクティブ方式のタスクである.あなたは応答プログラムと「順列当てゲーム」を行う.
まず最初に,応答プログラムは順列 <var>σ</var>を1つ内部で決める.
次に,あなたにはこの順列の大きさ <var>N</var> が伝えられ... |
p03659 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke and Raccoon have a heap of <var>N</var> cards. The <var>i</var>-th card from the top has the integer <var>a_i</var> written on it.</p>
<p>They will share these cards.
First, Snuke will take some n... |
p04036 | <span class="lang-en">
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have an undirected graph with <var>N</var> vertices and <var>M</var> edges. The vertices are numbered <var>1</var> through <var>N</var>, and the edges are numbered <var>1</var> through <var>M</var>. Edge <var>i</var> connects vertices <... |
p01234 |
<H1><font color="#000">Problem A:</font> Defend the Nation</H1>
<p>
Two nations Drone and Moonlamb have been engaged in a war. You have been called up for service as a talented
programmer in Drone.
</p>
<p>
Recently, the army of Moonlamb has set up a new cannon on the field. The army of Drone knows exactly where
it h... |
p03209 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In some other world, today is Christmas.</p>
<p>Mr. Takaha decides to make a multi-dimensional burger in his party. A <em>level-<var>L</var> burger</em> (<var>L</var> is an integer greater than or equal... |
p02048 | <h3>成績上昇大作戦</h3>
<!-- begin ja only -->
<p>受験生の太郎君は <i>N</i> 日間の勉強合宿に参加した.
この合宿では毎日 <i>M</i> 科目のテストを行い,
合宿の終了後にはすべてのテストの点数が書かれた成績表が配られる.
成績表は <i>N</i> 枚の紙からなっており,<i>i</i> 枚目の紙には <i>i</i> 日目の全 <i>M</i> 科目のテストの科目名と点数のみが印刷されている.</p>
<p>成績表に日付が書かれていないことに気付いた太郎君は,お母さんに成績表を渡す前に細工を加えることにした.
成績表の紙の順番を並べ替え,さらに1枚目から順番にページ番号を書き... |
p00075 |
<H1>BMI</H1>
<p>
肥満は多くの成人病の原因として挙げられています。過去においては、一部の例外を除けば、高校生には無縁なものでした。しかし、過度の受験勉強等のために運動不足となり、あるいはストレスによる過食症となることが、非現実的なこととはいえなくなっています。高校生にとっても十分関心を持たねばならない問題になるかもしれません。
</p>
<p>
そこで、あなたは、保健室の先生の助手となって、生徒のデータから肥満の疑いのある生徒を探し出すプログラムを作成することになりました。
</p>
<p>
方法は BMI (Body Mass Index) という数値を算出する方法です。BMIは次の式で与えられます。
... |
p02418 |
<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>Ring</h1><br>
<p>
Write ... |
p00425 |
<H1></H1>
<p>
サイコロが以下の図のような向きで置かれている.
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_2006-yo-t3-fig_base">
</center>
<br>
<p>
ここで使用するサイコロは,この図のように,上側に 1,南側に 2 があるときは,東側に 3 があるものとする.サイコロの向かいあう面の和は必ず 7 なので,見えない面はそれぞれ北側 5,西側 4,下側 6 になっている.
</p>
<p>
この初期配置の状態から指示に従ってサイコロを動かしていく.ただし,指示は... |
p03120 | <span class="lang-en">
<p>Score : <var>1400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Count the number of strings <var>S</var> that satisfy the following constraints, modulo <var>10^9 + 7</var>.</p>
<ul>
<li>The length of <var>S</var> is exactly <var>N</var>.</li>
<li><var>S</var> consi... |
p03570 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a string <var>s</var> consisting of lowercase English letters.
Snuke is partitioning <var>s</var> into some number of non-empty substrings.
Let the subtrings obtained be <var>s_1</var>, <var>s_2... |
p02731 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a positive integer <var>L</var>.
Find the maximum possible volume of a rectangular cuboid whose sum of the dimensions (not necessarily integers) is <var>L</var>.</p>
</section>
</div>
<div clas... |
p03823 | <span class="lang-en">
<p>Score : <var>1100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a set consisting of <var>N</var> distinct integers. The <var>i</var>-th smallest element in this set is <var>S_i</var>. We want to divide this set into two sets, <var>X</var> and <var>Y</var>,... |
p03989 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke loves permutations. He is making a permutation of length <var>N</var>.</p>
<p>Since he hates the integer <var>K</var>, his permutation will satisfy the following:</p>
<ul>
<li>Let the permutation ... |
p02361 | <script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Single Source Shortest Path</H1>
<p>
For a given weighted graph <var>G(V, E)</var> and a source <var>r</var>, find the source shortest path to each vertex from the source (SSSP: Single Source Shortest Path).
</p>
<H2>Input</H2>
<p>
An edge-weighted gr... |
p00649 |
<h1>Problem C: Yanagi's Comic</h1>
<p>
Yanagi is a high school student, and she is called "Hime" by her boyfriend who is a ninja fanboy. She likes picture books very much, so she often writes picture books by herself.
She always asks you to make her picture book as an assistant.
Today, you got asked to help her with m... |
p02674 | <span class="lang-en">
<p>Score : <var>2400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> people (with different names) and <var>K</var> clubs. For each club you know the list of members (so you have <var>K</var> unordered lists). Each person can be a member of many c... |
p03966 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>AtCoDeer the deer is seeing a quick report of election results on TV.
Two candidates are standing for the election: Takahashi and Aoki.
The report shows the ratio of the current numbers of votes the two... |
p00219 |
<H1>ヒストグラム</H1>
<p>
テンアイスクリームという名前のアイスクリーム屋さんがあります。このお店では常に 10 種類のアイスクリームが店頭に並ぶようにしています。お店の店長は商品開発の参考にするために、アイスクリームの売れ具合を表すグラフを毎日作成しています。
</p>
<p>
そんな店長のために、あなたは各アイスクリームの販売数をグラフで表示するプログラムを作成することになりました。
</p>
<p>
一日に販売されるアイスクリームの総数と売れたアイスクリームの番号を入力とし、アイスクリームの種類ごとに販売した数だけ * (半角アスタリスク) を出力するプログラムを作成してください。ただし、アイスクリー... |
p02224 | <span class="lang">
<span class="lang-ja">
<h1>N: 3人協力ゲーム</h1>
<p><span style='color: red;'>リアクティブ問題です。</span></p>
<div class="part">
<section>
<h3>問題文</h3><p>$1000$ ビットの非負整数が $200$ 個あり、$a_1, \ldots, a_{100}, b_1, \ldots, b_{100}$ とします。</p>
<p>アリスは $a_1, \ldots, a_{100}$ を確認し、$3000$ ビットのメモ $X$ をチャーリーのために残します。</p>
<p>ボ... |
p03065 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a polynomial of degree <var>N</var> with integer coefficients: <var>f(x)=a_Nx^N+a_{N-1}x^{N-1}+...+a_0</var>. Find all prime numbers <var>p</var> that divide <var>f(x)</var> for every inte... |
p01058 |
<h1>Point in The Triangle</h1>
<h2>Problem</h2>
<p>
点(0,0),(<var>n</var>-1,0),(0,<var>m</var>-1),(<var>n</var>-1,<var>m</var>-1)に囲まれた長方形の閉区間内から格子点を3点選び、三角形を作る。<br>
このとき、点(<var>x<sub>1</sub></var>,<var>y<sub>1</sub></var>)を含むが点(<var>x<sub>2</sub></var>,<var>y<sub>2</sub></var>)を含まない三角形の数と点(<var>x<sub>2</sub></var>,<... |
p03435 | <span class="lang-en">
<p>Score: <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>We have a <var>3 \times 3</var> grid. A number <var>c_{i, j}</var> is written in the square <var>(i, j)</var>, where <var>(i, j)</var> denotes the square at the <var>i</var>-th row from the top and the ... |
p01408 |
<H1>B: Brilliant Stars</H1>
<p>
ICPC で良い成績を収めるには修行が欠かせない.うさぎは ICPC で勝ちたいので,今日も修行をすることにした.
</p>
<p>
今日の修行は,夜空に輝くたくさんの星たちを観測して,視力と集中力を鍛えようというものである.うさぎは独自のセンスで星の特徴を記録していくことができる.
</p>
<p>
うさぎは「星の観測日記」として記録した星の特徴をノートにつけていくことにした.ここで,「似ている」 2 つの星をともに記録することは避けたい.2 つの星が「似ている」かどうかは,すべてうさぎの判断で決まっている.「似ている」かどうかの関係はあまり複雑ではなく,以下の... |
p01326 |
<h1><font color="#000">Problem F:</font> UTF-8</h1>
<p>UTF-8はマルチバイト文字を符号化する手法の一つである。</p>
<p>文字は計算機上ではバイト列として扱われる。英語だけであればラテンアルファベットおよび数字、記号を合わせても 1byteで表現できるが、残念ながら世界中で利用されている文字を1byteで表現することはできないため、複数のバイトを用いて文字を表す必要がある。</p>
<p>ここで例えば"あ"という文字に12354(0x3042)という2バイト列を割り当てたとき、そのままバイト列を並べると0x30,0x42と2文字なのか0x3042で1文字なのかが区... |
p02859 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is an integer <var>r</var>.</p>
<p>How many times is the area of a circle of radius <var>r</var> larger than the area of a circle of radius <var>1</var>?</p>
<p>It can be proved that the answer is... |
p00864 |
<H1><font color="#000">Problem A:</font> Grey Area</H1>
<p>
Dr. Grey is a data analyst, who visualizes various aspects of data received from all over the
world everyday. He is extremely good at sophisticated visualization tools, but yet his favorite is
a simple self-made histogram generator.
</p>
<p>
Figure 1 is a... |
p01776 |
<h2>E: Do You Divide It? / 切り刻む気か?</h2>
<h3>物語</h3>
<p>T君は過去に出場したプログラミングコンテストで平面図形の問題にひどく手こずらされ,それ以来,平面図形に強い恨みを抱いている.</p>
<p>中でも,特に二次元平面上に描かれる多角形に対して複雑な感情を抱いているため,多角形を見かけると切り刻まずにはいられない.</p>
<p>T君が多角形を切り刻むときには,y軸に平行に幅<var>0.5</var>の間隔でスリットの入った板で多角形を覆い,スリットで見えない部分を切り刻んで捨ててしまう.</p>
<p>しかしながら,T君は一方的な殺戮を好まないため,多角形に再起の... |
p00537 |
<h2>鉄道旅行 (Railroad Trip)</h2>
<p>
JOI 国には <var>N</var> 個の都市があり,それぞれ 1, 2, . . . , <var>N</var> の番号が付けられている.また,鉄道が <var>N</var> − 1 本あり,それぞれ 1, 2, . . . , <var>N</var> − 1 の番号が付けられている.鉄道 i (1 ≤ <var>i</var> ≤ <var>N</var> − 1) は,都市 <var>i</var> と都市 <var>i</var> + 1 を双方向に結んでいる.
<p>
JOI 国の鉄道に乗車する方法として,紙の切符で乗車する方... |
p00167 |
<H1>バブルソート</H1>
<p>
データを並べ替えるための整列(ソート)アルゴリズムはコンピュータ科学には欠かせない基本的なアルゴリズムです。例えば、下図のように「整数値の配列の要素を昇順に並べ替える」という操作が整列です。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_bubbleSort1"><br>
</center>
<p>
多くの整列アルゴリズムが考案されてきましたが、その中でも基本的なアルゴリズムの1つがバブルソートです。例として、与えられた整数値の配列をバブルソートで昇順に並べてみます。
<... |
p00472 |
<H1>旅人</H1>
<h2> 問題</h2>
<p>
あなたは JOI 街道を旅する旅人である.JOI 街道は東西にまっすぐに延びた道路で,JOI 街道上には n 個の宿場町がある.宿場町には西から東の順に 1 から n までの番号が付けられている.JOI 街道上の最も西の宿場町が宿場町 1 であり,最も東の宿場町が宿場町 n である.
</p>
<p>
あなたは,宿場町 1 から出発して m 日間の旅に出ることになった.あなたの旅程は数列 a1 , a2 , . . . , am に従い,次のように決められている.ai は i 日目の移動方法を表す 0 ではない整数である.i 日目にあなたが出発する宿場町を宿場... |
p00188 |
<H1>探索</H1>
<p>
「探索」とは、たくさんの情報の中から望みの情報を得る操作のことです。身近な例では、合格発表の時の「たくさんの受験番号から自分の受験番号を見つける」ことや、電話帳から「会津太郎さんの電話番号を見つける」ときなどがあります。この探索という操作はコンピュータの分野でも広く用いられています。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_search">
</center>
<br/>
<p>
探索の方法は沢山あります。探索の対象となるデータが、小さい順(または大きい順)に並べられている... |
p00022 |
<H1>Maximum Sum Sequence</H1>
<p>
Given a sequence of numbers <var>a<sub>1</sub></var>, <var>a<sub>2</sub></var>, <var>a<sub>3</sub></var>, ..., <var>a<sub>n</sub></var>, find the maximum sum of a contiguous subsequence of those numbers. Note that, a subsequence of one element is also a <i>contiquous</i> subsequence... |
p01263 |
<H1><font color="#000">Problem D:</font> Reaction</H1>
<p>
You are a hero of a role playing game, asked by the king to defeat monsters threating people’s life.
</p>
<p>
You have been making a long journey with your colleagues, and you are now in the town closest to the
final dungeon where the head of monsters dwells.... |
p01799 |
<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 J
New Game AI</h2>
<p... |
p00921 |
<H1><font color="#000">Problem H: </font>Don't Burst the Balloon</H1>
<p>
An open-top box having a square bottom is placed on the floor. You see a number of needles vertically planted on its bottom.
</p>
<p>
You want to place a largest possible spheric balloon touching the box bottom, interfering with none of the si... |
p01633 |
<h1>Problem G: 穴掘って埋まってます</h1>
<h2>Problem Statement</h2>
<p>
魔法使いの萩原さんは、非常にネガティブな性格である。彼女は、何か落ち込むようなことがあると、穴掘りの魔法を使って穴を作り、泣きながら埋まってしまう。穴掘りの魔法とは、次のようなものである。
</p>
<p>
彼女は、まずN本の線分を地面に描く。そして、彼女が呪文を唱えると、線で囲まれた範囲に穴が出来上がる。交差・内包の関係にある2つの穴は、1つの穴として数える。ただし、頂点のみで接している2つの穴は、別々の穴として数える。
</p>
<p>
図1と図2に、Sample Input 1と2の図を示す。... |
p02336 | <!--<h1>写像12相 その3:ボールに区別なし・箱に区別あり・箱の中身は1つ以上</h1>-->
<h1>Balls and Boxes 6</h1>
<table border="">
<tr><th>Balls</th><th>Boxes</th><th>Any way</th><th>At most one ball</th><th>At least one ball</th></tr>
<tr><th>Distinguishable</th><th>Distinguishable</th><td>1</td><td>2</td><td>3</td></tr>
<tr><th>Indistinguishab... |
p02766 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is an integer <var>N</var>. Find the number of digits that <var>N</var> has in base <var>K</var>.</p>
</section>
</div>
<div class="part">
<section>
<h3>Notes</h3><p>For information on base-<var>K... |
p03874 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><style>
#nck {
width: 30px;
height: auto;
}
</style>
<p>Welcome to CODE FESTIVAL 2016!
In order to celebrate this contest, find a string <var>s</var> that satisfies the following conditi... |
p01849 |
<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-AMS_HTML">
</script>
<h3>ぼくのかんがえたさいきょうのおふとん</h3>
<p>あなたは新生活に備え,おふとんを <i... |
p03527 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Ringo has a string <var>S</var>.</p>
<p>He can perform the following <var>N</var> kinds of operations any number of times in any order.</p>
<ul>
<li>Operation <var>i</var>: For each of the characters f... |
p03177 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a simple directed graph <var>G</var> with <var>N</var> vertices, numbered <var>1, 2, \ldots, N</var>.</p>
<p>For each <var>i</var> and <var>j</var> (<var>1 \leq i, j \leq N</var>), you are give... |
p03198 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> positive integers <var>A_1, A_2, ..., A_N</var>.
Takahashi can perform the following operation on these integers any number of times:</p>
<ul>
<li>Choose <var>1 \leq i \leq N</var... |
p03462 | <span class="lang-en">
<p>Score : <var>1100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> white balls arranged in a row, numbered <var>1,2,..,N</var> from left to right.
AtCoDeer the deer is thinking of painting some of these balls red and blue, while leaving some of ... |
p03032 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Your friend gave you a dequeue <var>D</var> as a birthday present.</p>
<p><var>D</var> is a horizontal cylinder that contains a row of <var>N</var> jewels.</p>
<p>The <em>values</em> of the jewels are <... |
p02789 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Takahashi is participating in a programming contest, AXC001. He has just submitted his code to Problem A.<br/>
The problem has <var>N</var> test cases, all of which must be passed to get an AC verdict.... |
p02273 |
<H1>Koch Curve</H1>
<p>
Write a program which reads an integer <i>n</i> and draws a Koch curve based on recursive calles of depth <i>n</i>.
</p>
<p>
The Koch curve is well known as a kind of <a href="http://en.wikipedia.org/wiki/Fractal">fractals</a>.
</p>
<p>
You can draw a Koch curve in the following algorithm:... |
p02623 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have two desks: A and B. Desk A has a vertical stack of <var>N</var> books on it, and Desk B similarly has <var>M</var> books on it.</p>
<p>It takes us <var>A_i</var> minutes to read the <var>i</var>... |
p03931 | <span class="lang-en lang-child hidden-lang">
<div id="task-statement">
<div class="part">
Max Score: $400$ Points
<section>
<h3>Problem Statement</h3>
<h3>Sample testcase 3 has a mistake, so we erased this case and rejudged all solutions of this problem. (21:01)</h3>
Snuke got a sequence $a$ of length ... |
p02337 | <!--<h1>写像12相 その7:ボールに区別あり・箱に区別なし・入れ方に制限なし</h1>-->
<h1>Balls and Boxes 7</h1>
<table border="">
<tr><th>Balls</th><th>Boxes</th><th>Any way</th><th>At most one ball</th><th>At least one ball</th></tr>
<tr><th>Distinguishable</th><th>Distinguishable</th><td>1</td><td>2</td><td>3</td></tr>
<tr><th>Indistinguishabl... |
p02767 | <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 living on a number line.</p>
<p>The <var>i</var>-th person lives at coordinate <var>X_i</var>.</p>
<p>You are going to hold a meeting that all <var>N</var> people have to a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.