question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p01878 |
<h2>G: 運命力 - Destiny Draw -</h2>
<h3>問題</h3>
<p>
Mr. D はカードゲームで勝負をすることになった。
このカードゲームでは、 <var>N</var> 枚のカードの山を用いる。
また、山のカードには、上から順に <var>1, 2, 3,</var> ... <var>, N</var> の番号がついている。
</p>
<p>
D で始まるものすべてを背負う彼に敗北は許されないが、不幸にも Mr. D はカードゲームが不得手である。
そこで、自分が引くカードをコントロールすることで勝利を手にすることにした。
</p>
<p>
Mr. D は <var>K</var> 種類... |
p02757 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has a string <var>S</var> of length <var>N</var> consisting of digits from <code>0</code> through <code>9</code>.</p>
<p>He loves the prime number <var>P</var>. He wants to know how many non-e... |
p00290 |
<h1>椅子の総数</h1>
<p>
選手のみなさん、パソコン甲子園にようこそ。パソコン甲子園の本選は会津大学で行われ、会場内では
1つの机に1チームが割り当てられます。パソコン甲子園は1チーム2人なので、チーム数×2脚の椅子が必要です。大学では、他にも様々なイベントの会場設営で机と椅子を準備する機会がありますが、必要な机と椅子の数も様々です。そこで、あるイベントに対して準備する机の数と、机1つあたりに必要な椅子の数が与えられたとき、必要な椅子の総数を計算するプログラムを作成してください。
</p>
<h2>入力</h2>
<p>
入力は以下の形式で与えられる。
</p>
<pre>
<var>d</var> <var>c... |
p02307 | <script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
</script>
<H1>Circumscribed Circle of a Triangle</H1>
<p>... |
p03146 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>A sequence <var>a=\{a_1,a_2,a_3,......\}</var> is determined as follows:</p>
<ul>
<li>
<p>The first term <var>s</var> is given as input.</p>
</li>
<li>
<p>Let <var>f(n)</var> be the following function: ... |
p01481 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<h1> Lucky Dip</h1>
<p>
Time Limit: 8 sec / Memory Limit: 64 MB
</p>
<h2> C: 福袋</h2>
<p>
福袋,それは年始を祝う商習慣の一つである.
人気の福袋には多くの人が開店前から行列を作り,ターゲットの福袋へダッシュする.
この風物詩に魅了されたあなたは,今年もお目当ての福袋を狙い,計画... |
p03516 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has come up with the following problem.</p>
<blockquote>
<p>You are given a sequence <var>d</var> of length <var>N</var>.
Find the number of the undirected graphs with <var>N</var> vertices label... |
p02891 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given is a string <var>S</var>. Let <var>T</var> be the concatenation of <var>K</var> copies of <var>S</var>.
We can repeatedly perform the following operation: choose a character in <var>T</var> and re... |
p03783 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>AtCoDeer the deer found <var>N</var> rectangle lying on the table, each with height <var>1</var>.
If we consider the surface of the desk as a two-dimensional plane, the <var>i</var>-th rectangle <var>i... |
p04046 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a large square grid with <var>H</var> rows and <var>W</var> columns.
Iroha is now standing in the top-left cell.
She will repeat going right or down to the adjacent cell, until she reaches the b... |
p03279 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> robots and <var>M</var> exits on a number line.
The <var>N + M</var> coordinates of these are all integers and all distinct.
For each <var>i</var> (<var>1 \leq i \leq N</var>), th... |
p01244 |
<H1><font color="#000">Problem B:</font> Divisor Function</H1>
<p>
Teiji is a number theory lover. All numbers are his friends - so long as they are integers. One day, while
preparing for the next class as a teaching assistant, he is interested in a number-theoretical function called the
<i>divisor function</i>. The ... |
p00906 |
<H1><font color="#000">Problem C: </font>One-Dimensional Cellular Automaton</H1>
<p>
There is a one-dimensional cellular automaton consisting of <i>N</i> cells. Cells are numbered from 0 to <i>N</i> − 1.
</p>
<p>
Each cell has a state represented as a non-negative integer less than <i>M</i>. The states of cell... |
p03629 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>A subsequence of a string <var>S</var> is a string that can be obtained by deleting zero or more characters from <var>S</var> without changing the order of the remaining characters.
For example, <code>a... |
p01614 |
<h1>B: VOCAL ANDROID</h1>
<p>ボーカルアンドロイド (VOCAL ANDROID) とは,メロディと歌詞を入力して音声を合成する作曲ツールである. 2013年3月9日に和歌山県で開催された,ボーカルアンドロイドのライブに行ったあなたは,音楽の素晴らしさに感動した. そこで,あなたは新作ボーカルアンドロイド「立音リプロ (CV.立命太郎)」を購入し,作曲を始めることにした. ところが,メロディは完成したものの作詞で詰まってしまった.</p>
<p>使いたいフレーズはいくつか断片的に用意しており,それらを組み合わせて各メロディにあてはめる. 各メロディは,長さが決まっており... |
p02192 | <h2>K Average Ranges</h2>
<p>数列<var>a_1,a_2,..,a_N</var>が与えられます。</p>
<p>この数列に値の平均が<var>K</var>以上の長さ<var>1</var>以上の区間はいくつありますか。</p>
<h3>入力</h3>
<pre>
<var>N K</var>
<var>a_1 a_2...a_N</var>
</pre>
<h3>出力</h3>
<p>答えを出力せよ。</p>
<h3>制約</h3>
<ul>
<li><var>1 \leq N \leq 10^5 </var></li>
<li><var>1 \leq K \leq 10^9 </va... |
p00455 |
<H1>タイムカード </H1>
<h2>問題</h2>
<p>
JOI商事では社員の在社時間をタイムカードで管理している.社員は,出社すると専用の装置を使ってタイムカードに出社時刻を刻印する.勤務を終え退社するときにも,タイムカードに退社時刻を刻印する.時刻は24時間制で扱われる.
</p>
<p>
防犯上の理由から,社員の出社時刻は7時以降である.また,全ての社員は23時より前に退社する.社員の退社時刻は常に出社時刻より後である.
</p>
<p>
入力としてJOI商事の3人の社員Aさん,Bさん,Cさんの出社時刻と退社時刻が与えられたとき,それぞれの社員の在社時間を計算するプログラムを作成せよ.
</p>
<h2>... |
p02468 |
<H1>Power</H1>
<br/>
<p>
For given integers <var>m</var> and <var>n</var>, compute <var>m<sup>n</sup></var> (mod 1,000,000,007). Here, <var>A</var> (mod <var>M</var>) is the remainder when <var>A</var> is divided by <var>M</var>.
</p>
<H2>Input</H2>
<pre>
<var>m</var> <var>n</var>
</pre>
<p>
Two integers <var>m</v... |
p00005 |
<H1>GCD and LCM</H1>
<p>
Write a program which computes the greatest common divisor (GCD) and the least common multiple (LCM) of given <var>a</var> and <var>b</var>.
</p>
<H2>Input</H2>
<p>
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a li... |
p02038 | <h1>B: たぬきつね<h1>
<h2>問題</h2>
<p>
謎の装置 $M$ があり,この装置に Tanuki と Fox を入れると, 装置から一匹の動物が出てくる(以下, Tanuki を $T$ ,Foxを $F$ とする).
</p>
<p>
$M(x, y)$ は,装置 $M$ に $x, y$ の順で動物を入れて出てきた動物を表す.
</p>
<p>
色々試した結果,以下のことがわかった.<br>
<ul>
$M(T, T) = T$ <br>
$M(T, F) = F$ <br>
... |
p00510 |
<H1>問題 1 </H1>
<br/>
<p>
n 分間にわたり,
トンネルの入口と出口で,
1分間に通過する車の数を数えたデータがある.
そのデータは,
全部で n+2 行からなり,
各行には次の内容が書かれている.
</p>
<UL>
<LI> 第1行目には,正整数 n が書かれており,
調査時間が n 分間であったことを表している.</LI>
<LI> 第2行目には,正整数 m が書かれており,
調査開始時におけるトンネル内の車の台数が m であったことを表している.</LI>
<LI> 第(2+i)行目( i = 1, 2, ... , n ) には,
調査開始後 (... |
p00140 |
<H1>バス路線</H1>
<p>
図 1のようなバス路線があります。停留所は 10 箇所で、それぞれ 0〜9 の番号がついています。バスは停留所 0 では折り返しますが、反対側は循環路線になっており、図のように 5→6→7→8→9→5 の順で循環します。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_busLine">
</center>
<br/>
<p>
このバス路線について、乗車する停留所と降車する停留所を入力とし、乗車から降車までに通る停留所の番号を出力するプログラムを作成してください。
</p>
... |
p01301 |
<H1><font color="#000">Problem I:</font> Crystal Jails</H1>
<p>
Artistic Crystal Manufacture developed products named Crystal Jails. They are cool ornaments
forming a rectangular solid. They consist of colorful crystal cubes. There are bright cores on the
center of cubes, which are the origin of the name. The combina... |
p00843 |
<H1><font color="#000">Problem H:</font> Bingo</H1>
<p>
A Bingo game is played by one gamemaster and several players. At the beginning of a game,
each player is given a card with <i>M</i> × <i>M</i> numbers in a matrix (See Figure 10).
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAG... |
p01751 |
<p>
A 君は山手線に乗って目的地にたどり着きたい.
</p>
<p>
A 君は電車に乗ってから <var>a</var> 分起きて <var>b</var> 分寝ることを繰り返す.目的地までは乗車後 <var>c</var> 分であり,このとき起きていれば下車できるが,逆に寝ている途中であれば乗り過ごしてしまう.また,A 君は乗り過ごしてもずっと同じ電車に乗り続け,電車は山手線を一周するのに <var>60</var> 分かかる.したがって,A 君は目的地に <var>60t + c</var> ( <var>t</var> は非負整数) 分後に着くことになる.
</p>
<p>
何分後にA 君は目的地に到着できるか.... |
p03296 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi lives in another world. There are slimes (creatures) of <var>10000</var> colors in this world. Let us call these colors Color <var>1, 2, ..., 10000</var>.</p>
<p>Takahashi has <var>N</var> sli... |
p02254 | <h1>Huffman Coding</h1>
<p>We want to encode a given string $S$ to a binary string. Each alphabet character in $S$ should be mapped to a different variable-length code and the code must not be a prefix of others.</p>
<p>Huffman coding is known as one of ways to obtain a code table for such encoding.</p>
<p>For example... |
p00269 |
<H1>図画工作</H1>
<p>
イヅア大学附属小学校は日本有数の競技プログラマー養成校として有名です。この学校の教員は幅広い
アルゴリズムの知識を持ち、日々それを活用しています。教員であるあなたは、今年は図画工作の授業
を担当することになりました。この授業では、児童全員がそれぞれ1年間で一つの課題を完成させることになっています。授業の概要は以下のとおりです。
</p>
<ul>
<li> 1年間で授業は D 回(同じ日に2 回以上授業はない)あり、その全てが課題制作に充てられる。</li>
<li> 制作する課題は M 種類用意されている。</li>
<li> それぞれの児童に、M 種類の中から課題を1つずつ割り当てる... |
p00793 |
<H1><font color="#000">Problem F:</font> Heavenly Jewels</H1>
<p>
There is a flat island whose shape is a perfect square. On this island, there are three habitants whose names are IC, PC, and ACM Every day, one jewel is dropped from the heaven. Just as the jewel touches the ground, IC, PC, and ACM leave their houses ... |
p01881 | <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>Help the Princess!</h2>
<p>
Th... |
p02604 | <span class="lang-en">
<p>Score: <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>New AtCoder City has an infinite grid of streets, as follows:</p>
<ul>
<li>At the center of the city stands a clock tower. Let <var>(0, 0)</var> be the coordinates of this point.</li>
<li>A straight str... |
p00639 | <H1><font color="#000000">Problem C:</font> Accelerated Railgun</H1>
<p>
She catched the thrown coin that draws parabolic curve with her sparkling fingers. She is an ESPer. Yes, she is an electro-master who has the third strongest power among more than one million ESPers in the city. Being flicked by her thumb, the co... |
p03916 | <span class="lang-en">
<p>Score : <var>1600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> squares in a row, numbered <var>1</var> through <var>N</var> from left to right.
Snuke and Rng are playing a board game using these squares, described below:</p>
<ol>
<li>First, ... |
p01478 |
<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... |
p03445 | <span class="lang-en">
<p>Score : <var>2000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given an <var>H \times W</var> grid.
The square at the top-left corner will be represented by <var>(0, 0)</var>, and the square at the bottom-right corner will be represented by <var>(H-1, W-1)... |
p01182 |
<H1><font color="#000">Problem B:</font> Restaurant</H1>
<p>
Steve runs a small restaurant in a city. Also, as he is the only cook in his restaurant, he cooks everything
ordered by customers.
</p>
<p>
Basically he attends to orders by <i>first-come-first-served</i> principle. He takes some prescribed time to
prepare ... |
p01028 | <h1>Problem A: Yu-kun Likes an Integer</h1>
<h2>Background</h2>
<p>
会津大学付属幼稚園はプログラミングが大好きな子供が集まる幼稚園である。園児の一人であるゆう君は、プログラミングと同じくらい数字が大好きだ。そんなゆう君は最近、表に0から9までのいずれかの数字の書かかれたプレートを<var>n</var>枚購入して<var>n</var>桁の数を作る遊びに熱中している。
今月もゆう君は貰ったお小遣いで<var>n</var>枚のプレートを買いに行こうと考えていた。
</p>
<h2>Problem</h2>
<p>
プレートは表に書かれている数字によって値段が異なる... |
p03015 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a positive integer <var>L</var> in base two.
How many pairs of non-negative integers <var>(a, b)</var> satisfy the following conditions?</p>
<ul>
<li><var>a + b \leq L</var></li>
<li><var>... |
p03500 | <span class="lang-en">
<p>Score : <var>1200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> non-negative integers written on the blackboard: <var>A_1, ..., A_N</var>.</p>
<p>Snuke can perform the following two operations at most <var>K</var> times in total in any order:... |
p01497 |
<H1><font color="#000">Problem B: </font>Bubble Puzzle</H1>
<p>
A browser-based puzzle game called "Bubble Puzzle" is now popular on the Internet.
</p>
<p>
The puzzle is played on a 4 × 4 grid, and initially there are several bubbles in the grid squares. Each bubble has a state expressed by a positive integer,... |
p03150 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>A string is called a KEYENCE string when it can be changed to <code>keyence</code> by removing its contiguous substring (possibly empty) only once.</p>
<p>Given a string <var>S</var> consisting of lower... |
p02311 |
<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>Common Tangent</H1>
<p>
Find common tange... |
p00286 |
<h1>古代遺跡の謎</h1>
<p>
古代遺跡から超大型あみだくじが発見された。学者達はこれをVLA(Very Long Amidakuji)と命名した。分析の結果、VLAは <var>N</var> 本の縦棒を持ついくつかの部品の組み合わせで構成され、多くの場合繰り返しを含んでいることがわかった。例えば、図のVLAは2種類の部品AとBを使った4つの部品から構成されている。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_PCK2013_monument" width="400">
</center>
<p>
こ... |
p02741 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Print the <var>K</var>-th element of the following sequence of length <var>32</var>:</p>
<pre>1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51
</pre>
</s... |
p03853 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is an image with a height of <var>H</var> pixels and a width of <var>W</var> pixels. Each of the pixels is represented by either <code>.</code> or <code>*</code>. The character representing the pi... |
p00052 |
<H1>階乗 II</H1>
<p>
<var>n! = n × (n − 1) × (n − 2) ×</var> ... <var> × 3 × 2 × 1</var><br/>
<br/>
を <var>n</var> の階乗といいます。例えば、12 の階乗は<br/>
<br/>
<var>12! = 12 × 11 × 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 ×... |
p02595 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> points in the two-dimensional plane. The coordinates of the <var>i</var>-th point are <var>(X_i,Y_i)</var>.</p>
<p>Among them, we are looking for the points such that the distance f... |
p00402 | <h1>集会所</h1>
<p>
イヅア村の住民は村に集会所を建てることにしました。この村では東西に一直線に伸びる道路に沿って建物を建てられる地点が決まっています。最も西の地点を0番目の地点として、そこから等間隔に東に向かって1番目、2番目、…と地点番号が与えられています。村人の家と集会所を建てることができるのは、これらの地点だけです。各家には1人以上の村人が住んでいます。どの村人も隣の地点まで1分間で移動できます。
</p>
<p>
集会を開くのに便利なように、ある時刻に一斉に全ての村人が自分の家から集会所に向かったとき、全員が集まるのに必要な時間が最小になるような場所に、集会所を建てることにしました。
</p>
<p>... |
p00951 |
<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
Three Kingdoms of Bo... |
p01643 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: { inlineMath: [['\\(','\\)']] }
});
</script>
<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
<h1 class="ndoc-heading1">Problem J: Avant-garde Art</h1>
<p class="n... |
p03384 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has an ability to generate a tree using a permutation <var>(p_1,p_2,...,p_n)</var> of <var>(1,2,...,n)</var>, in the following process:</p>
<p>First, prepare Vertex <var>1</var>, Vertex <var>2... |
p01213 |
<H1><font color="#000">Problem G:</font> Repeated Subsequences</H1>
<p>
You are a treasure hunter traveling around the world. Finally, you’ve got an ancient text
indicating the place where the treasure was hidden. The ancient text looks like a meaningless
string of characters at first glance. Actually, the secret pla... |
p04011 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a hotel with the following accommodation fee:</p>
<ul>
<li><var>X</var> yen (the currency of Japan) per night, for the first <var>K</var> nights</li>
<li><var>Y</var> yen per night, for the <va... |
p00814 | <H1><font color="#000">Problem D:</font> Life Line</H1>
<p>
Let's play a new board game ``Life Line''.
</p>
<p>
The number of the players is greater than 1 and less than 10.
</p>
<p>
In this game, the board is a regular triangle in which many small regular triangles are arranged (See Figure l). The edges of each small... |
p02829 | <span class="lang-en">
<p>Score: <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Takahashi is solving quizzes. He has easily solved all but the last one.</p>
<p>The last quiz has three choices: <var>1</var>, <var>2</var>, and <var>3</var>.</p>
<p>With his supernatural power, Takahas... |
p01706 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script language="JavaScript" type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML"></script>
<meta http-equiv="X-UA-Compatibl... |
p02983 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given two non-negative integers <var>L</var> and <var>R</var>.
We will choose two integers <var>i</var> and <var>j</var> such that <var>L \leq i < j \leq R</var>.
Find the minimum possible va... |
p03691 | <span class="lang-en">
<p>Score : <var>1400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> turkeys.
We number them from <var>1</var> through <var>N</var>.</p>
<p><var>M</var> men will visit here one by one.
The <var>i</var>-th man to visit will take the following actio... |
p01356 |
<H1>Problem H: Nearest Station</H1>
<p>
うさぎがある電車のチケットを<i>n</i> 枚持っている. チケットにはそれぞれ0 から<i>n</i> − 1 までの番号がついていて, <i>k</i> 番のチケットを使うと, <i>p</i>⋅<i>a<sup>k</sup></i> + <i>q</i>⋅<i>b<sup>k</sup></i> 駅進むことができる.
</p>
<p>
うさぎは今いる駅から<i>m</i> 駅進んだ駅にあるニンジン食べ放題の店に行きたいが, なるべく歩く距離を短くしたい. 駅は等間隔に並んでいる. チケットを電車の上り線で進むことの... |
p00117 |
<H1>大工の褒美</H1>
<p>
ある日、殿様は一人の大工に、「台風や地震が来たときに町人が避難できる、頑丈で大きな建物を造りなさい。」と命じました。しかし、その頑丈で大きな建物を完成させるには、大きな太い柱が必要です。町にそんな大きな柱はありません。そこで、大工は遠くの山里まで大きな柱を調達しに行くことになりました(大工は町から里山に行って、町に戻ってくる必要があります)。
</p>
<p>
大工の褒美は、殿様から受け取ったお金から柱の代金と交通費を差し引いた余りです。下の地図のように、山里に行くには、いろいろな町を通るたくさんの街道があり、2つの町をつなぐ街道はそれぞれ交通費が違います。大工の褒美を最大にするにはど... |
p02080 | <h1>C: Cyclic String</h1>
<h2>問題文</h2>
<p>文字列 $S = s_0 s_1 \ldots s_{n-1}$ が文字列 $T = t_0 t_1 \ldots t_{m-1}$ に巡回的に含まれるとは、
ある $k$ があって、全ての $i$ $(0 \le i \lt n)$ について
$s_i = t_{(i+k) \bmod m}$ が成立する事を言います。</p>
<p>$N$ 個の文字列 $S_1, \dots, S_N$ が与えられます。
以下の条件を満たす文字列の集合 $\{C_1, \dots, C_k\}$ を考えます($k$ は任意):</p>
<ul>
<li>各$i$ ... |
p00547 |
<h1>屋台 (Food stalls)</h1>
<h2>問題</h2>
<p>
JOI 君の住む IOI 市は,南北方向に H 区画,東西方向に W 区画の長方形の形をしており,H × W 個の区画に区切られている.北から i 番目,西から j 番目の区画を (i, j) と表す.現在,IOI 市で開催されている国際的なプログラミングコンテストを記念して,大規模なお祭りが開催されている.いくつかの区画には屋台が出ており,それぞれ違う種類のお菓子を販売している.
区画 (1, 1), 区画 (H, W) およびそれらに東西南北に隣接する区画には屋台はない.
</p>
<p>
JOI 君は区画 (1, 1) から区画 (... |
p01585 |
<H1><font color="#000">Problem E:</font> Mickle's Beam</H1>
<p>
Major Mickle is commanded to protect a secret base which is being attacked by <i>N</i> tanks. Mickle has an ultimate laser rifle called <i>Mickle's beam</i>. Any object shot by this beam will be immediately destroyed, and there is no way for protection. ... |
p03042 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You have a digit sequence <var>S</var> of length <var>4</var>. You are wondering which of the following formats <var>S</var> is in:</p>
<ul>
<li>YYMM format: the last two digits of the year and the two-... |
p03412 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given two integer sequences, each of length <var>N</var>: <var>a_1, ..., a_N</var> and <var>b_1, ..., b_N</var>.</p>
<p>There are <var>N^2</var> ways to choose two integers <var>i</var> and <var... |
p00394 | <!--<h1> Salary Calculation</h1>-->
<h1>Payroll</h1>
<p>
PCK company has $N$ salaried staff and they have specific ID numbers that run from $0$ to $N-1$. The company provides $N$ types of work that are also identified by ID numbers from $0$ to $N-1$. The time required to complete work $j$ is $t_j$.
</p>
<p>
To get ... |
p02653 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has a string <var>x</var> of length <var>N</var>.
Initially, every character in <var>x</var> is <code>0</code>.</p>
<p>Snuke can do the following two operations any number of times in any order:</... |
p03941 | <span class="lang-en">
<p>Score : <var>1400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><style>
#nck {
width: 30px;
height: auto;
}
</style>
<p>In the country there are <var>N</var> cities numbered <var>1</var> through <var>N</var>, which are connected by <var>N-1</var> bid... |
p02203 | <h2>競り (Auction)</h2>
<p>square1001君はとある競りを鑑賞していました。</p>
<p>競りとは、買い手が多数で品数に制限があるとき、高値を付けたものに買う権利を与える仕組みの取引です。<sub>(新明解国語辞典第七版より)</sub></p>
<p>ここでの競りのルールは以下の通りです。</p>
<br>
<p>1. 次の 2. ~ 6. を品物が尽きるまで繰り返す</p>
<p>2. 新たな品物を出し、客に見せる</p>
<p>3. 客のうちの 1 人が好きな値段を品物につける</p>
<p>4. 客のうちの 1 人が現在品物についている値段<strong>よりも</strong>高い値段をつける... |
p02716 | <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 <var>A_1, ..., A_N</var> of length <var>N</var>.</p>
<p>We will choose exactly <var>\left\lfloor \frac{N}{2} \right\rfloor</var> elements from this sequence so that no two a... |
p01839 |
<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-AMS_HTML">
</script>
<h2>A - 阿吽の呼吸</h2>
<h3>Problem Statement</h3>
<p... |
p03804 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given an image <var>A</var> composed of <var>N</var> rows and <var>N</var> columns of pixels, and a template image <var>B</var> composed of <var>M</var> rows and <var>M</var> columns of pixels.<... |
p02346 |
<H1>Range Sum Query</H1>
<p>
Write a program which manipulates a sequence <var>A</var> = {<var>a<sub>1</sub>, a<sub>2</sub>, . . . , a<sub>n</sub></var>} with the following operations:
</p>
<ul>
<li><var>add(i, x)</var>: add <var>x</var> to <var>a<sub>i</sub></var>.</li>
<li><var>getSum(s, t)</var>: print the sum of... |
p00681 |
<h1>Wall Breaker KND</h1>
<h2>Problem</h2>
<p>KND君は会津大学に在籍する学生プログラマである。彼はプログラマーであるとともに格闘家でもある。そんな彼は甘党であることで知られてるが、特に生クリームが大好物である。生クリームを食べればコンクリートの壁を数回壊すことができるようになるほどである。そのパワーに興味をもった彼の隣人は、生クリームたっぷりの新商品、「マトクリーム」を用いて実験をすることにした。
</p>
<p>その実験は、まず迷路を用意しKND君をそこに閉じ込める。その迷路には鍵がかかった扉、扉を開けるための鍵、マトクリームがそれぞれ1つずつ別のマスに存在する。彼は落ちてい... |
p01993 | <h2>E: 均衡な辺削除 (Balanced Edge Deletion)</h2>
<h3>問題</h3>
<p>
<var>N</var> 頂点 <var>M</var> 辺の重み付き単純無向グラフ <var>G</var> が与えられる。
頂点には <var>1</var> から <var>N</var>、 辺には <var>1</var> から <var>M</var> の番号がつけられている。
<var>i</var> 番目の辺は頂点 <var>u_i</var> と <var>v_i</var> を結んでおり、そのコストは <var>w_i</var> である。
</p>
<p>このグラフに対して、以下の操作を <... |
p03107 | <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> cubes stacked vertically on a desk.</p>
<p>You are given a string <var>S</var> of length <var>N</var>. The color of the <var>i</var>-th cube from the bottom is red if the <var>i</... |
p03557 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>The season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he needs an altar, which consists of three parts, one in each of the th... |
p01090 |
<h2>Bridge Construction Planning</h2>
<p>
There is a city consisting of many small islands, and the citizens live in these islands.
Citizens feel inconvenience in requiring ferry rides between these islands.
The city mayor decided to build bridges connecting all the islands.
</p>
<p>
The city has two construction c... |
p03520 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke found a record of a tree with <var>N</var> vertices in ancient ruins.
The findings are as follows:</p>
<ul>
<li>The vertices of the tree were numbered <var>1,2,...,N</var>, and the edges were numb... |
p03170 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a set <var>A = \{ a_1, a_2, \ldots, a_N \}</var> consisting of <var>N</var> positive integers.
Taro and Jiro will play the following game against each other.</p>
<p>Initially, we have a pile co... |
p02331 | <!--<h1>写像12相 その1:ボールに区別あり・箱に区別あり・入れ方に制限なし</h1>-->
<h1>Balls and Boxes 1</h1>
<table border="">
<tr><th>Balls</th><th>Boxes</th><th>Any way</th><th>At most one ball</th><th>At least one ball</th></tr>
<tr><th>Distinguishable</th><th>Distinguishable</th><td style="background-color:#aff">1</td><td>2</td><td>3</td></... |
p02761 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>If there is an integer not less than <var>0</var> satisfying the following conditions, print the smallest such integer; otherwise, print <code>-1</code>.</p>
<ul>
<li>The integer has exactly <var>N</var... |
p03873 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><style>
#nck {
width: 30px;
height: auto;
}
</style>
<p>Snuke received <var>N</var> intervals as a birthday present.
The <var>i</var>-th interval was <var>[-L_i, R_i]</var>.
It is guaran... |
p00249 |
<H1>アリの巣箱の形状</H1>
<p>
求悟君は夏休みの自由研究としてアリの巣の観察を行うことにしました。彼のおじいちゃんが孫のために用意してくれた観察用の透明ケースはとてもユニークで、図1のような形をしています。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_0253_1" title="アリの巣" alt="アリの巣"><br>
図1<br>
</center>
<br>
<p>
このケースは、2枚の合同な凸多角形 s1、s2 と何枚かの長方形で構成されています。s1、s2 以外のいずれかの長方形の面を床... |
p02274 |
<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>The Number of Inversions</H... |
p00619 |
<H1><font color="#000000">Problem E:</font> Kuru-Kuru Robot</H1>
<p>
ロボット工学の研究者であるアシモフ博士は、新しいロボットの開発に成功した。このロボットは、床に張り巡らせた特殊なワイヤーに沿って自由に動くことができる。ロボットは常に現在いるワイヤーに平行な方向を向いて前進する。
</p>
<p>
すばらしいことに、このロボットはワイヤー上を移動するためにその距離にかかわらずエネルギーを消費しない。しかし、ワイヤーの端点やワイヤーの交点で向きを変えるためにはその点を中心に回転する必要があり、その回転角度だけエネルギーを消費する。
</p>
<p>
こ... |
p02624 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>For a positive integer <var>X</var>, let <var>f(X)</var> be the number of positive divisors of <var>X</var>.</p>
<p>Given a positive integer <var>N</var>, find <var>\sum_{K=1}^N K\times f(K)</var>.</p>
... |
p03936 | <span class="lang-en lang-child hidden-lang">
<div id="task-statement">
<div class="part">
Max Score: $1500$ Points <br/>
<section>
<h3>Problem Statement</h3>
There is a $50 \times 50$ field. The cell at $i$-th row and $j$-th column is denoted $(i, j)$ (0-indexed). <br/>
One day, square1001 puts $250$ ... |
p03465 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given <var>N</var> integers <var>A_1</var>, <var>A_2</var>, ..., <var>A_N</var>.</p>
<p>Consider the sums of all non-empty subsequences of <var>A</var>. There are <var>2^N - 1</var> such sums, a... |
p01458 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Kth Sentence</H1>
<p>
A student, Kita_masa, is taking an English examination.
In this examination, he has to write a sentence of length <var>m</var>.
</p>
<p>
Since he completely forgot the English grammar, he decided to consider all sentences of length... |
p03035 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi, who is <var>A</var> years old, is riding a Ferris wheel.</p>
<p>It costs <var>B</var> yen (<var>B</var> is an even number) to ride the Ferris wheel if you are <var>13</var> years old or older... |
p01008 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<h1>Problem C: Last One</h1>
<h2>Problem</h2>
<p>
あなたは、集合好きな友人Aと一風変わったゲームをしてみる事にした。
</p>
<p>
n個の要素からなる重複が許される非負の整数の集合Sが与えられる。集合Sに含まれる各要素は非負の<var>p<sub>i</sub></var>進数である。集合Sに対して
以下のStep1~3を1つのターンとして、あなたと相手の二人が交互にターンを繰り返す。各ターンではこの番号の順に操作を行う。
</p>
<p>... |
p00530 |
<h2>バブルソート(Bubble Sort)</h2>
<p>
バブルソートとは,列をソートするアルゴリズムの 1 つである.長さ <var>N</var> の数列 <var>A</var> を昇順にソートしたいとしよう.バブルソートは,隣り合う 2 つの数で大小関係が崩れているものがあれば,それらの位置を交換する.これを,数列を前から順に走査しながら行う.すなわち,<var>A<sub>i</sub></var> > <var>A<sub>i+1</sub></var> となっている場所があれば,その 2 数を交換するということを,<var>i</var> = 1, 2, ... , <var>N</var> ... |
p00160 |
<H1>宅配料金</H1>
<p>
ある宅配業者の宅配料金は大きさと重量で下表のように料金が設定されています。
</p>
<center>
<table>
<tr>
<td width="80"></td>
<td width="100">A サイズ</td>
<td width="100">B サイズ</td>
<td width="100">C サイズ</td>
<td width="100">D サイズ</td>
<td width="100">E サイズ</td>
<td width="100">F サイズ</td>
</tr>
<tr>
<td>大きさ</td>
<td>60cm以内</td>
<td>80cm以... |
p01321 |
<h1><font color="#000">Problem A:</font> 期末試験!</h1>
<p>
私立桜が丘女子高等学校に通う平沢唯さんは明後日までに進路希望を出さなければならないのだが、困ったことに進路についてまだ何も決めていなかった。
友人の和に相談したところ、和の第一志望はK大と知り、自分もK大に入れるかどうか進路指導の先生に相談にいった。
</p>
<p>
相談された進路指導の先生であるあなたは唯さんがK大に入れるかどうかを予想するため唯さんの期末試験の成績を参考にすることにした。
しかし、唯さんは試験の山が当たるかどうかによって大きく成績が左右されるため、過去の期末試験の中で一番良かった時の点数と一番... |
p00863 |
<H1><font color="#000">Problem J:</font> The Teacher’s Side of Math</H1>
<p>
One of the tasks students routinely carry out in their mathematics classes is to solve a polynomial equation. It is, given a polynomial, say <i>X</i><sup>2</sup> - 4<i>X</i> + 1, to find its roots (2 ± √3).
</p>
<p>
If the stud... |
p01771 |
<h1 id="f-tree-木">F : Tree / 木</h1>
<h2 id="問題文">問題文</h2>
<p>大きさ <var>N</var> の根付き木がある。 各頂点には <var>0</var> から <var>N−1</var> までの番号が付けられ、根が <var>0</var>である。 任意の辺の両端の頂点について、割り当てられた整数は根に近いほうが小さい。初めは全ての辺の重みは <var>0</var> である。</p>
<p>この木に対する <var>Q</var> 個のクエリを順に処理せよ。クエリには以下の <var>2</var> 種類がある。</p>
<ul>
<li>頂点 <v... |
p01264 |
<H1><font color="#000">Problem E:</font> Magical Island</H1>
<p>
This is a story in the epoch of magic. A clan of magicians lived in an artificial island built by magic power.
</p>
<p>
One day, a crisis erupted on the island. An Empire ACM (Atlas Country of Magic) required unconditional
surrender to them, otherwise a... |
p03259 | <span class="lang-en">
<p>Score : <var>1900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has found two trees <var>A</var> and <var>B</var>, each with <var>N</var> vertices numbered <var>1</var> to <var>N</var>.
The <var>i</var>-th edge of <var>A</var> connects Vertex <var>a_i</var> a... |
p00926 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
</script>
<script type='text/javascript' src='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML'></script>
</script>
<h2>Problem C:
Shopping
</h2>
<p>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.