question_id stringlengths 6 6 | content stringlengths 1 27.2k |
|---|---|
p01822 |
<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>
<h3>Problem E:
Enclose Points</h3... |
p00730 |
<h1><font color="#000">Problem C:</font> Cut the Cake</h1>
<!-- end en only -->
<p>
Today is the birthday of Mr. Bon Vivant, who is known as one of the greatest <i>pâtissiers</i> in the world.
Those who are invited to his birthday party are <i>gourmets</i> from around the world.
They are eager to see and eat h... |
p00360 | <H1>Swapping Characters</H1>
<p>
You are given a string and a number <var>k</var>. You are suggested to generate new strings by swapping any adjacent pair of characters in the string up to <var>k</var> times. Write a program to report the lexicographically smallest string among them.
</p>
<h2>Input</h2>
<p>
... |
p01988 | <h3>NINJA GAME</h3>
<!-- begin ja only -->
<p>新作ゲーム "NIN<strong><em>JA G</em></strong>AME" がついに発売となった.このゲームではプレイヤーは二次元マップ上の忍者を操作して移動を行う.二次元マップは <i>x</i> 軸,または <i>y</i> 軸のどちらか一方に平行な辺のみからなる,自己交差のない多角形で表される.いま,多角形の内部に存在するスタート地点からゴール地点へと移動する必要がある.</p>
<p>移動は上下左右と斜め45°の8方向が可能で,いずれかの対応するコマンドを入力すると,指定した方向に自動で進み続ける.この自動移動の最中... |
p01121 | <!--<h2>Problem E</h2>-->
<!-- begin en only -->
<h3>Cube Surface Puzzle</h3>
<!-- end en only -->
<!-- begin en only -->
<p>
Given a set of six pieces, “Cube Surface Puzzle” is to construct a hollow cube with filled surface.
Pieces of a puzzle is made of a number of small unit cubes laid grid-aligned on... |
p01571 |
<H1><font color="#000">Problem A:</font> Adhoc Translation</H1>
<p>
One day, during daily web surfing, you encountered a web page which was written in a language you've never seen. The character set of the language was the same as your native language; moreover, the grammar and words seemed almost the same. Excitedly... |
p01766 |
<h1 id="a-soccer-サッカー">A : Soccer / サッカー</h1>
<h2 id="問題文">問題文</h2>
<p>A国とB国の間でAIサッカーの試合をした。あなたの手元には、ある時刻にボールを持っていた選手とその位置を記録した表がある。表は <var>N</var> 行からなり、上から <var>i</var> 番目の行は次に示す要素からなる。</p>
<ul>
<li>フレーム数 <var>f_i</var></li>
<li>ボールを持っている選手の背番号 <var>a_i</var></li>
<li>その選手が属するチーム <var>t_i</var></li>
<li>その選手の位置を表す... |
p02849 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has come to an integer shop to buy an integer.</p>
<p>The shop sells the integers from <var>1</var> through <var>10^9</var>. The integer <var>N</var> is sold for <var>A \times N + B \times d(N... |
p00874 |
<H1><font color="#000">Problem A:</font> Cubist Artwork</H1>
<p>
<i>International Center for Picassonian Cubism</i> is a Spanish national museum of cubist artworks,
dedicated to Pablo Picasso. The center held a competition for an artwork that will be displayed
in front of the facade of the museum building. The artwor... |
p01336 |
<h1><font color="#000">Problem D:</font>THE BYDOLM@STER</h1>
<h2>Description</h2>
<!-- <div style="float:right"><img src="https://judgeapi.u-aizu.ac.jp/resources/images/uvcs_static_image_03D_2" alt="ドブケラドプス" width=400 height=260></div> -->
<p>THE BYDOLM@STER(バイドルマスター)とは1rem社より2010/4/1にEXIDNAで発売が予定されている育成シミュレーションゲーム... |
p00177 |
<H1>2都市間の距離</H1>
<p>
地球上の2 都市の北緯と東経を入力とし、地表距離を計算して出力するプログラムを作成してください。ただし、地球は半径 6,378.1 km の球とし、2 点間の地表距離とはこの球面に沿った最短距離です。また、南半球でも南緯は用いずに北緯 0 ~ -90 度を用い、グリニッジ子午線の西でも西経は用いずに東経 180 ~ 360 度を用いることとします。地表距離は km 単位で求め、小数点以下は四捨五入し、整数値として出力してください。
</p>
<p>
以下に主要都市の北緯、東経の例を示します。
</p>
<center>
<table>
<tr><th width="120">地... |
p00527 |
<h2>IOI 列車で行こう(Take the 'IOI' train)</h2>
<p>
IOI 国ではこのたび新たに鉄道を敷設した.IOI 国の鉄道を走る列車はいくつかの車両が連結されたものであり,車両には <span>I</span>, <span>O</span> の 2 種類がある.車両はそれぞれ異なる種類の車両としか連結できない.また,列車に運転席を設ける関係上,列車の両端の車両は種類 <span>I</span> でなければならない.列車は車両の種類を表す文字を順につなげた文字列で表され,列車の長さはその文字列の長さであるとする.たとえば, <span>IOIOI</span> の順に車両を連結すると長さ ... |
p00032 |
<H1>プラスティック板</H1>
<p>
機械に辺・対角線の長さのデータを入力し、プラスティック板の型抜きをしている工場があります。この工場では、サイズは様々ですが、平行四辺形の型のみを切り出しています。あなたは、切り出される平行四辺形のうち、長方形とひし形の製造個数を数えるように上司から命じられました。
</p>
<p>
「機械に入力するデータ」を読み込んで、長方形とひし形の製造個数を出力するプログラムを作成してください。
</p>
<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_plastic"></center>
<b... |
p00462 |
<H1>ピザ </H1>
<h2>問題</h2>
<p>
JOI ピザでは,市の中心部を通る全長 <i>d</i> メートルの環状線の沿線上でピザの宅配販
売を行っている.
</p>
<p>
JOI ピザは,環状線上に <i>n</i> 個の店舗 <i>S</i><sub>1</sub>, ... , <i>S<sub>n</sub></i> を持つ.本店は <i>S</i><sub>1</sub> である. <i>S</i><sub>1</sub> から <i>S<sub>i</sub></i> まで,時計回りに環状線を移動したときの道のりを <i>d<sub>i</sub></i> メートルとおく. <... |
p00198 |
<h1>立方体の作品</h1>
<p>
芸術家品川は <var>n</var> 点の作品を出展するように依頼されました。そこで、立方体の 6 面をペンキで色付けしたものを作品として出展することにしました。作品は、Red、Yellow、Blue、Magenta、Green、Cyan の 6 色全てが使われていて、各面は 1 色で塗りつぶされています。品川は形が同じ立方体の作品でも色の配置の仕方を変え、異なる作品として <var>n</var> 点作成しました。
</p>
<center>
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE2_shi... |
p01623 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script
<!--
<h3><u>Sinking islands</u></h3>
-->
<!-- end en only -->
<!-- begin ja only -->
<h1><u>沈みゆく島</u></h1>
<!-- end ja only -->
<!-- begin en only -->
<!--
<p>
English text is not available in this practice contest.
</p>
-->
<!-- end en only -->
<!-- begin j... |
p00931 |
<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 H:
Cornering at Poles
<... |
p01273 |
<H1><font color="#000">Problem A:</font> Infected Computer</H1>
<p>
Adam Ivan is working as a system administrator at Soy Group, Inc. He is now facing at a big trouble:
a number of computers under his management have been infected by a computer virus. Unfortunately,
anti-virus system in his company failed to detect t... |
p01789 |
<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>J - Unfair Game</h2>
<h3>Probl... |
p03864 | <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> boxes arranged in a row.
Initially, the <var>i</var>-th box from the left contains <var>a_i</var> candies.</p>
<p>Snuke can perform the following operation any number of times:</p... |
p01859 |
<!--<script language="JavaScript" type="text/javascript" src="js/varmath.js" charset="UTF-8"></script>-->
<h2>B: 中島、あれやろうぜ! - Match Peas War -</h2>
<h3>問題</h3>
<p>中島「うぅっ・・・」</p>
<p>磯野「中島,大丈夫か?」</p>
<p>中島「・・・なんだか嫌な夢を見ていた気がするよ」</p>
<p>磯野「どんな夢だい?」</p>
<p>中島「無限に遊ぶ夢」</p>
<p>磯野「意味わからん.まぁいいや,中島,あれやろうぜ!」</p>
<p>中島「あれ... |
p02776 | <span class="lang-en">
<p>Score: <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>After being invaded by the Kingdom of AlDebaran, bombs are planted throughout our country, AtCoder Kingdom.</p>
<p>Fortunately, our military team called ABC has managed to obtain a device that is a part... |
p02326 |
<H1>Largest Square</H1>
<p>
Given a matrix (<var>H</var> × <var>W</var>) which contains only 1 and 0, find the area of the largest square matrix which only contains 0s.
</p>
<H2>Input</H2>
<pre>
<var>H</var> <var>W</var>
<var>c</var><sub>1,1</sub> <var>c</var><sub>1,2</sub> ... <var>c<sub>1,W</sub></var>
<v... |
p03167 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a grid with <var>H</var> horizontal rows and <var>W</var> vertical columns.
Let <var>(i, j)</var> denote the square at the <var>i</var>-th row from the top and the <var>j</var>-th column from t... |
p03537 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Ringo has a string <var>S</var>.</p>
<p>He can perform the following <var>N</var> kinds of operations any number of times in any order.</p>
<ul>
<li>Operation <var>i</var>: For each of the characters f... |
p03022 | <span class="lang-en">
<p>Score : <var>1600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke found a random number generator.
It generates an integer between <var>0</var> and <var>2^N-1</var> (inclusive).
An integer sequence <var>A_0, A_1, \cdots, A_{2^N-1}</var> represents the probabil... |
p03188 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>For an <var>n \times n</var> grid, let <var>(r, c)</var> denote the square at the <var>(r+1)</var>-th row from the top and the <var>(c+1)</var>-th column from the left.
A <em>good</em> coloring of this... |
p03472 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>You are going out for a walk, when you suddenly encounter a monster. Fortunately, you have <var>N</var> katana (swords), Katana <var>1</var>, Katana <var>2</var>, <var>…</var>, Katana <var>N</var>, and ... |
p03921 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>On a planet far, far away, <var>M</var> languages are spoken. They are conveniently numbered <var>1</var> through <var>M</var>.</p>
<p>For <em>CODE FESTIVAL 20XX</em> held on this planet, <var>N</var> p... |
p02633 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer <var>K</var> such that Takahashi will be at the starting position again after he does the following acti... |
p02799 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a connected undirected graph with <var>N</var> vertices and <var>M</var> edges.
Edge <var>i</var> in this graph (<var>1 \leq i \leq M</var>) connects Vertex <var>U_i</var> and Vertex <var>V_i</v... |
p02263 |
<p>
Reverse Polish notation is a notation where every operator follows all of its operands. For example, an expression (1+2)*(5+4) in the conventional Polish notation can be represented as 1 2 + 5 4 + * in the Reverse Polish notation. One of advantages of the Reverse Polish notation is that it is parenthesis-free.
</... |
p00570 | <h1>ストーブ(Stove)</h1>
<p>
JOI 君の部屋にはストーブがある.JOI 君自身は寒さに強いのでひとりで部屋にいるときはストーブをつける必要はないが,来客があるときはストーブをつける必要がある.
</p>
<p>
この日,JOI 君のもとには<var>N</var> 人の来客がある.<var>i</var> 番目(<var>1 \leq i \leq N</var>) の来客は時刻<var>T_i</var> に到着し,時刻<var>T_i + 1</var>に退出する.同時に複数人の来客があることはない.
</p>
<p>
JOI 君は任意の時刻にストーブをつけたり消したりできる.ただし,スト... |
p00120 |
<H1>パティシエ</H1>
<p>
ケーキ屋さんが、まちまちな大きさのロールケーキをたくさん作りました。あなたは、このケーキを箱に並べる仕事を任されました。
</p>
<p>
ロールケーキはとてもやわらかいので、他のロールケーキが上に乗るとつぶれてしまいます。ですから、図(a) のように全てのロールケーキは必ず箱の底面に接しているように並べなければなりません。並べ替えると必要な幅も変わります。
</p>
<center>
<table>
<tr><td><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_patisserie1"></td>... |
p01361 |
<H1><font color="#000">Problem C:</font> Dungeon Quest II</H1>
<p>
The cave, called "Mass of Darkness", had been a agitating point of the evil, but the devil king
and all of his soldiers were destroyed by the hero and the peace is there now.
</p>
<p>
One day, however, the hero was worrying about the rebirth of the d... |
p00989 | <h2>Draw in Straight Lines</h2>
<P>
You plan to draw a black-and-white painting on a rectangular canvas. The painting will be a grid array of pixels, either black or white. You can paint black or white lines or dots on the initially white canvas.
</p>
<p>
You can apply a sequence of the following two operations in a... |
p01731 |
<p>Nathan O. Davis has been running an electronic bulletin board system named JAG-channel. He is now having hard time to add a new feature there --- threaded view.
</p>
<p>Like many other bulletin board systems, JAG-channel is thread-based. Here a thread (also called a topic) refers to a single conversation with a co... |
p00823 |
<H1><font color="#000">Problem E:</font> Molecular Formula</H1>
<p>
Your mission in this problem is to write a computer program that manipulates molecular for-
mulae in <i>virtual chemistry</i>. As in real chemistry, each molecular formula represents a molecule
consisting of one or more atoms. However, it may not hav... |
p04026 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given a string <var>t</var>, we will call it <em>unbalanced</em> if and only if the length of <var>t</var> is at least <var>2</var>, and more than half of the letters in <var>t</var> are the same. For e... |
p01224 |
<h1><font color="#000">Problem B:</font> 完全数</h1>
<p>
ある整数 <var>N</var> に対し,その数自身を除く約数の和を <var>S</var>
とする.
<var>N</var> = <var>S</var> のとき
<var>N</var> は完全数 (perfect number),
<var>N</var> > <var>S</var> のとき
<var>N</var> は不足数 (deficient number),
<var>N</var> < <var>S</var> のとき
... |
p03219 | <span class="lang-en">
<p>Score: <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a train going from Station <var>A</var> to Station <var>B</var> that costs <var>X</var> yen (the currency of Japan).</p>
<p>Also, there is a bus going from Station <var>B</var> to Station <var>C... |
p01674 |
<h2>H - Rings</h2>
<h3>Problem Statement</h3>
<p>
There are two circles with radius 1 in 3D space. Please check two circles are connected as chained rings.
</p>
<h3>Input</h3>
<p>
The input is formatted as follows.
</p>
<pre>
<var>{c_x}_1</var> <var>{c_y}_1</var> <var>{c_z}_1</var>
<var>{v_x}_{1,1}</var> <var>{v_... |
p03649 | <span class="lang-en">
<p>Score : <var>600</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have a sequence of length <var>N</var> consisting of non-negative integers. Consider performing the following operation on this sequence until the largest element in this sequence becomes <var>N-1</v... |
p00966 |
<script type="text/x-mathjax-config">
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], skipTags: ["script","noscript","style","textarea","code"], processEscapes: true }});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config... |
p02408 | <H1>Finding Missing Cards</H1>
<p>
Taro is going to play a card game. However, now he has only <var>n</var> cards, even though there should be 52 cards (he has no Jokers).
</p>
<p>
The 52 cards include 13 ranks of each of the four suits: spade, heart, club and diamond.
</p>
<H2>Input</H2>
<p>
In the first line,... |
p00435 |
<H1>シーザー暗号</H1>
<h2>問題</h2>
<p>
ガイウス・ユリウス・カエサル(Gaius Julius Caesar),英語読みでジュリアス・シーザー(Julius Caesar)は,古代ローマの軍人であり政治家である.カエサルは,秘密の手紙を書くときに, 'A' を 'D' に, 'B' を 'E' に, 'C' を 'F' に,というように3つずらして表記したという記録が残っている.
</p>
<p>
大文字のアルファベット26文字だけからなる文字列を,カエサルがしたように3文字ずつずらす変換を施し得られた文字列がある.このような文字列を元の文字列に戻すプログラムを作成せよ.
</p>
<p>
各文字の変... |
p02058 | <h2>G: Tree</h2>
<h3>問題</h3>
<p><var>N</var> 頂点からなる木が与えられます。木の各頂点には <var>1</var> から <var>N</var> の番号が割り振られています。また、<var>N−1</var> 本の辺のうち、 <var>i\ (= 1, 2, ..., N-1)</var> 本目の辺は頂点 <var>u_i</var> と頂点 <var>v_i</var> とを結んでいます。</p>
<p>この木の <var>K</var> 個の空でない部分グラフの組であって、各部分グラフがいずれも連結で、どの二つの相異なる部分グラフも頂点を共有しないものの個数を求めるプログラムを... |
p00065 |
<H1>取引</H1>
<p>
取引先の顧客番号と取引日を月ごとに記録したデータがあります。今月のデータと先月のデータを読み込んで、先月から2ヶ月連続で取引のある会社の顧客番号と取引のあった回数を出力するプログラムを作成してください。ただし、月々の取引先数は 1,000 社以内です。
</p>
<H2>Input</H2>
<p>
今月のデータと、先月のデータが1行の空行で区切られて与えられます。それぞれのデータは以下のような形式で与えられます。
</p>
<pre>
<var>c<sub>1</sub></var>,<var>d<sub>1</sub></var>
<var>c<sub>2</sub></var>,<... |
p03560 | <span class="lang-en">
<p>Score : <var>700</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Find the smallest possible sum of the digits in the decimal notation of a positive multiple of <var>K</var>.</p>
</section>
</div>
<div class="part">
<section>
<h3>Constraints</h3><ul>
<li><var>2 \leq K... |
p03130 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are four towns, numbered <var>1,2,3</var> and <var>4</var>.
Also, there are three roads. The <var>i</var>-th road connects different towns <var>a_i</var> and <var>b_i</var> bidirectionally.
No two... |
p03999 | <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 digits between <code>1</code> and <code>9</code>, inclusive.
You can insert the letter <code>+</code> into some of the positions (possibly none) between... |
p02371 |
<H1>Diameter of a Tree</H2>
<br/>
<p>
Given a tree <var>T</var> with non-negative weight, find the diameter of the tree.
</p>
<p>
The diameter of a tree is the maximum distance between two nodes in a tree.
</p>
<H2>Input</H2>
<pre>
<var>n</var>
<var>s<sub>1</sub></var> <var>t<sub>1</sub></var> <var>w<sub>1</sub></... |
p03833 | <span class="lang-en">
<p>Score : <var>1000</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> barbecue restaurants along a street.
The restaurants are numbered <var>1</var> through <var>N</var> from west to east, and the distance between restaurant <var>i</var> and restau... |
p02721 | <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Takahashi has decided to work on <var>K</var> days of his choice from the <var>N</var> days starting with tomorrow.</p>
<p>You are given an integer <var>C</var> and a string <var>S</var>. Takahashi will... |
p00209 |
<H1>写真に写っている景色は?</H1>
<p>
A 君は会津に観光にやってきました。宿泊したホテルの窓からは会津盆地が一望できます。景色を眺めていると、床に写真の切れ端が落ちているのに気がつきました。どうやら窓から外の景色を撮ったようです。「どの辺りを撮ったのかな」と、A 君は窓の外の景色と写真が同じ大きさになるように写真をかざして、写真と窓の外の景色が一致する場所を探し始めました。
</p>
<p>
それでは、A 君がやっていることをコンピュータでやってみましょう。窓の外の景色を <var>n × n</var> マスの正方形に分割します (<var>n</var> を景色の大きさと呼びます)。各マス... |
p02234 |
<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>Matrix-chain Multiplication... |
p03976 | <span class="lang-en">
<p>Score : <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<blockquote>
<p>
Kyoto University Programming Contest is a programming contest voluntarily held by some Kyoto University students.
This contest is abbreviated as <b>K</... |
p00659 |
<H1>Problem A: Popularity Estimation</H1>
<p>
あなたはとあるアニメーション制作会社の企画部長である。昨今のアニメーション制作会社が制作するものは、アニメーションそのものにとどまらない。関連商品、例えば登場キャラクターのフィギュアやキャラクターソングCDなども、重要な収益源なのである。この収益をどれだけ伸ばせるかは、ひとえに企画部長のあなたにかかっているのであった。
</p>
<p>
当たり前のことだが、こういった関連商品は闇雲に発売すればいいというものではない。商品の開発には多くの時間と予算が必要なためだ。アニメの登場キャラクターのフィギュアを発売するにしても、多くの売上が見込まれ... |
p02664 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>For a string <var>S</var> consisting of the uppercase English letters <code>P</code> and <code>D</code>, let the <em>doctoral and postdoctoral quotient</em> of <var>S</var> be the total number of occurr... |
p03425 | <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. The name of the <var>i</var>-th person is <var>S_i</var>.</p>
<p>We would like to choose three people so that the following conditions are met:</p>
<ul>
<li>The name of ev... |
p01418 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<H1>Sleeping Time</H1>
<p>
Miki is a high school student.
She has a part time job, so she cannot take enough sleep on weekdays.
She wants to take good sleep on holidays, but she doesn't know the best length of sleeping time for her.
She is now trying t... |
p03075 | <span class="lang-en">
<p>Score: <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>In AtCoder city, there are five antennas standing in a straight line. They are called Antenna <var>A, B, C, D</var> and <var>E</var> from west to east, and their coordinates are <var>a, b, c, d</var> a... |
p01048 |
<h1>Divisor</h1>
<h2>Problem</h2>
<p>
12以下の自然数 <var>N</var> が与えられるので、約数の個数がちょうど <var>N</var> 個であるような最小の自然数を求めよ。
</p>
<h2>Input</h2>
<p>
1つの自然数 <var>N</var> が 1 行で与えられる。
</p>
<h2>Constraints</h2>
<ul>
<li>1 ≤ <var>N</var> ≤ 12</li>
</ul>
<h2>Output</h2>
<p>
約数の個数がちょうど <var>N</var> 個であるような最小の自然数を1行に出力せよ。
</p... |
p00835 |
<H1><font color="#000">Problem I:</font> Crossing Prisms</H1>
<p>
Prof. Bocchan is a mathematician and a sculptor. He likes to create sculptures with mathematics.
</p>
<p>
His style to make sculptures is very unique. He uses two identical prisms. Crossing them at right
angles, he makes a polyhedron that is their inte... |
p02808 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>There are <var>N</var> children, numbered <var>1,2,\ldots,N</var>.
In the next <var>K</var> days, we will give them some cookies.
In the <var>i</var>-th day, we will choose <var>a_i</var> children amon... |
p01727 |
<p>プログラミングコンテストの合宿で出す問題のアイディアが出ずに困っていたイクタ君は、ある日友人に相談した。
</p>
<p>イクタ君「こういうアルゴリズムを使わないと解けないような問題が出したいんですけど、なにかありませんかね?」
</p>
<p>友人「それではこういうものを考えたらいいんじゃないですか」
</p>
<p>このようにしてその友人は以下のような問題の原案となるアイデアを考えてくれた。
</p>
<p>2進数<var>A,B</var>が与えられた時、以下の様なクエリを処理せよ。
<ul>
<li> 出力クエリ: max{<var>x</var> を2進数で表したときの、1の数 | <var>A &l... |
p01377 |
<div>
<h1 class="title">問題 B : (iwi)</h1>
<p>20XX 年の今,G○○gle 社の世界的な支配により,人々のコミュニケーションは限られており,
例えば,自由に人と情報をやりとりすることは基本的に許されていない.
特に,過去にプログラミングコンテストで名を馳せた強豪たちは,危険と判断され,
お互いバラバラにされ,密かに注意深く監視されているという.</p>
<p>自分も,そんな一人であった,ような気がする.
しかし実は,自分は記憶を失ってしまっているのだ.
自分が何と名乗っていたか,それすらも思い出せない.
'i' とか 'w' とか括弧とかを使っていた気がするが,
それっぽいものを書... |
p00136 |
<H1>度数分布</H1>
<p>
健康診断で生徒の身長を計測しました。身長のデータを入力とし、度数分布を作成して出力するプログラムを作成してください。度数分布の階級は 5 cm 刻みの 6 つの階級とし、度数は人数を *(半角アスタリスク)で表示します。ただし、その階級の度数(人数)が 0 の場合、階級の見出しのみを出力してください。
</p>
<H2>Input</H2>
<p>
入力は以下の形式で与えられます。
</p>
<pre>
<var>n</var>
<var>h<sub>1</sub></var>
<var>h<sub>2</sub></var>
:
<var>h<sub>n</sub></var>
<... |
p00566 | <h1>幹線道路 (Trunk Road)</h1>
<h2>問題文</h2>
<p>
JOI 市は,東西方向にまっすぐに伸びる <var>H</var> 本の道路と,南北方向にまっすぐに伸びる <var>W</var> 本の道路によって,碁盤の目の形に区分けされている.道路と道路の間隔は <var>1</var> である.JOI 市では,これら <var>H+W</var> 本の道路から,東西方向に <var>1</var> 本,南北方向に <var>1</var> 本,合計 <var>2</var> 本の道路を幹線道路として選ぶことになった.</p>
<p>
北から <var>i</var> 本目 (<var>1≦i≦H</... |
p00073 |
<H1>四角すいの表面積</H1>
<p>
1 辺が <var>x</var> の正方形を底面とする、高さ <var>h</var> の四角すいの表面積 <var>S</var> を出力するプログラムを作成して下さい。ただし、頂点と底面の中心を結ぶ線分は底面と直交しているとします。また、 <var>x</var>、<var>h</var> は 100 以下の正の整数とします。
</p>
<H3 class="bar">Input</H3>
<p>
複数のデータセットが与えられます。各データセットは以下の形式で与えられます。
</p>
<pre>
<var>x</var>
<var>h</var>
</pre>
<p... |
p00589 |
<!--
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>problem</title>
</head>
<body bgcolor="#FFFFFF">
<link rel="stylesheet" href="../problem_e.css" type="text/css" />
-->
<H1>Extraordinary Girl (II)</H1>
<p>
She loves e-mail so much! She sends e-mails by her cellular phone t... |
p00423 |
<H1><!-- Card Game--></H1>
<p>
A と B の 2 人のプレーヤーが, 0 から 9 までの数字が書かれたカードを使ってゲームを行う.最初に, 2 人は与えられた n 枚ずつのカードを,裏向きにして横一列に並べる.その後, 2 人は各自の左から 1 枚ずつカードを表向きにしていき,書かれた数字が大きい方のカードの持ち主が,その 2 枚のカードを取る.このとき,その 2 枚のカードに書かれた数字の合計が,カードを取ったプレーヤーの得点となるものとする.ただし,開いた 2 枚のカードに同じ数字が書かれているときには,引き分けとし,各プレーヤーが自分のカードを 1 枚ずつ取るものとする.
</p>
... |
p00970 | <h2>Emergency Evacuation</h2>
<p>
The Japanese government plans to increase the number of inbound tourists to forty million in the year 2020, and sixty million in 2030. Not only increasing touristic appeal but also developing tourism infrastructure further is indispensable to accomplish such numbers.
</p>
<p>
One... |
p01662 |
<h2>G - 自由研究</h2>
<p>
きつねの次郎は夏休みの自由研究で<em>最大独立集合問題</em>のアルゴリズムを考えている.
最大独立集合問題では,入力として無向グラフ <var>G=(V,E)</var> が与えられる.
<var>G</var> の各頂点が白または黒で塗られており,どの辺の端点も少なくとも一方が白く塗られているとき,黒い頂点集合のことを<em>独立集合</em>と呼ぶ.
例えば下図において,図の左部のようなグラフが与えられた時,図の中央部のように色を塗ると黒い頂点集合は独立集合になっているが,一方で図の右部のように色を塗った場合は黒い頂点集合は独立集合になっていない.
問題の目的は,要素数が... |
p01398 |
<script src="./IMAGE/varmath.js" charset="UTF-8"></script>
<h2>
Problem A: スワップ暗号
</h2>
<p>
R大学のとある2D好きな彼は、人に見られると赤面するような恥ずかしい文章を日頃からよく書いている。
そのため、第三者に自分の書いている文章を見られないために、彼が独自に考え出したスワップ暗号という手法により文章を暗号化している。
スワップ暗号では、次のようなステップを<i>N</i>回繰り返し、暗号化を行う。
</p>
<ol>
<li>
文字列の<i>a<sub>i</sub></i>番目と<i>b<sub>i</sub></i>番目を入れ... |
p01232 |
<h1><font color="#000">Problem J:</font> いにしえの数式</h1>
<p>
あなたの友人の考古学者が遺跡を発掘していた.
ある日,彼は怪しげな記号の羅列が刻まれている石盤を大量に発見した.
彼はこの大発見に大喜びし,すぐさま石盤に刻まれている記号の解読を始めた.
何週間にもわたる彼の解読の努力の結果,
どうやらこれらの石盤には変数・演算子・カッコの組み合わせで成り立っている
数式のようなものが刻まれていることがわかった.
発掘した石盤と遺跡に関わる文献を調べていくうちに彼はさらに,
それぞれの石盤で演算子の結合規則が異な... |
p04030 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Sig has built his own keyboard. Designed for ultimate simplicity, this keyboard only has <var>3</var> keys on it: the <code>0</code> key, the <code>1</code> key and the backspace key.</p>
<p>To begin wi... |
p02737 | <span class="lang-en">
<p>Score : <var>900</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Given are simple undirected graphs <var>X</var>, <var>Y</var>, <var>Z</var>, with <var>N</var> vertices each and <var>M_1</var>, <var>M_2</var>, <var>M_3</var> edges, respectively.
The vertices in <var>... |
p01818 |
<h2>Leapfrog</h2>
<h3>Problem Statement</h3>
<p><var>N</var> 個のマスが円状に並んでいる。マスは時計回りに <var>1,\ 2,\ </var> ... <var>,\ N</var> と番号が振られている。各 <var>i</var> (<var>1 ≤ i ≤ N−1</var>) について、<var>i</var> 番目のマスと <var>i+1</var> 番目のマスは隣り合う。また、<var>N</var> 番目のマスと <var>1</var> 番目のマスは隣り合う。</p>
<p>これらのうち <var>M</var> 個... |
p03825 | <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> zeros and <var>M</var> ones written on a blackboard.
Starting from this state, we will repeat the following operation: select <var>K</var> of the rational numbers written on the ... |
p02367 |
<H1>Bridges</H1>
<p>
Find bridges of an undirected graph <var>G(V, E)</var>.
</p>
<p>
A bridge (also known as a cut-edge) is an edge whose deletion increase the number of connected components.
</p>
<H2>Input</H2>
<pre>
<var>|V|</var> <var>|E|</var>
<var>s<sub>0</sub></var> <var>t<sub>0</sub></var>
<var>s<sub>1</su... |
p03126 | <span class="lang-en">
<p>Score : <var>200</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Katsusando loves omelette rice.</p>
<p>Besides, he loves crème brûlée, tenderloin steak and so on, and believes that these foods are all loved by everyone.</p>
<p>To prove that hypothesis, he conducted ... |
p03576 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>We have <var>N</var> points in a two-dimensional plane.<br/>
The coordinates of the <var>i</var>-th point <var>(1 \leq i \leq N)</var> are <var>(x_i,y_i)</var>.<br/>
Let us consider a rectangle whose si... |
p03599 | <span class="lang-en">
<p>Score : <var>300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is making sugar water in a beaker.
Initially, the beaker is empty. Snuke can perform the following four types of operations any number of times. He may choose not to perform some types of operatio... |
p03063 | <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> stones arranged in a row. Every stone is painted white or black.
A string <var>S</var> represents the color of the stones. The <var>i</var>-th stone from the left is white if the ... |
p03433 | <span class="lang-en">
<p>Score: <var>100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3>
<p>E869120 has <var>A</var> <var>1</var>-yen coins and infinitely many <var>500</var>-yen coins.<br/>
Determine if he can pay exactly <var>N</var> yen using only these coins.</p>
</section>
</div>
<div cla... |
p02388 |
<H1>X Cubic</H1>
<p>
Write a program which calculates the cube of a given integer <var>x</var>.
</p>
<H2>Input</H2>
<p>
An integer <var>x</var> is given in a line.
</p>
<H2>Output</H2>
<p>
Print the cube of <var>x</var> in a line.
</p>
<h2>Constraints</h2>
<ul>
<li> 1 ≤ <var>x</var> ≤ 100</li>
</ul>
<... |
p02672 | <span class="lang-en">
<p>Score : <var>1100</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p><strong>This is an interactive task.</strong></p>
<p>You have to guess a secret password <var>S</var>.
A password is a nonempty string whose length is at most <var>L</var>.
The characters of a passwo... |
p03960 | <span class="lang-en">
<p>Score : <var>800</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Mr. Takahashi has in his room an art object with <var>H</var> rows and <var>W</var> columns, made up of <var>H \times W</var> blocks.
Each block has a color represented by a lowercase English letter (<c... |
p02222 | <span class="lang">
<span class="lang-ja">
<h1>L: 木の彩色</h1>
<div class="part">
<section>
<h3>問題文</h3><p>モデューロさんは木の絵を描くのがとてもうまいです。</p>
<p>モデューロさんは長い年月をかけて頂点が $N$ 個である木の絵を書きました。
この木の頂点には $1$ から $N$ までの番号がついており、頂点 $a_i$ と $b_i$ $(1 \leq i \leq N-1)$ は直接辺でつながれています。
すべての頂点には色がまだ塗られていません。</p>
<p>モデューロさんが書いたこの木の絵はたくさんの人を感動させ... |
p00531 |
<h2>水道料金 (Water Rate)</h2>
<h2> 問題</h2>
<p>
JOI 君が住んでいる地域には水道会社が X 社と Y 社の 2 つある.2 つの会社の 1 ヶ月の水道料金は,1 ヶ月の水道の使用量に応じて次のように決まる.
</p>
<ul>
<li>X 社: 1 リットル あたり A 円かかる.</li>
<li>Y 社: 基本料金は B 円である.使用量が C リットル以下ならば,料金は基本料金 B 円のみがかかる.使用量が C リットルを超えると基本料金 B 円に加えて追加料金がかかる.追加料金は使用量が C リットルを 1 リットル超えるごとに D 円である.</li>
</ul>
<... |
p00161 |
<H1>体育祭Sport Meet</H1>
<p>
秋の体育祭が行われます。種目は徒競走、ボール運び、障害物競走、リレーの4種目です。参加チームは <var>n</var> チームで、この4種目の合計タイムが最も小さいチームが「優勝」、次に小さいチームが「準優勝」、そして、最下位より2番目のチームを「ブービー賞」として表彰したいと思います。
</p>
<p>
各チームの成績を入力として、「優勝」、「準優勝」、「ブービー賞」のチームを出力するプログラムを作成してください。
ただし、チームにはそれぞれ 1 から <var>n</var> のチーム番号が割り当てられています。
</p>
<H2>Input</H2>
<p... |
p01320 |
<h1><font color="#000">Problem G:</font> Magical Island 2</h1>
<!--
<h3><U>魔法島物語2</U></h3>
-->
<p>まだ魔法があたりまえのように存在した時代である.ある魔導士の一族は,魔力によって作られた正方形の形の島に住んでいた.</p>
<p>ある時,この島に危機が訪れた.帝国が大陸間弾道魔導ミサイルを開発し,この島を照準に合わせてきたのである.この世界の魔法は地属性,水属性,火属性,風属性などに分類でき,魔導ミサイルもその四つの属性のいずれかに属していた.島の四隅にはそれぞれ地の水晶,水の水晶,火の水晶,風の水晶が配置されていて,水晶に... |
p00862 |
<H1><font color="#000">Problem I:</font> Most Distant Point from the Sea</H1>
<p>
The main land of Japan called Honshu is an island surrounded by the sea. In such an island, it
is natural to ask a question: "Where is the most distant point from the sea?" The answer to
this question for Honshu was found in 1996. The m... |
p01770 |
<h1 id="arojams-mask-ムジュラの仮面">E : Arojam's Mask / 仮面</h1>
<h2 id="問題文">問題文</h2>
<p>あなたは勇者である。勇者が旅をしている世界は <var>N</var> 個の街と、異なる街同士を結ぶ <var>M</var> 本の道からなる。道 <var>i</var> は街 <var>a_i</var> と街 <var>b_i</var> を結び、双方向に移動可能である。</p>
<p>街 <var>S</var> から出発し、街 <var>T</var> に移動することが勇者の目的である。 <var>S,T</var> は異なる街である。勇者は <... |
p03258 | <span class="lang-en">
<p>Score : <var>1300</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There is a string <var>s</var> consisting of <code>a</code> and <code>b</code>.
Snuke can perform the following two kinds of operation any number of times in any order:</p>
<ul>
<li>Choose an occurrenc... |
p01265 |
<H1><font color="#000">Problem F:</font> Ninja Legend</H1>
<p>
Ninjas are professional spies in the Middle Age of Japan. They have been popular in movies and games
as they have been described with extraordinary physical abilities and unrealistic abilities.
</p>
<p>
You are absorbed in one of ninja games, <i>Ninja Leg... |
p00927 |
<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 D:
Space Golf
</h2>
<p... |
p03608 | <span class="lang-en">
<p>Score : <var>400</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>There are <var>N</var> towns in the State of Atcoder, connected by <var>M</var> bidirectional roads.</p>
<p>The <var>i</var>-th road connects Town <var>A_i</var> and <var>B_i</var> and has a length of <... |
p01635 |
<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 B: Time Complexity</h1>
<p class="ndo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.