question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p03779 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a kangaroo at coordinate <var>0</var> on an infinite number line that runs from left to right, at time <var>0</var>.
During the period between time <var>i-1</var> and time <var>i</var>, the kan... |
p01314 |
<h1><font color="#000">Problem A:</font> Sum of Consecutive Integers</h1>
<!--
<h3><U>連続する整数の和</U></h3>
-->
<p>あなたは数か月に渡る受験戦争を勝ち抜き,晴れてICPC大学に入学することができた.入学手続きの日,大学のキャンパス内では熱狂的なサークルの勧誘活動が行われており,あなたは大量のパンフレットを受け取って帰ってきた.部屋に戻ってきたあなたは受け取ったパンフレットの中から気になる一枚を見つけた.そのパンフレットは大学の広報部から渡されたものだった.</p>
<p>パンフレットには以下のような問題が記されていた... |
p03329 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>To make it difficult to withdraw money, a certain bank allows its customers to withdraw only one of the following amounts in one operation:</p>
<ul>
<li>
<p><var>1</var> yen (the currency of Japan)</p>
... |
p00913 |
<H1><font color="#000">Problem J: </font>Cubic Colonies</H1>
<p>
In AD 3456, the earth is too small for hundreds of billions of people to live in peace. Interstellar Colonization Project with Cubes (ICPC) is a project that tries to move people on the earth to space colonies to ameliorate the problem. ICPC obtained fu... |
p01601 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<h2>回文数</h2>
<h2>Problem Statement</h2>
<p>整数<var>n</var>に最も近い回文数を求めよ.</p>
<p>なお,非負整数<var>x</var>が回文数であるとは,<var>x</var>を十進法で表現した文字列とそれを反転させた文字列が等しいことをいう.<br />
例えば0,7,33,10301などは回文数であり,32,90,1010などは回文数でない.</p>
<h2>Input</h2>
<p>入力は以下の形式に従う.与えられる数は全て整数で... |
p01251 |
<H1><font color="#000">Problem B:</font> Left Hand Rule</H1>
<p>
The left-hand rule, which is also known as the wall follower, is a well-known strategy that solves a two-
dimensional maze. The strategy can be stated as follows: once you have entered the maze, walk around
with keeping your left hand in contact with th... |
p02884 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a cave consisting of <var>N</var> rooms and <var>M</var> one-directional passages. The rooms are numbered <var>1</var> through <var>N</var>.</p>
<p>Takahashi is now in Room <var>1</var>, and Ro... |
p03796 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke loves working out. He is now exercising <var>N</var> times.</p>
<p>Before he starts exercising, his <em>power</em> is <var>1</var>. After he exercises for the <var>i</var>-th time, his power gets ... |
p00010 |
<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>Circumscribed Circle of A Triangle.</H1>
<p... |
p00440 |
<H1>最長の階段 </H1>
<h2>問題</h2>
<p>
1 から <i>n</i> までの整数がそれぞれ 1 つずつ書かれた <i>n</i> 枚のカードと,1 枚の白紙の
カードがある.これら <i>n</i> + 1 枚のカードの内,<i>k</i> 枚のカードが与えられる.ただし,
1 ≤ <i>k</i> ≤ n である.白紙のカードには 1 から <i>n</i> までの整数を 1 つ書くことができ
る.与えられたカードだけで,できるだけ長い連続した整数列を作りたい.
</p>
<p>
与えられるカードが入力されたときに, 与えられたカードから作ることができる連
続した整数列の最大長を出力... |
p02187 | <h2>F: 部分文字列分解</h2>
<h3>問題</h3>
<p>
2 つの文字列 <var>S</var> と <var>T</var> および整数 <var>k</var> が与えられる。
<var>T</var> の長さ <var>k</var> 以上の連続する部分文字列を考えたとき、それらの連結で <var>S</var> を構成できるか判定せよ。
</p>
<p>ここで文字列 <var>s = s_1 s_2 ... s_n</var> の連続する部分文字列 <var>s[l, r] = s_l s_{l+1} ... s_r</var> <var>(1 \leq l \leq r \leq n)</var> と... |
p03145 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a right triangle <var>ABC</var> with <var>∠ABC=90°</var>.</p>
<p>Given the lengths of the three sides, <var>|AB|,|BC|</var> and <var>|CA|</var>, find the area of the right triangle <var>ABC</va... |
p01178 |
<H1><font color="#000">Problem H:</font> Ramen Shop</H1>
<p>
Ron is a master of a ramen shop.
</p>
<p>
Recently, he has noticed some customers wait for a long time. This has been caused by lack of
seats during lunch time. Customers loses their satisfaction if they waits for a long time, and
even some of them will giv... |
p01482 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<h1> Memory Leak</h1>
<p>
Time Limit: 8 sec / Memory Limit: 64 MB
</p>
<h2> D: メモリーリーク</h2>
<p>
あなたの研究室の同期が, 実装中のソフトウェアのバグに悩まされていた.
彼のソフトウェアは, かなり下位のレイヤで動作するソフトウェアであるため,
高機能のデバッガやテストツ... |
p03515 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke Festival 2017 will be held in a tree with <var>N</var> vertices numbered <var>1,2, ...,N</var>.
The <var>i</var>-th edge connects Vertex <var>a_i</var> and <var>b_i</var>, and has <em>joyfulness</... |
p01528 |
<h1>I - 宝探し</h1>
<h2>問題文</h2>
<p>
わたしはある宝探しの依頼を受けた.<br>
どうやら,この近くの地中 <var>2W × 2H</var> の範囲内にお宝が埋まっているらしい.<br>
わたしの得意なダウジングを使えば,現在の位置からお宝がどの方向にねむっているのか知ることができる.
</p>
<p>
ただ,わたしの能力はその日の体調による影響が大きく,今日はダウジングをした時に最大で <var>E</var> 度まで誤差が出てしまいそうだ.<br>
また,わたしの体力にも限界はある.1日に200回までしかダウジングを行うことはできない.
</p>
<p>
わたしは考える... |
p00769 |
<h3>Hierarchical Democracy</h3>
<p>
The presidential election in Republic of Democratia is carried out through multiple stages as follows.
</p>
<ol>
<li>There are exactly two presidential candidates.</li>
<li>At the first stage, eligible voters go to the polls of his/her electoral district.
The winner of the dist... |
p02754 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has many red balls and blue balls. Now, he will place them in a row.</p>
<p>Initially, there is no ball placed.</p>
<p>Takahashi, who is very patient, will do the following operation <var>10^{... |
p03846 | <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, ... |
p00293 |
<h1>路線バスの時刻表</h1>
<p>
バスマニアの健次郎君は、A市内のバスをよく利用しています。ある日ふと、健次郎君の家の前のバス停から出発するすべてのバスを写真に収めることを思い立ちました。このバス停には飯盛山行きと鶴ケ城行きの2つのバス路線が通ります。各路線の時刻表は手に入れましたが、1つの時刻表としてまとめた方がバス停で写真が撮りやすくなります。
</p>
<p>
健次郎君を助けるために、2つの路線の時刻表を、0時0分を基準として出発時刻が早い順に1つの時刻表としてまとめるプログラムを作成してください。
</p>
<h2>入力</h2>
<p>
入力は以下の形式で与えられる。
</p>
<pre>
<var>... |
p00339 |
<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>
あなたは所属するプログラミング部の部室から古びたボ... |
p02304 |
<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>Segment Intersections: Manh... |
p02611 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is an integer <var>N</var>. Snuke will choose integers <var>s_1</var>, <var>s_2</var>, <var>n_1</var>, <var>n_2</var>, <var>u_1</var>, <var>u_2</var>, <var>k_1</var>, <var>k_2</var>, <var>e_1</var... |
p03903 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi found an undirected connected graph with <var>N</var> vertices and <var>M</var> edges. The vertices are numbered <var>1</var> through <var>N</var>. The <var>i</var>-th edge connects vertices <... |
p00786 |
<H1><font color="#000">Problem G:</font>BUT We Need a Diagram</H1>
<p>
Consider a data structure called BUT (Binary and/or Unary Tree). A BUT is defined inductively as follows:
</p>
<ul>
<li>Let <i>l</i> be a letter of the English alphabet, either lowercase or uppercase (n the sequel, we say simply "a letter"). Then... |
p01894 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>D: DAG トリオ / DAG Trio</h1>
<p>
この問題は G: DAG Trio (Hard) と制約... |
p02241 |
<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>Minimum Spanning Tree</H1>
... |
p03000 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>A ball will bounce along a number line, making <var>N + 1</var> bounces. It will make the first bounce at coordinate <var>D_1 = 0</var>, and the <var>i</var>-th bounce <var>(2 \leq i \leq N+1)</var> at ... |
p01197 |
<H1><font color="#000"></font>Rakunarok</H1>
<!-- Problem F -->
<p>
You are deeply disappointed with the real world, so you have decided to live the rest of your life in the world of
MMORPG (Massively Multi-Player Online Role Playing Game). You are no more concerned about the time you
spend in the game: all you need i... |
p03450 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> people standing on the <var>x</var>-axis.
Let the coordinate of Person <var>i</var> be <var>x_i</var>.
For every <var>i</var>, <var>x_i</var> is an integer between <var>0</var> an... |
p01302 |
<H1><font color="#000">Problem J:</font> Cave Explorer</H1>
<p>
Mike Smith is a man exploring caves all over the world.
</p>
<p>
One day, he faced a scaring creature blocking his way. He got scared, but in short time he took
his knife and then slashed it to attempt to kill it. Then they were split into parts, which ... |
p01752 |
<p>
A さんと B 君は,<var>N</var> × <var>M</var> の長方形のマス目状の地域に住んでいる.各マス目は道か壁か家のどれかである.この地域は,道が複雑で入り組んでいるので痴漢被害がよく起こることで有名であるため,この地域と外部との境界は全て壁で囲まれており,隔離されている.
</p>
<p>
B 君はなんとなく気が向いたので,A さんの家を眺めに行くことにした.しかし,不幸なことにB 君は明らかに怪しい顔をしているので,A さんの家に行く途中に少しでも痴漢の疑いがあるような行動を取ったらすぐに捕まってしまうだろう.特に,右手を壁から離して歩くことは絶対にやってはならない.B 君は,... |
p00840 |
<H1><font color="#000">Problem E:</font> Mobile Computing</H1>
<p>
There is a mysterious planet called Yaen, whose space is 2-dimensional. There are many beautiful
stones on the planet, and the Yaen people love to collect them. They bring the stones back home
and make nice mobile arts of them to decorate their 2-dime... |
p03295 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> islands lining up from west to east, connected by <var>N-1</var> bridges.</p>
<p>The <var>i</var>-th bridge connects the <var>i</var>-th island from the west and the <var>(i+1)</v... |
p00513 |
<H1>問題 4 </H1>
<br/>
<p>
IOI 不動産ではマンションの賃貸を行なっている.
この会社が取り扱うマンションの部屋は 1LDK で,
下図のように面積が 2xy+x+y になっている.
ただし, x, y は正整数である.
</p>
<br/>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_Madori" alt="Figure_Madori">
</center>
<br/>
<p>
IOI 不動産のカタログにはマンションの面積が昇順に(狭いものから順番に)書かれているが,この中にいくつか間違... |
p00143 |
<h1>牽牛と織女</h1>
<p>
織女は天帝の子供でしたが、父の言いつけであけてもくれても機を織っていました。
</p>
<p>
織女の織る雲錦という見事な布で仕立てた服を着るのが天帝の楽しみでした。雲錦は寿命が短くすぐに劣化してしまいますが、働き者の織女が毎日織ってくれるので、問題はありませんでした。織女は、父の言いつけを守り、毎日毎日雲錦を織り続けていたので、ボーイフレンドはいませんでした。かわいそうに思った父は、天の川の向こう岸に住む牽牛という働き者を紹介し、嫁入りさせました。
</p>
<p>
すると、織女は、結婚の楽しさに夢中になって、機織りなどそっちのけで、牽牛と遊び呆けています。天帝のお気に入りの雲... |
p02191 | <h2>Range Count Query</h2>
<p>数列<var>a_1,a_2,..,a_N</var>が与えられます。</p>
<p>クエリでは、値が<var>l</var>以上<var>r</var>以下の項の個数を答えてください。</p>
<h3>入力</h3>
<pre>
<var>N Q</var>
<var>a_1 a_2...a_N</var>
<var>l_1 r_1</var>
<var>l_2 r_2</var>
:
<var>l_q r_q</var>
</pre>
<h3>出力</h3>
<pre>
<var>ans_1</var>
<var>ans_2</var>
:
<var>ans_q</... |
p00456 |
<H1> コンテスト </H1>
<h2>問題</h2>
<p>
先日,オンラインでのプログラミングコンテストが行われた. W大学とK大学のコンピュータクラブは以前からライバル関係にあり,このコンテストを利用して両者の優劣を決めようということになった.
</p>
<p>
今回,この2つの大学からはともに10人ずつがこのコンテストに参加した.長い議論の末,参加した10人のうち,得点の高い方から3人の得点を合計し,大学の得点とすることにした.
</p>
<p>
W大学およびK大学の参加者の得点のデータが与えられる.このとき,おのおのの大学の得点を計算するプログラムを作成せよ.
</p>
<h2>入力</h2>
<p>
入力... |
p00006 |
<H1>Reverse Sequence</H1>
<p>
Write a program which reverses a given string <var>str</var>.
</p>
<H2>Input</H2>
<p>
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
</p>
<H2>Output</H2>
<p>
Print the reversed <var>str</var> in a line.
</p>
<H2>Sample Input</H2>
<pre>
w32nimda
</pre>
<H2>O... |
p03780 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>AtCoDeer the deer has <var>N</var> cards with positive integers written on them. The number on the <var>i</var>-th card <var>(1≤i≤N)</var> is <var>a_i</var>.
Because he loves big numbers, he calls a sub... |
p04045 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha is very particular about numbers. There are <var>K</var> digits that she dislikes: <var>D_1, D_2, ..., D_K</var>.</p>
<p>She is shopping, and now paying at the cashier.
Her total is <var>N</var> y... |
p02892 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a connected undirected graph with <var>N</var> vertices and <var>M</var> edges. The vertices are numbered <var>1</var> to <var>N</var>, and the edges are described by a grid of characters <var>... |
p01247 |
<H1><font color="#000">Problem G:</font> Japanese Style Pub</H1>
<p>
You’ve just entered a Japanese-style pub, or an <i>izakaya</i> in Japanese, for a drinking party (called <i>nomi-kai</i>) with
your dear friends.
</p>
<p>
Now you are to make orders for glasses of hard and soft drink as requested by the participants... |
p01617 |
<h1>E: Twins Idol / ツインズアイドル</h1>
<p>アイドル事務所841プロダクションには,多くの個性的なアイドル達が所属している. 双子のアイドルであるアキ&マキは,841プロに所属するアイドルであり,2人ともとてもゲーム好きである. ある日2人は,次のようなゲームを自分達で自作して楽しむことにした. このゲームは,2人で協力するタイプのゲームであるため,双子の息の合ったプレイが期待される.</p>
<p>まず,ゲームを始める前に,2人が別々に自分の好きなようにフィールドを床に描く. フィールドは,アルファベットの1文字が書かれたいくつかのボードと,ボード間をつなぐルート... |
p00905 |
<H1><font color="#000">Problem B: </font>Stylish</H1>
<p>
<i>Stylish</i> is a programming language whose syntax comprises <i>names</i>, that are sequences of Latin alphabet letters, three types of <i>grouping symbols</i>, periods ('.'), and newlines. Grouping symbols, namely round brackets ('(' and ')'), curly bracke... |
p02938 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given are integers <var>L</var> and <var>R</var>. Find the number, modulo <var>10^9 + 7</var>, of pairs of integers <var>(x, y)</var> <var>(L \leq x \leq y \leq R)</var> such that the remainder when <va... |
p02312 |
<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>Intersection of a Circle and a Polygon</H1>... |
p00285 |
<h1>微生物発電</h1>
<p>
飯沼博士は磐梯山の噴気孔でふしぎな微生物を見つけました。この微生物の雄と雌1体ずつが合体すると、電気エネルギーを放出します。この微生物を研究すれば、将来のエネルギー危機から我々を救えるかもしれません。
</p>
<p>
観察を続けると、微生物は合体したときだけ電気エネルギーを発生させることと、合体した微生物のさらなる合体はないことがわかりました。さらに観察を続けると、合体で放出される電気エネルギーは、微生物が体内に持つ未知の粒子(博士はこれを磐梯山にちなんでB粒子と名づけました)の量で決まることがわかりました。合体する雄と雌が体内に持つB粒子の量をそれぞれ <var>bm</var> ... |
p03850 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Joisino has a formula consisting of <var>N</var> terms: <var>A_1</var> <var>op_1</var> <var>A_2</var> <var>...</var> <var>op_{N-1}</var> <var>A_N</var>.
Here, <var>A_i</var> is an integer, and <var>op_i... |
p02742 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a board with <var>H</var> horizontal rows and <var>W</var> vertical columns of squares.
There is a bishop at the top-left square on this board.
How many squares can this bishop reach by zero or ... |
p03503 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Joisino is planning to open a shop in a shopping street.</p>
<p>Each of the five weekdays is divided into two periods, the morning and the evening. For each of those ten periods, a shop must be either o... |
p01494 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
</script>
<h2>Problem I:
ThreeRooks
</h2>
... |
p03153 | <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> cities in Republic of AtCoder. The size of the <var>i</var>-th city is <var>A_{i}</var>.
Takahashi would like to build <var>N-1</var> bidirectional roads connecting two cities so ... |
p03446 | <span class="lang-en">
<p>Score : <var>2100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a rectangular parallelepiped of dimensions <var>A×B×C</var>, divided into <var>1×1×1</var> small cubes.
The small cubes have coordinates from <var>(0, 0, 0)</var> through <var>(A-1, B-1, C-1)</... |
p01181 |
<H1><font color="#000">Problem A:</font> Moduic Squares</H1>
<p>
Have you ever heard of Moduic Squares? They are like 3 × 3 Magic Squares, but each of them has one
extra cell called a moduic cell. Hence a Moduic Square has the following form.
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/imag... |
p03016 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><!-- You are given <var>Q</var> tuples of integers <var>(L_i, A_i, B_i, M_i)</var>. For each tuple, answer the following question. -->
<p>There is an arithmetic progression with <var>L</var> terms: <var>s_... |
p02257 |
<H1>Prime Numbers</H1>
<p>
A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.
</p>
<p>
Write a program which reads a list of <i>N</i> integers and prints the number of prime numbers in the list.
</p>
... |
p01882 |
<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>We don't wanna work!</h2>
<p>
... |
p00790 |
<H1><font color="#000">Problem C:</font> Die Game</H1>
<p>
Life is not easy. Sometimes it is beyond your control. Now, as contestants of ACM ICPC, you might be just tasting the bitter of life. But don't worry! Do not look only on the dark side of life, but look also on the bright side. Life may be an enjoyable game o... |
p01928 |
<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>マトリョーシカはロ... |
p03915 | <span class="lang-en">
<p>Score : <var>1300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a graph with <var>N</var> vertices, numbered <var>0</var> through <var>N-1</var>. Edges are yet to be added.</p>
<p>We will process <var>Q</var> queries to add edges.
In the <var>i</var>-th <va... |
p02607 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> squares assigned the numbers <var>1,2,3,\ldots,N</var>. Each square has an integer written on it, and the integer written on Square <var>i</var> is <var>a_i</var>.</p>
<p>How many s... |
p00114 |
<h1>電子蝿</h1>
<p>
ある計算機学者が電子空間に棲息する電子蝿という奇妙な生命体を見つけました。電子蝿の行動を観察しているうちに、この空間の (<var>x</var>, <var>y</var>, <var>z</var>) 地点にいる電子蝿は、次に以下の規則で示される (<var>x'</var>, <var>y'</var>, <var>z'</var>)に移動することが分かりました。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_electroFly">
</center>
<br/>
<p... |
p02129 | <h1>Problem F: Ghost Legs</h1>
<h2>Problem</h2>
<p>
縦線が3本のあみだくじが$N$個ある。<br>
どの線からスタートしてもスタートした線で終わるあみだくじを良いあみだくじとする。<br>
あみだくじを1つ以上選んで縦に自由な順序でつなぐことができる。<br>
良いあみだくじを作ることができるのであれば"yes"、そうでなければ"no"を出力せよ。<br>
<br>
$i$番目のあみだくじには横線が$w_i$本ある。<br>
$a_{i,j}$はあみだくじ$i$の上から$j$番目の横棒が中央の縦線から左右どちらに伸びているかを表し、<br>
$a_{i,j}$が0ならば左に、1な... |
p02083 | <h1>F: Clique Drawing</h1>
<h2>問題文</h2>
<p>$M$ 回操作を行って $N$ 頂点のグラフを作ります。
初め、$N$ 頂点のどの頂点間にも辺は存在しません。
$i$ 番目の操作では、頂点集合 $\{ v_{i, 1}, v_{i, 2}, ... , v_{i, K_i} \}$ の全ての $2$ 頂点間に辺を張ります。ただし、以前の操作によって既に辺が貼られている頂点間には張りません。
また、どの頂点も $M$ 回の操作の内高々 $2$ 回の操作にしか現れません。
これらの操作によって出来たグラフ上の、最大独立集合の大きさを求めてください。</p>
<p>無向グラフ $G = (V, E)$... |
p00544 |
<h1>ロシアの旗 (Russian Flag)</h1>
<h2> 問題</h2>
<p>
K 理事長はロシアで開催される IOI 2016 に合わせて旗を作ることにした.K 理事長はまず倉庫から古い旗を取り出してきた.この旗は N 行 M 列のマス目に分けられていて,それぞれのマスには白・青・赤のいずれかの色が塗られている.
</p>
<p>
K 理事長はこの旗のいくつかのマスを塗り替えて<b>ロシアの旗</b>にしようとしている.ただし,この問題でいうロシアの旗とは以下のようなものである.
</p>
<ul>
<li>上から何行か (1 行以上) のマスが全て白で塗られている.</li>
<li>続く何行か (... |
p02579 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>A maze is composed of a grid of <var>H \times W</var> squares - <var>H</var> vertical, <var>W</var> horizontal.</p>
<p>The square at the <var>i</var>-th row from the top and the <var>j</var>-th column f... |
p03738 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given two positive integers <var>A</var> and <var>B</var>. Compare the magnitudes of these numbers.</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1 ≤ A, B ... |
p01705 |
<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... |
p00817 | <H1><font color="#000">Problem G:</font> True Liars</H1>
<p>
After having drifted about in a small boat for a couple of days, Akira Crusoe Maeda was finally cast ashore on a foggy island. Though he was exhausted and despaired, he was still fortunate to remember a legend of the foggy island, which he had heard from pat... |
p03692 | <span class="lang-en">
<p>Score : <var>1600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a directed graph <var>G</var> 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 <v... |
p02980 | <span class="lang-en">
<p>Score : <var>1800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a square grid with <var>N</var> rows and <var>M</var> columns. Takahashi will write an integer in each of the squares, as follows:</p>
<ul>
<li>First, write <var>0</var> in every square.</li>
<... |
p03368 | <span class="lang-en">
<p>Score : <var>1700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a rooted tree with <var>N</var> vertices, numbered <var>1</var> through <var>N</var>.
Vertex <var>1</var> is the root of the tree, and the parent of Vertex <var>i</var> ( <var>2\leq i \leq N<... |
p01355 |
<H1>Problem G: Nurie</H1>
<p>
紙の上に円が<i>n</i> 個書かれている. うさぎは<i>k</i> 色の絵の具を持っていて, 次のルールに従って紙に色を塗っていく.
</p>
<ul>
<li> 各領域をある1 色の絵の具で塗るか, 何も塗らない. ここで「領域」とは, 円弧の集合で囲まれた面積有限の部分を指す.</li>
<li> 隣り合っている2 つの領域を同じ色の絵の具で塗ることはできない. ここで「隣り合っている」とは,境界の一部を共有する円弧があることを指す. 共有点が有限個である2 つの領域は, 隣り合っているとはみなされない.
</li>
<li> 隣り合っている2 つの... |
p01640 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: { inlineMath: [['\\(','\\)']] }
});
</script>
<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
<h1 class="ndoc-heading1">Problem G: Get Lost</h1>
<p class="ndoc-top... |
p00952 |
<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 G
Placing Medals on ... |
p03387 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given three integers <var>A</var>, <var>B</var> and <var>C</var>. Find the minimum number of operations required to make <var>A</var>, <var>B</var> and <var>C</var> all equal by repeatedly perfo... |
p01210 |
<H1><font color="#000">Problem D:</font> Speed</H1>
<p>
Do you know <i>Speed</i>? It is one of popular card games, in which two players compete how quick
they can move their cards to tables.
</p>
<p>
To play <i>Speed</i>, two players sit face-to-face first. Each player has a deck and a tableau assigned
for him, and b... |
p04012 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let <var>w</var> be a string consisting of lowercase letters.
We will call <var>w</var> <em>beautiful</em> if the following condition is satisfied:</p>
<ul>
<li>Each lowercase letter of the English alph... |
p00051 |
<H1>整数の差</H1>
<p>
8 個の 0 から 9 までの数字を入力したとき、その 8 個の数字を並べ替えてできる、最大の整数と最小の整数の差を出力するプログラムを作成してください。並び替えてできる数は 00135569 のように 0 から始まってもよいものとします。
</p>
<H2>Input</H2>
<p>
複数のデータセットが与えられます。1行目にデータセット数 <var>n</var> (<var>n</var> ≤ 50) が与えられます。続いて <var>n</var> 行のデータが与えられます。各データは 8 個の数字の並び(0 から 9 の数字)です。
</p>
<H2>Output<... |
p02596 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi loves the number <var>7</var> and multiples of <var>K</var>.</p>
<p>Where is the first occurrence of a multiple of <var>K</var> in the sequence <var>7,77,777,\ldots</var>? (Also see Output and... |
p00401 | <h1>2の累乗</h1>
<p>
与えられた数を、それ以下の数の中で最大の$2$の累乗に変換してください。たとえば、$2$や$3$ならば$2^1=2$に変換してください。同様に$4$,$5$,$6$,$7$ならば$2^2=4$に、$8$,$9$,$10$,$11$,...,$15$ならば$2^3=8$に変換してください。
</p>
<p>
与えられた数を、その数以下の数の中で最大の$2$の累乗に変換するプログラムを作成せよ。
</p>
<h2>入力</h2>
<p>
入力は以下の形式で与えられる。
</p>
<pre>
$N$
</pre>
<p>
1行に数$N$ ($2 \leq N \leq 10^6$... |
p01139 |
<!-- begin en only -->
<h3><U>Surrounding Area</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>
ある 2 人の不動産屋が,客船に乗って南の島に向かっていた.青い空,さわ... |
p03104 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let <var>f(A, B)</var> be the exclusive OR of <var>A, A+1, ..., B</var>. Find <var>f(A, B)</var>.</p>
<p><details>
<summary style="display: list-item; outline: none;">What is exclusive OR?</summary></de... |
p01569 |
<h1>Sun and Moon</h1>
<p>In the year 20XX, mankind is hit by an unprecedented crisis.
The power balance between the sun and the moon was broken by the total eclipse of the sun, and the end is looming!
To save the world, the secret society called "Sun and Moon" decided to perform the ritual to balance the ... |
p03554 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a sequence <var>a = \{a_1, ..., a_N\}</var> with all zeros, and a sequence <var>b = \{b_1, ..., b_N\}</var> consisting of <var>0</var> and <var>1</var>. The length of both is <var>N</var>... |
p01093 |
<h3>Selection of Participants of an Experiment</h3>
<p>
Dr. Tsukuba has devised a new method of programming training.
In order to evaluate the effectiveness of this method,
he plans to carry out a control experiment.
Having two students as the participants of the experiment,
one of them will be trained under the conv... |
p03807 | <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> integers written on a blackboard. The <var>i</var>-th integer is <var>A_i</var>.</p>
<p>Takahashi will repeatedly perform the following operation on these numbers:</p>
<ul>
<li>Se... |
p02715 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Consider sequences <var>\{A_1,...,A_N\}</var> of length <var>N</var> consisting of integers between <var>1</var> and <var>K</var> (inclusive).</p>
<p>There are <var>K^N</var> such sequences. Find the su... |
p00728 |
<h1><font color="#000">Problem A:</font> ICPC Score Totalizer Software</h1>
<!-- end en only -->
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_a-1" width=300 align=left>
<!-- begin en only -->
<p>
The International Clown and Pierrot Competition (ICPC), is one of the
most distinguished and also the... |
p02345 | <H1>Range Minimum Query (RMQ)</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>find(s, t)</var>: report the minimum element in <var>a<sub>s</sub>, a<sub>s+1</sub>, . . . ,a<sub>t</... |
p00378 | <h1>Heat Stroke</h1>
<p>
We have had record hot temperatures this summer. To avoid heat stroke, you decided to buy a quantity of drinking water at the nearby supermarket. Two types of bottled water, 1 and 0.5 liter, are on sale at respective prices there. You have a definite quantity in your mind, but are willing to ... |
p01990 | <h2>B: ピボット (Pivots)</h2>
<h3>問題</h3>
<p>
<var>1</var> から <var>N</var> までの整数を並び変えた、長さ <var>N</var> の順列 <var>a_1, a_2, ..., a_N</var> が与えられる。
また、この順列に対して <var>Q</var> 個のクエリが順に与えられる。<var>i</var> 番目のクエリでは次の操作をしなければならない。
</p>
<ul>
<li> 値 <var>q_i</var> (<var>1 \leq q_i \leq N</var>) が与えられる。順列 <var>\{a_1, a_2, ..., a_N\}... |
p00682 |
<H1>Area of Polygons</H1>
<p>
Polygons are the most fundamental objects in geometric processing.
Complex figures are often represented and handled as polygons
with many short sides.
If you are interested in the processing of geometric data,
you'd better try some programming exercises about basic
operations on polygon... |
p00397 | <h1>K-th Exclusive OR</h1>
<p>
Exclusive OR (XOR) is an operation on two binary numbers $x$ and $y$ (0 or 1) that produces 0 if $x = y$ and $1$ if $x \ne y$. This operation is represented by the symbol $\oplus$. From the definition: $0 \oplus 0 = 0$, $0 \oplus 1 = 1$, $1 \oplus 0 = 1$, $1 \oplus 1 = 0$.
</p>
<p>
Excl... |
p03942 | <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>Shik's job is very boring. At day <var>0</var>, his boss gives him a string <var>S_0</var> of length <var>N</var> which consists o... |
p02650 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In a two-dimensional plane, we have a rectangle <var>R</var> whose vertices are <var>(0,0)</var>, <var>(W,0)</var>, <var>(0,H)</var>, and <var>(W,H)</var>, where <var>W</var> and <var>H</var> are posit... |
p02200 | <h2>今日の乱数 (Today's Random Number)</h2>
<p>E869120 君は、「今日の乱数」というキャンペーンをN日間行いました。これは、毎日 1 回乱数を生成し、その値をツイッターに投稿するという企画です。</p>
<p>$1, 2, 3, \dots, N$ 日目の「今日の乱数」は、それぞれ $A_1, A_2, A_3, \dots, A_N$ でした。</p>
<p>E869120 君は、今日の乱数の値が昨日の乱数の値よりも高ければ嬉しくなります。</p>
<p>$N$ 日間のなかで、E869120 君は何回「今日の乱数」によって嬉しくなったでしょうか?</p>
<h3>入力</h3>
<p>入力... |
p01586 |
<H1><font color="#000">Problem F:</font> Poor Computer</H1>
<p>
Brian Fulk is struggling with a really poor computer for a couple of days. Now he is trying to write a very simple program which receives a positive integer <i>x</i> and returns some of its multiples, say, <i>a</i><sub>1</sub><i>x</i>,...,<i>a</i><sub><i... |
p03041 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a string <var>S</var> of length <var>N</var> consisting of <code>A</code>, <code>B</code> and <code>C</code>, and an integer <var>K</var> which is between <var>1</var> and <var>N</var> (in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.