没有合适的资源?快使用搜索试试~ 我知道了~
首页Codeforces 题库 001-100
Codeforces 题库 001-100

Codeforces 题库 001-100 共~500题 codeforces.com版权所有。 程序可提交至该网站评测。
资源详情
资源评论
资源推荐

CODEFORCES PROBLEMSET
#001-#100
2013-4-11
Sorted by Jerry Xu in Shanghai
Codeforces (c) Copyright 2010-2013 Mike Mirzayanov
Codeforces is a Russian website dedicated to competitive programming. It was created and
is currently maintained by group of sportsmen from Saratov State University led by Mikhail
Mirzayanov.
Codeforces provides to all users following main services:
Participation in the short (2-hours) contests, so-called "Codeforces Rounds", held about
once a week;
Ability to solve problems from previous contests for training purposes;
"Polygon" for creating and testing problems;
Kind of social-networking by using of internal public blogs.
Contestants are rated by system similar to ELO. There are usually no prizes for winners,
though 100 winners of 100-th Codeforces Round received a T-Shirt. Some bigger contests
(mostly country internal) are hosted on Codeforces base, among them "Yandex Algorithm
2011", provided by Yandex - one of biggest Russian IT-companies.
Website: Codeforces.com

1A. Theatre Square
time limit per test
2 seconds
memory limit per test
64 megabytes
input
standard input
output
standard output
Theatre Square in the capital city of Berland has a rectangular shape with the size
n × m meters. On the occasion of the city's anniversary, a decision was taken to
pave the Square with square granite flagstones. Each flagstone is of the size a × a.
What is the least number of flagstones needed to pave the Square? It's allowed to
cover the surface larger than the Theatre Square, but the Square has to be covered.
It's not allowed to break the flagstones. The sides of flagstones should be parallel to
the sides of the Square.
Input
The input contains three positive integer numbers in the first line: n, m and a
(1 ≤ n, m, a ≤ 10
9
).
Output
Write the needed number of flagstones.
Sample test(s)
Input
6 6 4
Output
4
1B. Spreadsheets
time limit per test
10 seconds
memory limit per test
64 megabytes
input
standard input

output
standard output
In the popular spreadsheets systems (for example, in Excel) the following
numeration of columns is used. The first column has number A, the second —
number B, etc. till column 26 that is marked by Z. Then there are two-letter
numbers: column 27 has number AA, 28 — AB, column 52 is marked by AZ. After
ZZ there follow three-letter numbers, etc.
The rows are marked by integer numbers starting with 1. The cell name is the
concatenation of the column and the row numbers. For example, BC23 is the name
for the cell that is in column 55, row 23.
Sometimes another numeration system is used: RXCY, where X and Y are integer
numbers, showing the column and the row numbers respectfully. For instance,
R23C55 is the cell from the previous example.
Your task is to write a program that reads the given sequence of cell coordinates
and produce each item written according to the rules of another numeration system.
Input
The first line of the input contains integer number n (1 ≤ n ≤ 10
5
), the number of
coordinates in the test. Then there follow n lines, each of them contains
coordinates. All the coordinates are correct, there are no cells with the column
and/or the row numbers larger than 10
6
.
Output
Write n lines, each line should contain a cell coordinates in the other numeration
system.
Sample test(s)
Input
2
R23C55
BC23
Output
BC23
R23C55
1C. Ancient Berland Circus

time limit per test
2 seconds
memory limit per test
64 megabytes
input
standard input
output
standard output
Nowadays all circuses in Berland have a round arena with diameter 13 meters, but
in the past things were different.
In Ancient Berland arenas in circuses were shaped as a regular (equiangular)
polygon, the size and the number of angles could vary from one circus to another. In
each corner of the arena there was a special pillar, and the rope strung between the
pillars marked the arena edges.
Recently the scientists from Berland have discovered the remains of the ancient
circus arena. They found only three pillars, the others were destroyed by the time.
You are given the coordinates of these three pillars. Find out what is the smallest
area that the arena could have.
Input
The input file consists of three lines, each of them contains a pair of numbers ––
coordinates of the pillar. Any coordinate doesn't exceed 1000 by absolute value,
and is given with at most six digits after decimal point.
Output
Output the smallest possible area of the ancient arena. This number should be
accurate to at least 6 digits after the decimal point. It's guaranteed that the number
of angles in the optimal polygon is not larger than 100.
Sample test(s)
Input
0.000000 0.000000
1.000000 1.000000
0.000000 1.000000
Output
1.00000000

11
2A. Winner
time limit per test
1 second
memory limit per test
64 megabytes
input
standard input
output
standard output
The winner of the card game popular in Berland "Berlogging" is determined
according to the following rules. If at the end of the game there is only one player
with the maximum number of points, he is the winner. The situation becomes more
difficult if the number of such players is more than one. During each round a player
gains or loses a particular number of points. In the course of the game the number
of points is registered in the line "name score", where name is a player's name,
and score is the number of points gained in this round, which is an integer
number. If score is negative, this means that the player has lost in the round. So, if
two or more players have the maximum number of points (say, it equals to m) at the
end of the game, than wins the one of them who scored at least m points first.
Initially each player has 0 points. It's guaranteed that at the end of the game at least
one player has a positive number of points.
Input
The first line contains an integer number n (1 ≤ n ≤ 1000), n is the number of
rounds played. Then follow n lines, containing the information about the rounds in
"name score" format in chronological order, where name is a string of lower-case
Latin letters with the length from 1 to 32, and score is an integer number between
-1000 and 1000, inclusive.
Output
Print the name of the winner.
Sample test(s)
Input
3
mike 3
andrew 5
mike 2
剩余759页未读,继续阅读
















安全验证
文档复制为VIP权益,开通VIP直接复制

评论1