Usaco 2014 Jan
I. Question Overview
Chinese question name |
Team balance |
Ski video |
Ski Resort Construction |
English question name |
Bteams |
Recording |
Skicourse |
Executable File Name |
Bteams |
Recording |
Skicourse |
Input File Name |
Bteams. In |
Recording. In |
Skicourse. In |
Output file name |
Bteams. Out |
Recording. Out |
Skicourse. Out |
Time limit for each test point |
1 second |
1 second |
1 second |
Number of test points |
10 |
10 |
10 |
Score of each test point |
10 |
10 |
10 |
Comparison Method |
Full text comparison |
Full text comparison |
Full text comparison |
Ii. Running memory limit
Maximum running memory |
256 m |
256 m |
256 m |
1.Team balance{BronzeQuestion3}
[Problem description]
John, a farmer, divides 12 cows into four groups, each with three in each group. The skill value of each ox is an integer between 1 and 1,000,000. He hopes that the sum and sum of skills in each group should be balanced as much as possible, that is, the gap between the group with the largest sum of skills and the group with the smallest sum of skills should be as small as possible. Calculate the absolute value of the minimum gap.
[File input]
Row 12, with an integer in each line, indicates the skill value of a cow.
[File output]
The output is a row with an integer representing the absolute value of the minimum gap.
[Input example]
1
2
3
4
5
6
7
8
9
10
11
12
[Output example]
1
[Example]
(12, 1, 7), (9, 8, 3), (10, 5, 4), (11, 2, 6 ). The maximum value is 20 and the minimum value is 19.
2.Ski video{SilverQuestion3}
[Problem description]
The TV timetable for the Winter Olympics contains N (1 <= n <= 150) programs, each of which has a start time and end time. Farmer John has two video recorders. Please calculate the maximum number of programs he can record.
[File input]
The first line is an integer n.
The next n rows have two integers in each row, indicating the start time and end time of a program. The value range is 0 .. 1,000,000,000.
[File output]
An integer that indicates the maximum number of programs that can be recorded.
[Input example]
6
0 3
6 7
3 10
1 5
2 8
1 9
[Output example]
4
[Example]
1st recorded programs 1 and 3, and 2nd recorded programs 2 and 4.
3.Ski Resort Construction{GoldQuestion2}
[Problem description]
The design map of the ski resort is a matrix of M * n, each of which uses a letter R (rough) or S (flat ).
For example:
Rsrsss
Rsrsss
Rsrsss
Farmer John's tractor can mark all B * B (B <= m, B <= N) Areas B * B (B <= m, B <= N) each time) he wants B to be as big as possible. A grid can be marked multiple times. The next tag can overwrite the previous one. Each grid can be marked at least once.
[File input]
In the first line, the two integers separated by spaces represent M and N respectively.
Next 2. m + 1 line, each line contains an M Symbol, R or S. Indicates the target State marked.
[File output]
A total of rows. An integer indicates the maximum value of B.
[Input example]
3 6
Rsrsss
Rsrsss
Rsrsss
[Output example]
3
[Example]
First, mark all columns 1st to 3rd as R, then all columns 2nd to 4th as s, and then all columns 3rd to 5 as R, finally, mark all columns 4th to 6 as S.
Usaco 2014 Jan 3 (2)