Datasets:
Upload 3869 files
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- .gitattributes +2 -0
- datasets/problem_descriptions/p00001.html +81 -0
- datasets/problem_descriptions/p00002.html +43 -0
- datasets/problem_descriptions/p00003.html +44 -0
- datasets/problem_descriptions/p00004.html +53 -0
- datasets/problem_descriptions/p00005.html +40 -0
- datasets/problem_descriptions/p00006.html +31 -0
- datasets/problem_descriptions/p00007.html +35 -0
- datasets/problem_descriptions/p00008.html +40 -0
- datasets/problem_descriptions/p00009.html +39 -0
- datasets/problem_descriptions/p00010.html +51 -0
- datasets/problem_descriptions/p00011.html +75 -0
- datasets/problem_descriptions/p00012.html +68 -0
- datasets/problem_descriptions/p00013.html +90 -0
- datasets/problem_descriptions/p00014.html +74 -0
- datasets/problem_descriptions/p00015.html +66 -0
- datasets/problem_descriptions/p00016.html +85 -0
- datasets/problem_descriptions/p00017.html +54 -0
- datasets/problem_descriptions/p00018.html +32 -0
- datasets/problem_descriptions/p00019.html +31 -0
- datasets/problem_descriptions/p00020.html +32 -0
- datasets/problem_descriptions/p00021.html +48 -0
- datasets/problem_descriptions/p00022.html +75 -0
- datasets/problem_descriptions/p00023.html +57 -0
- datasets/problem_descriptions/p00024.html +55 -0
- datasets/problem_descriptions/p00025.html +74 -0
- datasets/problem_descriptions/p00026.html +76 -0
- datasets/problem_descriptions/p00027.html +51 -0
- datasets/problem_descriptions/p00028.html +50 -0
- datasets/problem_descriptions/p00029.html +44 -0
- datasets/problem_descriptions/p00030.html +48 -0
- datasets/problem_descriptions/p00031.html +55 -0
- datasets/problem_descriptions/p00032.html +58 -0
- datasets/problem_descriptions/p00033.html +46 -0
- datasets/problem_descriptions/p00034.html +59 -0
- datasets/problem_descriptions/p00035.html +64 -0
- datasets/problem_descriptions/p00036.html +223 -0
- datasets/problem_descriptions/p00037.html +79 -0
- datasets/problem_descriptions/p00038.html +88 -0
- datasets/problem_descriptions/p00039.html +72 -0
- datasets/problem_descriptions/p00040.html +72 -0
- datasets/problem_descriptions/p00041.html +53 -0
- datasets/problem_descriptions/p00042.html +86 -0
- datasets/problem_descriptions/p00043.html +67 -0
- datasets/problem_descriptions/p00044.html +45 -0
- datasets/problem_descriptions/p00045.html +48 -0
- datasets/problem_descriptions/p00046.html +49 -0
- datasets/problem_descriptions/p00047.html +56 -0
- datasets/problem_descriptions/p00048.html +61 -0
- datasets/problem_descriptions/p00049.html +56 -0
.gitattributes
CHANGED
@@ -57,3 +57,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
57 |
# Video files - compressed
|
58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
57 |
# Video files - compressed
|
58 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
59 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
60 |
+
datasets/test.json filter=lfs diff=lfs merge=lfs -text
|
61 |
+
datasets/train.json filter=lfs diff=lfs merge=lfs -text
|
datasets/problem_descriptions/p00001.html
ADDED
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>List of Top 3 Hills</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
There is a data which provides heights (in meter) of mountains. The data is only for ten mountains.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<p>
|
9 |
+
Write a program which prints heights of the top three mountains in descending order.
|
10 |
+
</p>
|
11 |
+
|
12 |
+
<H2>Input</H2>
|
13 |
+
|
14 |
+
<pre>
|
15 |
+
Height of mountain 1
|
16 |
+
Height of mountain 2
|
17 |
+
Height of mountain 3
|
18 |
+
.
|
19 |
+
.
|
20 |
+
Height of mountain 10
|
21 |
+
</pre>
|
22 |
+
|
23 |
+
<h2>Constraints</h2>
|
24 |
+
|
25 |
+
<p>
|
26 |
+
0 ≤ height of mountain (integer) ≤ 10,000
|
27 |
+
</p>
|
28 |
+
|
29 |
+
<H2>Output</H2>
|
30 |
+
|
31 |
+
<pre>
|
32 |
+
Height of the 1st mountain
|
33 |
+
Height of the 2nd mountain
|
34 |
+
Height of the 3rd mountain
|
35 |
+
</pre>
|
36 |
+
|
37 |
+
<H2>Sample Input 1</H2>
|
38 |
+
<pre>
|
39 |
+
1819
|
40 |
+
2003
|
41 |
+
876
|
42 |
+
2840
|
43 |
+
1723
|
44 |
+
1673
|
45 |
+
3776
|
46 |
+
2848
|
47 |
+
1592
|
48 |
+
922
|
49 |
+
</pre>
|
50 |
+
|
51 |
+
<H2>Output for the Sample Input 1</H2>
|
52 |
+
|
53 |
+
<pre>
|
54 |
+
3776
|
55 |
+
2848
|
56 |
+
2840
|
57 |
+
</pre>
|
58 |
+
|
59 |
+
|
60 |
+
|
61 |
+
<H2>Sample Input 2</H2>
|
62 |
+
<pre>
|
63 |
+
100
|
64 |
+
200
|
65 |
+
300
|
66 |
+
400
|
67 |
+
500
|
68 |
+
600
|
69 |
+
700
|
70 |
+
800
|
71 |
+
900
|
72 |
+
900
|
73 |
+
</pre>
|
74 |
+
|
75 |
+
<H2>Output for the Sample Input 2</H2>
|
76 |
+
|
77 |
+
<pre>
|
78 |
+
900
|
79 |
+
900
|
80 |
+
800
|
81 |
+
</pre>
|
datasets/problem_descriptions/p00002.html
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Digit Number</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Write a program which computes the digit number of sum of two integers <var>a</var> and <var>b</var>.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<H2>Input</H2>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
There are several test cases. Each test case consists of two non-negative integers <var>a</var> and <i>b</i> which are separeted by a space in a line. The input terminates with EOF.
|
12 |
+
</p>
|
13 |
+
|
14 |
+
<h2>Constraints</h2>
|
15 |
+
|
16 |
+
<ul>
|
17 |
+
<li>0 ≤ <var>a</var>, <var>b</var> ≤ 1,000,000</li>
|
18 |
+
<li>The number of datasets ≤ 200</li>
|
19 |
+
</ul>
|
20 |
+
|
21 |
+
<H2>Output</H2>
|
22 |
+
|
23 |
+
<p>
|
24 |
+
Print the number of digits of <var>a</var> + <var>b</var> for each data set.
|
25 |
+
</p>
|
26 |
+
|
27 |
+
<H2>Sample Input</H2>
|
28 |
+
|
29 |
+
<pre>
|
30 |
+
5 7
|
31 |
+
1 99
|
32 |
+
1000 999
|
33 |
+
</pre>
|
34 |
+
|
35 |
+
<H2>Output for the Sample Input</H2>
|
36 |
+
|
37 |
+
<pre>
|
38 |
+
2
|
39 |
+
3
|
40 |
+
4
|
41 |
+
</pre>
|
42 |
+
|
43 |
+
|
datasets/problem_descriptions/p00003.html
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Is it a Right Triangle?</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Write a program which judges wheather given length of three side form a right triangle. Print "<span>YES</span>" if the given sides (integers) form a right triangle, "<span>NO</span>" if not so.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<H2>Input</H2>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
Input consists of several data sets. In the first line, the number of data set, <var>N</var> is given. Then, <var>N</var> lines follow, each line corresponds to a data set. A data set consists of three integers separated by a single space.
|
12 |
+
</p>
|
13 |
+
|
14 |
+
<h2>Constraints</h2>
|
15 |
+
|
16 |
+
<ul>
|
17 |
+
<li> 1 ≤ length of the side ≤ 1,000</li>
|
18 |
+
<li> <var>N</var> ≤ 1,000</li>
|
19 |
+
</ul>
|
20 |
+
|
21 |
+
|
22 |
+
<H2>Output</H2>
|
23 |
+
|
24 |
+
<p>
|
25 |
+
For each data set, print "<span>YES</span>" or "<span>NO</span>".
|
26 |
+
</p>
|
27 |
+
|
28 |
+
<H2>Sample Input</H2>
|
29 |
+
<pre>
|
30 |
+
3
|
31 |
+
4 3 5
|
32 |
+
4 3 6
|
33 |
+
8 8 8
|
34 |
+
</pre>
|
35 |
+
|
36 |
+
<H2>Output for the Sample Input</H2>
|
37 |
+
|
38 |
+
<pre>
|
39 |
+
YES
|
40 |
+
NO
|
41 |
+
NO
|
42 |
+
</pre>
|
43 |
+
|
44 |
+
|
datasets/problem_descriptions/p00004.html
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Simultaneous Equation</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Write a program which solve a simultaneous equation:<br>
|
6 |
+
<br>
|
7 |
+
<var> ax + by = c</var><br>
|
8 |
+
<var> dx + ey = f</var><br>
|
9 |
+
<br>
|
10 |
+
|
11 |
+
The program should print <var>x</var> and <var>y</var> for given <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>, <var>e</var> and <var>f</var> (-1,000 ≤ <var>a, b, c, d, e, f</var> ≤ 1,000). You can suppose that given equation has a unique solution.
|
12 |
+
</p>
|
13 |
+
|
14 |
+
|
15 |
+
<H2>Input</H2>
|
16 |
+
|
17 |
+
<p>
|
18 |
+
The input consists of several data sets, 1 line for each data set. In a data set, there will be <var>a, b, c, d, e, f</var> separated by a single space. The input terminates with EOF.
|
19 |
+
</p>
|
20 |
+
|
21 |
+
<H2>Output</H2>
|
22 |
+
|
23 |
+
<p>
|
24 |
+
For each data set, print <var>x</var> and <var>y</var> separated by a single space. Print the solution to three places of decimals. Round off the solution to three decimal places.
|
25 |
+
</p>
|
26 |
+
|
27 |
+
<H2>Sample Input 1</H2>
|
28 |
+
<pre>
|
29 |
+
1 2 3 4 5 6
|
30 |
+
2 -1 -2 -1 -1 -5
|
31 |
+
</pre>
|
32 |
+
|
33 |
+
<H2>Output for the Sample Input 1</H2>
|
34 |
+
<pre>
|
35 |
+
-1.000 2.000
|
36 |
+
1.000 4.000
|
37 |
+
</pre>
|
38 |
+
|
39 |
+
<H2>Sample Input 2</H2>
|
40 |
+
|
41 |
+
<pre>
|
42 |
+
2 -1 -3 1 -1 -3
|
43 |
+
2 -1 -3 -9 9 27
|
44 |
+
</pre>
|
45 |
+
|
46 |
+
<H2>Output for the Sample Input 2</H2>
|
47 |
+
|
48 |
+
<pre>
|
49 |
+
0.000 3.000
|
50 |
+
0.000 3.000
|
51 |
+
</pre>
|
52 |
+
|
53 |
+
|
datasets/problem_descriptions/p00005.html
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>GCD and LCM</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
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>.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<H2>Input</H2>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
Input consists of several data sets. Each data set contains <var>a</var> and <var>b</var> separated by a single space in a line. The input terminates with EOF.
|
12 |
+
</p>
|
13 |
+
|
14 |
+
<h2>Constraints</h2>
|
15 |
+
|
16 |
+
<ul>
|
17 |
+
<li> 0 < <var>a, b</var> ≤ 2,000,000,000</li>
|
18 |
+
<li> LCM(<var>a, b</var>) ≤ 2,000,000,000</li>
|
19 |
+
<li> The number of data sets ≤ 50</li>
|
20 |
+
</ul>
|
21 |
+
|
22 |
+
<H2>Output</H2>
|
23 |
+
|
24 |
+
<p>
|
25 |
+
For each data set, print GCD and LCM separated by a single space in a line.
|
26 |
+
</p>
|
27 |
+
|
28 |
+
<H2>Sample Input</H2>
|
29 |
+
<pre>
|
30 |
+
8 6
|
31 |
+
50000000 30000000
|
32 |
+
</pre>
|
33 |
+
|
34 |
+
<H2>Output for the Sample Input</H2>
|
35 |
+
|
36 |
+
<pre>
|
37 |
+
2 24
|
38 |
+
10000000 150000000
|
39 |
+
</pre>
|
40 |
+
|
datasets/problem_descriptions/p00006.html
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Reverse Sequence</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Write a program which reverses a given string <var>str</var>.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<H2>Input</H2>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
<var>str</var> (the size of <var>str</var> ≤ 20) is given in a line.
|
12 |
+
</p>
|
13 |
+
|
14 |
+
<H2>Output</H2>
|
15 |
+
|
16 |
+
<p>
|
17 |
+
Print the reversed <var>str</var> in a line.
|
18 |
+
</p>
|
19 |
+
|
20 |
+
<H2>Sample Input</H2>
|
21 |
+
<pre>
|
22 |
+
w32nimda
|
23 |
+
</pre>
|
24 |
+
|
25 |
+
<H2>Output for the Sample Input</H2>
|
26 |
+
|
27 |
+
<pre>
|
28 |
+
admin23w
|
29 |
+
</pre>
|
30 |
+
|
31 |
+
|
datasets/problem_descriptions/p00007.html
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Debt Hell</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Your friend who lives in undisclosed country is involved in debt. He is borrowing 100,000-yen from a loan shark. The loan shark adds 5% interest of the debt and rounds it to the nearest 1,000 above week by week.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<p>
|
9 |
+
Write a program which computes the amount of the debt in <var>n</var> weeks.
|
10 |
+
</p>
|
11 |
+
|
12 |
+
<H2>Input</H2>
|
13 |
+
|
14 |
+
<p>
|
15 |
+
An integer <var>n</var> (0 ≤ <var>n</var> ≤ 100) is given in a line.
|
16 |
+
</p>
|
17 |
+
|
18 |
+
<H2>Output</H2>
|
19 |
+
|
20 |
+
<p>
|
21 |
+
Print the amout of the debt in a line.
|
22 |
+
</p>
|
23 |
+
|
24 |
+
<H2>Sample Input</H2>
|
25 |
+
|
26 |
+
<pre>
|
27 |
+
5
|
28 |
+
</pre>
|
29 |
+
|
30 |
+
<H2>Output for the Sample Input</H2>
|
31 |
+
|
32 |
+
<pre>
|
33 |
+
130000
|
34 |
+
</pre>
|
35 |
+
|
datasets/problem_descriptions/p00008.html
ADDED
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Sum of 4 Integers</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Write a program which reads an integer <var>n</var> and identifies the number of combinations of <var>a, b, c</var> and <var>d</var> (0 ≤ <var>a, b, c, d</var> ≤ 9) which meet the following equality:<br>
|
6 |
+
<br>
|
7 |
+
<var>a + b + c + d = n</var><br>
|
8 |
+
<br>
|
9 |
+
|
10 |
+
For example, for <var>n</var> = 35, we have 4 different combinations of (<var>a, b, c, d</var>): (<var>8, 9, 9, 9</var>), (<var>9, 8, 9, 9</var>), (<var>9, 9, 8, 9</var>), and (<var>9, 9, 9, 8</var>).
|
11 |
+
</p>
|
12 |
+
|
13 |
+
<H2>Input</H2>
|
14 |
+
|
15 |
+
<p>
|
16 |
+
The input consists of several datasets. Each dataset consists of <var>n</var> (1 ≤ <var>n</var> ≤ 50) in a line. The number of datasets is less than or equal to 50.
|
17 |
+
</p>
|
18 |
+
|
19 |
+
<H2>Output</H2>
|
20 |
+
|
21 |
+
<p>
|
22 |
+
Print the number of combination in a line.
|
23 |
+
</p>
|
24 |
+
|
25 |
+
<H2>Sample Input</H2>
|
26 |
+
|
27 |
+
<pre>
|
28 |
+
35
|
29 |
+
1
|
30 |
+
</pre>
|
31 |
+
|
32 |
+
<H2>Output for the Sample Input</H2>
|
33 |
+
|
34 |
+
<pre>
|
35 |
+
4
|
36 |
+
4
|
37 |
+
</pre>
|
38 |
+
|
39 |
+
|
40 |
+
|
datasets/problem_descriptions/p00009.html
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Prime Number</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Write a program which reads an integer <var>n</var> and prints the number of prime numbers which are less than or equal to <var>n</var>. A prime number is a natural number which has exactly two distinct natural number divisors: 1 and itself. For example, the first four prime numbers are: 2, 3, 5 and 7.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<H2>Input</H2>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
Input consists of several datasets. Each dataset has an integer <var>n</var> (1 ≤ <var>n</var> ≤ 999,999) in a line.
|
12 |
+
</p>
|
13 |
+
|
14 |
+
<p>
|
15 |
+
The number of datasets is less than or equal to 30.
|
16 |
+
</p>
|
17 |
+
|
18 |
+
<H2>Output</H2>
|
19 |
+
|
20 |
+
<p>
|
21 |
+
For each dataset, prints the number of prime numbers.
|
22 |
+
</p>
|
23 |
+
|
24 |
+
<H2>Sample Input</H2>
|
25 |
+
|
26 |
+
<pre>
|
27 |
+
10
|
28 |
+
3
|
29 |
+
11
|
30 |
+
</pre>
|
31 |
+
|
32 |
+
<H2>Output for the Sample Input</H2>
|
33 |
+
|
34 |
+
<pre>
|
35 |
+
4
|
36 |
+
2
|
37 |
+
5
|
38 |
+
</pre>
|
39 |
+
|
datasets/problem_descriptions/p00010.html
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<script type="text/x-mathjax-config">
|
3 |
+
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
|
4 |
+
</script>
|
5 |
+
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
|
6 |
+
</script>
|
7 |
+
|
8 |
+
<H1>Circumscribed Circle of A Triangle.</H1>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
Write a program which prints the central coordinate $(p_x, p_y)$ and the radius $r$ of a circumscribed circle of a triangle which is constructed by three points $(x_1, y_1)$, $(x_2, y_2)$ and $(x_3, y_3)$ on the plane surface.
|
12 |
+
</p>
|
13 |
+
|
14 |
+
<H2>Input</H2>
|
15 |
+
|
16 |
+
<p>
|
17 |
+
Input consists of several datasets. In the first line, the number of datasets $n$ is given. Each dataset consists of:<br/>
|
18 |
+
<br/>
|
19 |
+
$x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$<br/>
|
20 |
+
<br/>
|
21 |
+
|
22 |
+
in a line. All the input are real numbers.
|
23 |
+
</p>
|
24 |
+
|
25 |
+
<H2>Output</H2>
|
26 |
+
|
27 |
+
<p>
|
28 |
+
For each dataset, print $p_x$, $p_y$ and $r$ separated by a space in a line. Print the solution to three places of decimals. Round off the solution to three decimal places.
|
29 |
+
</p>
|
30 |
+
|
31 |
+
<h2>Constraints</h2>
|
32 |
+
|
33 |
+
<ul>
|
34 |
+
<li>$-100 \leq x_1, y_1, x_2, y_2, x_3, y_3 \leq 100$</li>
|
35 |
+
<li>$ n \leq 20$</li>
|
36 |
+
</ul>
|
37 |
+
|
38 |
+
<H2>Sample Input</H2>
|
39 |
+
|
40 |
+
<pre>
|
41 |
+
1
|
42 |
+
0.0 0.0 2.0 0.0 2.0 2.0
|
43 |
+
</pre>
|
44 |
+
|
45 |
+
<H2>Output for the Sample Input</H2>
|
46 |
+
|
47 |
+
<pre>
|
48 |
+
1.000 1.000 1.414
|
49 |
+
</pre>
|
50 |
+
|
51 |
+
|
datasets/problem_descriptions/p00011.html
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Drawing Lots</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Let's play Amidakuji.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<p>
|
9 |
+
In the following example, there are five vertical lines and four horizontal lines. The horizontal lines can intersect (jump across) the vertical lines.
|
10 |
+
</p>
|
11 |
+
|
12 |
+
<center>
|
13 |
+
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_amida1">
|
14 |
+
</center>
|
15 |
+
<br>
|
16 |
+
|
17 |
+
<p>
|
18 |
+
In the starting points (top of the figure), numbers are assigned to vertical lines in ascending order from left to right. At the first step, 2 and 4 are swaped by the first horizontal line which connects second and fourth vertical lines (we call this operation (2, 4)). Likewise, we perform (3, 5), (1, 2) and (3, 4), then obtain "4 1 2 5 3" in the bottom.
|
19 |
+
</p>
|
20 |
+
|
21 |
+
<p>
|
22 |
+
Your task is to write a program which reads the number of vertical lines <var>w</var> and configurations of horizontal lines and prints the final state of the Amidakuji. In the starting pints, numbers 1, 2, 3, ..., <var>w</var> are assigne to the vertical lines from left to right.
|
23 |
+
</p>
|
24 |
+
|
25 |
+
<H2>Input</H2>
|
26 |
+
|
27 |
+
<pre>
|
28 |
+
<var>w</var>
|
29 |
+
<var>n</var>
|
30 |
+
<var>a<sub>1</sub></var>,<var>b<sub>1</sub></var>
|
31 |
+
<var>a<sub>2</sub></var>,<var>b<sub>2</sub></var>
|
32 |
+
.
|
33 |
+
.
|
34 |
+
<var>a<sub>n</sub></var>,<var>b<sub>n</sub></var>
|
35 |
+
</pre>
|
36 |
+
|
37 |
+
<p>
|
38 |
+
<var>w</var> (<var>w</var> ≤ 30) is the number of vertical lines. <var>n</var> (<var>n</var> ≤ 30) is the number of horizontal lines. A pair of two integers <var>a<sub>i</sub></var> and <var>b<sub>i</sub></var> delimited by a comma represents the <var>i</var>-th horizontal line.
|
39 |
+
</p>
|
40 |
+
|
41 |
+
<H2>Output</H2>
|
42 |
+
|
43 |
+
<p>
|
44 |
+
The number which should be under the 1st (leftmost) vertical line<br>
|
45 |
+
The number which should be under the 2nd vertical line<br>
|
46 |
+
:<br>
|
47 |
+
The number which should be under the <var>w</var>-th vertical line<br>
|
48 |
+
</p>
|
49 |
+
|
50 |
+
<H2>Sample Input</H2>
|
51 |
+
|
52 |
+
<pre>
|
53 |
+
5
|
54 |
+
4
|
55 |
+
2,4
|
56 |
+
3,5
|
57 |
+
1,2
|
58 |
+
3,4
|
59 |
+
</pre>
|
60 |
+
|
61 |
+
<H2>Output for the Sample Input</H2>
|
62 |
+
|
63 |
+
<pre>
|
64 |
+
4
|
65 |
+
1
|
66 |
+
2
|
67 |
+
5
|
68 |
+
3
|
69 |
+
</pre>
|
70 |
+
|
71 |
+
<!--
|
72 |
+
<H2>Hint</H2>
|
73 |
+
<a href="IMAGE1/lots.gif">Try it.</a>
|
74 |
+
-->
|
75 |
+
|
datasets/problem_descriptions/p00012.html
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<script type="text/x-mathjax-config">
|
3 |
+
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
|
4 |
+
</script>
|
5 |
+
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
|
6 |
+
</script>
|
7 |
+
|
8 |
+
|
9 |
+
<H1>A Point in a Triangle</H1>
|
10 |
+
|
11 |
+
<p>
|
12 |
+
There is a triangle formed by three points $(x_1, y_1)$, $(x_2, y_2)$, $(x_3, y_3)$ on a plain.
|
13 |
+
</p>
|
14 |
+
<p>
|
15 |
+
Write a program which prints "<span>YES</span>" if a point $P$ $(x_p, y_p)$ is in the triangle and "<span>NO</span>" if not.
|
16 |
+
</p>
|
17 |
+
|
18 |
+
<!--
|
19 |
+
<p>
|
20 |
+
You can suppose that P is never on the points nor sides of the triangle.
|
21 |
+
</p>
|
22 |
+
-->
|
23 |
+
|
24 |
+
|
25 |
+
<H2>Input</H2>
|
26 |
+
|
27 |
+
<p>
|
28 |
+
Input consists of several datasets. Each dataset consists of:<br/>
|
29 |
+
<br/>
|
30 |
+
$x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_p$ $y_p$<br/>
|
31 |
+
</p>
|
32 |
+
|
33 |
+
<p>
|
34 |
+
All the input are real numbers. Input ends with EOF. The number of datasets is less than or equal to 100.
|
35 |
+
</p>
|
36 |
+
|
37 |
+
<h2>Constraints</h2>
|
38 |
+
<p>
|
39 |
+
You can assume that:
|
40 |
+
</p>
|
41 |
+
|
42 |
+
<ul>
|
43 |
+
<li>$ -100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_p, y_p \leq 100$</li>
|
44 |
+
<li>1.0 $\leq$ Length of each side of a tringle</li>
|
45 |
+
<li>0.001 $\leq$ Distance between $P$ and each side of a triangle</li>
|
46 |
+
</ul>
|
47 |
+
|
48 |
+
<H2>Output</H2>
|
49 |
+
|
50 |
+
<p>
|
51 |
+
For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line.
|
52 |
+
</p>
|
53 |
+
|
54 |
+
<H2>Sample Input</H2>
|
55 |
+
|
56 |
+
<pre>
|
57 |
+
0.0 0.0 2.0 0.0 2.0 2.0 1.5 0.5
|
58 |
+
0.0 0.0 1.0 4.0 5.0 3.0 -1.0 3.0
|
59 |
+
</pre>
|
60 |
+
|
61 |
+
<H2>Output for the Sample Input</H2>
|
62 |
+
|
63 |
+
<pre>
|
64 |
+
YES
|
65 |
+
NO
|
66 |
+
</pre>
|
67 |
+
|
68 |
+
|
datasets/problem_descriptions/p00013.html
ADDED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Switching Railroad Cars</H1>
|
3 |
+
|
4 |
+
<center>
|
5 |
+
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_switchingRailroadCars">
|
6 |
+
</center>
|
7 |
+
<br>
|
8 |
+
|
9 |
+
<p>
|
10 |
+
This figure shows railway tracks for reshuffling cars. The rail tracks end in the bottom and the top-left rail track is used for the entrace and the top-right rail track is used for the exit. Ten cars, which have numbers from 1 to 10 respectively, use the rail tracks.
|
11 |
+
</p>
|
12 |
+
|
13 |
+
<p>
|
14 |
+
We can simulate the movement (comings and goings) of the cars as follow:
|
15 |
+
</p>
|
16 |
+
|
17 |
+
<ul>
|
18 |
+
<li>An entry of a car is represented by its number.</li>
|
19 |
+
<li>An exit of a car is represented by 0</li>
|
20 |
+
</ul>
|
21 |
+
|
22 |
+
|
23 |
+
<p>
|
24 |
+
For example, a sequence
|
25 |
+
</p>
|
26 |
+
|
27 |
+
<pre>
|
28 |
+
1
|
29 |
+
6
|
30 |
+
0
|
31 |
+
8
|
32 |
+
10
|
33 |
+
</pre>
|
34 |
+
|
35 |
+
<p>
|
36 |
+
demonstrates that car 1 and car 6 enter to the rail tracks in this order, car 6 exits from the rail tracks, and then car 8 and car 10 enter.
|
37 |
+
</p>
|
38 |
+
|
39 |
+
<p>
|
40 |
+
Write a program which simulates comings and goings of the cars which are represented by the sequence of car numbers. The program should read the sequence of car numbers and 0, and print numbers of cars which exit from the rail tracks in order. At the first, there are no cars on the rail tracks. You can assume that 0 will not be given when there is no car on the rail tracks.
|
41 |
+
</p>
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
<H2>Input</H2>
|
47 |
+
|
48 |
+
<pre>
|
49 |
+
car number
|
50 |
+
car number or 0
|
51 |
+
car number or 0
|
52 |
+
.
|
53 |
+
.
|
54 |
+
.
|
55 |
+
car number or 0
|
56 |
+
</pre>
|
57 |
+
|
58 |
+
<p>
|
59 |
+
The number of input lines is less than or equal to 100.
|
60 |
+
</p>
|
61 |
+
|
62 |
+
<H2>Output</H2>
|
63 |
+
|
64 |
+
<p>
|
65 |
+
For each 0, print the car number.
|
66 |
+
</p>
|
67 |
+
|
68 |
+
<H2>Sample Input</H2>
|
69 |
+
|
70 |
+
<pre>
|
71 |
+
1
|
72 |
+
6
|
73 |
+
0
|
74 |
+
8
|
75 |
+
10
|
76 |
+
0
|
77 |
+
0
|
78 |
+
0
|
79 |
+
</pre>
|
80 |
+
|
81 |
+
<H2>Output for the Sample Input</H2>
|
82 |
+
|
83 |
+
<pre>
|
84 |
+
6
|
85 |
+
10
|
86 |
+
8
|
87 |
+
1
|
88 |
+
</pre>
|
89 |
+
|
90 |
+
|
datasets/problem_descriptions/p00014.html
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<script type="text/x-mathjax-config">
|
3 |
+
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
|
4 |
+
</script>
|
5 |
+
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
|
6 |
+
</script>
|
7 |
+
|
8 |
+
<H1>Integral</H1>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
Write a program which computes the area of a shape represented by the following three lines:<br/>
|
12 |
+
<br/>
|
13 |
+
$y = x^2$<br/>
|
14 |
+
$y = 0$<br/>
|
15 |
+
$x = 600$<br/>
|
16 |
+
<br/>
|
17 |
+
<!--<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF1"></center>-->
|
18 |
+
</p>
|
19 |
+
|
20 |
+
<p>
|
21 |
+
It is clear that the area is $72000000$, if you use an integral you learn in high school. On the other hand, we can obtain an approximative area of the shape by adding up areas of many rectangles in the shape as shown in the following figure:
|
22 |
+
</p>
|
23 |
+
|
24 |
+
<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integral"><br/>
|
25 |
+
$f(x) = x^2$<br/>
|
26 |
+
<br/>
|
27 |
+
</center>
|
28 |
+
<!--
|
29 |
+
<center>
|
30 |
+
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_integralF2">
|
31 |
+
</center>
|
32 |
+
-->
|
33 |
+
|
34 |
+
<p>
|
35 |
+
The approximative area $s$ where the width of the rectangles is $d$ is:<br/>
|
36 |
+
<br/>
|
37 |
+
area of rectangle where its width is $d$ and height is $f(d)$ $+$ <br/>
|
38 |
+
area of rectangle where its width is $d$ and height is $f(2d)$ $+$ <br/>
|
39 |
+
area of rectangle where its width is $d$ and height is $f(3d)$ $+$ <br/>
|
40 |
+
...<br/>
|
41 |
+
area of rectangle where its width is $d$ and height is $f(600 - d)$ <br/>
|
42 |
+
</p>
|
43 |
+
|
44 |
+
<p>
|
45 |
+
The more we decrease $d$, the higer-precision value which is close to $72000000$ we could obtain. Your program should read the integer $d$ which is a divisor of $600$, and print the area $s$.
|
46 |
+
</p>
|
47 |
+
|
48 |
+
<H2>Input</H2>
|
49 |
+
|
50 |
+
<p>
|
51 |
+
The input consists of several datasets. Each dataset consists of an integer $d$ in a line. The number of datasets is less than or equal to 20.
|
52 |
+
</p>
|
53 |
+
|
54 |
+
<H2>Output</H2>
|
55 |
+
|
56 |
+
<p>
|
57 |
+
For each dataset, print the area $s$ in a line.
|
58 |
+
</p>
|
59 |
+
|
60 |
+
<H2>Sample Input</H2>
|
61 |
+
|
62 |
+
<pre>
|
63 |
+
20
|
64 |
+
10
|
65 |
+
</pre>
|
66 |
+
|
67 |
+
<H2>Output for the Sample Input</H2>
|
68 |
+
|
69 |
+
<pre>
|
70 |
+
68440000
|
71 |
+
70210000
|
72 |
+
</pre>
|
73 |
+
|
74 |
+
|
datasets/problem_descriptions/p00015.html
ADDED
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>National Budget</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
A country has a budget of more than 81 trillion yen. We want to process such data, but conventional integer type which uses signed 32 bit can represent up to 2,147,483,647.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<p>
|
9 |
+
Your task is to write a program which reads two integers (more than or equal to zero), and prints a sum of these integers.
|
10 |
+
</p>
|
11 |
+
|
12 |
+
<p>
|
13 |
+
If given integers or the sum have more than 80 digits, print "overflow".
|
14 |
+
</p>
|
15 |
+
|
16 |
+
<H2>Input</H2>
|
17 |
+
|
18 |
+
<p>
|
19 |
+
Input consists of several datasets. In the first line, the number of datasets <var>N</var> (1 ≤ <var>N</var> ≤ 50) is given. Each dataset consists of 2 lines:
|
20 |
+
</p>
|
21 |
+
|
22 |
+
<pre>
|
23 |
+
The first integer
|
24 |
+
The second integer
|
25 |
+
</pre>
|
26 |
+
|
27 |
+
<p>
|
28 |
+
The integer has at most 100 digits.
|
29 |
+
</p>
|
30 |
+
|
31 |
+
<H2>Output</H2>
|
32 |
+
|
33 |
+
<p>
|
34 |
+
For each dataset, print the sum of given integers in a line.
|
35 |
+
</p>
|
36 |
+
|
37 |
+
<H2>Sample Input</H2>
|
38 |
+
|
39 |
+
<pre>
|
40 |
+
6
|
41 |
+
1000
|
42 |
+
800
|
43 |
+
9999999999999999999999999999999999999999
|
44 |
+
1
|
45 |
+
99999999999999999999999999999999999999999999999999999999999999999999999999999999
|
46 |
+
1
|
47 |
+
99999999999999999999999999999999999999999999999999999999999999999999999999999999
|
48 |
+
0
|
49 |
+
100000000000000000000000000000000000000000000000000000000000000000000000000000000
|
50 |
+
1
|
51 |
+
100000000000000000000000000000000000000000000000000000000000000000000000000000000
|
52 |
+
100000000000000000000000000000000000000000000000000000000000000000000000000000000
|
53 |
+
</pre>
|
54 |
+
|
55 |
+
<H2>Output for the Sample Input</H2>
|
56 |
+
|
57 |
+
<pre>
|
58 |
+
1800
|
59 |
+
10000000000000000000000000000000000000000
|
60 |
+
overflow
|
61 |
+
99999999999999999999999999999999999999999999999999999999999999999999999999999999
|
62 |
+
overflow
|
63 |
+
overflow
|
64 |
+
</pre>
|
65 |
+
|
66 |
+
|
datasets/problem_descriptions/p00016.html
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Treasure Hunt</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
When a boy was cleaning up after his grand father passing, he found an old paper:
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<center>
|
9 |
+
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure_en"><br>
|
10 |
+
</center>
|
11 |
+
<br/>
|
12 |
+
<!--
|
13 |
+
<center>
|
14 |
+
<table>
|
15 |
+
<tr>
|
16 |
+
<td align="top">
|
17 |
+
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_treasure">
|
18 |
+
</td>
|
19 |
+
<td align="top">
|
20 |
+
Stand facing to north from "Sanbonmatsu", and go according to the following steps. You will come across a treasure at the end point.<br>
|
21 |
+
<pre>
|
22 |
+
30, 10
|
23 |
+
50, -40
|
24 |
+
20, 15
|
25 |
+
.
|
26 |
+
.
|
27 |
+
</pre>
|
28 |
+
</td>
|
29 |
+
</tr>
|
30 |
+
</table>
|
31 |
+
</center>
|
32 |
+
-->
|
33 |
+
|
34 |
+
<p>
|
35 |
+
In addition, other side of the paper says that "go ahead a number of steps equivalent to the first integer, and turn clockwise by degrees equivalent to the second integer".
|
36 |
+
</p>
|
37 |
+
<p>
|
38 |
+
His grand mother says that Sanbonmatsu was standing at the center of town. However, now buildings are crammed side by side and people can not walk along exactly what the paper says in. Your task is to write a program which hunts for the treature on the paper.
|
39 |
+
</p>
|
40 |
+
|
41 |
+
<p>
|
42 |
+
For simplicity, 1 step is equivalent to 1 meter. Input consists of several pairs of two integers <var>d</var> (the first integer) and <var>t</var> (the second integer) separated by a comma. Input ends with "0, 0". Your program should print the coordinate (<var>x</var>, <var>y</var>) of the end point. There is the treature where x meters to the east and y meters to the north from the center of town.
|
43 |
+
</p>
|
44 |
+
|
45 |
+
<p>
|
46 |
+
You can assume that <var>d</var> ≤ 100 and -180 ≤ <var>t</var> ≤ 180.
|
47 |
+
</p>
|
48 |
+
|
49 |
+
<H2>Input</H2>
|
50 |
+
|
51 |
+
<p>
|
52 |
+
A sequence of pairs of integers <var>d</var> and <var>t</var> which end with "<span>0,0</span>".
|
53 |
+
</p>
|
54 |
+
|
55 |
+
<H2>Output</H2>
|
56 |
+
|
57 |
+
<p>
|
58 |
+
Print the integer portion of <var>x</var> and <var>y</var> in a line respectively.
|
59 |
+
</p>
|
60 |
+
|
61 |
+
<H2>Sample Input</H2>
|
62 |
+
|
63 |
+
<pre>
|
64 |
+
56,65
|
65 |
+
97,54
|
66 |
+
64,-4
|
67 |
+
55,76
|
68 |
+
42,-27
|
69 |
+
43,80
|
70 |
+
87,-86
|
71 |
+
55,-6
|
72 |
+
89,34
|
73 |
+
95,5
|
74 |
+
0,0
|
75 |
+
</pre>
|
76 |
+
|
77 |
+
<H2>Output for the Sample Input</H2>
|
78 |
+
|
79 |
+
<pre>
|
80 |
+
171
|
81 |
+
-302
|
82 |
+
</pre>
|
83 |
+
|
84 |
+
|
85 |
+
|
datasets/problem_descriptions/p00017.html
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Caesar Cipher</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
In cryptography, Caesar cipher is one of the simplest and most widely known encryption method. Caesar cipher is a type of substitution cipher in which each letter in the text is replaced by a letter some fixed number of positions down the alphabet. For example, with a shift of 1, 'a' would be replaced by 'b', 'b' would become 'c', 'y' would become 'z', 'z' would become 'a', and so on. In that case, a text:
|
6 |
+
<pre>
|
7 |
+
this is a pen
|
8 |
+
</pre>
|
9 |
+
<p>
|
10 |
+
is would become:
|
11 |
+
</p>
|
12 |
+
<pre>
|
13 |
+
uijt jt b qfo
|
14 |
+
</pre>
|
15 |
+
|
16 |
+
<p>
|
17 |
+
Write a program which reads a text encrypted by Caesar Chipher and prints the corresponding decoded text. The number of shift is secret and it depends on datasets, but you can assume that the decoded text includes any of the following words: "the", "this", or "that".
|
18 |
+
</p>
|
19 |
+
|
20 |
+
|
21 |
+
<H2>Input</H2>
|
22 |
+
<p>
|
23 |
+
Input consists of several datasets. Each dataset consists of texts in a line. Input ends with EOF. The text consists of lower-case letters, periods, space, and end-of-lines. Only the letters have been encrypted. A line consists of at most 80 characters.
|
24 |
+
</p>
|
25 |
+
|
26 |
+
<p>
|
27 |
+
You may assume that you can create one decoded text which includes any of "the", "this", or "that" from the given input text.
|
28 |
+
</p>
|
29 |
+
|
30 |
+
<p>
|
31 |
+
The number of datasets is less than or equal to 20.
|
32 |
+
</p>
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
<H2>Output</H2>
|
37 |
+
|
38 |
+
<p>
|
39 |
+
Print decoded texts in a line.
|
40 |
+
</p>
|
41 |
+
|
42 |
+
<H2>Sample Input</H2>
|
43 |
+
|
44 |
+
<pre>
|
45 |
+
xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.
|
46 |
+
</pre>
|
47 |
+
|
48 |
+
<H2>Output for the Sample Input</H2>
|
49 |
+
|
50 |
+
<pre>
|
51 |
+
this is the picture that i took in the trip.
|
52 |
+
</pre>
|
53 |
+
|
54 |
+
|
datasets/problem_descriptions/p00018.html
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Sorting Five Numbers</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Write a program which reads five numbers and sorts them in descending order.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<H2>Input</H2>
|
9 |
+
<p>
|
10 |
+
Input consists of five numbers <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var> and <var>e</var> (-100000 ≤ <var>a</var>, <var>b</var>, <var>c</var>, <var>d</var>,<var>e</var> ≤ 100000). The five numbers are separeted by a space.
|
11 |
+
</p>
|
12 |
+
|
13 |
+
<H2>Output</H2>
|
14 |
+
|
15 |
+
<p>
|
16 |
+
Print the ordered numbers in a line. Adjacent numbers should be separated by a space.
|
17 |
+
</p>
|
18 |
+
|
19 |
+
<H2>Sample Input</H2>
|
20 |
+
|
21 |
+
<pre>
|
22 |
+
3 6 9 7 5
|
23 |
+
</pre>
|
24 |
+
|
25 |
+
<H2>Output for the Sample Input</H2>
|
26 |
+
|
27 |
+
<pre>
|
28 |
+
9 7 6 5 3
|
29 |
+
</pre>
|
30 |
+
|
31 |
+
|
32 |
+
|
datasets/problem_descriptions/p00019.html
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Factorial</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Write a program which reads an integer <var>n</var> and prints the factorial of <var>n</var>. You can assume that <var>n</var> ≤ 20.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<H2>Input</H2>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
An integer <var>n</var> (1 ≤ <var>n</var> ≤ 20) in a line.
|
12 |
+
</p>
|
13 |
+
|
14 |
+
<H2>Output</H2>
|
15 |
+
|
16 |
+
<p>
|
17 |
+
Print the factorial of <var>n</var> in a line.
|
18 |
+
</p>
|
19 |
+
|
20 |
+
<H2>Sample Input</H2>
|
21 |
+
|
22 |
+
<pre>
|
23 |
+
5
|
24 |
+
</pre>
|
25 |
+
|
26 |
+
<H2>Output for the Sample Input</H2>
|
27 |
+
|
28 |
+
<pre>
|
29 |
+
120
|
30 |
+
</pre>
|
31 |
+
|
datasets/problem_descriptions/p00020.html
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Capitalize</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Write a program which replace all the lower-case letters of a given text with the corresponding captital letters.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<H2>Input</H2>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
A text including lower-case letters, periods, and space is given in a line. The number of characters in the text is less than or equal to 200.
|
12 |
+
</p>
|
13 |
+
|
14 |
+
<H2>Output</H2>
|
15 |
+
|
16 |
+
<p>
|
17 |
+
Print the converted text.
|
18 |
+
</p>
|
19 |
+
|
20 |
+
<H2>Sample Input</H2>
|
21 |
+
|
22 |
+
<pre>
|
23 |
+
this is a pen.
|
24 |
+
</pre>
|
25 |
+
|
26 |
+
<H2>Output for the Sample Input</H2>
|
27 |
+
|
28 |
+
<pre>
|
29 |
+
THIS IS A PEN.
|
30 |
+
</pre>
|
31 |
+
|
32 |
+
|
datasets/problem_descriptions/p00021.html
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<script type="text/x-mathjax-config">
|
3 |
+
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
|
4 |
+
</script>
|
5 |
+
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
|
6 |
+
</script>
|
7 |
+
|
8 |
+
<H1>Parallelism</H1>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
There are four points: $A(x_1, y_1)$, $B(x_2, y_2)$, $C(x_3, y_3)$, and $D(x_4, y_4)$. Write a program which determines whether the line $AB$ and the line $CD$ are parallel. If those two lines are parallel, your program should prints "<span>YES</span>" and if not prints "<span>NO</span>".
|
12 |
+
</p>
|
13 |
+
|
14 |
+
<H2>Input</H2>
|
15 |
+
|
16 |
+
<p>
|
17 |
+
Input consists of several datasets. In the first line, you are given the number of datasets $n$ ($n \leq 100$). There will be $n$ lines where each line correspondgs to each dataset. Each dataset consists of eight real numbers:<br/>
|
18 |
+
<br/>
|
19 |
+
$x_1$ $y_1$ $x_2$ $y_2$ $x_3$ $y_3$ $x_4$ $y_4$<br/>
|
20 |
+
</p>
|
21 |
+
|
22 |
+
<p>
|
23 |
+
You can assume that $-100 \leq x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4 \leq 100$.
|
24 |
+
Each value is a real number with at most 5 digits after the decimal point.
|
25 |
+
</p>
|
26 |
+
|
27 |
+
<H2>Output</H2>
|
28 |
+
|
29 |
+
<p>
|
30 |
+
For each dataset, print "<span>YES</span>" or "<span>NO</span>" in a line.
|
31 |
+
</p>
|
32 |
+
|
33 |
+
<H2>Sample Input</H2>
|
34 |
+
|
35 |
+
<pre>
|
36 |
+
2
|
37 |
+
0.0 0.0 1.0 1.0 1.0 0.0 2.0 1.0
|
38 |
+
3.0 2.0 9.0 6.0 13.0 5.0 7.0 9.0
|
39 |
+
</pre>
|
40 |
+
|
41 |
+
<H2>Output for the Sample Input</H2>
|
42 |
+
|
43 |
+
<pre>
|
44 |
+
YES
|
45 |
+
NO
|
46 |
+
</pre>
|
47 |
+
|
48 |
+
|
datasets/problem_descriptions/p00022.html
ADDED
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
<H1>Maximum Sum Sequence</H1>
|
4 |
+
|
5 |
+
<p>
|
6 |
+
Given a sequence of numbers <var>a<sub>1</sub></var>, <var>a<sub>2</sub></var>, <var>a<sub>3</sub></var>, ..., <var>a<sub>n</sub></var>, find the maximum sum of a contiguous subsequence of those numbers. Note that, a subsequence of one element is also a <i>contiquous</i> subsequence.
|
7 |
+
</p>
|
8 |
+
|
9 |
+
<H2>Input</H2>
|
10 |
+
<p>
|
11 |
+
The input consists of multiple datasets. Each data set consists of:
|
12 |
+
|
13 |
+
<pre>
|
14 |
+
<var>n</var>
|
15 |
+
<var>a<sub>1</sub></var>
|
16 |
+
<var>a<sub>2</sub></var>
|
17 |
+
.
|
18 |
+
.
|
19 |
+
<var>a<sub>n</sub></var>
|
20 |
+
</pre>
|
21 |
+
|
22 |
+
<p>
|
23 |
+
You can assume that 1 ≤ <var>n</var> ≤ 5000 and -100000 ≤ <var>a<sub>i</sub></var> ≤ 100000.
|
24 |
+
</p>
|
25 |
+
|
26 |
+
<p>
|
27 |
+
The input end with a line consisting of a single 0.
|
28 |
+
</p>
|
29 |
+
|
30 |
+
<H2>Output</H2>
|
31 |
+
|
32 |
+
<p>
|
33 |
+
For each dataset, print the maximum sum in a line.
|
34 |
+
</p>
|
35 |
+
|
36 |
+
<H2>Sample Input</H2>
|
37 |
+
<pre>
|
38 |
+
7
|
39 |
+
-5
|
40 |
+
-1
|
41 |
+
6
|
42 |
+
4
|
43 |
+
9
|
44 |
+
-6
|
45 |
+
-7
|
46 |
+
13
|
47 |
+
1
|
48 |
+
2
|
49 |
+
3
|
50 |
+
2
|
51 |
+
-2
|
52 |
+
-1
|
53 |
+
1
|
54 |
+
2
|
55 |
+
3
|
56 |
+
2
|
57 |
+
1
|
58 |
+
-2
|
59 |
+
1
|
60 |
+
3
|
61 |
+
1000
|
62 |
+
-200
|
63 |
+
201
|
64 |
+
0
|
65 |
+
</pre>
|
66 |
+
|
67 |
+
<H2>Output for the Sample Input</H2>
|
68 |
+
|
69 |
+
<pre>
|
70 |
+
19
|
71 |
+
14
|
72 |
+
1001
|
73 |
+
</pre>
|
74 |
+
|
75 |
+
|
datasets/problem_descriptions/p00023.html
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<script type="text/x-mathjax-config">
|
3 |
+
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
|
4 |
+
</script>
|
5 |
+
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
|
6 |
+
</script>
|
7 |
+
|
8 |
+
<H1>Circles Intersection</H1>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
You are given circle $A$ with radius $r_a$ and with central coordinate $(x_a, y_a)$ and circle $B$ with radius $r_b$ and with central coordinate $(x_b, y_b)$.
|
12 |
+
</p>
|
13 |
+
<p>
|
14 |
+
Write a program which prints:
|
15 |
+
</p>
|
16 |
+
<ul>
|
17 |
+
<li>"2" if $B$ is in $A$,</li>
|
18 |
+
<li>"-2" if $A$ is in $B$, </li>
|
19 |
+
<li>"1" if circumference of $A$ and $B$ intersect, and</li>
|
20 |
+
<li>"0" if $A$ and $B$ do not overlap.</li>
|
21 |
+
</ul>
|
22 |
+
|
23 |
+
<p>
|
24 |
+
You may assume that $A$ and $B$ are not identical.
|
25 |
+
</p>
|
26 |
+
|
27 |
+
<H2>Input</H2>
|
28 |
+
|
29 |
+
<p>
|
30 |
+
The input consists of multiple datasets. The first line consists of an integer $N$ ($N \leq 50$), the number of datasets. There will be $N$ lines where each line represents each dataset. Each data set consists of real numbers:<br/>
|
31 |
+
<br/>
|
32 |
+
$x_a$ $y_a$ $r_a$ $x_b$ $y_b$ $r_b$<br/>
|
33 |
+
</p>
|
34 |
+
|
35 |
+
<H2>Output</H2>
|
36 |
+
|
37 |
+
<p>
|
38 |
+
For each dataset, print 2, -2, 1, or 0 in a line.
|
39 |
+
</p>
|
40 |
+
|
41 |
+
<H2>Sample Input</H2>
|
42 |
+
|
43 |
+
<pre>
|
44 |
+
2
|
45 |
+
0.0 0.0 5.0 0.0 0.0 4.0
|
46 |
+
0.0 0.0 2.0 4.1 0.0 2.0
|
47 |
+
</pre>
|
48 |
+
|
49 |
+
<H2>Output for the Sample Input</H2>
|
50 |
+
|
51 |
+
<pre>
|
52 |
+
2
|
53 |
+
0
|
54 |
+
</pre>
|
55 |
+
|
56 |
+
|
57 |
+
|
datasets/problem_descriptions/p00024.html
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<script type="text/x-mathjax-config">
|
3 |
+
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
|
4 |
+
</script>
|
5 |
+
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
|
6 |
+
</script>
|
7 |
+
|
8 |
+
<H1>Physical Experiments</H1>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
Ignoring the air resistance, velocity of a freely falling object $v$ after $t$ seconds and its drop $y$ in $t$ seconds are represented by the following formulas:<br/>
|
12 |
+
<br/>
|
13 |
+
$ v = 9.8 t $<br/>
|
14 |
+
$ y = 4.9 t^2 $<br/>
|
15 |
+
</p>
|
16 |
+
<!--
|
17 |
+
<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_physical"></center>
|
18 |
+
-->
|
19 |
+
|
20 |
+
<p>
|
21 |
+
A person is trying to drop down a glass ball and check whether it will crack. Your task is to write a program to help this experiment.
|
22 |
+
</p>
|
23 |
+
|
24 |
+
<p>
|
25 |
+
You are given the minimum velocity to crack the ball. Your program should print the lowest possible floor of a building to crack the ball. The height of the $N$ floor of the building is defined by $5 \times N - 5$.
|
26 |
+
</p>
|
27 |
+
|
28 |
+
|
29 |
+
<H2>Input</H2>
|
30 |
+
|
31 |
+
<p>
|
32 |
+
The input consists of multiple datasets. Each dataset, a line, consists of the minimum velocity <i>v</i> (0 < <i>v</i> < 200) to crack the ball. The value is given by a decimal fraction, with at most 4 digits after the decimal point. The input ends with EOF. The number of datasets is less than or equal to 50.
|
33 |
+
</p>
|
34 |
+
|
35 |
+
<H2>Output</H2>
|
36 |
+
|
37 |
+
<p>
|
38 |
+
For each dataset, print the lowest possible floor where the ball cracks.
|
39 |
+
</p>
|
40 |
+
|
41 |
+
<H2>Sample Input</H2>
|
42 |
+
|
43 |
+
<pre>
|
44 |
+
25.4
|
45 |
+
25.4
|
46 |
+
</pre>
|
47 |
+
|
48 |
+
<H2>Output for the Sample Input</H2>
|
49 |
+
|
50 |
+
<pre>
|
51 |
+
8
|
52 |
+
8
|
53 |
+
</pre>
|
54 |
+
|
55 |
+
|
datasets/problem_descriptions/p00025.html
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>Hit and Blow</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Let's play Hit and Blow game. <i>A</i> imagines four numbers and <i>B</i> guesses the numbers. After <i>B</i> picks out four numbers, <i>A</i> answers:
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<ul>
|
9 |
+
<li> The number of numbers which have the same place with numbers <i>A</i> imagined (Hit) </li>
|
10 |
+
<li> The number of numbers included (but different place) in the numbers <i>A</i> imagined (Blow)</li>
|
11 |
+
</ul>
|
12 |
+
|
13 |
+
<p>
|
14 |
+
For example, if <i>A</i> imagined numbers:
|
15 |
+
</p>
|
16 |
+
|
17 |
+
<pre>
|
18 |
+
9 1 8 2
|
19 |
+
</pre>
|
20 |
+
<p>
|
21 |
+
and <i>B</i> chose:
|
22 |
+
</p>
|
23 |
+
<pre>
|
24 |
+
4 1 5 9
|
25 |
+
</pre>
|
26 |
+
<p>
|
27 |
+
<i>A</i> should say 1 Hit and 1 Blow.
|
28 |
+
</p>
|
29 |
+
|
30 |
+
|
31 |
+
<p>
|
32 |
+
Write a program which reads four numbers <i>A</i> imagined and four numbers <i>B</i> chose and prints the number of Hit and Blow respectively. You may assume that the four numbers are all different and within from 0 to 9.
|
33 |
+
</p>
|
34 |
+
<H2>Input</H2>
|
35 |
+
|
36 |
+
<p>
|
37 |
+
The input consists of multiple datasets. Each dataset set consists of:
|
38 |
+
</p>
|
39 |
+
<pre>
|
40 |
+
<var>a<sub>1</sub></var> <var>a<sub>2</sub></var> <var>a<sub>3</sub></var> <var>a<sub>4</sub></var>
|
41 |
+
<var>b<sub>1</sub></var> <var>b<sub>2</sub></var> <var>b<sub>3</sub></var> <var>b<sub>4</sub></var>
|
42 |
+
</pre>
|
43 |
+
<p>
|
44 |
+
, where <var>a<sub>i</sub></var> (0 ≤ <var>a<sub>i</sub></var> ≤ 9) is <var>i</var>-th number <i>A</i> imagined and <var>b<sub>i</sub></var> (0 ≤ <var>b<sub>i</sub></var> ≤ 9) is <var>i</var>-th number <i>B</i> chose.
|
45 |
+
</p>
|
46 |
+
|
47 |
+
<p>
|
48 |
+
The input ends with EOF. The number of datasets is less than or equal to 50.
|
49 |
+
</P>
|
50 |
+
|
51 |
+
<H2>Output</H2>
|
52 |
+
|
53 |
+
<p>
|
54 |
+
For each dataset, print the number of Hit and Blow in a line. These two numbers should be separated by a space.
|
55 |
+
</p>
|
56 |
+
|
57 |
+
<H2>Sample Input</H2>
|
58 |
+
|
59 |
+
<pre>
|
60 |
+
9 1 8 2
|
61 |
+
4 1 5 9
|
62 |
+
4 6 8 2
|
63 |
+
4 6 3 2
|
64 |
+
</pre>
|
65 |
+
|
66 |
+
<H2>Output for the Sample Input</H2>
|
67 |
+
|
68 |
+
<pre>
|
69 |
+
1 1
|
70 |
+
3 0
|
71 |
+
</pre>
|
72 |
+
|
73 |
+
|
74 |
+
|
datasets/problem_descriptions/p00026.html
ADDED
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
<H1>Dropping Ink</H1>
|
4 |
+
|
5 |
+
<p>
|
6 |
+
As shown in the following figure, there is a paper consisting of a grid structure where each cell is indicated by (<var>x</var>, <var>y</var>) coordinate system.
|
7 |
+
</p>
|
8 |
+
|
9 |
+
<p>
|
10 |
+
We are going to put drops of ink on the paper. A drop comes in three different sizes: Large, Medium, and Small. From the point of fall, the ink sinks into surrounding cells as shown in the figure depending on its size. In the figure, a star denotes the point of fall and a circle denotes the surrounding cells.
|
11 |
+
</p>
|
12 |
+
|
13 |
+
<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_ink1"></center>
|
14 |
+
<br/>
|
15 |
+
|
16 |
+
<p>
|
17 |
+
Originally, the paper is white that means for each cell the value of density is 0. The value of density is increased by 1 when the ink sinks into the corresponding cells.
|
18 |
+
|
19 |
+
For example, if we put a drop of Small ink at (1, 2) and a drop of Medium ink at (3, 2), the ink will sink as shown in the following figure (left side):
|
20 |
+
</p>
|
21 |
+
|
22 |
+
<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_ink2"></center>
|
23 |
+
<br/>
|
24 |
+
|
25 |
+
<p>
|
26 |
+
In the figure, density values of empty cells are 0. The ink sinking into out of the paper should be ignored as shown in the figure (top side). We can put several drops of ink at the same point.
|
27 |
+
</p>
|
28 |
+
|
29 |
+
<p>
|
30 |
+
Your task is to write a program which reads a sequence of points of fall (<var>x</var>, <var>y</var>) with its size (Small = 1, Medium = 2, Large = 3), and prints the number of cells whose density value is 0. The program must also print the maximum value of density.
|
31 |
+
</p>
|
32 |
+
|
33 |
+
<p>
|
34 |
+
You may assume that the paper always consists of 10 × 10, and 0 ≤ <var>x</var> < 10, 0 ≤ <var>y</var> < 10.
|
35 |
+
</p>
|
36 |
+
|
37 |
+
<H2>Input</H2>
|
38 |
+
|
39 |
+
<pre>
|
40 |
+
<var>x<sub>1</sub></var>,<var>y<sub>1</sub></var>,<var>s<sub>1</sub></var>
|
41 |
+
<var>x<sub>2</sub></var>,<var>y<sub>2</sub></var>,<var>s<sub>2</sub></var>
|
42 |
+
:
|
43 |
+
:
|
44 |
+
</pre>
|
45 |
+
|
46 |
+
<p>
|
47 |
+
(<var>x<sub>i</sub></var>, <var>y<sub>i</sub></var>) represents the position of the <var>i</var>-th drop and <var>s<sub>i</sub></var> denotes its size. The number of drops is less than or equal to 50.
|
48 |
+
</p>
|
49 |
+
|
50 |
+
|
51 |
+
<H2>Output</H2>
|
52 |
+
|
53 |
+
<p>
|
54 |
+
Print the number of cells whose density value is 0 in first line.<br>
|
55 |
+
Print the maximum value of density in the second line.
|
56 |
+
</p>
|
57 |
+
|
58 |
+
<H2>Sample Input</H2>
|
59 |
+
|
60 |
+
<pre>
|
61 |
+
2,5,3
|
62 |
+
3,6,1
|
63 |
+
3,4,2
|
64 |
+
4,5,2
|
65 |
+
3,6,3
|
66 |
+
2,4,1
|
67 |
+
</pre>
|
68 |
+
|
69 |
+
<H2>Output for the Sample Input</H2>
|
70 |
+
|
71 |
+
<pre>
|
72 |
+
77
|
73 |
+
5
|
74 |
+
</pre>
|
75 |
+
|
76 |
+
|
datasets/problem_descriptions/p00027.html
ADDED
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
<H1>What day is today?</H1>
|
4 |
+
|
5 |
+
<p>
|
6 |
+
Your task is to write a program which reads a date (from 2004/1/1 to 2004/12/31) and prints the day of the date. Jan. 1, 2004, is Thursday. Note that 2004 is a leap year and we have Feb. 29.
|
7 |
+
</p>
|
8 |
+
|
9 |
+
<H2>Input</H2>
|
10 |
+
|
11 |
+
<p>
|
12 |
+
The input is a sequence of datasets. The end of the input is indicated by a line containing one zero. Each dataset consists of two integers <var>m</var> and <var>d</var> separated by a single space in a line. These integers respectively represent the month and the day.
|
13 |
+
</p>
|
14 |
+
|
15 |
+
<p>
|
16 |
+
The number of datasets is less than or equal to 50.
|
17 |
+
</p>
|
18 |
+
|
19 |
+
<H2>Output</H2>
|
20 |
+
|
21 |
+
<p>
|
22 |
+
For each dataset, print the day (please see the following words) in a line.
|
23 |
+
</p>
|
24 |
+
<pre>
|
25 |
+
Monday
|
26 |
+
Tuesday
|
27 |
+
Wednesday
|
28 |
+
Thursday
|
29 |
+
Friday
|
30 |
+
Saturday
|
31 |
+
Sunday
|
32 |
+
</pre>
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
<H2>Sample Input</H2>
|
37 |
+
|
38 |
+
<pre>
|
39 |
+
1 1
|
40 |
+
2 29
|
41 |
+
0 0
|
42 |
+
</pre>
|
43 |
+
|
44 |
+
<H2>Output for the Sample Input</H2>
|
45 |
+
|
46 |
+
<pre>
|
47 |
+
Thursday
|
48 |
+
Sunday
|
49 |
+
</pre>
|
50 |
+
|
51 |
+
|
datasets/problem_descriptions/p00028.html
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<h1>Mode Value</h1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Your task is to write a program which reads a sequence of integers and prints mode values of the sequence.
|
6 |
+
The mode value is the element which occurs most frequently.
|
7 |
+
</p>
|
8 |
+
|
9 |
+
<H2>Input</H2>
|
10 |
+
|
11 |
+
<p>
|
12 |
+
A sequence of integers <var>a<sub>i</sub></var> (1 ≤ <var>a<sub>i</sub></var> ≤ 100). The number of integers is less than or equals to 100.
|
13 |
+
|
14 |
+
</p>
|
15 |
+
|
16 |
+
<H2>Output</H2>
|
17 |
+
|
18 |
+
<p>
|
19 |
+
Print the mode values. If there are several mode values, print them in ascending order.
|
20 |
+
</p>
|
21 |
+
|
22 |
+
<H2>Sample Input</H2>
|
23 |
+
|
24 |
+
<pre>
|
25 |
+
5
|
26 |
+
6
|
27 |
+
3
|
28 |
+
5
|
29 |
+
8
|
30 |
+
7
|
31 |
+
5
|
32 |
+
3
|
33 |
+
9
|
34 |
+
7
|
35 |
+
3
|
36 |
+
4
|
37 |
+
</pre>
|
38 |
+
|
39 |
+
<H2>Output for the Sample Input</H2>
|
40 |
+
|
41 |
+
<pre>
|
42 |
+
3
|
43 |
+
5
|
44 |
+
</pre>
|
45 |
+
|
46 |
+
<p>
|
47 |
+
For example, 3 and 5 respectively occur three times, 7 occurs two times, and others occur only one. So, the mode values are 3 and 5.
|
48 |
+
</p>
|
49 |
+
|
50 |
+
|
datasets/problem_descriptions/p00029.html
ADDED
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<H1>English Sentence</H1>
|
3 |
+
|
4 |
+
<p>
|
5 |
+
Your task is to write a program which reads a text and prints two words. The first one is the word which is arise most frequently in the text. The second one is the word which has the maximum number of letters.
|
6 |
+
</p>
|
7 |
+
|
8 |
+
<p>
|
9 |
+
The text includes only alphabetical characters and spaces. A word is a sequence of letters which is separated by the spaces.
|
10 |
+
</p>
|
11 |
+
|
12 |
+
<H2>Input</H2>
|
13 |
+
|
14 |
+
<p>
|
15 |
+
A text is given in a line. You can assume the following conditions:
|
16 |
+
</p>
|
17 |
+
|
18 |
+
<ul>
|
19 |
+
<li>The number of letters in the text is less than or equal to 1000.</li>
|
20 |
+
<li> The number of letters in a word is less than or equal to 32.</li>
|
21 |
+
<li> There is only one word which is arise most frequently in given text.</li>
|
22 |
+
<li> There is only one word which has the maximum number of letters in given text.</li>
|
23 |
+
</ul>
|
24 |
+
|
25 |
+
<H2>Output</H2>
|
26 |
+
|
27 |
+
<p>
|
28 |
+
The two words separated by a space.
|
29 |
+
</p>
|
30 |
+
|
31 |
+
<H2>Sample Input</H2>
|
32 |
+
|
33 |
+
<pre>
|
34 |
+
Thank you for your mail and your lectures
|
35 |
+
</pre>
|
36 |
+
|
37 |
+
<H2>Output for the Sample Input</H2>
|
38 |
+
|
39 |
+
<pre>
|
40 |
+
your lectures
|
41 |
+
</pre>
|
42 |
+
|
43 |
+
|
44 |
+
|
datasets/problem_descriptions/p00030.html
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>整数の和</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
0 から 9 の数字から異なる <var>n</var> 個の数を取り出して合計が <var>s</var> となる組み合わせの数を出力するプログラムを作成してください。<var>n</var> 個の数はおのおの 0 から 9 までとし、1つの組み合わせに同じ数字は使えません。たとえば、<var>n</var> が 3 で <var>s</var> が 6 のとき、3 個の数字の合計が 6 になる組み合わせは、<br/>
|
8 |
+
<br/>
|
9 |
+
1 + 2 + 3 = 6<br/>
|
10 |
+
0 + 1 + 5 = 6<br/>
|
11 |
+
0 + 2 + 4 = 6<br/>
|
12 |
+
<br/>
|
13 |
+
の 3 通りとなります。
|
14 |
+
</p>
|
15 |
+
|
16 |
+
<H2>Input</H2>
|
17 |
+
|
18 |
+
<p>
|
19 |
+
複数のデータセットが与えられます。各データセットに <var>n</var> (1 ≤ <var>n</var> ≤ 9) と <var>s</var> (0 ≤ <var>s</var> ≤ 100) が1つのスペースで区切られて1行に与えられます。<var>n</var> と <var>s</var> が共に 0 のとき入力の最後とします(この場合は処理せずにプログラムを終了する)。
|
20 |
+
</p>
|
21 |
+
|
22 |
+
<p>
|
23 |
+
データセットの数は 50 を超えません。
|
24 |
+
</p>
|
25 |
+
|
26 |
+
|
27 |
+
<H2>Output</H2>
|
28 |
+
|
29 |
+
<p>
|
30 |
+
各データセットに対して、<var>n</var> 個の整数の和が <var>s</var> になる組み合わせの数を1行に出力して下さい。
|
31 |
+
</p>
|
32 |
+
|
33 |
+
<H2>Sample Input</H2>
|
34 |
+
|
35 |
+
<pre>
|
36 |
+
3 6
|
37 |
+
3 1
|
38 |
+
0 0
|
39 |
+
</pre>
|
40 |
+
|
41 |
+
<H2>Output for the Sample Input</H2>
|
42 |
+
|
43 |
+
<pre>
|
44 |
+
3
|
45 |
+
0
|
46 |
+
</pre>
|
47 |
+
|
48 |
+
|
datasets/problem_descriptions/p00031.html
ADDED
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>Weight</H1>
|
5 |
+
|
6 |
+
<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_weight"></center>
|
7 |
+
<br/>
|
8 |
+
|
9 |
+
<p>
|
10 |
+
祖母が天秤を使っています。天秤は、二つの皿の両方に同じ目方のものを載せると釣合い、そうでない場合には、重い方に傾きます。10 個の分銅の重さは、軽い順に 1g, 2g, 4g, 8g, 16g, 32g, 64g, 128g, 256g, 512g です。
|
11 |
+
</p>
|
12 |
+
|
13 |
+
<p>
|
14 |
+
祖母は、「1kg くらいまでグラム単位で量れるのよ。」と言います。「じゃあ、試しに、ここにあるジュースの重さを量ってよ」と言ってみると、祖母は左の皿にジュースを、右の皿に 8g と64g と128g の分銅を載せて釣合わせてから、「分銅の目方の合計は 200g だから、ジュースの目方は 200g ね。どう、正しいでしょう?」と答えました。
|
15 |
+
</p>
|
16 |
+
|
17 |
+
<p>
|
18 |
+
左の皿に載せる品物の重さを与えるので、天秤で与えられた重みの品物と釣合わせるときに、右の皿に載せる分銅を軽い順に出力するプログラムを作成して下さい。ただし、量るべき品物の重さは、すべての分銅の重さの合計 (=1023g) 以下とします。
|
19 |
+
</p>
|
20 |
+
|
21 |
+
<H2>Input</H2>
|
22 |
+
|
23 |
+
<p>
|
24 |
+
複数のデータセットが与えられます。各データセットに、左の皿に載せる品物の重さが1行に与えられます。入力の最後まで処理して下さい。データセットの数は 50 を超えません。
|
25 |
+
|
26 |
+
</p>
|
27 |
+
|
28 |
+
<H2>Output</H2>
|
29 |
+
|
30 |
+
<p>
|
31 |
+
各データセットに対して、右の皿に載せる分銅(昇順)を1つの空白で区切って、1行に出力して下さい。
|
32 |
+
</p>
|
33 |
+
|
34 |
+
<H2>Sample Input</H2>
|
35 |
+
|
36 |
+
<pre>
|
37 |
+
5
|
38 |
+
7
|
39 |
+
127
|
40 |
+
</pre>
|
41 |
+
|
42 |
+
<H2>Output for the Sample Input</H2>
|
43 |
+
|
44 |
+
<pre>
|
45 |
+
1 4
|
46 |
+
1 2 4
|
47 |
+
1 2 4 8 16 32 64
|
48 |
+
</pre>
|
49 |
+
|
50 |
+
|
51 |
+
<H2>Hint</H2>
|
52 |
+
<p>
|
53 |
+
分銅の重さは 2 の <var>n</var> 乗 ( <var>n</var> = 0, 1, .... 9 )g です。
|
54 |
+
</p>
|
55 |
+
|
datasets/problem_descriptions/p00032.html
ADDED
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>プラスティック板</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
機械に辺・対角線の長さのデータを入力し、プラスティック板の型抜きをしている工場があります。この工場では、サイズは様々ですが、平行四辺形の型のみを切り出しています。あなたは、切り出される平行四辺形のうち、長方形とひし形の製造個数を数えるように上司から命じられました。
|
8 |
+
</p>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
「機械に入力するデータ」を読み込んで、長方形とひし形の製造個数を出力するプログラムを作成してください。
|
12 |
+
</p>
|
13 |
+
|
14 |
+
<center><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_plastic"></center>
|
15 |
+
<br/>
|
16 |
+
|
17 |
+
<H2>Input</H2>
|
18 |
+
<p>
|
19 |
+
入力は以下の形式で与えられます。
|
20 |
+
</p>
|
21 |
+
|
22 |
+
<pre>
|
23 |
+
<var>a<sub>1</sub></var>,<var>b<sub>1</sub></var>,<var>c<sub>1</sub></var>
|
24 |
+
<var>a<sub>2</sub></var>,<var>b<sub>2</sub></var>,<var>c<sub>2</sub></var>
|
25 |
+
:
|
26 |
+
</pre>
|
27 |
+
|
28 |
+
|
29 |
+
<p>
|
30 |
+
機械に入力するデータが複数行に与えられます。<var>i</var> 行目に <var>i</var> 番目の平行四辺形の隣り合う2辺の長さを表す整数 <var>a<sub>i</sub></var>, <var>b<sub>i</sub></var> と対角線の長さを表す整数 <var>c<sub>i</sub></var> がカンマ区切りで与えられます (1 ≤ <var>a<sub>i</sub>, b<sub>i</sub>, c<sub>i</sub></var> ≤ 1000, <var>a<sub>i</sub> + b<sub>i</sub></var> > <var>c<sub>i</sub></var>)。データの数は 100 件を超えません。
|
31 |
+
</p>
|
32 |
+
|
33 |
+
<H2>Output</H2>
|
34 |
+
|
35 |
+
<p>
|
36 |
+
1行目に長方形の製造個数、2行目ひし形の製造個数を出力します。
|
37 |
+
</p>
|
38 |
+
|
39 |
+
<H2>Sample Input</H2>
|
40 |
+
|
41 |
+
<pre>
|
42 |
+
3,4,5
|
43 |
+
5,5,8
|
44 |
+
4,4,4
|
45 |
+
5,4,3
|
46 |
+
</pre>
|
47 |
+
|
48 |
+
<H2>Output for the Sample Input</H2>
|
49 |
+
|
50 |
+
<pre>
|
51 |
+
1
|
52 |
+
2
|
53 |
+
</pre>
|
54 |
+
|
55 |
+
|
56 |
+
|
57 |
+
|
58 |
+
|
datasets/problem_descriptions/p00033.html
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>玉</H1>
|
5 |
+
|
6 |
+
<center>
|
7 |
+
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_ball">
|
8 |
+
</center>
|
9 |
+
<br/>
|
10 |
+
|
11 |
+
<p>
|
12 |
+
図のように二股に分かれている容器があります。1 から 10 までの番号が付けられた10 個の玉を容器の開口部 A から落とし、左の筒 B か右の筒 C に玉を入れます。板 D は支点 E を中心に左右に回転できるので、板 D を動かすことで筒 B と筒 C のどちらに入れるか決めることができます。
|
13 |
+
</p>
|
14 |
+
|
15 |
+
<p>
|
16 |
+
開口部 A から落とす玉の並びを与えます。それらを順番に筒 B 又は筒 Cに入れていきます。このとき、筒 B と筒 C のおのおのが両方とも番号の小さい玉の上に大きい玉を並べられる場合は YES、並べられない場合は NO と出力するプログラムを作成してください。ただし、容器の中で玉の順序を入れ替えることはできないものとします。また、続けて同じ筒に入れることができるものとし、筒 B, C ともに 10 個の玉がすべて入るだけの余裕があるものとします。
|
17 |
+
</p>
|
18 |
+
|
19 |
+
|
20 |
+
<H2>Input</H2>
|
21 |
+
|
22 |
+
<p>
|
23 |
+
複数のデータセットが与えられます。1行目にデータセット数 <var>N</var> が与えられます。つづいて、<var>N</var> 行のデータセットが与えられます。各データセットに 10 個の番号が左から順番に空白区切りで与えられます。
|
24 |
+
</p>
|
25 |
+
|
26 |
+
<H2>Output</H2>
|
27 |
+
|
28 |
+
<p>
|
29 |
+
各データセットに対して、<span>YES</span> または <span>NO</span> を1行に出力して下さい。
|
30 |
+
</p>
|
31 |
+
|
32 |
+
<H2>Sample Input</H2>
|
33 |
+
|
34 |
+
<pre>
|
35 |
+
2
|
36 |
+
3 1 4 2 5 6 7 8 9 10
|
37 |
+
10 9 8 7 6 5 4 3 2 1
|
38 |
+
</pre>
|
39 |
+
|
40 |
+
<H2>Output for the Sample Input</H2>
|
41 |
+
|
42 |
+
<pre>
|
43 |
+
YES
|
44 |
+
NO
|
45 |
+
</pre>
|
46 |
+
|
datasets/problem_descriptions/p00034.html
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>鉄道路線</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
複線(上りと下りが別の線路になっていてどこででもすれ違える)の鉄道路線があります。この路線には終端駅を含めて11 の駅があり、それぞれの駅と駅の間は図で示す区間番号で呼ばれています。
|
8 |
+
</p>
|
9 |
+
|
10 |
+
<center>
|
11 |
+
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_railway">
|
12 |
+
</center>
|
13 |
+
<br/>
|
14 |
+
|
15 |
+
|
16 |
+
<p>
|
17 |
+
この路線の両方の終端駅から列車が同時に出発して、途中で停まらずに走ります。各区間の長さと2 本の列車の速度を読み込んで、それぞれの場合について列車がすれ違う区間の番号を出力するプログラムを作成してください。ただし、ちょうど駅のところですれ違う場合は、両側の区間番号のうち小さいほうの数字を出力します。また、列車の長さ、駅の長さは無視できるものとします。
|
18 |
+
</p>
|
19 |
+
|
20 |
+
<H2>Input</H2>
|
21 |
+
|
22 |
+
<p>
|
23 |
+
複数のデータセットが与えられる。各データセットは以下のような形式で与えられる。
|
24 |
+
</p>
|
25 |
+
|
26 |
+
<pre>
|
27 |
+
<var>l<sub>1</sub></var>,<var>l<sub>2</sub></var>,<var>l<sub>3</sub></var>,<var>l<sub>4</sub></var>,<var>l<sub>5</sub></var>,<var>l<sub>6</sub></var>,<var>l<sub>7</sub></var>,<var>l<sub>8</sub></var>,<var>l<sub>9</sub></var>,<var>l<sub>10</sub></var>,<var>v<sub>1</sub></var>,<var>v<sub>2</sub></var>
|
28 |
+
</pre>
|
29 |
+
|
30 |
+
<p>
|
31 |
+
<var>l<sub>i</sub></var> (1 ≤ <var>l<sub>i</sub></var> ≤ 2,000) は区間 <var>i</var> の長さ(km)を表す整数である。<var>v<sub>1</sub></var> は区間 1 側の終端駅を出発した列車の速度(km/h)、<var>v<sub>2</sub></var> は区間 10 側の終端駅を出発した列車の速度(km/h)を表す整数である (1 ≤ <var>v<sub>1</sub></var>, <var>v<sub>2</sub></var> ≤ 2,000)。
|
32 |
+
</p>
|
33 |
+
|
34 |
+
<p>
|
35 |
+
データセットの数は 50 を超えない。
|
36 |
+
</p>
|
37 |
+
|
38 |
+
<H2>Output</H2>
|
39 |
+
|
40 |
+
<p>
|
41 |
+
データセットごとに、列車がすれちがう区間の番号を1行に出力する。
|
42 |
+
</p>
|
43 |
+
|
44 |
+
<H2>Sample Input</H2>
|
45 |
+
|
46 |
+
<pre>
|
47 |
+
1,1,1,1,1,1,1,1,1,1,40,60
|
48 |
+
1,1,1,1,1,3,3,3,3,3,50,50
|
49 |
+
10,10,10,10,10,10,10,10,10,10,50,49
|
50 |
+
</pre>
|
51 |
+
|
52 |
+
<H2>Output for the Sample Input</H2>
|
53 |
+
|
54 |
+
<pre>
|
55 |
+
4
|
56 |
+
7
|
57 |
+
6
|
58 |
+
</pre>
|
59 |
+
|
datasets/problem_descriptions/p00035.html
ADDED
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<script type="text/x-mathjax-config">
|
5 |
+
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
|
6 |
+
</script>
|
7 |
+
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
|
8 |
+
</script>
|
9 |
+
|
10 |
+
<H1>凸?</H1>
|
11 |
+
|
12 |
+
<p>
|
13 |
+
平面上の異なる 4 点 $A (x_a, y_a)$, $B (x_b, y_b)$, $C (x_c, y_c)$, $D(x_d, y_d)$ の座標を読み込んで、それら 4 点を頂点とした四角形 $ABCD$ に凹みがなければ YES、凹みがあれば NO と出力するプログラムを作成してください。
|
14 |
+
</p>
|
15 |
+
|
16 |
+
<p>
|
17 |
+
凹みのある四角形とは図 1 のような四角形です。
|
18 |
+
</p>
|
19 |
+
|
20 |
+
<center>
|
21 |
+
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_isConvex">
|
22 |
+
</center>
|
23 |
+
<br/>
|
24 |
+
|
25 |
+
<H2>Input</H2>
|
26 |
+
|
27 |
+
<p>
|
28 |
+
複数のデータセットが与えられます。各データセットの形式は以下のとおりです。<br/>
|
29 |
+
<br/>
|
30 |
+
$x_a$,$y_a$,$x_b$,$y_b$,$x_c$,$y_c$,$x_d$,$y_d$
|
31 |
+
</p>
|
32 |
+
|
33 |
+
<p>
|
34 |
+
$x_a$, $y_a$, $x_b$, $y_b$, $x_c$, $y_c$, $x_d$, $y_d$ はそれぞれ -100 以上 100 以下であり、実数で与えられます。
|
35 |
+
</p>
|
36 |
+
|
37 |
+
<p>
|
38 |
+
1 直線上に 3 つ以上点が並ぶことはないものとします。また、入力順に点を結んでいけば、四角形になる順番に点の座標が入力されるものとします。(つまり、図 2 のような形になる順番で点が与えられることはありません。)
|
39 |
+
</p>
|
40 |
+
|
41 |
+
<p>
|
42 |
+
データセットの数は 100 を超えません。
|
43 |
+
</p>
|
44 |
+
|
45 |
+
<H2>Output</H2>
|
46 |
+
|
47 |
+
<p>
|
48 |
+
各データセットごとに、YES または NO を1行に出力します。
|
49 |
+
</p>
|
50 |
+
|
51 |
+
<H2>Sample Input</H2>
|
52 |
+
|
53 |
+
<pre>
|
54 |
+
0.0,0.0,1.0,0.0,1.0,1.0,0.0,1.0
|
55 |
+
0.0,0.0,3.0,0.0,1.0,1.0,1.0,3.0
|
56 |
+
</pre>
|
57 |
+
|
58 |
+
<H2>Output for the Sample Input</H2>
|
59 |
+
|
60 |
+
<pre>
|
61 |
+
YES
|
62 |
+
NO
|
63 |
+
</pre>
|
64 |
+
|
datasets/problem_descriptions/p00036.html
ADDED
@@ -0,0 +1,223 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>平面上の図形</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
縦 8、横 8 のマスからなる図 1 のような平面があります。
|
8 |
+
<br>
|
9 |
+
<center>
|
10 |
+
<table cellspacing=0 cellpadding=0>
|
11 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
12 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
13 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
14 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
15 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
16 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
17 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
18 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
19 |
+
</table>
|
20 |
+
<br>
|
21 |
+
<table>
|
22 |
+
<tr><td>図1</td></tr>
|
23 |
+
</table>
|
24 |
+
</center>
|
25 |
+
<br>
|
26 |
+
<p>
|
27 |
+
この平面上に、以下の A から G の図形のどれかが一つだけ置かれています。
|
28 |
+
</p>
|
29 |
+
<center>
|
30 |
+
<table>
|
31 |
+
<tr>
|
32 |
+
<td width=100>
|
33 |
+
<table><tr><td>A</td></tr></table>
|
34 |
+
<table cellspacing=0 cellpadding=0>
|
35 |
+
<tr><td>■</td><td>■</td><td></td><td></td></tr>
|
36 |
+
<tr><td>■</td><td>■</td><td></td><td></td></tr>
|
37 |
+
<tr><td></td><td></td><td></td><td></td></tr>
|
38 |
+
<tr><td></td><td></td><td></td><td></td></tr>
|
39 |
+
</table>
|
40 |
+
</td>
|
41 |
+
<td width=100>
|
42 |
+
<table><tr><td>B</td></tr></table>
|
43 |
+
<table cellspacing=0 cellpadding=0>
|
44 |
+
<tr><td></td><td>■</td><td></td><td></td></tr>
|
45 |
+
<tr><td></td><td>■</td><td></td><td></td></tr>
|
46 |
+
<tr><td></td><td>■</td><td></td><td></td></tr>
|
47 |
+
<tr><td></td><td>■</td><td></td><td></td></tr>
|
48 |
+
</table>
|
49 |
+
</td>
|
50 |
+
<td width=100>
|
51 |
+
<table><tr><td>C</td></tr></table>
|
52 |
+
<table cellspacing=0 cellpadding=0>
|
53 |
+
<tr><td>■</td><td>■</td><td>■</td><td>■</td></tr>
|
54 |
+
<tr><td></td><td></td><td></td><td></td></tr>
|
55 |
+
<tr><td></td><td></td><td></td><td></td></tr>
|
56 |
+
<tr><td></td><td></td><td></td><td></td></tr>
|
57 |
+
</table>
|
58 |
+
</td>
|
59 |
+
</tr>
|
60 |
+
</table>
|
61 |
+
<br/>
|
62 |
+
<table>
|
63 |
+
<tr>
|
64 |
+
<td width=100>
|
65 |
+
<table><tr><td>D</td></tr></table>
|
66 |
+
<table cellspacing=0 cellpadding=0>
|
67 |
+
<tr><td></td><td>■</td><td></td><td></td></tr>
|
68 |
+
<tr><td>■</td><td>■</td><td></td><td></td></tr>
|
69 |
+
<tr><td>■</td><td></td><td></td><td></td></tr>
|
70 |
+
<tr><td></td><td></td><td></td><td></td></tr>
|
71 |
+
</table>
|
72 |
+
</td>
|
73 |
+
<td width=100>
|
74 |
+
<table><tr><td>E</td></tr></table>
|
75 |
+
<table cellspacing=0 cellpadding=0>
|
76 |
+
<tr><td>■</td><td>■</td><td></td><td></td></tr>
|
77 |
+
<tr><td></td><td>■</td><td>■</td><td></td></tr>
|
78 |
+
<tr><td></td><td></td><td></td><td></td></tr>
|
79 |
+
<tr><td></td><td></td><td></td><td></td></tr>
|
80 |
+
</table>
|
81 |
+
</td>
|
82 |
+
<td width=100>
|
83 |
+
<table><tr><td>F</td></tr></table>
|
84 |
+
<table cellspacing=0 cellpadding=0>
|
85 |
+
<tr><td>■</td><td></td><td></td><td></td></tr>
|
86 |
+
<tr><td>■</td><td>■</td><td></td><td></td></tr>
|
87 |
+
<tr><td></td><td>■</td><td></td><td></td></tr>
|
88 |
+
<tr><td></td><td></td><td></td><td></td></tr>
|
89 |
+
</table>
|
90 |
+
</td>
|
91 |
+
<td width=100>
|
92 |
+
<table><tr><td>G</td></tr></table>
|
93 |
+
<table cellspacing=0 cellpadding=0>
|
94 |
+
<tr><td></td><td>■</td><td>■</td><td></td></tr>
|
95 |
+
<tr><td>■</td><td>■</td><td></td><td></td></tr>
|
96 |
+
<tr><td></td><td></td><td></td><td></td></tr>
|
97 |
+
<tr><td></td><td></td><td></td><td></td></tr>
|
98 |
+
</table>
|
99 |
+
</td>
|
100 |
+
</tr>
|
101 |
+
</table>
|
102 |
+
</center>
|
103 |
+
|
104 |
+
<br/>
|
105 |
+
|
106 |
+
<p>たとえば、次の図 2 の例では E の図形が置かれています。
|
107 |
+
<br/>
|
108 |
+
|
109 |
+
<center>
|
110 |
+
<table>
|
111 |
+
<tr>
|
112 |
+
<td>
|
113 |
+
<table cellspacing=0 cellpadding=0>
|
114 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
115 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
116 |
+
<tr><td>□</td><td>■</td><td>■</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
117 |
+
<tr><td>□</td><td>□</td><td>■</td><td>■</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
118 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
119 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
120 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
121 |
+
<tr><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td><td>□</td></tr>
|
122 |
+
</table>
|
123 |
+
</td>
|
124 |
+
</tr>
|
125 |
+
</table>
|
126 |
+
<br>
|
127 |
+
<table>
|
128 |
+
<tr>
|
129 |
+
<td>図2</td>
|
130 |
+
</tr>
|
131 |
+
</table>
|
132 |
+
</center>
|
133 |
+
<br>
|
134 |
+
|
135 |
+
|
136 |
+
<p>
|
137 |
+
平面の中で図形が占めているマスを 1、占めていないマスを 0 で表現した数字の列を読み込んで、置かれている図形の種類(A〜G)を出力するプログラムを作成してください。
|
138 |
+
<p>
|
139 |
+
ただし、ひとつの平面に置かれている図形は必ず1つで、複数の図形が置かれていることはありません。また、A〜G で表される図形以���のものが置かれていることはありません。
|
140 |
+
</p>
|
141 |
+
|
142 |
+
|
143 |
+
<H2>Input</H2>
|
144 |
+
|
145 |
+
<p>
|
146 |
+
入力は複数のデータセットからなります。
|
147 |
+
</p>
|
148 |
+
|
149 |
+
<p>
|
150 |
+
1つのデータセットとして、平面の中で図形が占めているマスを 1、占めていないマスを 0 で表現した 8 文字からなる 8 つの文字列が与えられます。例えば、図 2 に対応する文字列の並びは次のようになります。
|
151 |
+
</p>
|
152 |
+
|
153 |
+
<center>
|
154 |
+
<table>
|
155 |
+
<tr>
|
156 |
+
<td>
|
157 |
+
<table cellspacing=0 cellpadding=0>
|
158 |
+
<tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
|
159 |
+
<tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
|
160 |
+
<tr><td>0</td><td>1</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
|
161 |
+
<tr><td>0</td><td>0</td><td>1</td><td>1</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
|
162 |
+
<tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
|
163 |
+
<tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
|
164 |
+
<tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
|
165 |
+
<tr><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td><td>0</td></tr>
|
166 |
+
</table>
|
167 |
+
</tr>
|
168 |
+
</table>
|
169 |
+
</center>
|
170 |
+
<br>
|
171 |
+
|
172 |
+
<p>
|
173 |
+
データセットの間は1つの空行で区切られています。データセットの数は 50 を超えません。
|
174 |
+
</p>
|
175 |
+
|
176 |
+
|
177 |
+
|
178 |
+
<H2>Output</H2>
|
179 |
+
|
180 |
+
<p>
|
181 |
+
各データセットごとに、平面に与えられた図形の種類(A〜G のいずれか)を1行に出力してください。
|
182 |
+
</p>
|
183 |
+
|
184 |
+
<H2>Sample Input</H2>
|
185 |
+
|
186 |
+
<pre>
|
187 |
+
00000000
|
188 |
+
00000000
|
189 |
+
01100000
|
190 |
+
00110000
|
191 |
+
00000000
|
192 |
+
00000000
|
193 |
+
00000000
|
194 |
+
00000000
|
195 |
+
|
196 |
+
00011110
|
197 |
+
00000000
|
198 |
+
00000000
|
199 |
+
00000000
|
200 |
+
00000000
|
201 |
+
00000000
|
202 |
+
00000000
|
203 |
+
00000000
|
204 |
+
|
205 |
+
00000000
|
206 |
+
00000000
|
207 |
+
00110000
|
208 |
+
00110000
|
209 |
+
00000000
|
210 |
+
00000000
|
211 |
+
00000000
|
212 |
+
00000000
|
213 |
+
</pre>
|
214 |
+
|
215 |
+
<H2>Output for the Sample Input</H2>
|
216 |
+
|
217 |
+
<pre>
|
218 |
+
E
|
219 |
+
C
|
220 |
+
A
|
221 |
+
</pre>
|
222 |
+
|
223 |
+
|
datasets/problem_descriptions/p00037.html
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>格子上の経路</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
上から見ると図 1 のような形の格子状の広場があります。この格子の各辺に「壁」があるかないかを 0 と 1 の並びで表します。点 A に立って壁に右手をつき、壁に右手をついたまま、矢印の方向に歩き続けて再び点 A に戻ってくるまでの経路を出力するプログラムを作成してください。
|
8 |
+
</p>
|
9 |
+
<center>
|
10 |
+
<table>
|
11 |
+
<tr><th>
|
12 |
+
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_pathOnGrid1">
|
13 |
+
</t></tr>
|
14 |
+
</table>
|
15 |
+
<table>
|
16 |
+
<tr><th>
|
17 |
+
図1
|
18 |
+
</th></tr>
|
19 |
+
</table>
|
20 |
+
</center>
|
21 |
+
<br/>
|
22 |
+
|
23 |
+
<H2>Input</H2>
|
24 |
+
|
25 |
+
<p>
|
26 |
+
入力は9行からなり、以下の図 2 に示すように、壁がある場合を 1、ない場合を 0 として、以下の形式で与えられます。
|
27 |
+
<br><br>
|
28 |
+
1 行目は一番上の横線の壁の有無を左から 0 と 1 で表した文字列<br>
|
29 |
+
2 行目はその下の縦線の壁の有無を左から0 と1 で表した文字列<br>
|
30 |
+
3 行目は上から2 本目の横線の壁の有無を左から0 と1 で表した文字列<br>
|
31 |
+
...<br>
|
32 |
+
9 行目は一番下の横線の壁の有無を左から0 と1 で表した文字列<br>
|
33 |
+
</p>
|
34 |
+
|
35 |
+
<center>
|
36 |
+
<table>
|
37 |
+
<tr><th>
|
38 |
+
<img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_pathOnGrid2">
|
39 |
+
</th></tr>
|
40 |
+
<tr><th>
|
41 |
+
図2 (壁あるところを太線で表しています) (対応する数字のならび)
|
42 |
+
</th></tr>
|
43 |
+
</table>
|
44 |
+
</center>
|
45 |
+
<br/>
|
46 |
+
|
47 |
+
<p>
|
48 |
+
ただし、図1の太線に示すように、点 A から右に 1 区画分は必ず壁があるものとします。すなわち、1 行目の 1 文字目は常に 1 です。
|
49 |
+
</p>
|
50 |
+
|
51 |
+
<H2>Output</H2>
|
52 |
+
|
53 |
+
|
54 |
+
<p>
|
55 |
+
「図の左方向に一区画分進む」を '<span>L</span>'、「図の右方向に一区画分進む」を '<span>R</span>'、「図の上方向に一区画分進む」を '<span>U</span>'、「図の下方向に一区画分進む」を '<span>D</span>' で表わし、進む順に '<span>L</span>', '<span>R</span>', '<span>U</span>', '<span>D</span>' を1行に並べて出力します。
|
56 |
+
</p>
|
57 |
+
|
58 |
+
|
59 |
+
<H2>Sample Input</H2>
|
60 |
+
|
61 |
+
<pre>
|
62 |
+
1111
|
63 |
+
00001
|
64 |
+
0110
|
65 |
+
01011
|
66 |
+
0010
|
67 |
+
01111
|
68 |
+
0010
|
69 |
+
01001
|
70 |
+
0111
|
71 |
+
</pre>
|
72 |
+
|
73 |
+
<H2>Output for the Sample Input</H2>
|
74 |
+
|
75 |
+
<pre>
|
76 |
+
RRRRDDDDLLLUUURRDDLURULLDDDRRRUUUULLLL
|
77 |
+
</pre>
|
78 |
+
|
79 |
+
|
datasets/problem_descriptions/p00038.html
ADDED
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>ポーカー</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
ポーカーの手札データを読み込んで、それぞれについてその役を出力するプログラムを作成してください。ただし、この問題では、以下のルールに従います。
|
8 |
+
</p>
|
9 |
+
|
10 |
+
|
11 |
+
<ul>
|
12 |
+
<li>ポーカーはトランプ 5 枚で行う競技です。</li>
|
13 |
+
<li>同じ数字のカードは 5 枚以上ありません。</li>
|
14 |
+
<li>ジョーカーは無いものとします。</li>
|
15 |
+
<li>以下のポーカーの役だけを考えるものとします。(番号が大きいほど役が高くなります。)</li>
|
16 |
+
</ul>
|
17 |
+
<ol style="margin-left:40px">
|
18 |
+
<li>役なし(以下に挙げるどれにも当てはまらない)</li>
|
19 |
+
<li>ワンペア(2 枚の同じ数字のカードが1 組ある)</li>
|
20 |
+
<li>ツーペア(2 枚の同じ数字のカードが2 組ある)</li>
|
21 |
+
<li>スリーカード(3 枚の同じ数字のカードが1 組ある)</li>
|
22 |
+
<li>ストレート(5 枚のカードの数字が連続している)<br>
|
23 |
+
|
24 |
+
ただし、A を含むストレートの場合、A で終わる並びもストレートとします。つまり、A を含むストレート
|
25 |
+
は、A 2 3 4 5 と 10 J Q K A の2種類です。J Q K A 2 などのように、A をまたぐ並び
|
26 |
+
はストレートではありません。(この場合、「役なし」になります)。
|
27 |
+
</li>
|
28 |
+
|
29 |
+
<li>フルハウス(3 枚の同じ数字のカードが1 組と、残りの2 枚が同じ数字のカード)</li>
|
30 |
+
<li>フォーカード(4 枚の同じ数字のカードが1 組ある)</li>
|
31 |
+
</ol>
|
32 |
+
|
33 |
+
|
34 |
+
|
35 |
+
<H2>Input</H2>
|
36 |
+
|
37 |
+
<p>
|
38 |
+
入力は複数のデータセットからなります。各データセットは以下の形式で与えられます。
|
39 |
+
</p>
|
40 |
+
|
41 |
+
<pre class=exp>
|
42 |
+
手札1,手札2,手札3,手札4,手札5
|
43 |
+
</pre>
|
44 |
+
|
45 |
+
<p>
|
46 |
+
手札は、トランプのJ(ジャック) を11、Q(クイーン) を12、K(キング) を13、A(エース)を 1、その他はそれぞれの数字で表すこととします。
|
47 |
+
</p>
|
48 |
+
|
49 |
+
<p>
|
50 |
+
データセットの数は 50 を超えません。
|
51 |
+
</p>
|
52 |
+
|
53 |
+
<H2>Output</H2>
|
54 |
+
|
55 |
+
<p>
|
56 |
+
データセットごとに、手札によってできる最も高い役をひとつ出力してください。役の表記については出力例に従ってください。
|
57 |
+
</p>
|
58 |
+
|
59 |
+
<H2>Sample Input</H2>
|
60 |
+
|
61 |
+
<pre>
|
62 |
+
1,2,3,4,1
|
63 |
+
2,3,2,3,12
|
64 |
+
12,13,11,12,12
|
65 |
+
7,6,7,6,7
|
66 |
+
3,3,2,3,3
|
67 |
+
6,7,8,9,10
|
68 |
+
11,12,10,1,13
|
69 |
+
11,12,13,1,2
|
70 |
+
</pre>
|
71 |
+
|
72 |
+
<H2>Output for the Sample Input</H2>
|
73 |
+
|
74 |
+
<pre>
|
75 |
+
one pair
|
76 |
+
two pair
|
77 |
+
three card
|
78 |
+
full house
|
79 |
+
four card
|
80 |
+
straight
|
81 |
+
straight
|
82 |
+
null
|
83 |
+
</pre>
|
84 |
+
|
85 |
+
<p>
|
86 |
+
3 3 2 3 3 という手札であったときは、two pair ではなく four card です。
|
87 |
+
</p>
|
88 |
+
|
datasets/problem_descriptions/p00039.html
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>ローマ数字</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
古代ローマでは数を数えることは難しい仕事でした。アラビア数字の 0,1,2,3,…, 9 はまだ流布していませんでした。その代わり次のような記号が使われていました。
|
8 |
+
</p>
|
9 |
+
|
10 |
+
<center>
|
11 |
+
<table border=1>
|
12 |
+
<tr>
|
13 |
+
<td bgcolor="#EEFFFF" width="100">アラビア数字</td><td width="100">ローマ数字</td><td bgcolor="#EEFFFF" width="100">アラビア数字</td><td width="100">ローマ数字</td><td bgcolor="#EEFFFF" width="100">アラビア数字</td><td width="100">ローマ数字</td>
|
14 |
+
</tr>
|
15 |
+
<tr><td bgcolor="#EEFFFF">1</td><td>I</td><td bgcolor="#EEFFFF">11<td>XI</td><td bgcolor="#EEFFFF">30</td><td>XXX</td><td>
|
16 |
+
<tr><td bgcolor="#EEFFFF">2</td><td>II</td><td bgcolor="#EEFFFF">12<td>XII</td><td bgcolor="#EEFFFF">40</td><td>XL</td><td>
|
17 |
+
<tr><td bgcolor="#EEFFFF">3</td><td>III</td><td bgcolor="#EEFFFF">13<td>XIII</td><td bgcolor="#EEFFFF">50</td><td>L</td><td>
|
18 |
+
<tr><td bgcolor="#EEFFFF">4</td><td>IV</td><td bgcolor="#EEFFFF">14<td>XIV</td><td bgcolor="#EEFFFF">60</td><td>LX</td><td>
|
19 |
+
<tr><td bgcolor="#EEFFFF">5</td><td>V</td><td bgcolor="#EEFFFF">15<td>XV</td><td bgcolor="#EEFFFF">70</td><td>LXX</td><td>
|
20 |
+
<tr><td bgcolor="#EEFFFF">6</td><td>VI</td><td bgcolor="#EEFFFF">16<td>XVI</td><td bgcolor="#EEFFFF">80</td><td>LXXX</td><td>
|
21 |
+
<tr><td bgcolor="#EEFFFF">7</td><td>VII</td><td bgcolor="#EEFFFF">17<td>XVII</td><td bgcolor="#EEFFFF">90</td><td>XC</td><td>
|
22 |
+
<tr><td bgcolor="#EEFFFF">8</td><td>VIII</td><td bgcolor="#EEFFFF">18<td>XVIII</td><td bgcolor="#EEFFFF">100</td><td>C</td><td>
|
23 |
+
<tr><td bgcolor="#EEFFFF">9</td><td>IX</td><td bgcolor="#EEFFFF">19<td>XIX</td><td bgcolor="#EEFFFF">500</td><td>D</td><td>
|
24 |
+
<tr><td bgcolor="#EEFFFF">10</td><td>X</td><td bgcolor="#EEFFFF">20<td>XX</td><td bgcolor="#EEFFFF">1000</td><td>M</td><td>
|
25 |
+
</table>
|
26 |
+
</center>
|
27 |
+
<br/>
|
28 |
+
|
29 |
+
|
30 |
+
<p>
|
31 |
+
I は 1、 V は 5、 X は 10、 L は 50、 C は 100、 D は 500、 M は 1000、 他の例は上の表を見てください。小さい数が大きい数に続いている、つまり右側にあるときは足し算をします。小さい数が大きい数の前に、つまり左にあるときは、大きい数から小さい数を引きます。大きい数字の前にあって引き算を表す小さな数字は一回の引き算あたりひとつしかありません。
|
32 |
+
</p>
|
33 |
+
|
34 |
+
<p>
|
35 |
+
ローマ数字をアラビア数字(通常の数字)の表記(10 進表示)に変換して出力するプログラムを作成してください。ただし、与えられるローマ数字は上記のルールにのみ従っています(実際のローマ数字の表記にはもっと細かいルールがありますが、ここでは考慮する必要はありません。たとえば、実際のローマ数字ではI はV かX から、X はL かC から、C はD かM からしか引き算しませんし、同じローマ数字は4つ以上(または5つ以上)足し並べることはありません。)
|
36 |
+
</p>
|
37 |
+
|
38 |
+
|
39 |
+
<H2>Input</H2>
|
40 |
+
|
41 |
+
<p>
|
42 |
+
複数のデータセットが与えられます。それぞれのデータセットにローマ数字(半角大文字のI, V, X, L, C, D ,M で表される連続した文字列)が1行に与えられます。与えられるローマ数字の文字列の長さはおのおの 100 以下です。
|
43 |
+
</p>
|
44 |
+
<p>
|
45 |
+
データセットの数は 50 を超えません。
|
46 |
+
</p>
|
47 |
+
|
48 |
+
|
49 |
+
|
50 |
+
|
51 |
+
<H2>Output</H2>
|
52 |
+
|
53 |
+
<p>
|
54 |
+
各データセットに対し、アラビア数字(整数)を1行に出力して下さい。
|
55 |
+
</p>
|
56 |
+
|
57 |
+
<H2>Sample Input</H2>
|
58 |
+
|
59 |
+
<pre>
|
60 |
+
IV
|
61 |
+
CCCCLXXXXVIIII
|
62 |
+
CDXCIX
|
63 |
+
</pre>
|
64 |
+
|
65 |
+
<H2>Output for the Sample Input</H2>
|
66 |
+
|
67 |
+
<pre>
|
68 |
+
4
|
69 |
+
499
|
70 |
+
499
|
71 |
+
</pre>
|
72 |
+
|
datasets/problem_descriptions/p00040.html
ADDED
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<script type="text/x-mathjax-config">
|
5 |
+
MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});
|
6 |
+
</script>
|
7 |
+
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML">
|
8 |
+
</script>
|
9 |
+
|
10 |
+
<H1>アフィン暗号</H1>
|
11 |
+
|
12 |
+
<p>
|
13 |
+
簡単な暗号法の一つに、アフィン暗号というものがあります。まず、アルファベット a〜z を a = 0, b = 1, c = 2,..., x = 23, y = 24, z = 25 と 0〜25 の数字に置き換えます。そして、以下の式で、原文のアルファベットを置換します。
|
14 |
+
</p>
|
15 |
+
|
16 |
+
<center>
|
17 |
+
<!--
|
18 |
+
<p>
|
19 |
+
F(γ) = (α・γ+β) mod 26
|
20 |
+
</p>
|
21 |
+
-->
|
22 |
+
|
23 |
+
<p>
|
24 |
+
$F(\gamma) = (\alpha \cdot \gamma + \beta)$ mod $26$
|
25 |
+
</p>
|
26 |
+
|
27 |
+
</center>
|
28 |
+
|
29 |
+
<p>
|
30 |
+
ただし、mod 26 は 26 で割った余りを表します。例えば、$\alpha = 3, \beta = 2$ のとき、アルファベットの 'a' (=0) は、$F(0) = (3 \cdot 0 + 2)$ mod $26 = 2$ で 'c' に、アルファベットの 'n' (=13) は $F(13) = (3 \cdot 13 + 2)$ mod $26 = 15$ で 'p' に置換されます。
|
31 |
+
このとき、$\gamma$ に対する $F(\gamma)$ が必ず 1 対 1 で対応付けられるように、$\alpha$ と $\beta$ は慎重に選ばれているものとします($\alpha$ と 26 が互いに素であることが条件)。$\alpha = 4, \beta = 7$ のときのように、$F('a') = 7, F('n') = 7$ と、'a' も 'n' も同じ 'h' に置換されるようなことはありません。また、アルファベット以外の文字は置換されません。
|
32 |
+
</p>
|
33 |
+
<p>
|
34 |
+
暗号化された文字列を元の文章に復号したものを出力するプログラムを作成してください。元の文章には、キーワードとして
|
35 |
+
</p>
|
36 |
+
|
37 |
+
<pre>
|
38 |
+
that
|
39 |
+
this
|
40 |
+
</pre>
|
41 |
+
|
42 |
+
<p>
|
43 |
+
のいずれかが必ず含まれているものとします。
|
44 |
+
</p>
|
45 |
+
|
46 |
+
<H2>Input</H2>
|
47 |
+
|
48 |
+
<p>
|
49 |
+
複数のデータセットが与えられます。1行目にデータセット数 $n$ ($n \leq 30$) が与えられます。続いて $n$ 行のデータが与えられます。各データセットに英小文字と空白からなる 256 文字以内の暗号化された文章が1行に与えられます。
|
50 |
+
</p>
|
51 |
+
|
52 |
+
<H2>Output</H2>
|
53 |
+
|
54 |
+
<p>
|
55 |
+
各データセットに対して、復号した元の文章を1行に出力して下さい。
|
56 |
+
</p>
|
57 |
+
|
58 |
+
<H2>Sample Input</H2>
|
59 |
+
|
60 |
+
<pre>
|
61 |
+
1
|
62 |
+
y eazqyp pnop pngtg ye obmpngt xmybp mr lygw
|
63 |
+
</pre>
|
64 |
+
|
65 |
+
<H2>Output for the Sample Input</H2>
|
66 |
+
|
67 |
+
<pre>
|
68 |
+
i submit that there is another point of view
|
69 |
+
</pre>
|
70 |
+
|
71 |
+
|
72 |
+
|
datasets/problem_descriptions/p00041.html
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>式</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
与えられた 4 つの 1 から 9 の整数を使って、答えが 10 になる式をつくります。
|
8 |
+
4 つの整数 <var>a, b, c, d</var> を入力したとき、下記の条件に従い、答えが 10 になる式を出力するプログラムを作成してください。また、答えが複数ある時は、最初に見つかった答えだけを出力するものとします。答えがない時は、0 と出力してください。
|
9 |
+
</p>
|
10 |
+
|
11 |
+
<ul>
|
12 |
+
<li>演算子として、加算 (+)、減算 (-)、乗算 (*) だけを使います。除算 (/) は使いません。使用できる演算子は3個です。</li>
|
13 |
+
<li>数を4つとも使わなければいけません。</li>
|
14 |
+
<li>4つの数の順番は自由に入れ換えてかまいません。</li>
|
15 |
+
<li>カッコを使ってもかまいません。使用できるカッコは3組(6個)以下です。</li>
|
16 |
+
</ul>
|
17 |
+
|
18 |
+
<H2>Input</H2>
|
19 |
+
|
20 |
+
<p>
|
21 |
+
複数のデータセットが与えられます。各データセットの形式は以下のとおり:
|
22 |
+
</p>
|
23 |
+
|
24 |
+
<pre><var>a</var> <var>b</var> <var>c</var> <var>d</var></pre>
|
25 |
+
|
26 |
+
<p>
|
27 |
+
入力は4つの 0 で終了します。データセットの数は 40 を超えません。
|
28 |
+
</p>
|
29 |
+
|
30 |
+
<H2>Output</H2>
|
31 |
+
|
32 |
+
<p>
|
33 |
+
各データセットについて、与えられた 4 つの整数と上記の演算記号およびカッコを組み合わせて値が 10 となる式または 0 を1行に出力してください。式の文字列が 1024 文字を超えてはいけません。
|
34 |
+
</p>
|
35 |
+
|
36 |
+
<H2>Sample Input</H2>
|
37 |
+
|
38 |
+
<pre>
|
39 |
+
8 7 9 9
|
40 |
+
4 4 4 4
|
41 |
+
5 5 7 5
|
42 |
+
0 0 0 0
|
43 |
+
</pre>
|
44 |
+
|
45 |
+
<H2>Output for the Sample Input</H2>
|
46 |
+
|
47 |
+
<pre>
|
48 |
+
((9 * (9 - 7)) - 8)
|
49 |
+
0
|
50 |
+
((7 * 5) - (5 * 5))
|
51 |
+
</pre>
|
52 |
+
|
53 |
+
|
datasets/problem_descriptions/p00042.html
ADDED
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
<H1>泥棒</H1>
|
6 |
+
|
7 |
+
<p>
|
8 |
+
宝物がたくさん収蔵されている博物館に、泥棒が大きな風呂敷を一つだけ持って忍び込みました。盗み出したいものはたくさんありますが、風呂敷が耐えられる重さが限られており、これを超えると風呂敷が破れてしまいます。そこで泥棒は、用意した風呂敷を破らず且つ最も価値が高くなるようなお宝の組み合わせを考えなくてはなりません。
|
9 |
+
</p>
|
10 |
+
|
11 |
+
<p>
|
12 |
+
風呂敷が耐えられる重さ <var>W</var>、および博物館にある個々のお宝の価値と重さを読み込んで、重さの総和が <var>W</var> を超えない範囲で価値の総和が最大になるときの、お宝の価値総和と重さの総和を出力するプログラムを作成してください。ただし、価値の総和が最大になる組み合わせが複数あるときは、重さの総和が小さいものを出力することとします。
|
13 |
+
</p>
|
14 |
+
|
15 |
+
<!--
|
16 |
+
また、博物館にあるお宝の総数は 1000 以下とし、お宝の価値は10000 以下とします。
|
17 |
+
-->
|
18 |
+
|
19 |
+
<H2>Input</H2>
|
20 |
+
|
21 |
+
<p>
|
22 |
+
複数のデータセットが与えられます。各データセットは以下のような形式で与えられます。
|
23 |
+
</p>
|
24 |
+
|
25 |
+
<pre>
|
26 |
+
<var>W</var>
|
27 |
+
<var>N</var>
|
28 |
+
<var>v<sub>1</sub></var>,<var>w<sub>1</sub></var>
|
29 |
+
<var>v<sub>2</sub></var>,<var>w<sub>2</sub></var>
|
30 |
+
:
|
31 |
+
<var>v<sub>N</sub></var>,<var>w<sub>N</sub></var>
|
32 |
+
</pre>
|
33 |
+
|
34 |
+
<p>
|
35 |
+
1行目に風呂敷の耐えられる重さを表す整数 <var>W</var> (<var>W</var> ≤ 1,000)、2行目にお宝の数 <var>N</var> (1 ≤ <var>N</var> ≤ 1,000) が与えられます。続く <var>N</var> 行に <var>i</var> 番目のお宝の価値を表す整数 <var>v<sub>i</sub></var> (0 ≤ <var>v<sub>i</sub></var> ≤ 10,000) とその重さを表す整数 <var>w<sub>i</sub></var> (0 ≤ <var>w<sub>i</sub></var> ≤ <var>W</var>) の組がそれぞれ1行に与えられます。
|
36 |
+
</p>
|
37 |
+
|
38 |
+
<p>
|
39 |
+
<var>W</var> が 0 のとき入力の最後とします。データセットの数は 50 を超えません。
|
40 |
+
</p>
|
41 |
+
|
42 |
+
<H2>Output</H2>
|
43 |
+
|
44 |
+
<p>
|
45 |
+
各データセットに対して以下のように出力して下さい。
|
46 |
+
</p>
|
47 |
+
|
48 |
+
<pre>
|
49 |
+
Case データセットの番号:
|
50 |
+
風呂敷に入れたお宝の価値総和
|
51 |
+
そのときのお宝の重さの総和
|
52 |
+
</pre>
|
53 |
+
|
54 |
+
<H2>Sample Input</H2>
|
55 |
+
|
56 |
+
<pre>
|
57 |
+
50
|
58 |
+
5
|
59 |
+
60,10
|
60 |
+
100,20
|
61 |
+
120,30
|
62 |
+
210,45
|
63 |
+
10,4
|
64 |
+
50
|
65 |
+
5
|
66 |
+
60,10
|
67 |
+
100,20
|
68 |
+
120,30
|
69 |
+
210,45
|
70 |
+
10,4
|
71 |
+
0
|
72 |
+
</pre>
|
73 |
+
|
74 |
+
<H2>Output for the Sample Input</H2>
|
75 |
+
|
76 |
+
<pre>
|
77 |
+
Case 1:
|
78 |
+
220
|
79 |
+
49
|
80 |
+
Case 2:
|
81 |
+
220
|
82 |
+
49
|
83 |
+
</pre>
|
84 |
+
|
85 |
+
|
86 |
+
|
datasets/problem_descriptions/p00043.html
ADDED
@@ -0,0 +1,67 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>パズル</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
1 〜 9 の数字を 14 個組み合わせて完成させるパズルがあります。与えられた 13 個の数字にもうひとつ数字を付け加えて完成させます。
|
8 |
+
</p>
|
9 |
+
|
10 |
+
<p>
|
11 |
+
パズルの完成条件は
|
12 |
+
</p>
|
13 |
+
<ul>
|
14 |
+
<li>同じ数字を2つ組み合わせたものが必ずひとつ必要です。</li>
|
15 |
+
<li>残りの12 個の数字は、3個の数字の組み合わせ4つです。<br>
|
16 |
+
3個の数字の組み合わせ方は、同じ数字を3つ組み合わせたものか、または3つの連続する数字を組み合わせたものです。ただし、9 1 2 のような並びは連続する数字とは認められません。</li>
|
17 |
+
<li>同じ数字は4 回まで使えます。</li>
|
18 |
+
</ul>
|
19 |
+
|
20 |
+
<p>
|
21 |
+
13 個の数字からなる文字列を読み込んで、パズルを完成することができる数字を昇順に全て出力するプログラムを作成してください。なお、1〜9 のどの数字を付け加えてもパズルを完成させることができないときは 0 を出力してください。
|
22 |
+
</p>
|
23 |
+
|
24 |
+
<p>例えば与えられた文字列が 3456666777999 の場合<br/>
|
25 |
+
<br/>
|
26 |
+
「2」があれば、 <span>234 567 666 77 999</span><br/>
|
27 |
+
「3」があれば、 <span>33 456 666 777 999</span><br/>
|
28 |
+
「5」があれば、 <span>345 567 666 77 999</span><br/>
|
29 |
+
「8」があれば、 <span>345 666 678 77 999</span><br/>
|
30 |
+
<br/>
|
31 |
+
というふうに、2 3 5 8 のいずれかの数字が付け加えられるとパズルは完成します。「6」でも整いますが、5 回目の使用になるので、この例では使えないことに注意してください。
|
32 |
+
</p>
|
33 |
+
|
34 |
+
<H2>Input</H2>
|
35 |
+
|
36 |
+
<p>
|
37 |
+
入力は複数のデータセットからなります。各データセットとして、13 個の数字が1行に与えられます。データセットの数は 50 を超えません。
|
38 |
+
</p>
|
39 |
+
|
40 |
+
<H2>Output</H2>
|
41 |
+
|
42 |
+
<p>
|
43 |
+
データセットごとに、パズルを完成させることができる数字を昇順に空白区切りで1行に出力します。
|
44 |
+
</p>
|
45 |
+
|
46 |
+
<H2>Sample Input</H2>
|
47 |
+
|
48 |
+
<pre>
|
49 |
+
3649596966777
|
50 |
+
6358665788577
|
51 |
+
9118992346175
|
52 |
+
9643871425498
|
53 |
+
7755542764533
|
54 |
+
1133557799246
|
55 |
+
</pre>
|
56 |
+
|
57 |
+
<H2>Output for the Sample Input</H2>
|
58 |
+
|
59 |
+
<pre>
|
60 |
+
2 3 5 8
|
61 |
+
3 4
|
62 |
+
1 2 3 4 5 6 7 8 9
|
63 |
+
7 8 9
|
64 |
+
1 2 3 4 6 7 8
|
65 |
+
0
|
66 |
+
</pre>
|
67 |
+
|
datasets/problem_descriptions/p00044.html
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
|
5 |
+
<H1>素数 II</H1>
|
6 |
+
|
7 |
+
<p>
|
8 |
+
素数というのは、1 よりも大きくそれ自身か 1 でしか割りきれない整数をいいます。例えば、2 は、2 と 1 でしか割り切れないので素数ですが、12 は、12 と 1 のほかに、2, 3, 4, 6 で割りきれる数なので素数ではありません。
|
9 |
+
</p>
|
10 |
+
|
11 |
+
<p>
|
12 |
+
整数 <var>n</var> を入力したとき、<var>n</var> より小さい素数のうち最も大きいものと、<var>n</var> より大きい素数のうち最も小さいものを出力するプログラムを作成してください。
|
13 |
+
</p>
|
14 |
+
|
15 |
+
<H2>Input</H2>
|
16 |
+
|
17 |
+
<p>
|
18 |
+
複数のデータセットが与えられます。各データセットに <var>n</var> (3 ≤ <var>n</var> ≤ 50,000) が1行に与えられます。
|
19 |
+
</p>
|
20 |
+
|
21 |
+
<p>
|
22 |
+
データセットの数は 50 を超えません。
|
23 |
+
</p>
|
24 |
+
|
25 |
+
<H2>Output</H2>
|
26 |
+
|
27 |
+
<p>
|
28 |
+
各データセットに対して、<var>n</var> より小さい素数のうち最大のものと、<var>n</var> より大きい素数のうち最小のものを1つのスペースで区切って1行に出力して下さい。
|
29 |
+
</p>
|
30 |
+
|
31 |
+
<H2>Sample Input</H2>
|
32 |
+
|
33 |
+
<pre>
|
34 |
+
19
|
35 |
+
3517
|
36 |
+
</pre>
|
37 |
+
|
38 |
+
<H2>Output for the Sample Input</H2>
|
39 |
+
|
40 |
+
<pre>
|
41 |
+
17 23
|
42 |
+
3511 3527
|
43 |
+
</pre>
|
44 |
+
|
45 |
+
|
datasets/problem_descriptions/p00045.html
ADDED
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>Sum and Average</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
販売単価と販売数量を読み込んで、販売金額の総合計と販売数量の平均を出力するプログラムを作成してください。
|
8 |
+
</p>
|
9 |
+
|
10 |
+
<H2>Input</H2>
|
11 |
+
<p>
|
12 |
+
入力は以下の形式で与えられます。
|
13 |
+
</p>
|
14 |
+
|
15 |
+
<pre>
|
16 |
+
販売単価,販売数量
|
17 |
+
販売単価,販売数量
|
18 |
+
:
|
19 |
+
:
|
20 |
+
</pre>
|
21 |
+
|
22 |
+
<p>
|
23 |
+
カンマで区切られた販売単価と販売数量の組が、複数行に渡って与えられます。入力される値はすべて 0 以上 1,000 以下で、販売単価と販売数量の組の数は 100 を超えません。
|
24 |
+
</p>
|
25 |
+
|
26 |
+
<H2>Output</H2>
|
27 |
+
|
28 |
+
<p>
|
29 |
+
1行目に販売金額の総合計(整数)、2行目に販売数量の平均(整数)を出力してください。
|
30 |
+
販売数量の平均に端数(小数点以下の数)が生じた場合は小数点以下第 1 位を四捨五入してください。
|
31 |
+
</p>
|
32 |
+
|
33 |
+
<H2>Sample Input</H2>
|
34 |
+
|
35 |
+
<pre>
|
36 |
+
100,20
|
37 |
+
50,10
|
38 |
+
70,35
|
39 |
+
</pre>
|
40 |
+
|
41 |
+
<H2>Output for the Sample Input</H2>
|
42 |
+
|
43 |
+
<pre>
|
44 |
+
4950
|
45 |
+
22
|
46 |
+
</pre>
|
47 |
+
|
48 |
+
|
datasets/problem_descriptions/p00046.html
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>標高差</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
今まで登ったことのある山の標高を記録したデータがあります。このデータを読み込んで、一番高い山と一番低い山の標高差を出力するプログラムを作成してください。
|
8 |
+
</p>
|
9 |
+
|
10 |
+
<H2>Input</H2>
|
11 |
+
|
12 |
+
<p>
|
13 |
+
入力は以下の形式で与えられます。
|
14 |
+
</p>
|
15 |
+
|
16 |
+
<pre class="exp">
|
17 |
+
山の高さ
|
18 |
+
...
|
19 |
+
...
|
20 |
+
</pre>
|
21 |
+
|
22 |
+
<p>
|
23 |
+
山の高さが複数行に渡って与えられます。入力される値はすべて 0 以上 1,000,000 以下の実数です。入力される山の高さの数は 50 以下です。
|
24 |
+
</p>
|
25 |
+
|
26 |
+
<H2>Output</H2>
|
27 |
+
|
28 |
+
<p>
|
29 |
+
一番高い山と一番低い山の標高差を実数で出力する。出力は0.01以下の誤差を含んでもよい。
|
30 |
+
</p>
|
31 |
+
|
32 |
+
<H2>Sample Input</H2>
|
33 |
+
|
34 |
+
<pre>
|
35 |
+
3776.0
|
36 |
+
1819.0
|
37 |
+
645.2
|
38 |
+
2004.1
|
39 |
+
1208.6
|
40 |
+
</pre>
|
41 |
+
|
42 |
+
<H2>Output for the Sample Input</H2>
|
43 |
+
|
44 |
+
<pre>
|
45 |
+
3130.8
|
46 |
+
</pre>
|
47 |
+
|
48 |
+
|
49 |
+
|
datasets/problem_descriptions/p00047.html
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>カップゲーム</H1>
|
5 |
+
|
6 |
+
<center>
|
7 |
+
<table>
|
8 |
+
<tr>
|
9 |
+
<td><img src="https://judgeapi.u-aizu.ac.jp/resources/images/IMAGE1_cupGame"></td>
|
10 |
+
</tr>
|
11 |
+
</table>
|
12 |
+
</center>
|
13 |
+
<br/>
|
14 |
+
|
15 |
+
<p>
|
16 |
+
3 つのカップがふせて置かれています。カップの置かれている場所を、順に A,B,C と呼ぶことにします。最初は A に置かれているカップの中にボールが隠されているとします。カップの位置を入れ替えると、中に入っているボールも一緒に移動します。
|
17 |
+
</p>
|
18 |
+
|
19 |
+
<p>
|
20 |
+
入れ替える2つのカップの位置を読み込んで、最終的にどの場所のカップにボールが隠されているかを出力するプログラムを作成してください。
|
21 |
+
</p>
|
22 |
+
|
23 |
+
<H2>Input</H2>
|
24 |
+
<p>
|
25 |
+
入れ替える2つのカップの位置が順番に複数行にわたり与えられます。各行に、入れ替える2つのカップの位置を表す文字(A, B, または C)がカンマ区切りで与えられます。
|
26 |
+
</p>
|
27 |
+
|
28 |
+
<p>
|
29 |
+
入れ替える操作は 50 回を超えません。
|
30 |
+
</p>
|
31 |
+
|
32 |
+
|
33 |
+
<H2>Output</H2>
|
34 |
+
|
35 |
+
<p>
|
36 |
+
ボールが入っているカップの場所(A, B, または C)を1行に出力します。
|
37 |
+
</p>
|
38 |
+
|
39 |
+
<H2>Sample Input</H2>
|
40 |
+
|
41 |
+
<pre>
|
42 |
+
B,C
|
43 |
+
A,C
|
44 |
+
C,B
|
45 |
+
A,B
|
46 |
+
C,B
|
47 |
+
</pre>
|
48 |
+
|
49 |
+
<H2>Output for the Sample Input</H2>
|
50 |
+
|
51 |
+
<pre>
|
52 |
+
A
|
53 |
+
</pre>
|
54 |
+
|
55 |
+
|
56 |
+
|
datasets/problem_descriptions/p00048.html
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>階級</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
ボクシングは体重によって階級が分けられています。体重を読み込んで、その階級を出力するプログラムを作成してください。階級と体重の関係は以下の表のとおりとします。
|
8 |
+
</p>
|
9 |
+
|
10 |
+
|
11 |
+
<center>
|
12 |
+
<table border=1>
|
13 |
+
<tr><td bgcolor="#88AAFF" width="120">階級</td><td bgcolor="#88AAFF" width="240">体重(kg)</td></tr>
|
14 |
+
<tr><td>light fly</td><td>48.00kg 以下</td></tr>
|
15 |
+
<tr><td>fly</td><td>48.00kg 超 51.00kg 以下</td></tr>
|
16 |
+
<tr><td>bantam</td><td>51.00kg 超 54.00kg 以下</td></tr>
|
17 |
+
<tr><td>feather</td><td>54.00kg 超 57.00kg 以下</td></tr>
|
18 |
+
<tr><td>light</td><td>57.00kg 超 60.00kg 以下</td></tr>
|
19 |
+
<tr><td>light welter</td><td>60.00kg 超 64.00kg 以下</td></tr>
|
20 |
+
<tr><td>welter</td><td>64.00kg 超 69.00 kg 以下</td></tr>
|
21 |
+
<tr><td>light middle</td><td>69.00kg 超 75.00 kg 以下</td></tr>
|
22 |
+
<tr><td>middle</td><td>75.00kg 超 81.00 kg 以下</td></tr>
|
23 |
+
<tr><td>light heavy</td><td>81.00kg 超 91.00 kg 以下</td></tr>
|
24 |
+
<tr><td>heavy</td><td>91.00kg 超</td></tr>
|
25 |
+
</table>
|
26 |
+
</center>
|
27 |
+
<br/>
|
28 |
+
|
29 |
+
<H2>Input</H2>
|
30 |
+
|
31 |
+
<p>
|
32 |
+
入力は複数のデータセットからなります。各データセットとして、体重を表す1つの実数 <var>w</var> (40 ≤ <var>w</var> ≤ 150) が1行に与えられます。データセットの数は 50 を超えません。
|
33 |
+
</p>
|
34 |
+
|
35 |
+
|
36 |
+
<H2>Output</H2>
|
37 |
+
|
38 |
+
<p>
|
39 |
+
データセットごとに、対応する階級を1行に出力します。
|
40 |
+
</p>
|
41 |
+
|
42 |
+
|
43 |
+
<H2>Sample Input</H2>
|
44 |
+
|
45 |
+
<pre>
|
46 |
+
60.2
|
47 |
+
70.2
|
48 |
+
48.0
|
49 |
+
80.2
|
50 |
+
</pre>
|
51 |
+
|
52 |
+
<H2>Output for the Sample Input</H2>
|
53 |
+
|
54 |
+
<pre>
|
55 |
+
light welter
|
56 |
+
light middle
|
57 |
+
light fly
|
58 |
+
middle
|
59 |
+
</pre>
|
60 |
+
|
61 |
+
|
datasets/problem_descriptions/p00049.html
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
|
3 |
+
|
4 |
+
<H1>血液型</H1>
|
5 |
+
|
6 |
+
<p>
|
7 |
+
ある学級の生徒の出席番号と ABO 血液型を保存したデータを読み込んで、おのおのの血液型の人数を出力するプログラムを作成してください。なお、ABO 血液型には、A 型、B 型、AB 型、O 型の4種類の血液型があります。
|
8 |
+
</p>
|
9 |
+
|
10 |
+
<H2>Input</H2>
|
11 |
+
|
12 |
+
<p>
|
13 |
+
カンマで区切られた出席番号と血液型の組が、複数行に渡って与えられます。出席番号は 1 以上 50 以下の整数、血液型は文字列 "A", "B", "AB" または "O" のいずれかです。生徒の人数は 50 を超えません。
|
14 |
+
</p>
|
15 |
+
|
16 |
+
<H2>Output</H2>
|
17 |
+
|
18 |
+
<p>
|
19 |
+
1行目に A 型の人数<br/>
|
20 |
+
2行目に B 型の人数<br/>
|
21 |
+
3行目に AB 型の人数<br/>
|
22 |
+
4行目に O 型の人数<br/>
|
23 |
+
を出力します。
|
24 |
+
</p>
|
25 |
+
|
26 |
+
|
27 |
+
<H2>Sample Input</H2>
|
28 |
+
|
29 |
+
<pre>
|
30 |
+
1,B
|
31 |
+
2,A
|
32 |
+
3,B
|
33 |
+
4,AB
|
34 |
+
5,B
|
35 |
+
6,O
|
36 |
+
7,A
|
37 |
+
8,O
|
38 |
+
9,AB
|
39 |
+
10,A
|
40 |
+
11,A
|
41 |
+
12,B
|
42 |
+
13,AB
|
43 |
+
14,A
|
44 |
+
</pre>
|
45 |
+
|
46 |
+
<H2>Output for the Sample Input</H2>
|
47 |
+
|
48 |
+
<pre>
|
49 |
+
5
|
50 |
+
4
|
51 |
+
3
|
52 |
+
2
|
53 |
+
</pre>
|
54 |
+
|
55 |
+
|
56 |
+
|