question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p00365 | <H1>Age Difference</H1> <!-- Difference in ages-->
<p>
A trick of fate caused Hatsumi and Taku to come to know each other. To keep the encounter in memory, they decided to calculate the difference between their ages. But the difference in ages varies depending on the day it is calculated. While trying again and again,... |
p01124 | <!--<h2>Problem H</h2>-->
<!-- begin en only -->
<h3>Addition on Convex Polygons</h3>
<!-- end en only -->
<!-- begin en only -->
<p>
Mr. Convexman likes convex polygons very much.
During his study on convex polygons, he has come up with the following elegant addition on convex polygons.</p>
<!-- end en only -->
<!... |
p03119 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke participated in a magic show.</p>
<p>A magician prepared <var>N</var> identical-looking boxes.
He put a treasure in one of the boxes, closed the boxes, shuffled them, and numbered them <var>1</va... |
p01574 |
<H1><font color="#000">Problem D: </font> Dial Key</H1>
<p>
You are a secret agent from the Intelligence Center of Peacemaking Committee. You've just sneaked into a secret laboratory of an evil company, Automated Crime Machines.
</p>
<p>
Your mission is to get a confidential document kept in the laboratory. To reach... |
p03549 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is <code>YES</code> or <code>NO</code>.</p>
<p>When he checked the detailed status of the submissio... |
p01061 |
<h1>Community Integration</h1>
<!--
<p>安倍拾菜々「えぇっ!生まれ故郷のあの村、○○市に合併されてたんですか!? 20年前に!?」</p>
-->
<h2>Problem</h2>
<p>
<var>N</var>個の村がある。それぞれの村には1から<var>N</var>までの番号がついている。昨今の合併ブームにより、いくつかの村が合併されることになった。合併された2つ以上の村は新しい1つの市となり、どの村とも合併されない村は村のままである。
</p>
<p>
あなたは、ある2つの村が合併後に同じ市になる、という情報を複数与えられる。その情報の組み合わせによって、3つ以上の村が1つの... |
p01431 |
<script type="text/javascript" src="./varmath.js" charset="UTF-8"></script>
<h2>問題文</h2>
<p>
落書きの魔女 ALBERTINE は <var>W</var> 列 <var>H</var> 行の正方形のセルからなる長方形の結界の入り口に落書きをしている.この世界では落書きは必ずセルを白色か黒色で塗ることによって成り立つ.
</p>
<p>
すでに使い魔 ANJA の手によって落書きの一部が描かれているのだが,落書きの魔女は残りすべてのセルを塗り落書きを完成させたい.落書きの魔女にはあるこだわりがある.そのこだわりとは次のようなものである.
... |
p00670 |
<h1>Problem B: Spellcasters</h1>
<p>
n 人の魔法使いがいる。彼らには 1 から n までの番号があり、i 番目の魔法使いは魔力 r<sub>i</sub> ( 1 ≤ i ≤ n ) を持っている。いま彼らは強力な魔法使いと対峙しており、その敵の魔力は S である。n 人の魔法使いは協力して戦うのが得意で、特に 2 人で協力して戦うことを好む。2 人の魔法使いが協力した場合、魔力は単純にその和となり、強力な魔法などを駆使してある程度強い敵にも勝てるようになる。あなたの仕事は魔力 S を持つ敵に対して勝つことができる魔法使いのペア (i, j) ( i ≠ j かつ 1 &l... |
p01962 |
<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... |
p00220 |
<H1>博士が愛した2進数</H1>
<p>
「君の靴のサイズはいくつかね」 <br/>
<br/>
初対面の私に、いきなり博士は尋ねました。<br/>
<br/>
「 23.5 です」<br/>
「ほお、実にきりのいい数字だ。2 の 4 乗に 2 の 2 乗と 2 の 1 乗と 2 の 0 乗と 2 の -1 乗を 加えた数だ」<br/>
<br/>
続けて博士は尋ねました。<br/>
<br/>
「君、身長はいくつかね」<br/>
「はい、158.1 です」<br/>
<br/>
博士は腕組みをして目を閉じました。しばらくの沈黙の後、口を開きました。<br/>
<br/>
「ナ... |
p00037 |
<H1>格子上の経路</H1>
<p>
上から見ると図 1 のような形の格子状の広場があります。この格子の各辺に「壁」があるかないかを 0 と 1 の並びで表します。点 A に立って壁に右手をつき、壁に右手をついたまま、矢印の方向に歩き続けて再び点 A に戻ってくるまでの経路を出力するプログラムを作成してください。
</p>
<center>
<table>
<tr><th>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_pathOnGrid1">
</t></tr>
</table>
<table>
<tr><th>
図1
</th></tr... |
p00467 |
<H1>すごろく</H2>
<h2> 問題</h2>
<p>
JOI さんは一人ですごろく遊びをしている.
このすごろくには一直線上に N 個のマスがあり,それぞれ移動の指示が書かれている.スタート地点は 1 マス目であり,ゴールはNマス目である.
JOI さんはゴールするまで次を繰り返す.
</p>
<p>
サイコロを振って出た目の数だけ現在のマスから進み,そのマスの指示に従う.
指示に従って移動した先のマスの指示には従わない.
</p>
<p>
ちょうど N マス目に止まる時だけでなく,移動先が N マス目を超える場合もゴールとなる.
</p>
<p>
すごろくの盤面と, M 回分のサイコロの出る目が与えられたとき,サイ... |
p00934 |
<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 K:
$L_{\infty}$ Jumps
<... |
p02909 | <span class="lang-en">
<p>Score: <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>The weather in Takahashi's town changes day by day, in the following cycle: Sunny, Cloudy, Rainy, Sunny, Cloudy, Rainy, ...</p>
<p>Given is a string <var>S</var> representing the weather in the town tod... |
p01626 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<!--
<h3><u>Mirror Labyrinth</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 -->
<!-- begin j... |
p01276 |
<H1><font color="#000">Problem D:</font> Double Sorting</H1>
<p>
Here we describe a typical problem. There are <i>n</i> balls and <i>n</i> boxes. Each ball is labeled by a unique
number from 1 to <i>n</i>. Initially each box contains one of these balls. We can swap two balls in adjacent
boxes. We are to sort these ba... |
p00871 |
<H1><font color="#000">Problem H:</font> Top Spinning</H1>
<p>
Spinning tops are one of the most popular and the most traditional toys. Not only spinning
them, but also making one’s own is a popular enjoyment.
</p>
<p>
One of the easiest way to make a top is to cut out a certain shape from a cardboard and pierce
an a... |
p01763 |
<h1>D : Chopsticks / 箸</h1>
<h1>Problem</h1>
<p>お箸は 2 本 1 セット(1 膳)で用いるものである。しかしあるとき一人暮らしの大学生であるいあづ君は箸立てに入っているお箸が奇数本であることに気がついた。これは明らかにおかしい。いつの間にか何本か無くしてしまったのである。
困ったいあづ君は、今後このようなことが無いように箸の本数を毎日記録することにした。</p>
<p>ところが、いあづ君が決めた記録の方法は少し変わっている。 それは、まず<em>M</em> 個の自然数 <em>A<sub>1</sub></em>, ... , <em>A<SUB>M</SUB></em> ... |
p01299 |
<H1><font color="#000">Problem G:</font>Neko's Treasure</H1>
<p>
Maki is a house cat. One day she fortunately came at a wonderful-looking dried fish. Since she
felt not hungry on that day, she put it up in her bed. However there was a problem; a rat was
living in her house, and he was watching for a chance to steal h... |
p01333 |
<h1><font color="#000">Problem A:</font> Summer of KMC</h1>
<h2>Description</h2>
<p>KMCはコミックマーケットと呼ばれる同人即売会で毎年CDを販売している。
コミックマーケットでCDを売ることになったFであったが、Fの人気により、KMCの売り場には人が殺到し、お釣りの計算が追いつかない状態となった。そこでFは金額を入力すると即座にお釣りを出力するプログラムを書くことにした。</p>
<p>KMCが釣り銭として用意しているのは、100円玉と500円玉と1000円札のみである。これらの硬貨・札は無限にあるものと考えて良い。お釣りは、硬貨・札の個... |
p00172 |
<H1>博士の研究室</H1>
<p>
会津大学の鶴賀博士はとても研究熱心なことで有名です。彼の研究室には複数の学生がいますが、彼は毎日夜遅くまで研究をするので必ず最後に帰宅します。彼の研究室にはドアでつながった複数の部屋があり、最後に研究室を出る人がすべての部屋の明かりを消して帰宅することになっています。
</p>
<p>
最近、大学では省エネに力を入れているため、すべての明かりが消えているか厳しくチェックされます。困ったことに彼は誰もが認める極度の臆病者で、明かりの消えた部屋には決して入ることができません。そこで、彼はある部屋の照明のON/OFFを他の部屋から操作できるように研究室の照明設備を改造しました。
</p>... |
p00488 |
<H1>ランチ (Lunch) </H1>
<h2>問題</h2>
<p>
JOI パスタ店では,ランチのおすすめパスタと搾りたてジュースのセットメニューが好評である.このセットメニューを注文するときは,その日の 3 種類のパスタと 2 種類のジュースから 1 つずつ選ぶ.パスタとジュースの値段の合計から 50 円を引いた金額が代金となる.
</p>
<p>
ある日のパスタとジュースの値段が与えられたとき,その日のセットメニューの代金の最小値を求めるプログラムを作成せよ.
</p>
<h2> 入力</h2>
<p>
入力は 5 行からなり,1 行に 1 つずつ正の整数が書かれている.<br>
1 行目の整数は... |
p00522 |
<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> IOI 饅頭(IOI Manju)
</H1>
... |
p03027 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Consider the following arithmetic progression with <var>n</var> terms:</p>
<ul>
<li><var>x, x + d, x + 2d, \ldots, x + (n-1)d</var></li>
</ul>
<p>What is the product of all terms in this sequence?
Compu... |
p03477 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>A balance scale tips to the left if <var>L>R</var>, where <var>L</var> is the total weight of the masses on the left pan and <var>R</var> is the total weight of the masses on the right pan. Similarly... |
p02636 | <span class="lang-en">
<p>Score : <var>1100</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<... |
p01919 |
<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>D:歪みの国 - Country In Distortion -</h2>
<h3>物語</h3>
<p>アリスはすっかり退屈していました。いつも一緒に遊んでいる白ウサギが、トランプ城へ出かけているからです。(あーあ、こんなことなら一緒に出かければよかったわ。)とアリスは思い... |
p03924 | <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> towns in Takahashi Kingdom. They are conveniently numbered <var>1</var> through <var>N</var>.</p>
<p>Takahashi the king is planning to go on a tour of inspection for <var>M</var>... |
p02266 |
<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>Areas on the Cross-Section ... |
p02289 |
<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>Priority Queue</H1>
<p>
... |
p02773 | <span class="lang-en">
<p>Score: <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>We have <var>N</var> voting papers. The <var>i</var>-th vote <var>(1 \leq i \leq N)</var> has the string <var>S_i</var> written on it.</p>
<p>Print all strings that are written on the most number of vot... |
p03861 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given nonnegative integers <var>a</var> and <var>b</var> (<var>a ≤ b</var>), and a positive integer <var>x</var>.
Among the integers between <var>a</var> and <var>b</var>, inclusive, how many ar... |
p02323 |
<H1>Traveling Salesman Problem </H1>
<br/>
<p>
For a given weighted directed graph <var>G(V, E)</var>, find the distance of the shortest route that meets the following criteria:
</p>
<ul>
<li>It is a closed cycle where it ends at the same point it starts.</li>
<li>It visits each vertex exactly once.</li>
</ul>
<H2>I... |
p03498 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has an integer sequence, <var>a</var>, of length <var>N</var>. The <var>i</var>-th element of <var>a</var> (<var>1</var>-indexed) is <var>a_{i}</var>.</p>
<p>He can perform the following operation... |
p03162 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Taro's summer vacation starts tomorrow, and he has decided to make plans for it now.</p>
<p>The vacation consists of <var>N</var> days.
For each <var>i</var> (<var>1 \leq i \leq N</var>), Taro will choo... |
p03532 | <span class="lang-en">
<p>Score : <var>1900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Ringo has a tree with <var>N</var> vertices.
The <var>i</var>-th of the <var>N-1</var> edges in this tree connects Vertex <var>A_i</var> and Vertex <var>B_i</var> and has a weight of <var>C_i</var>.
Ad... |
p01221 |
<H1><font color="#000">Problem F:</font> Two-finger Programming</H1>
<p>
Franklin Jenkins is a programmer, but he isn’t good at typing keyboards. So he always uses only ‘f’
and ‘j’ (keys on the home positions of index fingers) for variable names. He insists two characters are
enough to write programs, but naturally h... |
p04023 | <span class="lang-en">
<p>Score : <var>1400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke got an integer sequence from his mother, as a birthday present. The sequence has <var>N</var> elements, and the <var>i</var>-th of them is <var>i</var>.
Snuke performs the following <var>Q</var> ... |
p00963 |
<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... |
p01671 |
<h2>E - Minimum Spanning Tree</h2>
<h3>Problem Statement</h3>
<p>
You are given an undirected weighted graph <var>G</var> with <var>n</var> nodes and <var>m</var> edges.
Each edge is numbered from <var>1</var> to <var>m</var>.
</p>
<p>
Let <var>G_i</var> be an graph that is made by erasing <var>i</var>-th edge from... |
p00430 |
<H1></H1>
<p>
同じ大きさの正方形の紙が <i>n</i> 枚ある.これらの紙の下部を水平に揃えて何列かに並べる.ただし,隣り合う列は左側が右側より低くならないように並べなければならない.例えば, <i>n</i> = 5 のときは,次のような 7 通りの並べ方が可能である.
</p>
<br>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_ioi2006ho3">
</center>
<br>
<p>
これらを,各列に並んだ正方形の個数の列で表すことにする.例えば, <i>n</i> = 5 の
とき... |
p00060 |
<H1>カードゲー ム</H1>
<p>
「1」から「10」までの数字が書かれたカードが各 1 枚、全部で 10 枚あります。このカードは、表側には数字が書かれ、裏側には何も書かれていません。このカードを使って、あなたと相手の 2 名で以下のルールでゲー ムを行います。
</p>
<ol>
<li> あなたと相手には、表を上にして 1 枚、裏を上にして 1 枚、計 2 枚のカードが配られています。あなたは相手の表のカードの数字を見ることができますが、裏のカードの数字は見えません。
</li>
<li> 配られたカードの数字の合計が 20 以下で、かつ相手の数字の合計より大きいときに勝ちとなります。
例... |
p00575 | <h1>ソーシャルゲーム (Social Game)</h1>
<!-- 時間制限 : 2sec / メモリ制限 : 256MB-->
<h2> 問題文</h2>
<p>
JOI 君は明日から新たにソーシャルゲームを始めることにした.
</p>
<p>
このソーシャルゲームでは,<var>1</var> 日につき <var>1</var> 回までログインすることができ,ログインするたびに <var>A</var> 枚のコインが得られる.
</p>
<p>
また,月曜日から日曜日まで <var>7</var> 日連続でログインすると,そのたびに,追加で <var>B</var> 枚のコインが得られる.
</p>
<p>
... |
p02548 | <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>N</var>.
How many tuples <var>(A,B,C)</var> of positive integers satisfy <var>A \times B + C = N</var>?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraint... |
p00125 |
<h1>日数</h1>
<p>
2 つの日付を入力とし、その 2 つの日付けの間の日数を出力するプログラムを作成してください。
</p>
<p>
日付 1 (<var>y<sub>1</sub>, m<sub>1</sub>, d<sub>1</sub></var>) は日付 2 (<var>y<sub>2</sub>, m<sub>2</sub>, d<sub>2</sub></var>) と同じか、あるいはそれ以前の日付とします。日付 1 は日数に含め、日付 2 は含めません。また、うるう年を考慮にいれて計算してください。うるう年の条件は次のとおりとします。
</p>
<ul>
<li>西暦年が 4 で割り切れ... |
p02118 |
<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>Problem H: Sequence</h1>
... |
p03359 | <span class="lang-en">
<p>Score: <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>In AtCoder Kingdom, Gregorian calendar is used, and dates are written in the "year-month-day" order, or the "month-day" order without the year.<br/>
For example, May <var>3</var>, <var>2018</var> is wri... |
p01364 |
<H1><font color="#000">Problem F:</font> Two-Wheel Buggy</H1>
<p>
International Car Production Company (ICPC), one of the largest automobile manufacturers in
the world, is now developing a new vehicle called "Two-Wheel Buggy". As its name suggests,
the vehicle has only two wheels. Quite simply, "Two-Wheel Buggy" is m... |
p00826 |
<H1><font color="#000">Problem H:</font> Monster Trap</H1>
<p>
Once upon a time when people still believed in magic, there was a great wizard Aranyaka
Gondlir. After twenty years of hard training in a deep forest, he had finally mastered ultimate
magic, and decided to leave the forest for his home.
</p>
<p>
Arriving ... |
p03709 | <span class="lang-en">
<p>Score : <var>1200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi is an expert of Clone Jutsu, a secret art that creates copies of his body.</p>
<p>On a number line, there are <var>N</var> copies of Takahashi, numbered <var>1</var> through <var>N</var>.
The... |
p01734 |
<p>
Ayimok is a wizard.
</p>
<p>
His daily task is to arrange magical tiles in a line, and then cast a magic spell.
</p>
<p>
Magical tiles and their arrangement follow the rules below:
</p>
<ul>
<li> Each magical tile has the shape of a trapezoid with a height of 1.</li>
<li> Some magical tiles may overlap with... |
p02231 | UF with standard input (K = 100) |
p02661 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> integers <var>X_1, X_2, \cdots, X_N</var>, and we know that <var>A_i \leq X_i \leq B_i</var>.
Find the number of different values that the median of <var>X_1, X_2, \cdots, X_N</va... |
p03973 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><var>N</var> people are waiting in a single line in front of the Takahashi Store. The cash on hand of the <var>i</var>-th person from the front of the line is a positive integer <var>A_i</var>.</p>
<p>M... |
p03420 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi had a pair of two positive integers not exceeding <var>N</var>, <var>(a,b)</var>, which he has forgotten.
He remembers that the remainder of <var>a</var> divided by <var>b</var> was greater th... |
p03070 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given <var>N</var> integers. The <var>i</var>-th integer is <var>a_i</var>.
Find the number, modulo <var>998244353</var>, of ways to paint each of the integers red, green or blue so that the fol... |
p01558 |
<h1>Substring</h1>
<p>長さnの文字列s=s<sub>1</sub>,s<sub>2</sub>,…,s<sub>n</sub>およびm個のクエリが与えられる。
各クエリq<sub>k</sub> (1 ≤ k ≤ m)は、"L++", "L--", "R++", "R--"の4種類のいずれかであり、
k番目のクエリq<sub>k</sub>に対してl[k]とr[k]を以下で定義する。
</p>
<ul><li><p> L++:l[k]=l[k-1]+1,r[k]=r[k-1]
</p></li><li><p> L--... |
p03565 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>E869120 found a chest which is likely to contain treasure.<br/>
However, the chest is locked. In order to open it, he needs to enter a string <var>S</var> consisting of lowercase English letters.<br/>
H... |
p01108 |
<h3><u>Equivalent Deformation</u></h3>
<p>
Two triangles <i>T</i><sub>1</sub> and <i>T</i><sub>2</sub> with the same area are on a plane.
Your task is to perform the following operation to <i>T</i><sub>1</sub> several times so that it is exactly superposed on <i>T</i><sub>2</sub>.
Here, vertices of <i>T</i><sub>1</su... |
p03135 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In order to pass the entrance examination tomorrow, Taro has to study for <var>T</var> more hours.</p>
<p>Fortunately, he can <em>leap</em> to World B where time passes <var>X</var> times as fast as it ... |
p02374 | <H1>Range Query on a Tree</H1>
<p>
Write a program which manipulates a weighted rooted tree $T$ with the following operations:
</p>
<ul>
<li>$add(v,w)$: add $w$ to the edge which connects node $v$ and its parent<br>
<li>$getSum(u)$: report the sum of weights of all edges from the root to node $u$<br>
</ul>
<p>
... |
p00349 |
<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>
大きなチェス盤上に、それぞれ1から <var>N</v... |
p02724 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi loves gold coins. He gains <var>1000</var> <em>happiness points</em> for each <var>500</var>-yen coin he has and gains <var>5</var> happiness points for each <var>5</var>-yen coin he has. (Yen... |
p00719 |
<h1><font color="#000">Problem D:</font> Traveling by Stagecoach</h1>
<p>
Once upon a time, there was a traveler.
</p>
<p>
He plans to travel using stagecoaches (horse wagons).
His starting point and destination are fixed,
but he cannot determine his route.
Your job in this problem is to write a program
which determ... |
p03836 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Dolphin resides in two-dimensional Cartesian plane, with the positive <var>x</var>-axis pointing right and the positive <var>y</var>-axis pointing up.<br/>
Currently, he is located at the point <var>(sx... |
p00076 |
<H1>宝探し II</H1>
<p>
蔵を片付けていたら、先祖の宝のありかへの行き方を記した古文書が見つかりました。この古文書にはおおよそ次のような事が書かれていました。
</p>
<pre class=exp>
1. まず、町外れの井戸から、真東に 1m の地点に立ち、まっすぐ井戸の方向を向け。
2. 右回りに 90 度向きを変え、1m 直進したら、まっすぐ井戸の方向を向け。
3. 右回りに 90 度向きを変え、1m 直進したら、まっすぐ井戸の方向を向け。
4. 〃
5. 〃
6. :
</pre>
<p>
2... |
p00426 |
<H1></H1>
<p>
大きさが異なる n 個のコップと 3 つのトレイ(お盆)A,B,C があり,それらのコップは 3 つのトレイの上にそれぞれ何個かずつ一山に重ねて置かれている.ただし,どのトレイにおいても,そのトレイの中で一番小さいコップが一番下に, 2 番目に小さいコップがその上に, 3 番目に小さいコップがその上にと,小さい順に伏せて重ねてある.例えば,下図の右側は, n = 5 個のコップがトレイ A,B,C にそれぞれ 2 個,0 個,3 個重ねて置かれている状態を示している.
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/... |
p01667 |
<h2>A - Everlasting Zero</h2>
<h3>Problem Statement</h3>
<p>
You are very absorbed in a famous role-playing game (RPG), "Everlasting -Zero-". An RPG is a game in which players assume the roles of characters in a fictional setting. While you play the game, you can forget your "real life" and become a different person... |
p02948 | <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> one-off jobs available. If you take the <var>i</var>-th job and complete it, you will earn the reward of <var>B_i</var> after <var>A_i</var> days from the day you do it.</p>
<p>Yo... |
p00975 | <h2>Four-Coloring</h2>
<p>
You are given a planar embedding of a connected graph. Each vertex of the graph corresponds to a distinct point with integer coordinates. Each edge between two vertices corresponds to a straight line segment connecting the two points corresponding to the vertices. As the given embedding is p... |
p04035 | <span class="lang-en">
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> pieces of ropes, numbered <var>1</var> through <var>N</var>. The length of piece <var>i</var> is <var>a_i</var>.</p>
<p>At first, for each <var>i (1≤i≤N-1)</var>, piece <var>i</var> and piece <var>i+1</var> are tied at... |
p01237 |
<H1><font color="#000">Problem D:</font> Life Game</H1>
<p>
You are working at a production plant of biological weapons. You are a maintainer of a terrible virus weapon
with very high reproductive power. The virus has a tendency to build up regular hexagonal colonies. So as a
whole, the virus weapon forms a hexagonal... |
p01722 |
<p>
イクタ君は速いプログラムが大好きである。最近は、除算のプログラムを高速にしようとしている。しかしなかなか速くならないので、「常識的に考えて典型的」な入力に対してのみ高速にすればよいと考えた。イクタ君が解こうとしている問題は次のようなものである。
</p>
<p>
与えられた非負整数<var>n</var>に対し、10進法で<var>p(n) − 1</var>桁の正整数<var>11</var>...<var>1</var>を<var>p(n)</var>で割ったあまりを求めよ。ただし<var>p(n)</var>は<var>2<sup>2<sup>{</sup> . . . <sup>2</sup><... |
p00830 |
<H1><font color="#000">Problem D:</font> Pathological Paths</H1>
<p>
Professor Pathfinder is a distinguished authority on the structure of hyperlinks in the World
Wide Web. For establishing his hypotheses, he has been developing software agents, which
automatically traverse hyperlinks and analyze the structure of the... |
p01372 |
<!-- begin en only -->
<!--<h3><U>6÷2(1+2)</U></h3>-->
<!-- end en only -->
<!-- begin ja only -->
<h3><U>6÷2(1+2)</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>
数学科の学生であるきたまさ君は,数学はとても得意なのだが算... |
p01688 |
<h2>B - Doctor Course Is Recommended / D進どうですか?</h2>
<h3>Story</h3>
<p>DのひとはD進を決意したので、博士後期課程入学試験を受けることにした。筆記試験はマークシート形式であった。自身の専門分野の問題ばかりだったので、Dのひとはすぐにすべての正答を導くことができた。しかし、ここで大きな問題に気づいた。Dのひとは宗教上の理由から、解答用紙には'D'としか書くことができなかったのだ。また、'D'と書くためには尋常ではない集中力を使うため,'D'と書くことのできる個数も決まっている。Dのひとが本当にD進することができるか調べるため、解答・配点を踏まえ、上記の条件を... |
p00133 |
<H1>パターンの回転</H1>
<p>
8 文字 × 8 行のパターンを右回りに 90 度、180 度、270 度回転させて出力するプログラムを作成してください。
</p>
<H2>Input</H2>
<p>
8 文字 × 8 行からなるパターンが与えられます。文字は、英数字、半角シャープ '#' 、アスタリスク '*' からなります。
</p>
<H2>Output</H2>
<p>
次の形式で、回転させたパターンを出力してください。
</p>
<pre>
90(半角数字固定)
90度回転させたパターン
180(半角数字固定)
180度回転させたパターン
270(半角数字固定)
27... |
p00563 |
<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>Rope</h1>
<p>
JOI is a baby playing with ... |
p00099 |
<H1>ワカサギ釣り大会 2</H1>
<p>
桧原湖でワカサギ釣り大会が行われました。今回はキャッチ&リリースが推奨されているようです。
</p>
<p>
参加者番号と釣った匹数またはリリースした匹数を1つのイベントとして順番に読み込み、各イベントの直後に最も多くのワカサギを手元に獲得している参加者番号と匹数を出力するプログラムを作成してください。最も多く獲得している参加者が複数いる場合(あるいは全ての参加者が 0 匹の場合)は、その中で参加者番号が最も小さい一人を出力してください。
</p>
<H2>入力</H2>
<p>
入力は以下の形式で与えられる。
</p>
<pre>
<var>n</var> <va... |
p03066 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Find the number, modulo <var>998244353</var>, of sequences of length <var>N</var> consisting of <var>0</var>, <var>1</var> and <var>2</var> such that none of their contiguous subsequences totals to <var... |
p03436 | <span class="lang-en">
<p>Score: <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem statement</h3>
<p>We have an <var>H \times W</var> grid whose squares are painted black or white. The square at the <var>i</var>-th row from the top and the <var>j</var>-th column from the left is denoted as <var>(i, j)<... |
p03965 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>AtCoDeer the deer and his friend TopCoDeer is playing a game.
The game consists of <var>N</var> turns.
In each turn, each player plays one of the two <em>gestures</em>, <em>Rock</em> and <em>Paper</em>,... |
p01958 |
<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... |
p02677 | <span class="lang-en">
<p>Score: <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Consider an analog clock whose hour and minute hands are <var>A</var> and <var>B</var> centimeters long, respectively.</p>
<p>An endpoint of the hour hand and an endpoint of the minute hand are fixed at... |
p02227 | UnionFind(ランダム生成) |
p03820 | <span class="lang-en">
<p>Score : <var>1200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has decided to play with <var>N</var> cards and a deque (that is, a double-ended queue).
Each card shows an integer from <var>1</var> through <var>N</var>, and the deque is initially empty.</p>
<... |
p02732 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>We have <var>N</var> balls. The <var>i</var>-th ball has an integer <var>A_i</var> written on it.<br/>
For each <var>k=1, 2, ..., N</var>, solve the following problem and print the answer. </p>
<ul>
<... |
p02698 | <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, whose <var>i</var>-th edge connects Vertex <var>u_i</var> and Vertex <var>v_i</var>.
Vertex <var>i</var> has an integer <var>a_i</var> written on it.
For every... |
p02362 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Single Source Shortest Path (Negative Edges)</H1>
<br/>
<H2>Input</H2>
<p>
An edge-weighted graph <var>G</var> (<var>V</var>, <var>E</var>) and the source <var>r</var>.
</p>
<pre>
|<var>V</var>| |<var>E</var>| <var>r</var>
<var>s<sub>0</sub></var> <var>t... |
p03123 | <span class="lang-en">
<p>Score : <var>2000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has <var>R</var> red balls and <var>B</var> blue balls.
He distributes them into <var>K</var> boxes, so that no box is empty and no two boxes are identical.
Compute the maximum possible value of ... |
p03089 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has an empty sequence <var>a</var>.</p>
<p>He will perform <var>N</var> operations on this sequence.</p>
<p>In the <var>i</var>-th operation, he chooses an integer <var>j</var> satisfying <var>1 \... |
p03573 | <span class="lang-en">
<p>Score : <var>100</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>.<br/>
Among them, two are the same, but the remaining one is different from the rest.<br/>
For example, when <var>A=5,B=7,C=5</v... |
p01260 |
<H1><font color="#000">Problem A:</font> Girls' Party</H1>
<p>
Issac H. Ives hosted a party for girls. He had some nice goods and wanted to distribute them to the girls
as the presents. However, there were not enough number of presents and thus he needed to decide who
would take them. He held a game for that purpose.... |
p00888 |
<H1><font color="#000">Problem E:</font> The Two Men of the Japanese Alps</H1>
<p>
Two experienced climbers are planning a first-ever attempt: they start at two points of the equal altitudes on a mountain range, move back and forth on a single route keeping their altitudes equal, and finally meet with each other at a... |
p01630 |
<h1>Problem D: 2DはDecision Diagramの略</h1>
<h2>Problem Statement</h2>
<p>
BDD(Binary Decision Diagram)というデータ構造をご存知だろうか。近年、組み合わせ爆発お姉さんの動画関連でも話題になったZDDは、BDDが派生したデータ構造である。この問題は、BDDの基本的な実装を行うものである。
</p>
<p>
BDDとは、論理関数を表現する閉路のないグラフ(DAG)である。例えば、表1の真理値表を表わす論理関数は、図1のBDDとなる。BDDは、0エッジ(破線矢印)、1エッジ(実線矢印)、0終端ノード(0の四角)、1終端ノード(1... |
p00922 |
<H1><font color="#000">Problem I: </font>Hidden Tree</H1>
<p>
Consider a binary tree whose leaves are assigned integer weights. Such a tree is called <i>balanced</i> if, for every non-leaf node, the sum of the weights in its left subtree is equal to that in the right subtree. For instance, the tree in the following f... |
p00471 |
<H1>方向音痴のトナカイ</H1>
<h2> 問題</h2>
<p>
今年も JOI 町にサンタクロースが空からやってきた.JOI 町にある全ての家には子供がいるので,このサンタクロースは JOI 町の全ての家にプレゼントを配ってまわらなければならない.しかし,今年は連れているトナカイが少々方向音痴であり,また建物の上以外に降りることができないため,全ての家にプレゼントを配るためには少々道順を工夫しなければならないようだ.
</p>
<p>
JOI 町は東西南北に区画整理されており,各区画は家,教会,空き地のいずれかである.JOI 町には 1 つだけ教会がある.次のルールに従い,サンタクロースとトナカイは教会から出発し,... |
p00021 |
<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>Parallelism</H1>
<p>
There are four points:... |
p00534 |
<h2>シルクロード (Silk Road)</h2>
<h2>問題</h2>
<p>
現在カザフスタンがある地域には,古くは「シルクロード」と呼ばれる交易路があった.
</p>
<p>
シルクロード上には N + 1 個の都市があり,西から順に都市 0, 都市 1, ... , 都市 N と番号がつけられている.都市 i - 1 と都市 i の間の距離 (1 ≤ i ≤ N) は D<sub>i</sub> である.
</p>
<p>
貿易商である JOI 君は,都市 0 から出発して,都市を順番に経由し,都市 N まで絹を運ぶことになった.都市 0 から都市 N まで M 日以内に移動しなければならな... |
p02159 | <h1>Problem K: Encampment Game</h1>
<h2>Problem</h2>
<p>
$N$頂点の木がある。各頂点はそれぞれ1から$N$の番号が割り振られている。<br>
Gacho君と川林君はこの木を使って陣取りゲームをすることにした。<br>
ゲームはGacho君と川林君が異なる頂点にいる状態からスタートする。<br>
Gacho君から交互に頂点を移動することを繰り返し、最初に移動できなくなった方が負けである。<br>
<br>
移動方法:<br>
頂点$x$にいる時、頂点$x$と辺で直接結ばれているまだ誰も訪れたことがない頂点のいずれかに移動する。<br>
そのよう... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.