question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p01484 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<body>
<h1> Icy Composer</h1>
<p>
Time Limit: 8 sec / Memory Limit: 64 MB
</p>
<h2> F: 氷の作曲家</h2>
<p>
岡部錬太郎(愛称オカレン)は,西洋音楽の第一人者である.
彼は,5歳から作曲を行うことができた天才であり,彼が作詞・作曲した『攻城の槌』はとても有名である.
才能あふれるオカレ... |
p03143 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a 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 edges are numbered <var>1</var> to <var>M</var>.
... |
p03513 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> islands floating in Ringo Sea, and <var>M</var> travel agents operate ships between these islands. For convenience, we will call these islands Island <var>1,</var> <var>2,</var> <... |
p03006 | <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> balls in a two-dimensional plane. The <var>i</var>-th ball is at coordinates <var>(x_i, y_i)</var>.</p>
<p>We will collect all of these balls, by choosing two integers <var>p</var... |
p03456 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>AtCoDeer the deer has found two positive integers, <var>a</var> and <var>b</var>.
Determine whether the concatenation of <var>a</var> and <var>b</var> in this order is a square number.</p>
</section>
</... |
p01191 |
<H1><font color="#000"></font>Grated Radish</H1>
<!-- Problem B-->
<p>
Grated radish (daikon-oroshi) is one of the essential spices in Japanese cuisine. As the name shows, it’s
made by grating white radish.
</p>
<p>
You are developing an automated robot for grating radish. You have finally finished developing mechan-
... |
p02617 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a tree with <var>N</var> vertices and <var>N-1</var> edges, respectively numbered <var>1, 2,\cdots, N</var> and <var>1, 2, \cdots, N-1</var>. Edge <var>i</var> connects Vertex <var>u_i</var> and... |
p01938 |
<h2>A: A-Z-</h2>
<h3>問題</h3>
<p><var>26</var> マスの円環状のボードがあり、各マスには大文字のアルファベット <var>1</var> 文字が、アルファベット順に時計回りに書かれています。すなわち、 'A' のマスの時計回り隣は 'B' のマスで、 'B' のマスの隣は 'C' のマスで、・・・、 'Z' のマスの時計回り隣は 'A' のマスです。</p>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE3_ACPC2017Day3_HUPC2017_aizu17-a-01" type="image/... |
p03905 | <span class="lang-en">
<p>Score : <var>1500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is an undirected connected graph with <var>N</var> vertices numbered <var>1</var> through <var>N</var>.
The lengths of all edges in this graph are <var>1</var>.
It is known that for each <var>i (... |
p02247 |
<H1>Naive String Search</H1>
<p>
Find places where a string <var>P</var> is found within a text <var>T</var>.
Print all indices of <var>T</var> where <var>P</var> found. The indices of <var>T</var> start with 0.
</p>
<H2>Input</H2>
<p>
In the first line, a text <var>T</var> is given. In the second line, a ... |
p00780 |
<H1><font color="#000">Problem A:</font>Goldbach's Conjecture</H1>
<p>
<b>Goldbach's Conjecture:</b> For any even number <i>n</i> greater than or equal to 4, there exists at least one pair of prime numbers <i>p</i><sub>1</sub> and <i>p</i><sub>2</sub> such that <i>n</i> = <i>p</i><sub>1</sub> + <i>p</i><sub>2</sub>.
... |
p01892 |
<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>B: イカったー / SNS</h1>
<h2>問題文</h2>
<p>
AOR イカちゃんは最近少し機嫌が悪い。
ど... |
p00515 |
<H1>問題 1: 平均点 (Average Score)
</H1>
<br/>
<h2>問題</h2>
<p>
JOI 高校の授業には,太郎君,次郎君,三郎君,四郎君,花子さんの 5 人の生徒が参加した.
</p>
<p>
この授業では,期末試験を実施した.期末試験は,5 人全員が受験した.期末試験の点数が 40 点以上の生徒は,期末試験の点数がそのまま成績になった.期末試験の点数が 40 点未満の生徒は全員,補習を受け,成績が 40 点になった.
</p>
<p>
5 人の生徒の期末試験の点数が与えられたとき,5 人の成績の平均点を計算するプログラムを作成せよ.
</p>
<h2> 入力</h2>
<p>
入... |
p02178 | <h1>D: Walking</h1>
<h2>問題</h2>
<p>
$1$ から $N$ の番号がつけられている $N$ 個の島がある.<br>
それぞれの島は $N-1$ 個の橋によって、どの $2$ つの島も何本かの橋を渡って互いに移動することができる.<br>
それぞれの橋には耐久度があり、入力が与えられた時点での $i$ 番目の橋の耐久度は $w_i$ である.<br>
それぞれの島にはお宝が $1$ つずつ置いており、島に滞在しているときにお宝を拾うことができる.
</p>
<p>
現在島 $S$ にいるyebiくんは、島 $E$ にある博物館に全てのお宝を運びたい.<br>
yeb... |
p00145 |
<H1>カード</H1>
<p>
正の整数が書かれた一組のカードがあります。カードを積んで山をいくつか作り、それらを横一列に並べます。その中から隣り合った 2 つのカードの山を選び、右側の山の上に左側の山をそのまま重ねます。この操作をカードの山が一つになるまで繰り返していきます。
</p>
<p>
2 つのカードの山を重ねる時にそれらの一番上と下のカードに書かれた数をすべて掛け合わせます。こうして得られた数をカードの重ね合わせのコストと呼ぶことにします。カードの山を一つにするためのコストはすべての重ね合わせのコストを足し合わせたものとします。
</p>
<p>
どのような順番でカードの山を重ねるかでコストは変わります。た... |
p01304 |
<h1><font color="#000">Problem B:</font> 平安京ウォーキング</h1>
<p>
平安京は、道が格子状になっている町として知られている。
</p>
<p>
平安京に住んでいるねこのホクサイは、パトロールのために毎日自宅から町はずれの秘密の場所まで行かなければならない。しかし、毎日同じ道を通るのは飽きるし、後を付けられる危険もあるので、ホクサイはできるだけ毎日異なる経路を使いたい。その一方で、ホクサイは面倒臭がりなので、目的地から遠ざかるような道は通りたくない。
</p>
<p>
平安京のあちこちの道にはマタタビが落ちていて、ホクサイはマタタビが落ちている道を通ることができない。そのような... |
p03339 | <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> people standing in a row from west to east.
Each person is facing east or west.
The directions of the people is given as a string <var>S</var> of length <var>N</var>.
The <var>i</... |
p03293 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given string <var>S</var> and <var>T</var> consisting of lowercase English letters.</p>
<p>Determine if <var>S</var> equals <var>T</var> after <em>rotation</em>.</p>
<p>That is, determine if <va... |
p01754 |
<p>
2014 年春,ある学生は無事大学に合格し,一人暮らしを始める事となった.ここで問題となるのが夕食をどうするかである.彼はこれから <var>N</var> 日間の夕食の計画を立てる事にした.
</p>
<p>
彼は <var>N</var> 日間で得られる幸福度の合計を出来る限り大きくしたい.もちろん,美味しいものや好きなものを食べるほど幸福度は高い.
</p>
<p>
彼の夕食の選択肢は2 つ,近くの食堂に向かうか,自炊をするかのどちらかである.
</p>
<p>
食堂で得られる幸福度は,その日のメニューによって変わる.メニューは日替わりだが毎日一種類のみで,<var>N</var> 日間のメニューは全て既に... |
p03769 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We will call a string <var>x</var> <em>good</em> if it satisfies the following condition:</p>
<ul>
<li>Condition: <var>x</var> can be represented as a concatenation of two copies of another string <var... |
p00846 |
<H1><font color="#000">Problem B:</font> How I Mathematician Wonder What You Are!</H1>
<p>
After counting so many stars in the sky in his childhood, Isaac, now an astronomer and a
mathematician, uses a big astronomical telescope and lets his image processing program count
stars. The hardest part of the program is to ... |
p01241 |
<H1><font color="#000">Problem H:</font> Finding the Top RPS Player</H1>
<p>
A company “ACM Foods” is preparing for opening its chain shop in a certain area, but another company “ICPC
Pizza” is also planning to set up its branch shop in the same area. In general, two competitive shops gain less
incomes if they are lo... |
p03786 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke found <var>N</var> strange creatures.
Each creature has a fixed color and size. The color and size of the <var>i</var>-th creature are represented by <var>i</var> and <var>A_i</var>, respectively.... |
p04043 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Iroha loves <em>Haiku</em>. Haiku is a short form of Japanese poetry. A Haiku consists of three phrases with <var>5</var>, <var>7</var> and <var>5</var> syllables, in this order.</p>
<p>To create a Haik... |
p02894 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given are <var>N</var> points on the circumference of a circle centered at <var>(0,0)</var> in an <var>xy</var>-plane.
The coordinates of the <var>i</var>-th point are <var>(\cos(\frac{2\pi T_i}{L}),\s... |
p01611 |
<h2>K-th String</h2>
<h2>Problem Statement</h2>
<p>長さ<var>N</var>の文字列<var>S</var>に対する接尾辞配列<var>SA</var>を,以下の手順で得られる<var>N</var>以下の正整数の順列として定義する.<br />
<var>S</var>の<var>i</var>文字目から<var>j</var>文字目までの部分文字列を<var>S[i..j]</var>と表す.ただし添字は1-indexedである.</p>
<ol class="list1" style="padding-left:16px;margin-left:16px"><l... |
p00903 |
<H1><font color="#000">Problem J:</font>Round Trip</H1>
<p>
Jim is planning to visit one of his best friends in a town in the mountain area. First, he leaves his hometown and goes to the destination town. This is called the go phase. Then, he comes back to his hometown. This is called the return phase. You are expect... |
p00450 |
<H1> 碁石ならべ </H1>
<h2>問題</h2>
<p>
白と黒の碁石をテーブルの上にならべて遊ぶ.まずテーブルの左端に碁石を置く.次に左から 2 番目の場所に碁石を置く.これを n 回繰り返して n 個の碁石を横一列にならべる.ただし,新しく i 番目の碁石を置く際には,次のルールに従ってテーブル上の碁石を置き換える.
</p>
<ul>
<li> i が奇数の場合: テーブルに置いてあった碁石は置き換えず,新しい碁石を左
から i 番目に置く.</li>
<li> i が偶数の場合: 新しく左から i 番目に置く碁石の色とテーブル上の右端の碁
石の色が同じ場合は,テーブル上の碁石は置き... |
p02197 | <h2>双子 (Twins)</h2>
<p>square1001君とE869120君は双子です。</p>
<p>このうち先に生まれた方を出力して下さい。</p>
<h3>入力</h3>
<p>入力は与えられない。</p>
<h3>出力</h3>
<p>正解の文字列を一行に出力せよ。</p>
<p>ただし、最後には改行を入れること。</p>
<h3>出力例1</h3>
<pre>
square1001
</pre> |
p00000 |
<H1>QQ</H1>
<p>
Write a program which prints multiplication tables in the following format:
</p>
<pre>
1x1=1
1x2=2
.
.
9x8=72
9x9=81
</pre>
<H2>Input</H2>
<p>
No input.
</p>
<H2>Output</H2>
<pre>
1x1=1
1x2=2
.
.
9x8=72
9x9=81
</pre>
<H2>Template for C</H2>
<pre>
#include<stdio.h>
int main(){
ret... |
p03505 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><em>ButCoder Inc.</em> runs a programming competition site called <em>ButCoder</em>. In this site, a user is given an integer value called rating that represents his/her skill, which changes each time h... |
p01538 |
<h1>かけざん</h1>
<p>
太郎君はかけざんを習いたての小学生です。なんとなく、彼はかけざんを気に入っているので、数字を見かけるとかけざんをしたくなります。そんな彼はここのところ、次のような処理を0以上の整数に施すことが好きなようです。
(処理の流れ)
</p>
<ul>
<li>手順1. ある0以上の整数nが10進数表示で一けたならばそこで処理を終了する。そうでなければ手順2に進む
</li><li>手順2. 10以上の整数nを10進数表示をするとどこかの桁の間に切れ目を入れて二つの数字に分解することが可能である(例えば2012-> 20,12)。このような切り方としてありうるものに対して,得られた二つの... |
p03155 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>It has been decided that a programming contest sponsored by company A will be held, so we will post the notice on a bulletin board.</p>
<p>The bulletin board is in the form of a grid with <var>N</var> r... |
p01168 |
<H1><font color="#000">Problem F:</font> Lying about Your Age</H1>
<p>
You have moved to a new town. As starting a new life, you have made up your mind to do
one thing: lying about your age. Since no person in this town knows your history, you don’t
have to worry about immediate exposure. Also, in order to ease your ... |
p01492 |
<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:
CarrotBreeding
</h... |
p00329 |
<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>
PCK 君はみんなでゲーム大会をしています。このゲ... |
p02314 |
<H1>Coin Changing Problem</H1>
<br/>
<p>
Find the minimum number of coins to make change for <var>n</var> cents using coins of denominations <var>d<sub>1</sub></var>, <var>d<sub>2</sub></var>,.., <var>d</var><sub><var>m</var></sub>. The coins can be used any number of times.
</p>
<H2>Input</H2>
<pre>
<var>n</var> <... |
p03856 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a string <var>S</var> consisting of lowercase English letters.
Another string <var>T</var> is initially empty.
Determine whether it is possible to obtain <var>S = T</var> by performing the... |
p00779 |
<h3>Don't Cross the Circles!</h3>
<p>
There are one or more circles on a plane.
Any two circles have different center positions and/or different radiuses.
A circle may intersect with another circle,
but no three or more circles have areas nor points shared by all of them.
A circle may completely contain another circ... |
p02744 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In this problem, we only consider strings consisting of lowercase English letters.</p>
<p>Strings <var>s</var> and <var>t</var> are said to be <strong>isomorphic</strong> when the following conditions a... |
p00283 |
<h1>巨樹の刻み手</h1>
<p>
あなたは <var>N</var> 種類の道具を使って、目の前の巨樹を切り倒そうとしています。はじめは、樹の耐久力は <var>D</var>、あなたの経験値は 0 ですが、道具 <var>i</var> で1回樹を叩くと樹の耐久力は <var>a<sub>i</sub></var> 減り、あなたは <var>e<sub>i</sub></var> の経験値を得ます。ただし、道具 <var>i</var> を使うためには、あなたは <var>r<sub>i</sub></var> 以上の経験値を持っていなければなりません。樹の耐久力が 0 以下になると樹は倒れます。
</p>
<p>... |
p01884 |
<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>Similarity of Subtrees</h2>
<p... |
p00796 |
<H1><font color="#000">Problem A:</font> Lost in Space</H1>
<p>
William Robinson was completely puzzled in the music room; he could not find his triangle in
his bag. He was sure that he had prepared it the night before. He remembered its clank when
he had stepped on the school bus early that morning. No, not in his d... |
p02251 | <h1>Change-Making Problem</h1>
<p>You want to make change for $n$ cents. Assuming that you have infinite supply of coins of 1, 5, 10 and/or 25 cents coins respectively, find the minimum number of coins you need.</p>
<h2>Input</h2>
<pre>
$n$
</pre>
<p>The integer $n$ is given in a line.</p>
<h2>出力</h2>
<p>Print th... |
p03913 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Rng is baking cookies.</p>
<p>Initially, he can bake one cookie per second.</p>
<p>He can also eat the cookies baked by himself.
When there are <var>x</var> cookies not yet eaten, he can choose to eat ... |
p02601 | <span class="lang-en">
<p>Score: <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>M-kun has the following three cards:</p>
<ul>
<li>A red card with the integer <var>A</var>.</li>
<li>A green card with the integer <var>B</var>.</li>
<li>A blue card with the integer <var>C</var>.</li>
... |
p01187 |
<H1><font color="#000">Problem G:</font> Make Friendships</H1>
<p>
Isaac H. Ives attended an international student party and made a lot of girl friends (as many other persons
expected). To strike up a good friendship with them, he decided to have dates with them. However, it
is hard for him to schedule dates because ... |
p03440 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are given a forest with <var>N</var> vertices and <var>M</var> edges. The vertices are numbered <var>0</var> through <var>N-1</var>.
The edges are given in the format <var>(x_i,y_i)</var>, which mea... |
p03010 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>Diverta City is a new city consisting of <var>N</var> towns numbered <var>1, 2, ..., N</var>.</p>
<p>The mayor Ringo is planning to connect every pair of two different towns with a bidirectional road. ... |
p01703 |
<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... |
p00811 | <H1><font color="#000">Problem A:</font> Calling Extraterrestrial Intelligence Again</H1>
<p>
A message from humans to extraterrestrial intelligence was sent through the Arecibo radio telescope in Puerto Rico on the afternoon of Saturday November l6, l974. The message consisted of l679 bits and was meant to be transla... |
p01353 |
<H1>Problem E: Rabbit Plays Games!</H1>
<p>
うさぎがとあるロールプレイングゲームで遊んでいる. 城に入る直前で, 敵に待ち伏せされていた!
</p>
<p>
うさぎが操作する主人公1 人と, <i>n</i> 体の敵との戦闘となった. 各キャラクターには4 つの能力値, 体力<i>h<sub>i</sub></i>, 攻撃力<i>a<sub>i</sub></i>, 防御力<i>d<sub>i</sub></i>, 敏捷<i>s<sub>i</sub></i> が定められている. <i>i</i> = 0 は主人公の情報, 1 ≤ <i>i</i> ≤ <i>n</i... |
p03694 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>It is only six months until Christmas, and AtCoDeer the reindeer is now planning his travel to deliver gifts.<br/>
There are <var>N</var> houses along <em>TopCoDeer street</em>. The <var>i</var>-th hous... |
p02986 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a tree with <var>N</var> vertices numbered <var>1</var> to <var>N</var>.
The <var>i</var>-th edge in this tree connects Vertex <var>a_i</var> and Vertex <var>b_i</var>, and the color and length... |
p00112 |
<h1>ミルクショップ</h1>
<p>
鈴木さんは会津地域に新しく搾りたてミルクの移動販売のお店を開きました。その日買い求めに来るお客さんは全員持ち帰るためのボトルを持って既にお店に並んでいて、それ以上増えないものとします。お客さんはそれぞれ1回だけしか注文しません。タンクの蛇口が一つしかないので、一人ずつ順番に販売しなければなりません。そこで、鈴木さんはなるべく並んでいるお客さんの待ち時間を少なくしたいと考えています。
</p>
<p>
お客さんの人数とお客さんが牛乳を注ぎきるのに要する時間が入力として与えられます。あなたはお客さんの「一人一人の待ち時間の合計」(以下「待ち時間の合計」とする)を最小にするための注文の... |
p00542 |
<h1>科目選択 (Selecting Subjects)</h1>
<h2> 問題</h2>
<p>
JOI 君は物理,化学,生物,地学,歴史,地理の 6 科目のテストを受けた.
それぞれのテストは 100 点満点で採点された.
</p>
<p>
JOI 君は物理,化学,生物,地学の 4 科目から 3 科目を選択し,歴史,地理の 2 科目から 1 科目を選択する.
</p>
<p>
テストの合計点が最も高くなるように科目を選ぶとき,
JOI 君の選んだ科目のテストの合計点を求めよ.
</p>
<h2> 入力</h2>
<p>
入力は 6 行からなり,1 行に 1 つずつ整数が書かれている.
</p>
<p>
... |
p02085 |
<h1>H: Permutation Score</h1>
<h2>問題文</h2>
<p>松崎くんは順列が大好きです。今日は順列によって定まる「サイクル森」について考えることにしました。</p>
<p>$1$ から $k$ までの順列 $p = (p_1, \ldots, p_k)$ に対し「$p$ によって定まるサイクル森」とは、以下の2条件を満たすグラフ $G(p)$ を指します:</p>
<ul>
<li>$G(p)$ は $k$ 頂点からなり、それぞれの頂点には $1$ から $k$ の番号が付けられている。</li>
<li>$i=1, \ldots, k$ について、頂点 $i$ と頂点 $p_i$ の間に辺が張られ... |
p02590 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Let’s take a prime <var>P = 200\,003</var>.
You are given <var>N</var> integers <var>A_1, A_2, \ldots, A_N</var>.
Find the sum of <var>((A_i \cdot A_j) \bmod P)</var> over all <var>N \cdot (N-1) / 2</va... |
p00057 |
<H1>領域の数</H1>
<p>
無限に広い平面の上に、無限に長い直線を数本引くと、この平面はいくつかの領域に分割されます。たとえば、直線を1本引くと、平面は2つの領域に分割されます。同じ数の直線を引いても、引き方によって得られる領域の数は異なります。たとえば、2 本の直線を平行に引けば得られる領域は 3 つになり、互いに垂直に引けば得られる領域は 4 つになります。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_area">
</center>
<br/>
<p>
<var>n</var> 本の直線を引くこと... |
p00407 | <h1>天空の城ツルガ</h1>
<p>
天空の城ツルガはアイヅ国の上空に浮かんでいる。アイヅ国では、天空の城ツルガによって日光がさえぎられる日もある。日光が当たらない日があった場所の住人には、その日数に応じて補償金を支払っている。アイヅ国の補償金支払い担当者であるあなたは、天空の城ツルガの日ごとの位置と補償金の申請があった場所のリストから、その日にその場所で日光が当たらなかったことを確かめる必要がある。
</p>
<p>
天空の城ツルガの場所とアイヅ国の地上のある場所が与えられたとき、その日にその場所が影に入っていたかどうかを判定するプログラムを作成せよ。影の中に入っていたかどうかは、ある特定の時刻で判定するので、天... |
p03381 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>When <var>l</var> is an odd number, the median of <var>l</var> numbers <var>a_1, a_2, ..., a_l</var> is the <var>(\frac{l+1}{2})</var>-th largest value among <var>a_1, a_2, ..., a_l</var>.</p>
<p>You ar... |
p01646 |
<h2>Problem Statement</h2>
<p>
We found a dictionary of the Ancient Civilization Mayo (ACM) during excavation of the ruins.
After analysis of the dictionary, we revealed they used a language that had not more than 26 letters.
So one of us mapped each letter to a different English alphabet and typed all the words in t... |
p02969 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>It is known that the area of a regular dodecagon inscribed in a circle of radius <var>a</var> is <var>3a^2</var>.</p>
<p>Given an integer <var>r</var>, find the area of a regular dodecagon inscribed in ... |
p00954 |
<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 I
Skinny Polygon
</... |
p04014 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>For integers <var>b (b \geq 2)</var> and <var>n (n \geq 1)</var>, let the function <var>f(b,n)</var> be defined as follows:</p>
<ul>
<li><var>f(b,n) = n</var>, when <var>n < b</var></li>
<li><var>f(b... |
p01216 |
<H1><font color="#000">Problem A:</font> Election</H1>
<p>
Giselle has just made a vote for a national election. In her country, members of the legislature are elected
by a system called mixed member proportional representation (MMP). Basically, half the members are
elected from constituencies, and the other half are... |
p03801 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke loves constructing integer sequences.</p>
<p>There are <var>N</var> piles of stones, numbered <var>1</var> through <var>N</var>.
The pile numbered <var>i</var> consists of <var>a_i</var> stones.</... |
p02713 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Find <var>\displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}</var>.</p>
<p>Here <var>\gcd(a,b,c)</var> denotes the greatest common divisor of <var>a</var>, <var>b</var>, and <var>c</v... |
p01996 | <h1>A: テスト</h1>
<h2>問題</h2>
<p>
$N$ 個の席が一直線上に並んでいる教室で $M$ 人の生徒がテストを受けることになった。
席には、前から $1 \dots N$ の番号が振られており、席 $1$ つにつき生徒 $1$ 人が座れる。
</p>
<p>
いま、 各生徒は、 $A_1, \dots, A_M$ 番の席に座っている。
</p>
<p>
テストを始めるためには、以下の条件を満たさなければならない。
<ul>
<li> $1 \dots M$ 番のどの席にも生徒が座っている。</li>
</ul>
</p>
<p>
そこで、条件を満たすまで次の操作を繰... |
p00684 |
<H1>Calculation of Expressions</H1>
<P>Write a program to calculate values of arithmetic expressions which may
involve complex numbers. Details of the expressions are described below.</P>
<P>In this problem, basic elements of expressions are
non-negative integer numbers and
the special symbol "<TT>i</TT>"... |
p02343 |
<H1>Disjoint Set</H1>
<p>
Write a program which manipulates a disjoint set <var>S = {S<sub>1</sub>, S<sub>2</sub>, . . . , S<sub>k</sub>}</var>.
</p>
<p>
First of all, the program should read an integer <var>n</var>, then make a disjoint set where each element consists of 0, 1, ... <var>n−1</var> respectively.... |
p03102 | <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> pieces of source code. The characteristics of the <var>i</var>-th code is represented by <var>M</var> integers <var>A_{i1}, A_{i2}, ..., A_{iM}</var>.</p>
<p>Additionally, you are... |
p01095 |
<h3>Bamboo Blossoms</h3>
<p>
The bamboos live for decades, and at the end of their lives,
they flower to make their seeds. Dr. ACM, a biologist, was fascinated
by the bamboos in blossom in his travel to Tsukuba. He liked
the flower so much that he was tempted to make a garden where
the bamboos bloom annu... |
p03552 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a deck consisting of <var>N</var> cards. Each card has an integer written on it. The integer on the <var>i</var>-th card from the top is <var>a_i</var>.</p>
<p>Two people X and Y will play a gam... |
p03047 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has <var>N</var> integers: <var>1,2,\ldots,N</var>.
He will choose <var>K</var> of them and give those to Takahashi.</p>
<p>How many ways are there to choose <var>K</var> consecutive integers?</p>... |
p01580 |
<H1><font color="#000">Problem K:</font> Up Above the World So High</H1>
<p>
One of the questions children often ask is "How many stars are there in the sky?" Under ideal conditions, even with the naked eye, nearly eight thousands are observable in the northern hemisphere. With a decent telescope, you may find many m... |
p03417 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a grid with infinitely many rows and columns. In this grid, there is a rectangular region with consecutive <var>N</var> rows and <var>M</var> columns, and a card is placed in each square in thi... |
p03944 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a rectangle in the <var>xy</var>-plane, with its lower left corner at <var>(0, 0)</var> and its upper right corner at <var>(W, H)</var>. Each of its sides is parallel to the <var>x</var>-axis o... |
p01979 | <h1>F: ごちうさ数</h1>
<h2>問題</h2>
<p>
ごちうさが大好きなAORイカちゃんは「ごちうさ数」を定義した。
ごちうさ数とは、 $10$ 進表記において「 $51?3$ 」を含む自然数のことである。<br>
$?$ は $0$ 〜 $9$ のどの数字であってもよい。
</p>
<p>
$N$ 以下の自然数のうち、ごちうさ数の個数を求めよ。
</p>
<h2>制約</h2>
<ul>
<li>$1 \le N < 10^{18}$</li>
</ul>
<h2>入力</h2>
<p>
$N$<br>
</p>
<h2>出力</h2>
<p>
ごちうさ数の個数を一行で出力せよ。また末尾に改行を出力... |
p02656 | <span class="lang-en">
<p>Score : <var>1800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke has <var>X+Y</var> balls.
<var>X</var> of them have an integer <var>A</var> written on them, and the other <var>Y</var> of them have an integer <var>B</var> written on them.</p>
<p>Snuke will div... |
p00391 | <h1>Treasure Map</h1>
<p>
Mr. Kobou found a bundle of old paper when he was cleaning his family home. On each paper, two series of numbers are written. Strange as it appeared to him, Mr. Kobou further went through the storehouse and found out a note his ancestor left. According to it, the bundle of paper is a treasur... |
p02206 | <h2>賞金 (Prize)</h2>
<p>Segtree くんは、 $N$ 人のチームでプログラミングコンテストに出場し、 $K$ 円の賞金を得ました!今、この賞金を分配しようとしています。</p>
<p>Segtree くんを含む $N$ 人のチームメンバーそれぞれには、実力順に $1$ から $N$ までの番号がつけられています。Segtree くんは $1$ 番です。</p>
<p>$i$ 番のチームメイト $(i \geq 2)$ の得る賞金額が「$i - 1$ 番のチームメイトの得た賞金額の半分を整数に切り捨てた値」より少ないと、その人は怒ってしまいます。</p>
<p>怒る人が一人もいないように $K$ 円の賞金を分... |
p03899 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> panels arranged in a row in Takahashi's house, numbered <var>1</var> through <var>N</var>. The <var>i</var>-th panel has a number <var>A_i</var> written on it. Takahashi is playin... |
p02271 |
<H1>Exhaustive Search</H1>
<p>
Write a program which reads a sequence <i>A</i> of <i>n</i> elements and an integer <i>M</i>, and outputs "<span>yes</span>" if you can make <i>M</i> by adding elements in <i>A</i>, otherwise "<span>no</span>". You can use an element only once.
</p>
<p>
You are given the sequence <i>A<... |
p03933 | <span class="lang-en lang-child hidden-lang">
<div id="task-statement">
<div class="part">
Max Score: $850$ Points <br/>
<section>
<h3>Problem statement</h3>
There is a circle which radius is 1. <br/>
There are $N$ vertices on the circle's circumference. <br/>
The vertices divides into $N$ equal ... |
p02621 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given an integer <var>a</var> as input, print the value <var>a + a^2 + a^3</var>.</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>1 \leq a \leq 10</var></li>
<li><va... |
p03460 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>AtCoDeer is thinking of painting an infinite two-dimensional grid in a <em>checked pattern of side <var>K</var></em>.
Here, a checked pattern of side <var>K</var> is a pattern where each square is paint... |
p03030 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You have decided to write a book introducing good restaurants.
There are <var>N</var> restaurants that you want to introduce: Restaurant <var>1</var>, Restaurant <var>2</var>, <var>...</var>, Restaurant... |
p01518 |
<!-- begin en only -->
<h3><u>Dog Food
</u></h3>
<!-- end en only -->
<!-- begin ja only -->
<h3><u>ドッグフード
</u></h3>
<!-- end ja only -->
<div>
<!-- begin en only -->
<p>
English text is not available in this practice contest.
</p>
<!-- end en only -->
<!-- begin ja only -->
<p>
あなたは, 賢い犬を選ぶコンテストの主催者である.
種目の1つに,以下のよう... |
p03525 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>In CODE FESTIVAL XXXX, there are <var>N+1</var> participants from all over the world, including Takahashi.</p>
<p>Takahashi checked and found that the <em>time gap</em> (defined below) between the local... |
p01148 |
<!-- begin en only -->
<h3><U> Princess, a Strategist </U></h3>
<!-- end en only -->
<!-- begin ja only -->
<h3><U> お姫様は戦略家 </U></h3>
<!-- end ja only -->
<!-- begin en only -->
<p>
English text is not available in this practice contest.
</p>
<!-- end en only -->
<!-- begin ja only -->
<p>
ある貧乏な国の勇敢なお姫様は,お城を抜け出して古... |
p03175 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a tree with <var>N</var> vertices, numbered <var>1, 2, \ldots, N</var>.
For each <var>i</var> (<var>1 \leq i \leq N - 1</var>), the <var>i</var>-th edge connects Vertex <var>x_i</var> and <var>... |
p02334 | <!--<h1>写像12相 その4:ボールに区別なし・箱に区別あり・入れ方に制限なし</h1>-->
<h1>Balls and Boxes 4</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>1</td><td>2</td><td>3</td></tr>
<tr><th>Indistinguishabl... |
p00309 |
<h1>アカベコ国王の配慮</h1>
<p>
アカベコ国の国王には2人の王子がいます。国王は自分が退位するときに国を2つに分割し、それぞれの王子に一つずつ国を治めさせることにしました。新しい国の名前はアカ国とベコ国です。アカベコ国には <var>N</var> 個の町と、2つの町を繋ぐ <var>M</var> 本の道があります。国王は、以下の手順でアカベコ国の町と一部の道を2つの国に配分することにしました。<br>
<br>
(1) 町を2つ選び、それぞれアカ国とベコ国に配分する。<br>
(2) すでに配分された町sを選ぶ。さらに、町 <var>s</var> から1本の道... |
p03876 | <span class="lang-en">
<p>Score : <var>1500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><style>
#nck {
width: 30px;
height: auto;
}
</style>
<p>Construct an <var>N</var>-gon that satisfies the following conditions:</p>
<ul>
<li>The polygon is simple (see notes for the defin... |
p02764 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi wants to grill <var>N</var> pieces of meat on a grilling net, which can be seen as a two-dimensional plane. The coordinates of the <var>i</var>-th piece of meat are <var>\left(x_i, y_i\right)<... |
p00759 |
<h3><U>A Broken Door</U></h3>
<!-- end en only -->
<div> <!-- please enclose each h3 level section with div -->
<!-- begin en only -->
<p>
There is a rectangular maze consisting of a number of square rooms
arranged in grid. The maze is surrounded by
walls except for its entry and exit. The entry to the maze is at... |
p01261 |
<H1><font color="#000">Problem B:</font> Bitwise Kingdom</H1>
<p>
In the Bitwise Kingdom, located somewhere in the universe, there are exactly 2<sup><i>N</i></sup> citizens living and each
of them has a unique identification string that represents his or her class in the society. An identification
string is a binary ... |
p00889 |
<H1><font color="#000">Problem F:</font> Find the Multiples</H1>
<p>
You are given a sequence <i>a</i><sub>0</sub><i>a</i><sub>1</sub>...<i>a</i><sub><i>N</i>-1</sub> digits and a prime number <i>Q</i>. For each <i>i</i> ≤ <i>j</i> with <i>a<sub>i</sub></i> ≠ 0, the subsequence <i>a</i><sub><i>i</i></sub><i>a</... |
p01631 |
<h1>Problem E: 英語の勉強</h1>
<h2>Problem Statement</h2>
<p>
会津合宿に参加予定の高槻さんは勉強熱心で、最近は英語の勉強をがんばっている。彼女は、携帯を使って次のようなゲームをプレイすることで、少しでも多く英単語を覚えようとしている。彼女が持っている携帯は、指で画面を操作するタッチパネル式である。
</p>
<p>
携帯の画面には、4 * 4のマス目が描かれており、各マスにはアルファベット大文字が書かれている。このゲームは、制限時間T秒の間に、マス目の中に隠されている英単語をたくさん見つけ、発見できた英単語の種類により点数を競うものである。
</p>
<p>
1つの単語... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.