question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p00731 |
<h1><font color="#000">Problem D:</font> Cliff Climbing</h1>
<!-- end en only -->
<!-- begin en only -->
<p>
At 17:00, special agent Jack starts to escape from the enemy camp.
There is a cliff in between the camp and the nearest safety zone.
Jack has to climb the almost vertical cliff
by stepping his feet on the b... |
p00361 | <!--<H1>Modification of Road Network</H1>-->
<h1>Road Improvement</h1>
<p>
Aizu is a country famous for its rich tourism resources and has <var>N</var> cities, each of which is uniquely identified with a number (0 to <var>N</var>-1). It has a road network consisting of <var>M</var> one-way roads connecting a city to a... |
p01989 | <h2>A: IPアドレス (Internet Protocol Address)</h2>
<h3>問題</h3>
<p>
数字列が <var>1</var> つ与えられるので、IPv4のIPアドレスとして有効な区切り方の個数を求めよ。
ただし、IPv4のIPアドレスとして有効な区切り方は以下の通りである。
</p>
<ul>
<li>数字列は <var>4</var> つに区切られ、区切られた各列について以下をすべて満たす。</li>
<ul>
<li>空列でない。</li>
<li><var>10</var> 進数として読むと <var>0</var> 以上 <var>255</var> 以下の整数である。</li>
<l... |
p01120 | <!--<h2>Problem D</h2>-->
<!-- begin en only -->
<h3>Tally Counters</h3>
<!-- end en only -->
<!-- begin en only -->
<p>
A number of tally counters are placed in a row.
Pushing the button on a counter will increment the displayed value by one, or, when the value is already the maximum, it goes down to one.
All the c... |
p01570 |
<h1>Usoperanto</h1>
<p>Usoperanto is an artificial spoken language designed and regulated by Usoperanto Academy.
The academy is now in study to establish Strict Usoperanto, a variation of the language intended for formal documents.
</p>
<p>In Usoperanto, each word can modify at most one other word, and modifiers are ... |
p00048 |
<H1>階級</H1>
<p>
ボクシングは体重によって階級が分けられています。体重を読み込んで、その階級を出力するプログラムを作成してください。階級と体重の関係は以下の表のとおりとします。
</p>
<center>
<table border=1>
<tr><td bgcolor="#88AAFF" width="120">階級</td><td bgcolor="#88AAFF" width="240">体重(kg)</td></tr>
<tr><td>light fly</td><td>48.00kg 以下</td></tr>
<tr><td>fly</td><td>48.00kg 超 51.00kg 以下</td... |
p02075 | <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: ... |
p00418 | <h1>決まりごとの多いジム</h1>
<p>
イヅア村のスポーツジムには$1$から$N$までの番号が付いた$N$台のトレーニング機器があります。トレーニング機器を1回利用するには、その機器の番号が書かれたチケットが1枚必要です。トレーニング機器を1回利用したときの消費カロリーは、機器ごとに決まっています。
</p>
<p>
このスポーツジムのチケットを何枚かもらったアツシ君は、運動不足解消のためにジムに行きました。このジムでは、利用者が運動をやりすぎて体を痛めないように、機器の利用回数にルールがあります。たとえば、「2番の機器は3番の機器よりも5回以上多く使ってはいけません」というようなルールです。機器を使う人は、ルールを守っ... |
p02425 | <h1>Bit Flag</h1>
<p>
A state with $n$ flags of ON or OFF can be represented by a sequence of bits where $0, 1, ..., n-1$ -th flag corresponds to 1 (ON) or 0 (OFF).
The state can be managed by the corresponding decimal integer, because the sequence of bits is a binary representation where each bit is 0 or 1.
</p>... |
p03664 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Mole decided to live in an abandoned mine. The structure of the mine is represented by a simple connected undirected graph which consists of <var>N</var> vertices numbered <var>1</var> through <var>N</v... |
p01659 |
<h2>D - カーペット</h2>
<p>
総合研究7号館の引越しに伴い,研究室にカーペットを敷くことになった.
この問題では研究室を上から見たときの床を,二次元平面上の多角形とみなす.
床の形状を表す要素数<var>N</var>の数列<var>\{a_i\}</var>が与えられる.
<var>R_i</var>を,左下の座標が<var>(i,0)</var>で右上の座標が<var>(i+1,a_i)</var>である各辺がx軸またはy軸に平行な長方形の境界及び内部領域とする.
このとき,床を表す多角形は<var>R_1 ∪ R_2 ∪ R_3 ∪ … ∪ R_N</var>... |
p02976 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a simple connected undirected graph with <var>N</var> vertices and <var>M</var> edges. The vertices are numbered <var>1</var> to <var>N</var>, and the <var>i</var>-th edge connects Vertex ... |
p03234 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>2N</var> points evenly spaced on the circumference of a circle.
These points are numbered <var>1</var> to <var>2N</var> in clockwise order, starting from some of them.</p>
<p>Snuke will d... |
p01209 |
<H1><font color="#000">Problem C:</font> !</H1>
<p>
You are one of ICPC participants and in charge of developing a library for multiprecision numbers
and radix conversion. You have just finished writing the code, so next you have to test if it
works correctly. You decided to write a simple, well-known factorial funct... |
p03721 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is an empty array.
The following <var>N</var> operations will be performed to insert integers into the array.
In the <var>i</var>-th operation <var>(1≤i≤N)</var>, <var>b_i</var> copies of an integ... |
p02833 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>For an integer <var>n</var> not less than <var>0</var>, let us define <var>f(n)</var> as follows:</p>
<ul>
<li><var>f(n) = 1</var> (if <var>n < 2</var>)</li>
<li><var>f(n) = n f(n-2)</var> (if <var>n... |
p02999 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><var>X</var> and <var>A</var> are integers between <var>0</var> and <var>9</var> (inclusive).</p>
<p>If <var>X</var> is less than <var>A</var>, print <var>0</var>; if <var>X</var> is not less than <var>... |
p03371 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>"Pizza At", a fast food chain, offers three kinds of pizza: "A-pizza", "B-pizza" and "AB-pizza". A-pizza and B-pizza are completely different pizzas, and AB-pizza is one half of A-pizza and one half of ... |
p02130 | <h1>Problem G: Combine Two Elements</h1>
<h2>Problem</h2>
<p>
$N$個の非負整数のペア$(a_i, b_i)$と非負整数$A$, $B$ が与えられる。<br>
以下のいずれかの操作をできるだけたくさん行いたい。<br>
<ul>
<li>$|a_i - b_i| \leq A$ または $B \leq |a_i - b_i| \leq 2A$を満たす要素$i$を取り出し、削除する</li>
<li> $|(a_i + a_j) - (b_i + b_j)| \leq A$ または $B \leq |(a_i + a_j) - (b_i + b_j... |
p02560 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In this problem, you should process <var>T</var> testcases.</p>
<p>For each testcase, you are given four integers <var>N, M, A, B</var>.</p>
<p>Calculate <var>\sum_{i = 0}^{N - 1} floor((A \times i + B)... |
p00273 |
<H1>入場料金</H1>
<p>
アイヅ温泉には、浴場とプールがあり、浴場を利用するには入浴券を、プールを利用するにはプール券をそれぞれ買う必要があります。これらの券の値段は、日によって変わるかもしれません。また、アイヅ温泉には以下のようなルールがあります。
</p>
<ul>
<li> 券は購入当日1回の利用に限り有効。</li>
<li> 「入浴券5枚以上かつプール券2枚以上」でまとめて買うと、すべての券が2割引になる。</li>
</ul>
<p>
温泉好きの貞吉さんとその友人たちは、アイヅ温泉に毎日のように通っています。彼らは皆気まぐれで、日によって使う枚数は異なります。アイヅ温泉には割引ルールがあるため、グループ... |
p00789 |
<H1><font color="#000">Problem B:</font> Square Coins</H1>
<p>
People in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values of all square numbers up to 289 (= 17<sup>2</sup>), i.e., 1-credit coins, 4-credit coins, 9-credit coins, ..., and 289-cred... |
p01931 |
<!-- - - - - - 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: 丸付け</h1>
<h2... |
p00623 |
<H1><font color="#000000">Problem C:</font> Midnight Teatime</H1>
<p>
ICPCの国内予選に備えて問題を解いていた僕は, その日3つ目のAcceptを貰ったところでキーボードを叩く手を止めた. 時計を見れば, もう日付が変わろうかという時刻だ. 紅茶とお菓子で一服して, 今日はもう寝ることにしよう. そう思って僕はキッチンへと向かった.
</p>
<p>
ダージリンのかぐわしい香りがキッチンを満たした頃, 妹がやってきた. 受験生である彼女は今日もこんな時間まで真面目に勉強していたようだ. 僕は彼女を誘って, 小さな深夜のお茶会を開くことにした.
</p>... |
p01462 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Network Reliability</H1>
<p>
An undirected graph is given.
Each edge of the graph disappears with a constant probability.
Calculate the probability with which the remained graph is connected.
</p>
<H2>Input</H2>
<p>
The first line contains three intege... |
p01198 |
<H1><font color="#000"></font>Dock to the Future</H1>
<!-- Problem A -->
<p>
You had long wanted a spaceship, and finally you bought a used one yesterday! You have heard that the most
difficult thing on spaceship driving is to stop your ship at the right position in the dock. Of course you are no
exception. After a do... |
p01032 | <h1>Problem E: Rooted Tree Game</h1>
<h2>Problem</h2>
<p>
初期状態として複数の根付き木が与えられる。これに対しAliceとBobはゲームを行う。ゲームは2人交互に行い、先手がAliceで後手がBobである。ターンが回ってきたプレイヤーは以下の行動を取る。
</p>
<ol>
<li>根(親を持たない頂点)を1つ選択する。この頂点を<var>S</var>とする。</li>
<li><var>S</var>を根とする根付き木に含まれる頂点を選択する(ここでは<var>S</var>も選択可能)。この頂点を<var>T</var>とする。</li>
<li><var>S</v... |
p01527 |
<h1>H - 植林</h1>
<h2>問題文</h2>
<p>
とある大学の魔法学部の生徒であるK君は広大な屋敷に住んでいる.
屋敷の裏には林が広がっていたが,所々木が生えていない箇所があった.
このままでは屋敷からの見た目が悪いと感じたので,K君は木が生えていない箇所に木を植えることに決めた.
魔法使いの卵であるK君は使い魔を召喚することが出来るので,植林の作業を使い魔にやらせようと考えた.
</p>
<p>
林は <var>H × W</var> 個のセルを持つ長方形領域とみなすことが出来る.
各セルは木が1本生えているか1本も生えていないかのどちらかである.
K君はこの <v... |
p01177 |
<H1><font color="#000">Problem G:</font> Entangled Tree</H1>
<p>
The electronics division in Ishimatsu Company consists of various development departments
for electronic devices including disks and storages, network devices, mobile phones, and many
others. Each department covers a wide range of products. For example,... |
p00336 |
<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>
古代国家イワシロを発見し調査を進めた我々研究者は... |
p01874 |
<script language="JavaScript" type="text/javascript" src="js/varmath.js" charset="UTF-8"></script>
<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?con... |
p03849 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a positive integer <var>N</var>.
Find the number of the pairs of integers <var>u</var> and <var>v</var> <var>(0≦u,v≦N)</var> such that there exist two non-negative integers <var>a</var> an... |
p00766 |
<h1>Patisserie ACM</h1>
<!-- end en only -->
<!-- begin en only -->
<p>
Amber Claes Maes, a patissier, opened her own shop last month.
She decided to submit her work to the International Chocolate
Patissier Competition to promote her shop, and she
was pursuing a recipe of sweet chocolate bars.
After thousands of t... |
p03799 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke loves puzzles.</p>
<p>Today, he is working on a puzzle using <code>S</code>- and <code>c</code>-shaped pieces.
In this puzzle, you can combine two <code>c</code>-shaped pieces into one <code>S</co... |
p03263 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a grid of square cells with <var>H</var> horizontal rows and <var>W</var> vertical columns. The cell at the <var>i</var>-th row and the <var>j</var>-th column will be denoted as Cell <var>(i, j... |
p03633 | <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> clocks. The hand of the <var>i</var>-th clock <var>(1≤i≤N)</var> rotates through <var>360°</var> in exactly <var>T_i</var> seconds.<br/>
Initially, the hand of every clock stands st... |
p02921 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You will be given a string <var>S</var> of length <var>3</var> representing the weather forecast for three days in the past.</p>
<p>The <var>i</var>-th character <var>(1 \leq i \leq 3)</var> of <var>S</... |
p02188 | <h2>G: Restricted DFS</h2>
<h3>問題</h3>
<p><var>N</var> 頂点 <var>N-1</var> 辺からなる、自己ループや多重辺が存在しない無向木 <var>G</var> がある。頂点はそれぞれ <var>1</var> から <var>N</var> まで番号付けされており、辺もそれぞれ <var>1</var> から <var>N-1</var> まで番号付けされており、<var>i</var> 番目の辺は <var>u_i</var> と <var>v_i</var> を結んでいる。また、<var>i</var> 番目の頂点には非負整数 <var>A_i</var> がそれぞ... |
p02472 | <h2>Addition of Big Integers</h2>
<p>
Given two integers $A$ and $B$, compute the sum, $A + B$.
</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 sum in a line.
</p>
<h3>Constraints</h3>
<ul>
<li>$-1 \times 10^{100000} \l... |
p02022 | <h2>H: 慈悲 (Mercy)</h2>
<p>サンタクロースは、クリスマスなのにプログラミングをやっている集団を見つけた。</p>
<p>サンタクロースは彼らを可哀想に思ったので、ケーキをプレゼントすることにした。</p>
<p>クリームが $N$ 種類あって、美味しさは $A_1, A_2, A_3, \dots, A_N$ である。</p>
<p>スポンジが $M$ 種類あって、美味しさは $B_1, B_2, B_3, \dots, B_M$ である。</p>
<p>クリーム 1 種類とスポンジ 1 種類を組み合わせてケーキを作り、その美味しさは (クリームの美味しさ) × (スポンジの美味しさ) になる。</p>
<... |
p02537 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a sequence <var>A_1, A_2, ..., A_N</var> and an integer <var>K</var>.</p>
<p>Print the maximum possible length of a sequence <var>B</var> that satisfies the following conditions:</p>
<ul>
... |
p02167 | <h1>Problem F: Bus</h1>
<h2>Problem</h2>
<p>
円環状に $1$ から $N$ までの番号がつけられた $N$ 個のバス停が右回りに並んでいる。
隣接するバス停どうしは道で結ばれている。
各 $i \ (1 \le i \le N)$ について、バス停 $i$ とバス停 $i+1$ の間を直接結ぶ道の長さは $d_i$ メートルである。
ただし、バス停 $N+1$ はバス停 $1$ のことを表す。
<p>
<p>
$M$ 台のバスがある。
$j \ (1 \le j \le M)$ 番目のバスは $c_j='R'$ のとき右回り、$c_j='L'$ のとき左回り... |
p03326 | <span class="lang-en">
<p>Score: <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Takahashi became a pastry chef and opened a shop <em>La Confiserie d'ABC</em> to celebrate AtCoder Beginner Contest 100.</p>
<p>The shop sells <var>N</var> kinds of cakes.<br/>
Each kind of cake has thr... |
p03776 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given <var>N</var> items.<br/>
The <em>value</em> of the <var>i</var>-th item <var>(1 \leq i \leq N)</var> is <var>v_i</var>.<br/>
Your have to select at least <var>A</var> and at most <var>B</v... |
p00859 |
<H1><font color="#000">Problem F:</font> Slim Span</H1>
<p>
Given an undirected weighted graph <i>G</i>, you should find one of spanning trees specified as follows.
</p>
<p>
The graph <i>G</i> is an ordered pair (<i>V</i>, <i>E</i>), where <i>V</i> is a set of vertices {<i>v</i><sub>1</sub>, <i>v</i><sub>2</sub>, ...... |
p02864 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We will create an artwork by painting black some squares in a white square grid with <var>10^9</var> rows and <var>N</var> columns.<br/>
The current plan is as follows: for the <var>i</var>-th column fr... |
p03019 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi and Aoki will take <var>N</var> exams numbered <var>1</var> to <var>N</var>.
They have decided to compete in these exams.
The winner will be determined as follows:</p>
<ul>
<li>
<p>For each ex... |
p01024 | <h1>Problem I: Sum of Last Digits</h1>
<h2>Problem</h2>
<p>
3つの整数 <var>n</var>, <var>m</var>, <var>k</var> が与えられるので<br>
<br>
<b>
<var>n</var><sup>1</sup>%10 + <var>n</var><sup>1+<var>m</var></sup>%10 + <var>n</var><sup>1+2<var>m</var></sup>%10 + ... + <var>n</var><sup>1+(<var>k</var... |
p03449 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a <var>2 \times N</var> grid. We will denote the square at the <var>i</var>-th row and <var>j</var>-th column (<var>1 \leq i \leq 2</var>, <var>1 \leq j \leq N</var>) as <var>(i, j)</var>.</p>
<... |
p01474 |
<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... |
p00635 |
<H1><font color="#000000">Problem 09:</font> Building Houses</H1>
<p>
この秋、割火ハウスは最近開拓が進んでいる松短地区の神暗通り沿いの土地を分譲することにした。
先日募集をかけ、今日は購入者に分譲説明会を開催する。
</p>
<p>
購入者が説明会場に集まりだしたところ、なんだか空気がとても凍り付いていた。不思議に思った担当者は開催前に
</p>
<p>
「皆さん新天地を求めてきたというのに、ちょっと表情が暗いですが大丈夫ですか?」
</p>
<p>
と聞いてみた。そこで思わぬ事実が判明した。実は、購入者全員が現在隣町の集合団地の住人で、あまりにも周... |
p02608 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let <var>f(n)</var> be the number of triples of integers <var>(x,y,z)</var> that satisfy both of the following conditions:</p>
<ul>
<li><var>1 \leq x,y,z</var></li>
<li><var>x^2 + y^2 + z^2 + xy + yz + ... |
p01927 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<h3>凸多角形柱工業都市</h3>
<p>凸多角形柱工業... |
p00265 |
<H1>モジュロ・クエリ</H1>
<p>
あなたに N 枚のカードを渡します。どのカードにも一つだけ自然数が書いてあります。ただし、同じ数が書いてあることはありません。
</p>
<p>
これから質問として、適当な自然数を言います。あなたが持っているカードに書いてある数を私が言った数で割ったときに得られる余りのうち最も大きなものを答えてください。
</p>
<p>
たとえば、あなたは 3 枚のカードを持っていて、それぞれ 9、3、8 と書いてあるとします。私が「4」と言ったら、9 と 3 と 8 をそれぞれ4 で割った余りを求めてください。余りはそれぞれ 1、3、0 ですが、この中でもっとも大きな余りは3 なので、3 ... |
p02258 |
<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>Maximum Profit</H1>
<p>
You... |
p00770 |
<h3>Prime Caves</h3>
<p>
An international expedition discovered abandoned Buddhist cave temples
in a giant cliff standing on the middle of a desert. There were many
small caves dug into halfway down the vertical cliff, which were
aligned on square grids. The archaeologists in the expedition were
excited by Bud... |
p01862 |
<!--<script language="JavaScript" type="text/javascript" src="js/varmath.js" charset="UTF-8"></script>-->
<h2>E: 星の作り方 - How To Make Stars -</h2>
<h3>物語</h3>
<p>北ノ木坂学院1年生の星屑鈴だニャ!鈴はお星様がだ〜い好き!夜はいつも幼馴染の花代ちんと一緒に,こっそりと学校の屋上でお星様を見てるんだ!だけど,今日のお天気はあいにくの雨・・・.これじゃ,お星様を見ることができないニャ!花代ちんどうしよう〜!</p>
<p>鈴「・・・ああっ!いいこと思い付いたニャ!色んな... |
p00320 |
<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>
アイヅ放送協会の教育番組(AHK教育)では、子供向けの... |
p01161 |
<H1><font color="#000">Problem G:</font> Traffic</H1>
<p>
You are a resident of Kyoot (oh, well, it’s not a misspelling!) city. All streets there are neatly built on a
grid; some streets run in a meridional (north-south) direction and others in a zonal (east-west) direction.
The streets that run from north to south a... |
p01531 |
<h1> Flick Input</h1>
<h2> A: フリック入力</h2>
<p>
二次元が大好きな大学生,通称2D君は,長年使用していたガラパゴス携帯からスマホに買いかえた.初めてスマホを操作した2D君は,文字入力の方式が,昔の携帯と少し違うことに気付いた.スマホでは,画面をタッチ・フリックできることを利用して,フリック入力という方式が採用されていたのである(フリックとは,「画面上で指を滑らせて弾く操作」を意味する).フリック入力は,次に示すような文字入力方式である.
</p>
<p>
フリック入力では,図A(a)のように,0-9の10個のボタンにより入力を行う(#と*については,今回は省略している).各ボタンには,... |
p02034 |
<h2>E: 往復文字列 / Round-trip String</h2>
<h3>物語</h3>
<p>ここは全人類が競技プログラマーになった世界。この世界ではみなさんの生きる現代では考えられないような習慣が多数存在する。その中の一つに、両親、特に母親に感謝の証を表す時は、文字列を送るという風習がある。送る文字列としてどのような文字列がふさわしいかは地域差があるが、北の大地北海道では、できるだけシンプルな文字列が贈り物としてふさわしい。また、送られた側の母親は子供に返礼として、送られた文字列がどれほど美しいかを答える必要がある。</p>
<p>さて、今あなたは1児の母親から相談を受けている。その母親は子供から素晴らしそうな文... |
p00009 |
<H1>Prime Number</H1>
<p>
Write a program which reads an integer <var>n</var> and prints the number of prime numbers which are less than or equal to <var>n</var>. A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, ... |
p02464 | <h1>Set Intersection</h1>
<p>
Find the intersection 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... |
p00459 |
<H1>シャッフル </H1>
<h2>問題</h2>
<p>
1 から n までの番号が書かれた n 枚のカードがある.まず,一番上が番号 1 のカード,上から2枚目が番号 2 のカード,…,一番下が番号 n のカードとなるように順番に重ねて,カードの山を作る.
</p>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_2009-yo-t5-1"><br>
<br>
<p>
カードの山に対して,「シャッフル(x,y)」と呼ばれる次のような操作を行うことで,カードを並び替える(x, y は 1 ≤ x < y < n をみ... |
p02937 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given are two strings <var>s</var> and <var>t</var> consisting of lowercase English letters. Determine if there exists an integer <var>i</var> satisfying the following condition, and find the minimum su... |
p01618 |
<h1>F: Opeartion training for BYDOL / BYDOLの操作訓練</h1>
<p>u'sというスクールアイドルを結成した私達は,さらなる高みを目指すため,部室にあったDVDで憧れの841プロダクションに所属するアイドル達を見ていた. このアイドル達は今でこそ輝くステージの上で活躍しているが,以前はBYDOLと呼ばれるロボットに乗り込み,隕石の撤去作業をしていたらしい. そこで,トップアイドルになるために,BYDOLの操縦技術が必要であることを知った私達は,急遽BYDOLを入手し,他校のスクールアイドルとBYDOLを用いた模擬戦をすることにした.</p>
<p>この模擬... |
p03625 | <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> sticks with negligible thickness.
The length of the <var>i</var>-th stick is <var>A_i</var>.</p>
<p>Snuke wants to select four different sticks from these sticks and form a rectangl... |
p01248 |
<H1><font color="#000">Problem I:</font> Text Justification</H1>
<p>
You are hired by the ∀I¶אΞ℘, an extraterrestrial intelligence, as a programmer of their typesetting system. Your
task today is to design an algorithm for <i>text justification</i>.
</p>
<p>
Text justification is to equalize the line widths as much a... |
p03275 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We will define the <strong>median</strong> of a sequence <var>b</var> of length <var>M</var>, as follows:</p>
<ul>
<li>Let <var>b'</var> be the sequence obtained by sorting <var>b</var> in non-decreasin... |
p02872 | <span class="lang-en">
<div class="part">
<section>
<h3>Problem Setting</h3></section>
</div>
<div class="part">
<section>
<h3>Overview</h3>
<ul>
<li><strong>Concept:</strong> In this programming contest, you will run a delivery service. Customers will place orders with your shop. Each order has a unique <var>\text{ID}... |
p03760 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke signed up for a new website which holds programming competitions.
He worried that he might forget his password, and he took notes of it.
Since directly recording his password would cause him troub... |
p03330 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a grid with <var>N</var> rows and <var>N</var> columns of squares. Let <var>(i,j)</var> be the square at the <var>i</var>-th row from the top and the <var>j</var>-th column from the left.</p>
<... |
p02171 | <h1>Problem J: Ukunichia Query</h1>
<h2>Problem</h2>
<p>
$N$ 人の人が左から右へ一列に並んでいる。彼らの間では文字列 $S$ が流行している。<br>
各人は、以下の条件を満たすとき<b>幸せ</b>であり、そうでないとき<b>幸せ</b>ではない。<br>
<ul>
<li>今までに $|S|$ 文字以上の文字を伝えられていて、かつ直近の $|S|$ 文字を古い順から新しい順に並べると $S$ と一致する</li>
</ul>
</p>
<p>
以下の $2$ 種類のクエリを合計 $Q$ 回処理せよ。
</p>
<p>
クエリ1<br>... |
p00232 |
<H1>人生ゲーム</H1>
<p>
太郎君は、おもちゃ屋さんに会津ホビー社製の人生ゲームを買いに行きました。人生ゲームは、マス目の書かれたボードとルーレットを使って遊びます。ボードには図のようにスタート地点とゴール地点が一つずつあり、それらはひとつながりのマス目でつながっています。最初に、コマはスタート地点のマスに置かれ、ルーレットを回して出た数によってコマを進めます。マスによっては、そこに止まったり通過したりすることでお金を得たり、コマの位置を変えたりするイベントマスがあります。最終的な勝敗は、コマがゴール地点に到達した時点の所持金の多寡で決まります。
</p>
<center>
<img src="https://j... |
p00662 |
<H1>Problem D: The Great Summer Contest</H1>
<p>
現在、人々の娯楽はプログラミングコンテストに限られている。彼女が所属しているとある中学校の娯楽部の活動内容は、プログラミングコンテストを企画し運営することだ。彼女の仕事は問題を作成することではない。多くの人から問題を募り、審判団を組織し、またコンテストの宣伝を行う、いわば裏方のお仕事だ。カリスマ作題者や著名なアルゴリズマーと違い、そういった仕事をする人に光が当たることはほとんどない。存在感はないけれども欠かすことのできないその仕事に、彼女は誇りを持って取り組んでいた。
</p>
<p>
娯楽部は常に問題を募集しているが、それら... |
p01970 | <h2>D: 素因数分解の多様性 (The Diversity of Prime Factorization)</h2>
<h3>Problem</h3>
<p>Ebi-chan has the FACTORIZATION MACHINE, which can factorize natural numbers M (greater than 1) in <var>O(</var>$\log$<var> M)</var> time! But unfortunately, the machine could display only digits and whitespaces.</p>
<p>In general, we c... |
p00398 | <h1>Road Construction</h1>
<p>
The Zuia Kingdom has finally emerged through annexation of $N$ cities, which are identified by index from $1$ to $N$. You are appointed the Minister of Transport of the newly born kingdom to construct the inter-city road network.
</p>
<p>
To simplify the conceptual design planning, you o... |
p01423 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Rabbit Party</H1>
<p>
A rabbit Taro decided to hold a party and invite some friends as guests.
He has <var>n</var> rabbit friends, and <var>m</var> pairs of rabbits are also friends with each other.
Friendliness of each pair is expressed with a positiv... |
p01073 |
<h1>Problem B: Potatoes</h1>
<h2>Problem</h2>
<p>
がっちょ君は<var>N</var>面の畑と<var>M</var>個の芋を所有している。各畑にはそれぞれ1から<var>N</var>までの番号が付けられている。がっちょ君は畑に芋を植え収穫することで、芋の数を増やしたいと考えている。
</p>
<p>
がっちょ君は一人暮らしであり、1人では<var>K</var>面までの畑しか管理することができない。また、各畑の土の状態や面積は様々で、芋の収穫数や植えることのできる芋の数も様々である。芋を畑<var>i</var>に植えた場合、1年後には畑<var>i</var>に植えた... |
p01589 |
<H1><font color="#000">Problem I:</font> Strange Currency System</H1>
<p>
The currency system in the Kingdom of Yoax-Musty is strange and fairly inefficient. Like other countries, the kingdom has its own currencty unit denoted by K <span>$</span> (kingdom dollar). However, the Ministry of Finance issues bills for eve... |
p01566 |
<h1>Pipeline Plans</h1>
<p>There are twelve types of tiles in Fig. 1.
You were asked to fill a table with <var>R × C</var> cells with these tiles.
<var>R</var> is the number of rows and <var>C</var> is the number of columns.
</p>
<p>How many arrangements in the table meet the following constraints?
</p><ul><li>... |
p01136 |
<h1><font color="#000000">Problem F:</font> Gather the Maps!</h1>
<p>
はるか昔、八尾氏が残したとされる伝説の秘宝が八王子のどこかに眠っているという。 その在処を示すとされる宝の地図は、いくつかの断片に分割された状態で、八尾氏の <i>n</i> 人の子孫達によって受け継がれている。
</p>
<p>
今、八尾氏の子孫達は協力してその秘宝を手に入れようとしていた。 ところが、秘宝の在処を指し示す宝の地図の一部分だけでは秘宝を見つけることができない。 そこで、八尾氏の子孫達は全員で集まって地図を 1 ヶ所に集めようとした。
ところ... |
p00377 | <h1>Cake Party</h1>
<p>
I’m planning to have a party on my birthday. Many of my friends will come to the party. Some of them will come with one or more pieces of cakes, but it is not certain if the number of the cakes is a multiple of the number of people coming.
</p>
<p>
I wish to enjoy the cakes equally among... |
p00727 |
<H1><font color="#000">Problem F</font> Secrets in Shadows</h1>
<P>
Long long ago, there were several identical columns (or cylinders) built vertically in a big open space near Yokohama (Fig. F-1). In the daytime, the shadows of the columns were moving on the ground as the sun moves in the sky. Each col... |
p03808 | <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> boxes arranged in a circle. The <var>i</var>-th box contains <var>A_i</var> stones.</p>
<p>Determine whether it is possible to remove all the stones from the boxes by repeatedly p... |
p01835 |
<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>Donut Decoration</h2>
<p>
Donu... |
p03222 | <span class="lang-en">
<p>Score: <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Amidakuji is a traditional method of lottery in Japan.</p>
<p>To make an amidakuji, we first draw <var>W</var> parallel vertical lines, and then draw horizontal lines that connect them. The length of eac... |
p03388 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><var>10^{10^{10}}</var> participants, including Takahashi, competed in two programming contests.
In each contest, all participants had distinct ranks from first through <var>10^{10^{10}}</var>-th.</p>
<... |
p02960 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a string <var>S</var>. Each character in <var>S</var> is either a digit (<code>0</code>, ..., <code>9</code>) or <code>?</code>.</p>
<p>Among the integers obtained by replacing each occurrence ... |
p03672 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We will call a string that can be obtained by concatenating two equal strings an <em>even</em> string.
For example, <code>xyzxyz</code> and <code>aaaaaa</code> are even, while <code>ababab</code> and <c... |
p02433 | <h1>List</h1>
<p>
For a dynamic list $L$ of integers, perform a sequence of the following operations. $L$ has a special element called END at the end of the list and an element of $L$ is indicated by a cursor.
</p>
<ul>
<li>insert($x$): Insert $x$ before the element indicated by the cursor. After this operation,... |
p02599 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> colored balls arranged in a row from left to right; the color of the <var>i</var>-th ball from the left is <var>c_i</var>.</p>
<p>You are given <var>Q</var> queries. The <var>i</var... |
p02063 | <h2>D: 貪欲が最適?</h2>
<h3>物語</h3>
<p><var>1</var>, <var>5</var>, <var>10</var>, <var>50</var>, <var>100</var>, <var>500</var> 円玉がある日本では、ある金額を支払う時、大きい金額の硬貨をできるだけ多く使うという方法で支払うと、硬貨の枚数を最小化できることが知られている。</p>
<p>硬貨の金額が日本とは異なる場合、貪欲に支払うと必ずしも最小化できるとは限らない。</p>
<p>貪欲に支払うのが最適になるために、硬貨の金額が満たすべき条件は何なのだろうか。</p>
<h3>問題</h3>
<p>TAB 君は... |
p02576 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi loves takoyaki - a ball-shaped snack.</p>
<p>With a takoyaki machine, he can make at most <var>X</var> pieces of takoyaki at a time, taking <var>T</var> minutes regardless of the number of pie... |
p02126 | <h1>Problem C: Ball</h1>
<h2>Problem</h2>
<p>
$N$個のボールがあり、各ボールには色と価値が決められている。<br>
ボールの色は$1$から$C$まで$C$種類存在し、各色ごとに選べるボールの数の上限が決められている。<br>
ボールを全体で高々$M$個選ぶとき、得られる価値の合計を最大化せよ。<br>
</p>
<h2>Input</h2>
<p>入力は以下の形式で与えられる。</p>
<pre>
$N$ $M$ $C$
$l_1$ $l_2$ ... $l_C$
$c_1$ $w_1$
$c_2$ $w_2$
...
$c_N$ $w_N$
</pre>
<p>
入力はすべ... |
p03367 | <span class="lang-en">
<p>Score : <var>1700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has an integer sequence <var>A</var> whose length is <var>N</var>.
He likes permutations of <var>(1, 2, ..., N)</var>, <var>P</var>, that satisfy the following condition:</p>
<ul>
<li><var>P_i \l... |
p02825 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let us consider a grid of squares with <var>N</var> rows and <var>N</var> columns. You want to put some domino pieces on this grid.
Each domino piece covers two squares that have a common side. Each squ... |
p00818 |
<H1><font color="#000">Problem H:</font> Viva Confetti</H1>
<p>
Do you know <i>confetti</i>? They are small discs of colored paper, and people throw them around during parties or festivals. Since people throw lots of confetti, they may end up stacked one on another, so there may be hidden ones underneath.</p>
<p>
A h... |
p03737 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given three words <var>s_1</var>, <var>s_2</var> and <var>s_3</var>, each composed of lowercase English letters, with spaces in between.
Print the acronym formed from the uppercased initial lett... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.