question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p01634 |
<h1 class="ndoc-heading1">Problem A: Register Phase</h1>
<p class="ndoc-top">
インターネットをより安全に活用するために、堅牢なパスワードを使うことは重要である。それと同時に、同じパスワードを使い回さないことも非常に重要である。どんなに強いパスワードを使っていても、一箇所で平文が流出してしまえば、破るのは非常に容易になってしまう。もちろん、全てのアプリケーションがパスワードをハッシュ化し、SALTを適切に使用していれば流出してもそのような被害は発生しないが、いまだにパスワードを平文で保存しているアプリケーションはあるのである。</p>
<p class... |
p03609 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a sandglass that runs for <var>X</var> seconds. The sand drops from the upper bulb at a rate of <var>1</var> gram per second. That is, the upper bulb initially contains <var>X</var> grams of san... |
p02448 | <h1>Sorting Tuples</h1>
<p>
Write a program which reads $n$ items and sorts them. Each item has attributes $\{value, weight, type, date, name\}$ and they are represented by $\{$ integer, integer, upper-case letter, integer, string $\}$ respectively. Sort the items based on the following priorities.
</p>
<ol>
<li... |
p00475 |
<H1>博覧会</H1>
<h2> 問題</h2>
<p>
JOI 市では,とある大規模な博覧会を開催することになった.
</p>
<p>
今回の博覧会には 2 つのテーマがあり,JOI 市にある N 個の展示施設でそれぞれ,
2 つのテーマのうちどちらか一方に沿った展示を行う予定である.
</p>
<p>
施設の位置は平面座標 (x, y) で表される.位置 (x, y) にある施設から (x′ , y′) にある施設まで移動するためには, |x − x′| + |y − y′| だけの時間がかかる (整数 a に対して,
|a| で a の絶対値を表す).同一テーマ内での統一感を出すため,および一方のテーマのみに... |
p02018 | <h2>D: 忖度 (Surmise)</h2>
<p>とある双子は、偶数が好きである。</p>
<p>$N$ 個の整数 $A_1, A_2, A_3, \dots, A_N$ の中に偶数がいくつあるか数えよ。</p>
<h3>入力</h3>
<p>1 行目には整数 $N$ が与えられる。</p>
<p>2 行目には $N$ 個の整数 $A_1, A_2, A_3, \dots, A_N$ が空白区切りで与えられる。</p>
<h3>出力</h3>
<p>偶数の個数を出力せよ。ただし、最後に改行を入れること。</p>
<h3>制約</h3>
<ul>
<li>$N$ は $1$ 以上 $100$ 以下の整数</li>... |
p00025 |
<H1>Hit and Blow</H1>
<p>
Let's play Hit and Blow game. <i>A</i> imagines four numbers and <i>B</i> guesses the numbers. After <i>B</i> picks out four numbers, <i>A</i> answers:
</p>
<ul>
<li> The number of numbers which have the same place with numbers <i>A</i> imagined (Hit) </li>
<li> The number of numbers includ... |
p02736 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a sequence of <var>N</var> digits <var>a_1a_2\ldots a_N</var>, where each element is <var>1</var>, <var>2</var>, or <var>3</var>.
Let <var>x_{i,j}</var> defined as follows:</p>
<ul>
<li><var>x_... |
p03824 | <span class="lang-en">
<p>Score : <var>1400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We will recursively define <em>uninity</em> of a tree, as follows: (<em>Uni</em> is a Japanese word for sea urchins.)</p>
<ul>
<li>A tree consisting of one vertex is a tree of uninity <var>0</var>.</li... |
p01819 |
<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 A:
Where is the Boundar... |
p02366 |
<H1>Articulation Points</H1>
<p>
Find articulation points of a given undirected graph <var>G(V, E)</var>.
</p>
<p>
A vertex in an undirected graph is an articulation point (or cut vertex) iff removing it disconnects the graph.
</p>
<H2>Input</H2>
<pre>
<var>|V|</var> <var>|E|</var>
<var>s<sub>0</sub></var> <var>t... |
p03127 | <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> monsters, numbered <var>1, 2, ..., N</var>.</p>
<p>Initially, the health of Monster <var>i</var> is <var>A_i</var>.</p>
<p>Below, a monster with at least <var>1</var> health is ca... |
p03577 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Rng is going to a festival.</p>
<p>The name of the festival is given to you as a string <var>S</var>, which ends with <code>FESTIVAL</code>, from input. Answer the question: "Rng is going to a festival ... |
p03598 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> balls in the <var>xy</var>-plane. The coordinates of the <var>i</var>-th of them is <var>(x_i, i)</var>.
Thus, we have one ball on each of the <var>N</var> lines <var>y = 1</var>,... |
p03062 | <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> integers, <var>A_1, A_2, ..., A_N</var>, arranged in a row in this order.</p>
<p>You can perform the following operation on this integer sequence any number of times:</p>
<p><stro... |
p03432 | <span class="lang-en">
<p>Score : <var>1800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have an <var>N \times M</var> grid. The square at the <var>i</var>-th row and <var>j</var>-th column will be denoted as <var>(i,j)</var>.
Particularly, the top-left square will be denoted as <var>(1... |
p02389 |
<H1>Rectangle</H1>
<p>
Write a program which calculates the area and perimeter of a given rectangle.
</p>
<H2>Input</H2>
<p>
The length <var>a</var> and breadth <var>b</var> of the rectangle are given in a line separated by a single space.
</p>
<H2>Output</H2>
<p>
Print the area and perimeter of the rectangle ... |
p02673 | <span class="lang-en">
<p>Score : <var>1300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are playing a game and your goal is to maximize your expected gain.
At the beginning of the game, a pawn is put, uniformly at random, at a position <var>p\in\{1,2,\dots, N\}</var>. The <var>N</var>... |
p03961 | <span class="lang-en">
<p>Score : <var>1200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>One day Mr. Takahashi picked up a dictionary containing all of the <var>N</var>! permutations of integers <var>1</var> through <var>N</var>.
The dictionary has <var>N</var>! pages, and page <var>i</var... |
p02223 | <span class="lang">
<span class="lang-ja">
<h1>M: 文字列集合</h1>
<div class="part">
<section>
<h3>問題文</h3><p>以下の条件を満たす文字列集合 $S$ のうち、要素数が最大となるものを $1$ つ構成してください。</p>
<ul>
<li>$S$ に含まれる文字列の長さは $1$ 以上 $N$ 以下である。</li>
<li>$S$ に含まれる文字列の長さはそれぞれ異なる。</li>
<li>$S$ に含まれる文字列は、文字 <code>0</code>, <code>1</code> のみからなる。</li>
<li>$S$ に含ま... |
p02809 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Niwango has <var>N</var> cards, numbered <var>1,2,\ldots,N</var>.
He will now arrange these cards in a row.</p>
<p>Niwango wants to know if there is a way to arrange the cards while satisfying all the ... |
p00834 |
<H1><font color="#000">Problem H:</font> Inherit the Spheres</H1>
<p>
In the year 2xxx, an expedition team landing on a planet found strange objects made by an
ancient species living on that planet. They are transparent boxes containing opaque solid spheres
(Figure 1). There are also many lithographs which seem to co... |
p01726 |
<p>不運なイクタ君は持っていた大事な文字列<var>T</var>をウィルスによって異なる文字列<var>T'</var>に書き換えられてしまった。そのウィルスが<var>T</var>の1文字を異なる文字に書き換えてしまったことがわかっている。すなわち<var>T</var>と<var>T'</var>はちょうど1文字のみ異なっている。イクタ君は<var>T</var>を復元するために、<var>T</var>が出現していると思われる文書<var>S</var>を用意した。<var>T</var>を復元するための下準備として<var>S</var>の部分文字列で<var>T</var>と一致している可能性があるものの個数... |
p01376 |
<div>
<h1 class="title">問題 A : プログラミングコンテスト</h1>
<p>時は 20XX 年,世界は G○○gle 社の支配によるディストピアである.
現在,人々の娯楽はプログラミングコンテストに限られている.
例えば,週末に家族で T○pC○der アリーナを訪れるというのはとてもよく見られる光景である.
しかし,それは光の世界のプログラミングコンテストの姿に過ぎない.
一方で,G○○gle と反抗勢力がぶつかり合う闇の世界では,
命をかけたプログラミングコンテストが行われている.</p>
<p>自分も久しぶりにプログラミングコンテストに参加してみよう.
足慣らしに,まずは,プログラミングコン... |
p00137 |
<H1>平方採中法</H1>
<p>
古典的な乱数生成方法の一つである平方採中法のプログラムを作成します。平方採中法は、フォンノイマンによって 1940 年代半ばに提案された方法です。
</p>
<p>
平方採中法は、生成する乱数の桁数を <var>n</var> としたとき、初期値 <var>s</var> の2乗を計算し、その数値を <var>2n</var> 桁の数値とみて、(下の例のように 2 乗した桁数が足りないときは、0 を補います。)その中央にある <var>n</var> 個の数字を最初の乱数とします。次にこの乱数を 2 乗して、同じ様に、中央にある <var>n</var> 個の数字をとって、次の乱数とし... |
p00567 | <h1>水ようかん (Mizuyokan)</h1>
<h2>問題文</h2>
<p>
水ようかんとは,おもに小豆からなる餡を型に流し込んで寒天で固めることにより作られる和菓子である.いま,JOI 君の手元には,横長の直方体の形をした水ようかんがひとつある.JOI 君は,今日のおやつとしてこの水ようかんを食べる予定である.</p>
<p>
この水ようかんには,縦方向の切れ目が全部で <var>N-1</var> 箇所に入っている.水ようかんの長さは <var>L_1 + L_2 + ... + L_N</var> であり,<var>i</var> 番目 <var>(1 ≦ i ≦ N-1)</var> の切れ目は,左から <v... |
p00072 |
<H1>灯篭</H1>
<p>
会津若松市は「歴史の町」として知られています。今から約 400 年前、蒲生氏郷により城下町の骨格が作られましたが、その後、徳川三代将軍家光公の異母弟「保科正之」公を藩祖とする会津藩 23 万石の中心都市として発展しました。今でも市内のいたるところに史跡や昔日の面影が残っているため、毎年、全国から多くの観光客が訪れています。
</p>
<p>
<!--特に、-->今年は、NHK大河ドラマで「新選組!」が放送されているため、新選組ゆかりの地(*1)として、大幅に観光客が増加しています。そこで市では、市内に点在する史跡を結ぶ通り沿いに 100 m 間隔で灯篭を設置して飾りたてることにしました。灯篭... |
p00588 |
<H1>Extraordinary Girl (I)</H1>
<p>
She is an extraordinary girl. She works for a library. Since she is young
and cute, she is forced to do a lot of laborious jobs. The most annoying job
for her is to put returned books into shelves, carrying them by a cart. The
cart is large enough to carry many books, but too... |
p00422 | <h1>惑星ヤナイヅの資源</h1>
<p>
人類はついに知的生命体の存在する惑星ヤナイヅを発見した。惑星ヤナイヅでは科学が進歩していたので、次第に我々との共同研究が盛んにおこなわれるようになった。
</p>
<p>
惑星ヤナイヅではベコという虫が重要な資源とみなされている。ベコは幼虫からう化して成虫になる。ベコの生息域ではベコの幼虫が群れて生息している群生がいくつもあり、そのような群生が一列に並んでいる。惑星ヤナイヅのバイオテクノロジーを使うと、群生に対して以下のような操作ができる。
</p>
<ul>
<li> 指定した範囲のすべての群生に、同じ数の幼虫を追加する。</li>
<li> 指定した範囲のすべての群生で、指定し... |
p00971 | <h2>Shortest Common Non-Subsequence</h2>
<p>
A subsequence of a sequence $P$ is a sequence that can be derived from the original sequence $P$ by picking up some or no elements of $P$ preserving the order. For example, "<span>ICPC</span>" is a subsequence of "<span>MICROPROCESSOR</span>".
</p>
<p>
A common subsequen... |
p01663 |
<h2>H - N and K</h2>
<p>
1以上<var>N</var>以下の整数からなる狭義単調増加数列で,数列の要素からどの2つの異なる数を取ってきても
他方が一方を割り切ることがないようなものを考える.
そのような数列のうち,とりうる最大の長さを<var>L</var>として,そのような数列<var>(a_1,a_2,...,a_L)</var>を考える.
この数列の<var>K</var>番目の要素<var>a_K</var>を求めよ.ただし,そのような数列<var>(a_1...a_L)</var>が複数個存在する場合は,
<var>a_K</var>の値としてとりう... |
p01399 |
<h2>
Problem B: B問題
</h2>
<p>
R大学の2D好きの人たち (2DRespecters)は、A津大学で開催されるプログラミングの練習合宿に参加する。
この練習合宿では、参加者たちが自作のプログラミング問題を持ち寄り、練習に用いる。
</p>
<p>
2DRespectersも、いくつかの問題を作成することになった。
しかし、合宿の3日前になっても、まだ、B問題が完成していなかった。
最初のB問題の担当者が作成した問題は、担当者が問題の制約を難しくし過ぎてしまったため、C問題以降にまわされてしまったのだ。
そして、簡単すぎても、難しすぎてもいけない、微妙な難易度の調整が必要とされるB問題... |
p01233 |
<h1><font color="#000">Problem K:</font> 電波基地</h1>
<p>
20XX年,長年の研究が実を結び,
無線によるエネルギー送受信の技術が実用化された.
この技術を利用することで,
コストが見合わず今まで電力線を引くことができなかった過疎地にも
電力を供給することが可能となった.
この技術には少しくせがあって,
どこまでも遠くにエネルギーを送ることができるのだが,
特定の位置でしか電波の受信ができないという制約が存在する.
つまり,世界を2次元平面で表し,<var>y</var>軸正の方向を北,
... |
p04031 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Evi has <var>N</var> integers <var>a_1,a_2,..,a_N</var>. His objective is to have <var>N</var> equal <strong>integers</strong> by transforming some of them.</p>
<p>He may transform each integer at most ... |
p03561 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In Finite Encyclopedia of Integer Sequences (FEIS), all integer sequences of lengths between <var>1</var> and <var>N</var> (inclusive) consisting of integers between <var>1</var> and <var>K</var> (inclu... |
p03131 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has one biscuit and zero Japanese yen (the currency) in his pocket.
He will perform the following operations exactly <var>K</var> times in total, in the order he likes:</p>
<ul>
<li>Hit his pocket... |
p03998 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Alice, Bob and Charlie are playing <em>Card Game for Three</em>, as below:</p>
<ul>
<li>At first, each of the three players has a deck consisting of some number of cards. Each card has a letter <code>a<... |
p02370 |
<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>Topological Sort</H1>
<ce... |
p03832 | <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> people, conveniently numbered <var>1</var> through <var>N</var>.
We want to divide them into some number of groups, under the following two conditions:</p>
<ul>
<li>
<p>Every grou... |
p02720 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>A positive integer <var>X</var> is said to be a lunlun number if and only if the following condition is satisfied:</p>
<ul>
<li>In the base ten representation of <var>X</var> (without leading zeros), f... |
p02235 |
<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>Longest Common Subsequence<... |
p00208 |
<H1>病院の部屋番号 </H1>
<p>
ウォーターデブンに住む建築家のデブンキーさんのもとに、古い大病院を改装する仕事の依頼が舞い込んできました。
</p>
<p>
国によっては忌み数(いみかず)として嫌われる数字を部屋番号に用いたくない人がいます(日本では 4 と 9 が有名です)。しかし、この病院の部屋番号は忌み数に関係なく、1 から順番に付けられていました。
</p>
<p>
それが気になったデブンキーさんは、機材やベッドの入れ替えが全て終わる前にウォーターデブンの忌み数である「4」と「6」を除いた数字で部屋番号を付けなおしてしまいました。しかし、入れ替え作業は旧部屋番号で計画していたので、残りの作... |
p03977 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part"><section>
<h3>Problem Statement</h3>
<p>A professor invented Cookie Breeding Machine for his students who like cookies very much. </p>
<p>When one cookie with the taste of <var>x</var> is put into the machine and a non-negative integer <var>y... |
p02665 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is an integer sequence of length <var>N+1</var>: <var>A_0, A_1, A_2, \ldots, A_N</var>. Is there a binary tree of depth <var>N</var> such that, for each <var>d = 0, 1, \ldots, N</var>, there are e... |
p00658 |
<H1>Problem L: The Tower</H1>
<p>
Your task is to write a program that reads some lines of command for the following game and simulates operations until the player reaches the game over. We call following 2-dimensional grid of <i>m</i> by <i>n</i> characters Tower. The objective of this game is to move blocks in the t... |
p01419 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>On or Off</H1>
<p>
Saving electricity is very important!
</p>
<p>
You are in the office represented as <var>R \times C</var> grid that consists of walls and rooms.
It is guaranteed that, for any pair of rooms in the office, there exists exactly one rou... |
p03424 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In Japan, people make offerings called <em>hina arare</em>, colorful crackers, on March <var>3</var>.</p>
<p>We have a bag that contains <var>N</var> hina arare. (From here, we call them arare.)</p>
<p>... |
p01049 |
<h1>Array Update</h1>
<h2>Problem</h2>
<p>
項数 <var>N</var>、初項 <var>a</var>、公差 <var>d</var> の等差数列 <var>A</var> がある。以下の形式で数列を更新する命令文が <var>M</var> 個与えられるので、与えられた順序で数列 <var>A</var> を <var>M</var> 回更新したときの <var>K</var> 項目の値を求めよ。
</p>
<ul>
<li>
<var>i</var> 番目の命令文は3つの整数 <var> x<sub>i</sub> , y<sub>i</sub> , z<sub>i</... |
p03074 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><var>N</var> people are arranged in a row from left to right.</p>
<p>You are given a string <var>S</var> of length <var>N</var> consisting of <code>0</code> and <code>1</code>, and a positive integer <v... |
p00571 | <h1>美術展(Art Exhibition)</h1>
<p>
JOI 国で美術展が行われることになった.美術展では,国中から集まった様々な美術品が展示される予定である.
</p>
<p>
展示される美術品の候補として,<var>N</var> 点の美術品が集まった.これらの美術品には<var>1, 2, ..., N</var> の番号が付けられている.それぞれの美術品には大きさと価値と呼ばれる値が定まっている.美術品<var>i</var> <var>(1 \leq i \leq N)</var> の大きさは<var>A_i</var>,価値は<var>B_i</var> である.
</p>
<p>
美術展で... |
p00121 |
<H1>7 パズル</H1>
<p>
7 パズルは 8 つの正方形のカードとこれらのカードがぴたりと収まる枠で構成されています。それぞれのカードには、互いに区別できるように 0, 1, 2, ..., 7 と番号がつけられています。枠には、縦に 2 個、横に 4 個のカードを並べることができます。
</p>
<p>
7 パズルを始めるときには、まず枠にすべてのカードを入れます。枠のなかで 0 のカードだけは、上下左右に隣接するカードと位置を交換することができます。たとえば、枠の状態が図(a) のときに、0 のカードの右に隣接した、7 のカードと位置を交換すれば、図(b) の状態になります。あるいは、図(a) の状態から 0... |
p01360 |
<H1><font color="#000">Problem B:</font> Step Step Evolution</H1>
<p>
Japanese video game company has developed the music video game called Step Step Evolution.
The gameplay of Step Step Evolution is very simple. Players stand on the dance platform, and
step on panels on it according to a sequence of arrows shown in ... |
p00988 | <h2>Fun Region</h2>
<p>
Dr. Ciel lives in a planar island with a polygonal coastline. She loves strolling on the island along spiral paths. Here, a path is called <i>spiral</i> if both of the following are satisfied.
</p>
<ul>
<li> The path is a simple planar polyline with no self-intersections.</li>
<li> At all of i... |
p01730 |
<p>キョウトという街は古い寺社仏閣で有名な観光地である。</p>
<p>イクタ君は数人の友人とキョウト観光に来ていたが、全員が好き勝手に行動した結果、みんな迷子になってしまった。
</p>
<p>そこでイクタ君は、なるべく早く全員と合流するためには集合場所をどこにするのがよいか考えることにした。
</p>
<p>
キョウトの道路は東西と南北に距離10の間隔で無数に走っており、無限に広がる正方格子とみなすことができる。
</p>
<p>
道路は直線であるとみなし、幅は無いものとする。
また、街の中心を基準として東に距離<var>x</var>、北に距離<var>y</var>移動した位置を<var>(x,y)</var... |
p00822 |
<H1><font color="#000">Problem D:</font> Weather Forecast</H1>
<p>
You are the God of Wind.
</p>
<p>
By moving a big cloud around, you can decide the weather: it invariably rains under the cloud,
and the sun shines everywhere else.
</p>
<p>
But you are a benign God: your goal is to give enough rain to every field in ... |
p04027 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><strong>12:17 (UTC): The sample input 1 and 2 were swapped. The error is now fixed. We are very sorry for your inconvenience.</strong></p>
<p>There are <var>N</var> children in AtCoder Kindergarten, con... |
p03218 | <span class="lang-en">
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {skipTags:["script","noscript","style","textarea","code"],inlineMath: [['\\(','\\)']]}
});
</script>
<script async="" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML" type="text/java... |
p01225 |
<h1><font color="#000">Problem C:</font> ラミー</h1>
<p>
あなたの友達は最近 UT-Rummy というカードゲームを思いついた.
</p>
<p>
このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が
つけられている.
このゲームのプレイヤーはそれぞれ9枚の手札を持ち,
自分のターンに手札から1枚選んで捨てて,
代わりに山札から1枚引いてくるということを繰り返す.
このように順番にターンを進めていき,
最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー... |
p03648 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a sequence of length <var>N</var> consisting of non-negative integers. Consider performing the following operation on this sequence until the largest element in this sequence becomes <var>N-1</v... |
p01675 |
<h2>I - The J-th Number</h2>
<h3>Problem Statement</h3>
<p>
You are given <var>N</var> empty arrays, <var>t_1, ..., t_n</var>. At first, you execute <var>M</var> queries as follows.
</p>
<ul>
<li>add a value <var>v</var> to array <var>t_i</var> (<var>a \leq i \leq b</var>)</li>
</ul>
<p>
Next, you process <var>Q</... |
p00967 |
<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... |
p00434 |
<H1>未提出者は誰だ</H1>
<h2>問題</h2>
<p>
JOI大学のM教授はプログラミングの授業を担当している.クラスには30人の受講生がいて各受講生には1番から30番までの出席番号がふられている.この授業の課題を28人の学生が提出した.提出した28人の出席番号から提出していない2人の出席番号を求めるプログラムを作成せよ.
</p>
<H2>入力</H2>
<p>
入力は28行あり,各行には提出者の出席番号(1以上30以下)が1つずつ書かれている.入力される出席番号に重複はないが,どのような順に入力されるかはわからない.
</p>
<H2>出力</H2>
<p>
<!--提出する出力ファイルは2行からなる. 1... |
p02409 | <H1>Official House</H1>
<p>
You manage 4 buildings, each of which has 3 floors, each of which consists of 10 rooms. Write a program which reads a sequence of tenant/leaver notices, and reports the number of tenants for each room.
</p>
<p>
For each notice, you are given four integers <var>b</var>, <var>f</var>, <var... |
p00064 |
<H1>暗証番号</H1>
<p>
新しい暗証番号は覚えにくいものです。メモするのはダメといわれましたが、覚えられそうにありません。そこで文章の中に数値を埋め込んで暗証番号をメモすることにしました。ここでは全ての数値の和が暗証番号になります。
</p>
<p>
メモされた文章を読み込んで、暗証番号を出力するプログラムを作成してください。
</p>
<H2>Input</H2>
<p>
正の整数が埋め込まれた文章が複数行にわたり与えられます。各行は半角英数字、記号、空白を含む文字列または空行です。
ただし、入力は 1 行あたり 80 文字以内で、暗証番号は 10,000 以下であることが保障されています。
</p>
<... |
p02059 | <h2>H: Revenge of UMG</h2>
<h3>問題</h3>
<p>'U', 'M', 'G' の三種類の文字からなる文字列 <var>T</var> に対し、<var>1, 2, ..., |T|</var> 文字目をそれぞれ <var>T_1, T_2, ..., T_{|T|}</var> と表すことにしたとき、以下の条件を満たす <var>(i, j, k)</var> の組の個数を、文字列 <var>T</var> の “UMG 数”と呼ぶことにします:</p>
<ul>
<li> <var>1 \leq i < j < k \leq |T|</var></li>
<li> <var>j -... |
p01858 |
<!--<script language="JavaScript" type="text/javascript" src="js/varmath.js" charset="UTF-8"></script>-->
<h2>A: 磯野、あれやろうぜ! - Sendame -</h2>
<h3>物語</h3>
<p>中島「磯野〜,あれやろうぜ!」</p>
<p>磯野「あれって何だよ,中島」</p>
<p>中島「ほら,あれだよ,あれ.なぜか文字で表さなきゃならないから,説明しづらいな〜」</p>
<p>磯野「いや,図や写真も入れられるみたいだぞ?」</p>
<img src="https://judgeapi.u-aizu... |
p03865 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a string <var>s</var> of length <var>3</var> or greater.
No two neighboring characters in <var>s</var> are equal.</p>
<p>Takahashi and Aoki will play a game against each other.
The two players ... |
p02777 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>We have <var>A</var> balls with the string <var>S</var> written on each of them and <var>B</var> balls with the string <var>T</var> written on each of them.<br/>
From these balls, Takahashi chooses one... |
p02327 |
<H1>Largest Rectangle</H1>
<p>
Given a matrix (<var>H</var> × <var>W</var>) which contains only 1 and 0, find the area of the largest rectangle which only contains 0s.
</p>
<H2>Input</H2>
<pre>
<var>H</var> <var>W</var>
<var>c</var><sub>1,1</sub> <var>c</var><sub>1,2</sub> ... <var>c<sub>1,W</sub></var>
<va... |
p03166 | <span class="lang-en">
<p>Score : <var>100</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, 2, \ldots, N</var>, and for each <var>i</var> (<var>1 \leq i \leq M</var>), th... |
p03536 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In the final of CODE FESTIVAL in some year, there are <var>N</var> participants.
The <em>height</em> and <em>power</em> of Participant <var>i</var> is <var>H_i</var> and <var>P_i</var>, respectively.</p... |
p03023 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given an integer <var>N</var> not less than <var>3</var>, find the sum of the interior angles of a regular polygon with <var>N</var> sides.</p>
<p>Print the answer in degrees, but do not print units.</p... |
p03189 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given an integer sequence of length <var>N</var>: <var>A_1,A_2,...,A_N</var>. Let us perform <var>Q</var> operations in order.
The <var>i</var>-th operation is described by two integers <var>X_... |
p03473 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>How many hours do we have until New Year at <var>M</var> o'clock (24-hour notation) on <var>30</var>th, December?</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1≤M... |
p03920 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>The problem set at <em>CODE FESTIVAL 20XX Finals</em> consists of <var>N</var> problems.</p>
<p>The score allocated to the <var>i</var>-th <var>(1≦i≦N)</var> problem is <var>i</var> points.</p>
<p>Takah... |
p02632 | <span class="lang-en">
<p>Score: <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>How many strings can be obtained by applying the following operation on a string <var>S</var> exactly <var>K</var> times: "choose one lowercase English letter and insert it somewhere"?</p>
<p>The answer... |
p02798 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> cards numbered <var>1, 2, ..., N</var>.
Card <var>i</var> (<var>1 \leq i \leq N</var>) has an integer <var>A_i</var> written in red ink on one side and an integer <var>B_i</var> wri... |
p02262 |
<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>Shell Sort</h2>
<p>
Shel... |
p01767 |
<h1 id="b-rupc">B : RUPC</h1>
<h2 id="問題文">問題文</h2>
<p>ロシア連邦でプログラミングコンテストが開催される。コンテストには <var>N</var> 個の問題が出題され、<var>M</var> 人の参加者がいる。問題 <var>i</var> には得点 <var>a_i</var> が設定されており、参加者 <var>j</var> の実力は <var>b_j</var> であることがわかっている。問題 <var>i</var> と参加者 <var>j</var> について、 <var>a_i ≤ b_j</var> のときかつそのとき限り、参加者 <var>j</v... |
p00875 |
<H1><font color="#000">Problem B:</font> Repeated Substitution with Sed</H1>
<p>
Do you know "sed," a tool provided with Unix? Its most popular use is to substitute every
occurrence of a string <i.α</i> contained in the input string (actually each input line) with another
string <i>β</i>. More precisely, i... |
p02848 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a string <var>S</var> consisting of uppercase English letters. Additionally, an integer <var>N</var> will be given.</p>
<p>Shift each character of <var>S</var> by <var>N</var> in alphabetical or... |
p01337 |
<h1><font color="#000">Problem E:</font> The Number of the Real Roots of a Cubic Equation</h1>
<h2>Description</h2>
<p>3次方程式:<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_03Emath" alt="ax^3+bx^2+cx+d=0"> が与えられるので,その正の実数根の個数,負の実数根の個数をそれぞれ調べて欲しい.</p>
<p>根の個数は,重根も含めて数えるものとする.</p>
<h2>Input</h2>
<p>入... |
p00176 |
<H1>何色?</H1>
<p>
ウェブデザイナーを目指す太郎君はただいま修行中。事務所の先輩から「このページの背景色は#ffe085で」と、ウェブデザイン特有の色番号で指示されるのですが、それがどんな色かパッと思い浮かべることができません。
</p>
<p>
この色番号は光の三原色である赤、緑、青それぞれの強さを表わしています。具体的には2 桁の 16 進数を3 つ組み合わせたもので、色番号を“#RGB”とするとき、R は赤の強さ、G は緑の強さ、は青の強さを表します。それぞれ 00 から ff までの値になります。
</p>
<p>
色番号にまだ不慣れな太郎君のために、色番号を入力とし、色の表の中からもっとも近い色の... |
p00526 |
<h2>電飾(Illumination)</h2>
<p>
JOI 高校の文化祭では毎年廊下に電飾が飾られる.電飾は <var>N</var> 個の電球で構成されており,電球は廊下の西側から東側に一列に並んでいる.各電球は明かりがついているか,ついていないかのいずれかの状態である.
</p>
<p>
JOI 高校の倉庫には電球を操作する機械が眠っている.この機械は電飾内で連続した電球を指定すると,指定された電球のうち,明かりがついている電球全てを明かりがついていない状態にし,明かりがついていない電球全てを明かりがついている状態にする.ただし,機械は老朽化のため,1 回しか使用できない.
</p>
<p>
JOI 高校の... |
p00033 |
<H1>玉</H1>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_ball">
</center>
<br/>
<p>
図のように二股に分かれている容器があります。1 から 10 までの番号が付けられた10 個の玉を容器の開口部 A から落とし、左の筒 B か右の筒 C に玉を入れます。板 D は支点 E を中心に左右に回転できるので、板 D を動かすことで筒 B と筒 C のどちらに入れるか決めることができます。
</p>
<p>
開口部 A から落とす玉の並びを与えます。それらを順番に筒 B 又は筒 Cに入れていきま... |
p00463 |
<H1>あみだくじ </H1>
<h2>問題</h2>
<p>
あなたは J 君と一緒にあみだくじを使って遊んでいる.あみだくじは <i>n</i> 本の縦棒と
<i>m</i> 本の横棒からなる.縦棒には左から順に 1 から <i>n</i> の番号がついており,縦棒 <i>i</i> の下端には正整数 <i>s<sub>i</sub></i> が書かれている.
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amidakuji1">
<p>
図 3-1 あみだくじの例(<i>n</i> = 4, <i>m... |
p00199 |
<h1>難儀な人たちが座る椅子</h1>
<p>
4つの国の中心にある中立都市アイズシティには、大陸横断列車バンダイ号のホームがあります。 ホームには、バンダイ号を待つ乗客用の椅子が一列に用意されており、ホームに入ってきた人は自由に椅子を利用することができます。
</p>
<p>
このバンダイ号、安いし早いし快適ということで、周囲の4つの国からの利用者が絶えません。今日は開通記念日ということで、ホームに座っている人たちに特別なことをしてあげようと思っています。そのためには、改札を通った人たちがどこに座っているか把握しなければなりません。4つの国の人たちの難儀な性格を考慮して、椅子がどのように埋まっているかをシミュレー... |
p01622 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<!-- begin en only -->
<!--
<h3><u>Twin book report</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>
-->
<!-- e... |
p00930 |
<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:
Flipping Parentheses... |
p01272 |
<h1><font color="#000">Problem F:</font> Shore Erosion</h1>
<p>
あなたは地元の市役所に勤めるプログラマーである.あなたの住んでいる町は観光業が盛んで,とくに離れ小島にある海岸の海水浴場が人気がある.この島の周囲は砂浜により構成されているのだが,近年海岸浸食によって砂浜の面積が減ってきた.事態を重く見た観光課は,あなたに砂浜の形状変化のシミュレーションを依頼してきた.
</p>
<p>
シミュレーションでは,現在の砂浜の形状をもとに,ある期間が経過した後の砂浜の形状を求める.簡単のため,島の海岸線の形状は多角形(凸とは限らない)とみなす.期間のうちに,砂浜は現在の海... |
p01788 |
<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>I - Tokyo Olympics Center</h2>
... |
p01065 |
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML">
</script>
<h1>Barter</h1>
<!--
<p>
私の名前は五月雨ほたる。父のお菓子会社に駄菓子屋を経営する馬田ヨウさんを引っこ抜くためにこの村にやってきたわ。そこで出会ったヨウさんの息子のナナツくんが駄菓子センスバツグン!…なのだけれど、自身は漫画を書きたがっていて、ヨウさんの駄菓子屋を継ぐ気がないみたい……せっかく才能があるのだから、どうにか説得し... |
p03058 | <span class="lang-en">
<p>Score : <var>2200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a tree <var>T</var> with <var>N</var> vertices and an undirected graph <var>G</var> with <var>N</var> vertices and <var>M</var> edges.
The vertices of each graph are numbered <var>1</var>... |
p01435 |
<script type="text/javascript" src="./varmath.js" charset="UTF-8"></script>
<h2>問題文</h2>
<p>
<i>キュゥべえ</i>はワルプルギスの夜に向けて魔女の合成に明け暮れている.ワルプルギスの夜のために,特別な<i>グリーフシード</i> (魔女の卵) を使って手に入れやすい魔女をうまく合成し目的である舞台装置の魔女を創り上げなければならないからである.
</p>
<p>
<i>キュゥべえ</i>は手に入れやすい種類の魔女の<i>グリーフシード</i>から魔女の素となるものを取り出し,空の特別な<i>グリーフシード</i>に入れることで,その<... |
p03408 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has <var>N</var> blue cards and <var>M</var> red cards.
A string is written on each card. The string written on the <var>i</var>-th blue card is <var>s_i</var>, and the string written on the <... |
p01966 |
<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... |
p02649 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given are <var>N</var> pairwise distinct non-negative integers <var>A_1,A_2,\ldots,A_N</var>.
Find the number of ways to choose a set of between <var>1</var> and <var>K</var> numbers (inclusive) from th... |
p00674 |
<h1>Problem F: Strawberry Cake</h1>
<p>
会津大学附属小学校 (会津大小) に入学したシャ、ネロ、エリ、コーは競技プログラマとして活躍するために IPPC というプログラミングコンテストに出場することにした。しかし IPPC は 3 人 1 組でチームとしてコンテストに出場する決まりで、4 人でチームを組むことはできない。そこで彼らは 2 人ずつに分かれてチームを組み、2 人 1 組で参加できる IPOCH というプログラミングコンテストに出場することにした。
</p>
<p>
チームは分かれてしまったが、実力は拮抗しており互いに良い練習相手になっている。
</p>
<p>
ある日彼らのコー... |
p02219 | <span class="lang">
<span class="lang-ja">
<h1>H: 魔法使いの塔</h1>
<div class="part">
<section>
<h3>問題文</h3><p>あなたが持っている魔導書には、 $N$ 個の魔法が載っています。</p>
<p>魔法には $1$ から $N$ までの番号がついていて、魔法 $i (1 \le i \le N)$ のコストははじめ整数 $A_i$ です。</p>
<p>あなたの目的は、魔導書に載っているすべての魔法を $1$ 回ずつ唱えることです。</p>
<p>魔法を唱えはじめる前に、あなたはクッキーを $K$ 枚食べることができます。クッキーを食べる... |
p00224 |
<H1>自転車でダイエット</H1>
<p>
A さんは甘いものが大好きですが、最近は奥さんからダイエットするように言われています。ある日、A さんが自宅から市役所に出かけるとき、奥さんは自転車で行くことを勧めました。そこでA さんはしぶしぶ自転車に乗って出かけましたが、甘い物の好きな A さんは、途中にあるケーキ屋さんに立ち寄りケーキの食べ歩きをしようと思いつきました。
</p>
<p>
自転車をこげば走行距離に応じてカロリーが消費されますが、ケーキを食べればその分カロリーが摂取されます。正味の消費カロリーは、自転車をこいで消費したカロリーからケーキを食べて摂取したカロリーを引いた値になります。したがって、正味の... |
p01823 |
<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 F:
Marching Course
</... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.