question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p02658 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given <var>N</var> integers <var>A_1, ..., A_N</var>, compute <var>A_1 \times ... \times A_N</var>.</p>
<p>However, if the result exceeds <var>10^{18}</var>, print <code>-1</code> instead.</p>
</section... |
p01977 | <h1>D: 水槽</h1>
<h2>問題</h2>
<p>
AORイカちゃんは縦 $1$ 横 $N$ の大きさの水槽をもらった。水槽は水を入れるのに十分な高さがある。
水槽には $N-1$ 個の仕切りがあり $N$ 個の区画に等間隔に区切られている。
ここに水を注いだところ、各区画の水の高さは $a_i$ になった。
</p>
<p>
AORイカちゃんはいくつか仕切りを取り除き、区画の数を $M$ 個以下にすることにした。
仕切りを取り除き終わった時、各区画の水の高さの総和の最大値を求めよ。
</p>
<p>
なお、仕切りの厚さは無視できるものとする。
</p>
<h2>制約</h2>
<ul>
<li>$1 \le N \... |
p00370 | <H1>Lake Survery</H1>
<p>
The Onogawa Expedition is planning to conduct a survey of the Aizu nature reserve. The expedition planner wants to take the shortest possible route from the start to end point of the survey, while the expedition has to go around the coast of the Lake of Onogawa en route. The expedition walk... |
p01998 | <h1>C: 素数</h1>
<h2>問題</h2>
<p>
ある日、素数が大好きなそすうさ君は $p + q$ が素数となるペア $(p, q)$ で遊んでいた。
そすうさ君は突然、このペアのうち、 $p$ と $q$ がともに $N$ 以下の素数であるペアがいくつあるか気になりだした。
そすうさ君に代わって個数を求めよ。
</p>
<h2>制約</h2>
<ul>
<li>入力値は全て整数である。</li>
<li>$1 \leq N \leq 10^7$</li>
</ul>
<h2>入力形式</h2>
<p> 入力は以下の形式で与えられる。 </p>
<p>
$N$
</p>
<h2>出力<... |
p00720 |
<h1><font color="#000">Problem E:</font> Earth Observation with a Mobile Robot Team</h1>
<p>
A new type of mobile robot has been developed for environmental earth
observation.
It moves around on the ground, acquiring and recording various sorts of
observational data using high precision sensors.
Robots of this type ... |
p01832 |
<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>Shifting a Matrix</h2>
<p>
Yo... |
p01561 |
<h1>A Two Floors Dungeon</h1>
<p>It was the last day of the summer camp you strayed into the labyrinth on the way to Komaba Campus, the University of Tokyo.
The contest has just begun.
Your teammates must impatiently wait for you.
So you have to escape from this labyrinth as soon as possible.<br>
The labyrinth is r... |
p01131 |
<h1><font color="#000000">Problem A:</font> Keitai Message</h1>
<p>
Alice さんは Miku さんに携帯電話でメールを送ろうとしている。
</p>
<p>
携帯電話には入力に使えるボタンは数字のボタンしかない。 そこで、文字の入力をするために数字ボタンを何度か押して文字の入力を行う。携帯電話の数字ボタンには、次の文字が割り当てられており、ボタン 0 は確定ボタンが割り当てられている。この携帯電話では 1 文字の入力が終わったら必ず確定ボタンを押すことになっている。
</p>
<ul>
<li>1: . , ! ? (スペー... |
p02930 | <span class="lang-en">
<p>Score: <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>AtCoder's head office consists of <var>N</var> rooms numbered <var>1</var> to <var>N</var>. For any two rooms, there is a direct passage connecting these rooms.</p>
<p>For security reasons, Takahashi th... |
p03622 | <span class="lang-en">
<p>Score : <var>2000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are participating in a quiz with <var>N + M</var> questions and Yes/No answers.</p>
<p>It's known in advance that there are <var>N</var> questions with answer Yes and <var>M</var> questions with an... |
p03788 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has a lot of peculiar devices.
These cylindrical devices receive balls from left and right.
Each device is in one of the two states A and B, and for each state, the device operates as follows:... |
p03272 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is an <var>N</var>-car train.</p>
<p>You are given an integer <var>i</var>. Find the value of <var>j</var> such that the following statement is true: "the <var>i</var>-th car from the front of the... |
p02033 | <h2>D: 矢 / Arrow</h2>
<h3>問題</h3>
<p>rodea 君は 1 次元座標系の中におり、<var>x = 0</var> の場所に立っている。この位置から、<var>x = N</var> の位置にある的を目がけて、 常に速さ <var>1</var> で移動する正の整数の長さの矢を投げる。しかし、rodea 君は非力なため、 区間 <var>0 \leq x \leq N</var> の中に合計 <var>M</var> 個の送風機を置くことにしている。</p>
<p>ここで、矢の先端から根元までの位置に <var>1</var> つの送風機も含まれない場合を「損失」と定義する。損失の判定は、矢... |
p02199 | <h2>走れ双子 (Run, Twins)</h2>
<p>E869120君は、家から学校へ向かって分速 $P$ メートルで走り出しました。</p>
<p>square1001君は、E869120君が家を出発してから $A$ 分後にE869120君の忘れ物に気が付き、分速 $Q$ メートルで追いかけました。</p>
<p>その後、E869120君は、E869120君が家を出発してから $B$ 分後に忘れものに気が付き、分速 $R$ メートルで道を引き返しました。</p>
<p>E869120君が家を出発してから何分後に双子は出会うでしょうか?</p>
<p>ただし、$B$ 分後までにE869120君とsquare1001君が出会うこ... |
p02463 | <h1>Set Union</h1>
<p>
Find the union of two sets $A = \{a_0, a_1, ..., a_{n-1}\}$ and $B = \{b_0, b_1, ..., b_{m-1}\}$.
</p>
<h2>Input</h2>
<p>
The input is given in the following format.
</p>
<pre>
$n$
$a_0 \; a_1 \; ... \; a_{n-1}$
$m$
$b_0 \; b_1 \; ... \; b_{m-1}$
</pre>
<p>
Elements of $A$ and $B$ ar... |
p02176 | <h1>B: Shortest Crypt</h1>
<h2>問題</h2>
<p>
xryuseixくんの学校では暗号が流行している. 格子状の街に住んでいるxryuseixくんは集合場所を決める新しい暗号を考えた.
</p>
<p>
暗号文は $N$ 文字の文字列 $S$ からなり, $S_i$ の文字によって現在地からの移動方向を決める. 移動方向に関しては以下の通りである.<br>
<ul>
<li>A ~ M : 北に1マス進む.</li>
<li>N ~ Z : 南に1マス進む.</li>
<li>a ~ m : 東に1マス進む.</li>
<li>n ~ z : 西に1... |
p02875 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a positive even number <var>N</var>.</p>
<p>Find the number of strings <var>s</var> of length <var>N</var> consisting of <code>A</code>, <code>B</code>, and <code>C</code> that satisfy the foll... |
p00848 |
<H1><font color="#000">Problem D:</font> Sum of Different Primes</H1>
<p>
A positive integer may be expressed as a sum of different prime numbers (primes), in one way or
another. Given two positive integers <i>n</i> and <i>k</i>, you should count the number of ways to express
<i>n</i> as a sum of <i>k</i> different p... |
p03767 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>3N</var> participants in <em>AtCoder Group Contest</em>.
The <em>strength</em> of the <var>i</var>-th participant is represented by an integer <var>a_i</var>.
They will form <var>N</var> ... |
p03337 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given two integers <var>A</var> and <var>B</var>.
Find the largest value among <var>A+B</var>, <var>A-B</var> and <var>A \times B</var>.</p>
</section>
</div>
<div class="part">
<section>
<h3>Co... |
p00632 |
<H1><font color="#000000">Problem 06:</font> Ghost Buster!</H1>
<p>
一般人には知る由も無いことだが、この街は幽霊で溢れている。そのほとんどは無害なのだが、困ったことに、人を呪う悪霊も少なからずいるのだ。
</p>
<p>
あるところに、そんな悪霊と戦う少女がいた。彼女は昼間は何食わぬ顔で高校に通いながらも、夜になると街中を歩き回り、彷徨える魂を見付けては成仏させるのだ。
</p>
<p>
幽霊を成仏させるためにはまずその幽霊に接近する必要があるのだが、それは簡単なことではない。幽霊は物をすり抜けられるからだ。幽霊は民家に壁から侵入して勝手口から出て行ったり... |
p01920 |
<link rel="stylesheet" href="css/description.css" type="text/css" />
<script language="JavaScript" type="text/javascript" src="js/varmath2017.js" charset="UTF-8"></script>
<h2>E:バイナリ列 - Binary Sequence -</h2>
<h3>物語</h3>
<p>
わしはバイナリ大好きBonald.Brvin.Bnuthじゃ!
オフトゥンフォード大学でバイナリ列の性質を研究しておってのお、Bnuthおじさんと呼ばれて、親しまれておるぞい!
... |
p00262 |
<H1>ブロックの三角形</H1>
<p>
図a のように積まれたブロックに対し、以下の並べ替え操作を繰り返す。
</p>
<ol>
<li> 一番下のブロック全て(図a 中の白のブロック)を右端に新しく積み上げる(残りのブロックは自動的に1段下に落ち、図b のようになる)。</li>
<li> ブロックの間に隙間ができたら、左に詰めて隙間をなくす(図 b から図c のようになる)。</li>
</ol>
<p>
1 以上の整数 k に対して、k×(k+1)/2 で表される数 (例:1, 3, 6, 10, ...)を三角数という。ブロックの総数が三角数の場合、上記の並べ替えを繰り返すと、左端の高さが1 で右... |
p00798 |
<H1><font color="#000">Problem C:</font> Push!!</H1>
<p>
Mr. Schwarz was a famous powerful pro wrestler. He starts a part time job as a warehouseman.
His task is to move a cargo to a goal by repeatedly pushing the cargo in the warehouse, of course,
without breaking the walls and the pillars of the warehouse.
</p>
<p>... |
p01023 |
<h1>Problem H: Caterpillar</h1>
<p>
とある天空都市に住む大学生のGは、芋虫のいも太郎を飼っている。 彼は、いも太郎に最短歩数で全てのえさを順番に食べるように躾けをした。彼の友人であるあなたは、彼からいも太郎が本当に躾けられているかどうかを調べて欲しいと依頼されたので、プログラムを書くことにした。
</p>
<h2>Problem</h2>
<p>
複数の障害物とエサがグリッド状のエリア内に存在する。頭と 5 つの胴体を持つ芋虫がこのエリアを探索する。芋虫が順番に最後までエサを食べたときの最小の歩数を求めよ。
ただし全てのエサを食べることが不可能な場合は -1 を出力すること。なお、エサの上... |
p01473 |
<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... |
p01189 |
<H1><font color="#000">Problem I:</font> Roads in a City</H1>
<p>
Roads in a city play important roles in development of the city. Once a road is built, people start their
living around the road. A broader road has a bigger capacity, that is, people can live on a wider area
around the road.
</p>
<p>
Interstellar Cong... |
p01166 |
<H1><font color="#000">Problem D:</font> So Sleepy</H1>
<p>
You have an appointment to meet a friend of yours today, but you are so sleepy because you
didn’t sleep well last night.
</p>
<p>
As you will go by trains to the station for the rendezvous, you can have a sleep on a train. You
can start to sleep as soon as y... |
p01536 |
<h1> Transparent Mahjong</h1>
<h2> F: 透明な麻雀牌</h2>
<p>
あなたは,闇に舞い降りた天災と噂されるギャンブラーの鷹巣さんと麻雀で対局することになった.
鷹巣さんは天災と噂されるだけあって,鷹巣牌という奇怪な麻雀牌を用いた対局を提案してきた.
</p>
<p>
麻雀とは,プレイヤーが互いに手牌という複数枚の牌を持ち合い,自分の手牌を相手よりもはやく,アガリの形にすることで勝利が確定するゲームである.
麻雀の牌の表側には,その牌が何であるかが描かれており,牌の裏側には,何も描かれていない.
よって,あなたが麻雀で対局するときは,あなたの手牌の表側をあなたの側に,裏側を対局者の側に向ける... |
p00777 |
<h3>Bridge Removal</h3>
<p>
ICPC islands once had been a popular tourist destination.
For nature preservation, however, the government decided to prohibit entrance to the islands,
and to remove all the man-made structures there.
The hardest part of the project is to remove all the bridges connecting the islands.
</p... |
p03858 | <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> pinholes on the <var>xy</var>-plane. The <var>i</var>-th pinhole is located at <var>(x_i,y_i)</var>.</p>
<p>We will denote the Manhattan distance between the <var>i</var>-th and <... |
p01865 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>A: 秤 /... |
p00327 |
<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>
ただお君は頭の体操をするために、数列... |
p00448 |
<H1> おせんべい </H1>
<h2>問題</h2>
<p>
IOI製菓では,創業以来の伝統の製法で煎餅(せんべい)を焼いている.この伝統の製法は,炭火で一定時間表側を焼き,表側が焼けると裏返して,炭火で一定時間裏側を焼くというものである.この伝統を守りつつ,煎餅を機械で焼いている.この機械は縦 R (1 ≤ R ≤ 10) 行, 横 C (1 ≤ C ≤ 10000) 列の長方形状に煎餅を並べて焼く.通常は自動運転で,表側が焼けたら一斉に煎餅を裏返し裏側を焼く.
</p>
<p>
ある日,煎餅を焼いていると,煎餅を裏返す直前に地震が起こり何枚かの煎餅が裏返ってしまった.幸いなことに炭火の状態は適... |
p02475 | <h2>Division of Big Integers</h2>
<p>
Given two integers $A$ and $B$, compute the quotient, $\frac{A}{B}$. Round down to the nearest decimal.
</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 quotient in a line.
</p>
<h3>C... |
p00018 |
<H1>Sorting Five Numbers</H1>
<p>
Write a program which reads five numbers and sorts them in descending order.
</p>
<H2>Input</H2>
<p>
Input consists of five numbers <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var> and <var>e</var> (-100000 ≤ <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>,<var>e</v... |
p02025 | <h2>K: 救済 (Angel Relief)</h2>
<p>天使の天真さんは、ある街を救うことにした。</p>
<p>この街は南北 $H$ 区画 × 東西 $W$ 区画に分けられた長方形の形をしており、各区画に家がある。</p>
<p>北から数えて $X$ 番目、西から数えて $Y$ 番目の区画を $(X, Y)$ で表す。</p>
<p>区画 $(i, j)$ にある家には $A_{i, j}$ 人の人が住んでいる。</p>
<p>天真さんは、辺が南北または東西に平行または垂直な長方形のエリアを選び、その中に住んでいる人全員を<b>ひとりずつ</b>救済する。</p>
<p>天真さんは、考えられるすべての長方形でこの操作を... |
p03264 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Find the number of ways to choose a pair of an even number and an odd number from the positive integers between <var>1</var> and <var>K</var> (inclusive). The order does not matter.</p>
</section>
</div... |
p01259 |
<H1><font color="#000">Problem J:</font> Tile Puzzle</H1>
<p>
You are visiting Ancient and Contemporary Museum. Today there is held an exhibition on the history of
natural science. You have seen many interesting exhibits about ancient, medieval, and modern science
and mathematics, and you are in a resting space now.
... |
p03634 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a tree with <var>N</var> vertices.<br/>
Here, a <em>tree</em> is a kind of graph, and more specifically, a connected undirected graph with <var>N-1</var> edges, where <var>N</var> is the n... |
p01609 |
<h2>One</h2>
<h2>Problem Statement</h2>
<p>電車の窓から美しい山並みが見える.<br />
窓は,左下隅の座標が <var>(0, 0)</var>,右上隅の座標が <var>(W, H)</var> の長方形である.<br />
窓からは <var>N</var> つの山が見えており,<var>i</var> 番目の山は上に凸な放物線 <var>y = a_i (x-p_i)^2 + q_i</var> の形をしている.<br />
山と空との境界線の長さを求めよ.</p>
<p>次の三つの図は Sample Input に対応している.太線で示されている部分が山と空との境界線... |
p02926 | <span class="lang-en">
<p>Score: <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>E869120 is initially standing at the origin <var>(0, 0)</var> in a two-dimensional plane.</p>
<p>He has <var>N</var> engines, which can be used as follows:</p>
<ul>
<li>When E869120 uses the <var>i</var... |
p03321 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In the State of Takahashi in AtCoderian Federation, there are <var>N</var> cities, numbered <var>1, 2, ..., N</var>.
<var>M</var> bidirectional roads connect these cities.
The <var>i</var>-th road conne... |
p03771 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> oases on a number line. The coordinate of the <var>i</var>-th oases from the left is <var>x_i</var>.</p>
<p>Camel hopes to visit all these oases.
Initially, the volume of the hum... |
p02863 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi is at an all-you-can-eat restaurant.</p>
<p>The restaurant offers <var>N</var> kinds of dishes. It takes <var>A_i</var> minutes to eat the <var>i</var>-th dish, whose deliciousness is <var>B_i... |
p02160 | <h1>Problem L: Product</h1>
<h2>Problem</h2>
<p>会津君は、素数$P$、自然数からなる集合$G$、自然数$A$を使ってゲームをすることにしました。</p>
<p>まず、会津君は手元の紙に$1$を書きます。その後、以下の一連の操作を任意の回数行います。</p>
<ul>
<li>$G$から要素を一つ選ぶ。これを$g$とする。</li>
<li>手元の紙に書かれた数と$g$との積を新しく紙に書く。</li>
<li>元々紙に書かれていた数を消す。</li>
</ul>
<p>手元の紙に書かれた数を$P$で割ったあまりと$A$が等しければ会津君の勝ちで、そうでなければ負けです。$P... |
p01465 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Testing Circuits</H1>
<p>
A Boolean expression is given.
In the expression, each variable appears exactly once.
Calculate the number of variable assignments that make the expression evaluate to true.
</p>
<H2>Input</H2>
<p>
A data set consists of only ... |
p03458 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>AtCoDeer is thinking of painting an infinite two-dimensional grid in a <em>checked pattern of side <var>K</var></em>.
Here, a checked pattern of side <var>K</var> is a pattern where each square is paint... |
p01035 |
<h1>Problem I: Hard Beans</h1>
<h2>Problem</h2>
<p>
大津大学では豆が盛んです。
<var>N</var>個の豆が一直線上に並んでいます。
それぞれ0から順に<var>N</var>−1まで番号がふられており、<var>i</var>番目の豆の硬さを<var>a<sub>i</sub></var>とします。
</p>
<p>
シアン君は理想の豆の硬さを<var>D</var>だと考えています。しかし、シアン君は面倒くさがりなのであまり遠くにある豆を取りに行きたくありません。したがって、シアン君は<var>l</var>番目の豆から<var>r</var>番目の豆の中... |
p03008 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>The squirrel Chokudai has <var>N</var> acorns.
One day, he decides to do some trades in multiple precious metal exchanges to make more acorns.</p>
<p>His plan is as follows:</p>
<ol>
<li>Get out of the ... |
p02249 |
<H1>Pattern Search</H1>
<p>
Find places where a <var>R</var> × <var>C</var> pattern is found within a <var>H</var> × <var>W</var> region. Print top-left coordinates (<var>i</var>, <var>j</var>) of sub-regions where the pattern found. The top-left and bottom-right coordinates of the region is (0, 0) and (<... |
p00274 |
<H1>おそろいの景品</H1>
<p>
ジョウ君とヤエさんは仲の良いカップルです。ジョウ君はカプセル玩具自販機(ガチャポン)の景品を集めており、二人で出かけたときも、ガチャポンを見つけると何度かやってみるほどの熱の入りようです。ヤエさんは楽しそうなジョウ君をそばで見ているだけでしたが、ジョウ君の今度の誕生日プレゼントにガチャポンの景品をひとつあげることにしました。ヤエさんはガチャポン自体にはあまり興味がわきませんでしたが、できればジョウ君とおそろいの景品が欲しいと思っています。
</p>
<p>
ヤエさんがやってみようと思うガチャポンは、1回のチャレンジで景品がひとつ出ます。品切れのものも含め景品が何種類あるのかと、それ... |
p01936 |
<!-- - - - - - begin nicebody - - - - - -->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
</script>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<h1>F: Steps</h1>
... |
p02619 | <span class="lang-en">
<p>(Please read problem A first. The maximum score you can get by solving this problem B is 1, which will have almost no effect on your ranking.)</p>
<div class="part">
<section>
<h3>Beginner's Guide</h3><p>Let's first write a program to calculate the score from a pair of input and output. You ca... |
p00624 |
<H1><font color="#000000">Problem D:</font> Dr. Nakamura's Lab.</H1>
<p>
Dr.中村は偉大な発明者である, 今日も常人には発想出来ない新たな発明に取り掛かっている. 今発明しているのは新たな防犯システムとコンテナである.
</p>
<p>
防犯システムの方は上に乗った者を識別して招かれざる客だった場合, 電流を流して気絶させるパネルである. このパネルは踏まないように上を通過しても無駄で, 空中のものに対し放電する. しかし, まだ完成には程遠く, 電流は強すぎて調節が不可能で, 一度放電すると充電しない限り使えない. また, 人と物体の区別ができず... |
p00331 |
<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>
太陽が現れることを「日の出」、隠れることを... |
p01873 |
<h2>B: 周期数列 - Periodic Sequence -</h2>
<h3>問題</h3>
<p>H大学の教授を務めているPeriod博士は、万物に潜むとされる周期と呼ばれる性質を研究している。一般的に知られている基本的な周期としては、数列に潜む周期が考えられるだろう。すなわち、長さ<var>N</var>の数列<var>S = S_1, S_2,</var> ... <var>, S_N</var>が以下の性質を満たすならば、周期<var>t</var> (<var>t \≤ N</var>) を持つという事実である。</p>
<p><var>1 \≤ i \≤ N − t</va... |
p00761 |
<h1>Recurring Decimals</h1>
<!-- end en only -->
<!-- begin en only -->
<p>
A decimal representation of an integer can be transformed to another integer by rearranging the order of digits.
Let us make a sequence using this fact.
</p>
<p>
A non-negative integer <i>a</i><sub>0</sub> and the number of digits <i>L</i> ... |
p01520 |
<h1>A - アルデンテ</h1>
<h2>問題文</h2>
<p>
わたしは近所のスーパーで初めてスパゲッティというものを購入した.パッケージの情報によると,このスパゲッティは <var>T</var> 秒茹でると最も理想的な状態に茹で上がるらしい.
</p>
<p>
ところでわたしは電気が嫌いな人間であり,家にはテレビやパソコンはおろか,時計さえ無い.
そのためスパゲッティを茹でようにも,時間を測ることができない.
電池式の時計は嫌なので,わたしは代わりに砂時計を買おうと考え,スーパーの砂時計売り場へと向かった.
売り場には <var>N</var> 個の砂時計があった.<var>i</var> 番目の砂時計はちょうど... |
p01170 |
<H1><font color="#000">Problem H:</font> Robot's Crash</H1>
<p>
Prof. Jenifer A. Gibson is carrying out experiments with many robots. Since those robots are
expensive, she wants to avoid their crashes during her experiments at her all effort. So she asked
you, her assistant, as follows.
</p>
<p>
“Suppose that we have... |
p03399 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You planned a trip using trains and buses.
The train fare will be <var>A</var> yen (the currency of Japan) if you buy ordinary tickets along the way, and <var>B</var> yen if you buy an unlimited ticket.... |
p03663 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><font color="red"><strong>This is an interactive task.</strong></font></p>
<p>Snuke has a favorite positive integer, <var>N</var>. You can ask him the following type of question at most <var>64</var> ti... |
p02971 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a sequence of length <var>N</var>: <var>A_1, A_2, ..., A_N</var>.
For each integer <var>i</var> between <var>1</var> and <var>N</var> (inclusive), answer the following question:</p>
<ul>
<... |
p03233 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a directed weighted graph with <var>N</var> vertices.
Each vertex has two integers written on it, and the integers written on Vertex <var>i</var> are <var>A_i</var> and <var>B_i</var>.</p>
<p>In... |
p02588 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given <var>N</var> real values <var>A_1, A_2, \ldots, A_N</var>.
Compute the number of pairs of indices <var>(i, j)</var>
such that <var>i < j</var> and the product <var>A_i \cdot A_j</va... |
p02072 | <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: ... |
p02422 |
<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>
<h2>Transformation</h2><br>
<p... |
p02137 | <h1>Problem A: Special Chat</h1>
<h2>Problem</h2>
<p>人気動画投稿サイト「ZouTube」は今、空前の「バーチャルZouTuber」ブームの真っ只中にある。その中でも、最近特に注目を集めているのは、後輩系バーチャルZouTuber「アイヅマリム(通称:アヅリム)」だ。</p>
<p>アヅリムの大ファンであるあなたは、本日のアヅリムのライブ配信で、彼女に「スペシャルチャット」を送るつもりだ。</p>
<p>「スペシャルチャット」とは、ZouTubeの提供する「視聴者が配信者にポイントをプレゼントする機能」 だ。視聴者はスペシャルチャット$1$回につき、$500$, $1000$,... |
p02567 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given an array <var>a_0, a_1, ..., a_{N-1}</var> of length <var>N</var>. Process <var>Q</var> queries of the following types.</p>
<p>The type of <var>i</var>-th query is represented by <var>T_i<... |
p03726 | <span class="lang-en">
<p>Score : <var>900</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>Initial... |
p00809 |
<H1><font color="#000">Problem G:</font> Nim</H1>
<p>
Let's play a traditional game Nim. You and I are seated across a table and we have a hundred stones on the table (we know the number of stones exactly). We play in turn and at each turn, you or I can remove one to four stones from the heap. You play first and the ... |
p02834 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a tree with <var>N</var> vertices. The <var>i</var>-th edge connects Vertex <var>A_i</var> and <var>B_i</var> bidirectionally.</p>
<p>Takahashi is standing at Vertex <var>u</var>, and Aoki is st... |
p03376 | <span class="lang-en">
<p>Score : <var>900</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 ... |
p01961 |
<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... |
p00673 |
<h1>Problem E: School Excursion</h1>
<p>
春、それは修学旅行の時期である。
会津大学附属小学校(会津大小)でも、来年度の修学旅行の計画が建てられていた。
修学旅行は電車で移動することが伝統になっている。
会津若松市内では電車を利用する機会が少ないためだ。
</p>
<p>
しかし、学校に届いたある苦情により教員たちは頭を悩ませていた。
それは、「ある駅で大人数で乗り換えを行っていたので、その駅を利用する他の乗客に迷惑であった」という内容だった。
とくに、電車を降りたあとホームからの通路で大混雑してしまったという。
</p>
<p>
それは近年、会津大小の生徒数が急上昇しているからであった。... |
p00389 | <h1>Pilling Blocks</h1>
<p>
We make a tower by stacking up blocks. The tower consists of several stages and each stage is constructed by connecting blocks horizontally. Each block is of the same weight and is tough enough to withstand the weight equivalent to up to $K$ blocks without crushing.
</p>
<p>
We have to ... |
p00223 |
<H1>迷子の双子</H1>
<p>
たかゆき君とかずゆき君は仲良しの双子ですが、行動が真逆です。 例えば、たかゆき君が西に行けば、かずゆき君は東へ行き、かずゆき君が北へ行けば、たかゆき君は南へ行きます。 現在 2 人はデパートに来ており、別々の場所にいます。真逆に移動してしまう 2 人ができるだけ早く出会うためにはどうしたらよいでしょうか?
</p>
<p>
デパートは横 <var>W</var> 個 × 縦 <var>H</var> 個のマスで構成されるグリッドで表され、2 人は単位時間に東西南北に 1 マス分移動することができます。ただし、グリッドの範囲外や障害物のあるマスに移動することはできません。... |
p01062 |
<h1>Courage Test</h1>
<p>
P「今日は肝試し企画の番組の収録だ。」<br><br>
O型智絵里「き、きもだめし……」<br><br>
四村かな子「智絵里ちゃん大丈夫?」<br><br>
月野茜「さすがPさん!一行で状況が明晰判明にわかる素晴らしい解説です!さあ!火の玉に向かって走りましょう!」<br><br>
P「ルールは簡単、みんなで協力してこのエリアのすべての神社にお参りしてくるだけだ。」<br><br>
茜「オーソドックスですね!早速神社に向かって走りましょう!」<br><br>
かな子「でもここ、日本有数の神社密度で行かなくちゃいけない神社がたくさんあるんじゃなかったっけ……」<b... |
p01598 |
<h2>Problem H: Testing Sorting Networks</h2>
<p>A <var>N</var> sorting network is a circuit that accepts <var>N</var>
numbers as its input, outputs them sorted. Mr. Smith is an engineer of a company
that sells various sizes of the circuit.</p>
<p>One day, the company got an order of <var>N</var> sorting networks.
Un... |
p01432 |
<script type="text/javascript" src="./varmath.js" charset="UTF-8"></script>
<h2>問題文</h2>
<p>影の魔女 ELSAMARIA はすべてのものに対して祈りを続ける魔女である.影に捕まったあらゆる命はこの魔女の中に引きずり込まれてしまう.</p>
<p>影は触手のように動き<i>美樹さやか</i>を引きずり込もうと狙っている.<i>美樹さやか</i>はこの魔女に捕まることなく攻撃するために,魔女にとって予測の難しいでたらめな動きをすることを考えた.具体的には,まず頭の中で <var>1</var> から <var>N</var> までの整数を一... |
p01127 |
<h1>X-Ray Screening System</h1>
<p>
これは 20XX 年の話である.再生発電網による安定したエネルギー供給,および液化合成燃料の発明によって航空旅客数は鰻登りに増加した.しかし,航空機によるテロリズムの脅威は依然として存在するため,高速でかつ高い信頼性をもつ自動手荷物検査システムの重要性が高まっている.検査官が全部の荷物を調べることは実際問題として困難であることから,自動検査において疑わしいと判断された手荷物だけを検査官で改めて調べるという仕組みを整えたいわけである.
</p>
<p>
航空機業界からの要請を受け,国際客室保護会社(International Cabin Protecti... |
p01577 |
<H1><font color="#000">Problem H:</font> Magic Walls</H1>
<p>
You are a magician and have a large farm to grow magical fruits.
</p>
<p>
One day, you saw a horde of monsters, approaching your farm. They would ruin your magical farm once they reached your farm. Unfortunately, you are not strong enough to fight against... |
p01824 |
<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:
Surface Area of Cu... |
p03819 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has decided to play a game, where the player runs a railway company.
There are <var>M+1</var> stations on Snuke Line, numbered <var>0</var> through <var>M</var>.
A train on Snuke Line stops at sta... |
p00736 |
<h1><font color="#000000">Problem C:</font> How can I satisfy thee? Let me count the ways...</h1>
<!-- end en only -->
<!-- begin en only -->
<p>
Three-valued logic is a logic system that has, in addition to "true" and
"false", "unknown" as a valid value.
In the following, logical values "false", "unknown" and "t... |
p00366 | <H1>Electric Metronome</H1>
<p>
A boy PCK is playing with <var>N</var> electric metronomes. The <var>i</var>-th metronome is set to tick every <var>t_i</var> seconds. He started all of them simultaneously.
</p>
<p>
He noticed that, even though each metronome has its own ticking interval, all of them tick simultaneo... |
p00171 |
<H1>サイコロパズル</H1>
<p>
各面にアルファベット一文字(a 〜 z、A 〜 Z)が描かれたサイコロがあります。
</p>
<br><center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/dice22Puzzle1"></center><br>
<p>
このようなサイコロを8つ組み合わせて 2 × 2 × 2 の立方体を作ることを考えます。
</p>
<br><center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/dice22Puzzle2"></center>... |
p00521 |
<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> JOI 紋章(JOI Emblem)
</H1>... |
p01760 |
<h1>A : Taps / 蛇口</h1>
<h1>Problem</h1>
<p>あいづ君の家の浴槽には2つの蛇口 <em>A</em>, <em>B</em> がついており、 ひねるとひねった角度に比例した量の水が出てくる。 出てくる水の温度は <em>A</em> は <em>t<SUB>A</SUB></em> [℃]、<em>B</em> は <em>t<SUB>B</SUB></em> [℃]で一定である。 風呂に入るときにはそれらの量を調節して混ぜあわせることで適度な温度になるようにしている。</p>
<p><em>t<SUB>A</SUB></em> [℃] の水 <em>v<SUB>A</SUB></e... |
p00872 |
<H1><font color="#000">Problem I:</font> Common Polynomial</H1>
<p>
Math teacher Mr. Matsudaira is teaching expansion and factoring of polynomials to his students.
Last week he instructed the students to write two polynomials (with a single variable x), and
to report GCM (greatest common measure) of them as a homewor... |
p01330 |
<h1><font color="#000">Problem J:</font> 多項式の解の個数</h1>
<p>きたまさ君は大学でさまざまな変換について研究している。最近、きたまさ君が興味を持っている変換は次のようなものである。 N+1個の整数 a<sub>0</sub>, ..., a<sub>N</sub> を固定し、整数 z を入力とする。また P を素数とする。</p>
<blockquote>
t = ( a<sub>N</sub>z<sup>N</sup> + a<sub>N-1</sub>z<sup>N-1</sup> + ... + a<sub>2</sub>z<sup>2</sup> + a<sub>1<... |
p03618 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You have a string <var>A = A_1 A_2 ... A_n</var> consisting of lowercase English letters.</p>
<p>You can choose any two indices <var>i</var> and <var>j</var> such that <var>1 \leq i \leq j \leq n</var> ... |
p01625 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<!--
<h3><u>Princess Tetra’s Puzzle</u></h3>
-->
<!-- end en only -->
<!-- begin ja only -->
<h1><u>テトラ姫のパズル</u></h1>
<!-- end ja only -->
<!-- begin en only -->
<!--
<p>
English text is not available in this practice contest.
</p>
-->
<!-- end en only -->
... |
p00937 |
<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 C
Sibling Rivalry</h2>... |
p03248 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a string <var>s</var> of length <var>n</var>.
Does a tree with <var>n</var> vertices that satisfies the following conditions exist?</p>
<ul>
<li>The vertices are numbered <var>1,2,..., n</... |
p01275 |
<H1><font color="#000">Problem C:</font> Dial Lock</H1>
<p>
A dial lock is a kind of lock which has some dials with printed numbers. It has a special sequence of
numbers, namely an unlocking sequence, to be opened.
</p>
<p>
You are working at a manufacturer of dial locks. Your job is to verify that every manufactured... |
p00034 |
<H1>鉄道路線</H1>
<p>
複線(上りと下りが別の線路になっていてどこででもすれ違える)の鉄道路線があります。この路線には終端駅を含めて11 の駅があり、それぞれの駅と駅の間は図で示す区間番号で呼ばれています。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_railway">
</center>
<br/>
<p>
この路線の両方の終端駅から列車が同時に出発して、途中で停まらずに走ります。各区間の長さと2 本の列車の速度を読み込んで、それぞれの場合について列車がすれ違う区間の番号を出力するプログラムを作... |
p02009 | <h1>Problem F. Nim without Zero</h1>
<!--
Time Limit: 2 sec
Memory Limit: 512 MB
-->
<p>
Alice: "Hi, Bob! Let's play Nim!"<br>
Bob: "Are you serious? I don't want to play it. I know how to win the game."<br>
Alice: "Right, there is an algorithm to calculate the optimal move using XOR. How about changing the rule so t... |
p00464 |
<H1> 散歩 </H1>
<h2>問題</h2>
<p>
JOI 町に住む太郎君は, ある日,健康増進のために散歩を日課にしようと思い立った.
太郎君の住む JOI 町には,図のように,東西方向に走る (<i>H</i> + 1) 本の道路と,南北
方向に走る (<i>W</i> + 1) 本の道路が碁盤目状に通っている.太郎君の家はもっとも北西の
交差点にあり,ここから散歩を開始する.
</p>
<p>
以降,北から <i>a</i> 番目,西から <i>b</i> 番目の交差点を (<i>a</i>, <i>b</i>) で表す.たとえば,太郎君の家がある交差点は (1, 1) である.
</p>
<br>
<... |
p02459 | <h1>Map: Search</h1>
<p>
For a dictionary $M$ that stores elements formed by a pair of a string key and an integer value, perform a sequence of the following operations. Note that <u>each key in $M$ must be unique</u>.
</p>
<ul>
<li>insert($key$, $x$): Insert an element formed by a pair of $key$ and $x$ to $M$. If ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.