A - 青年歌手大奖赛_评委会打分
青年歌手大奖赛_评委会打分
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 104819 Accepted Submission(s): 51776
Problem Description
青年歌手大奖赛中,评委会给参赛选手打分。选手得分规则为去掉一个最高分和一个最低分,然后计算平均得分,请编程输出某选手的得分。
Input
输入数据有多组,每组占一行,每行的第一个数是n(2<n<=100),表示评委的人数,然后是n个评委的打分。
Output
对于每组输入数据,输出选手的得分,结果保留2位小数,每组输出占一行。
Sample Input
3 99 98 974 100 99 98 97
Sample Output
98.0098.50
Author
lcy
注意一下数据类型为浮点型就好了
B - 偶数求和
偶数求和Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description 有一个长度为n(n<=100)的数列,该数列定义为从2开始的递增有序偶数,现在要求你按照顺序每m个数求出一个平均值,如果最后不足m个,则以实际数量求平均值。编程输出该平均值序列。
Input 输入数据有多组,每组占一行,包含两个正整数n和m,n和m的含义如上所述。
Output 对于每组输入数据,输出一个平均值序列,每组输出占一行。
Sample Input 3 24 2
Sample Output 3 63 7
|
细心一点儿就好了
三角形
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 108913 Accepted Submission(s): 35707
Problem Description
给定三条边,请你判断一下能不能组成一个三角形。
Input
输入数据第一行包含一个数M,接下有M行,每行一个实例,包含三个正数A,B,C。其中A,B,C <1000;
Output
对于每个测试实例,如果三条边长A,B,C能组成三角形的话,输出YES,否则NO。
Sample Input
21 2 32 2 2
Sample Output
NOYES
Author
linle
水题,注意一下数据范围是实数
A. Text Volume
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output
You are given a text of single-space separated words, consisting of small and capital Latin letters.
Volume of the word is number of capital letters in the word. Volume of the text is maximum volume
Calculate the volume
Input
The first line contains one integer number n (1 ≤ n ≤ 200) — length of the text.
The second line contains text of single-space separated words s1, s2, ..., si, consisting only of small and capital Latin letters.
Output
Print one integer number — volume
Examples
Copy
7 NonZERO
Copy
5
Copy
24 this is zero answer text
Copy
0
Copy
24 Harbour Space University
Copy
1
给你一行短文, 由单个空格分开的一些单词组成,仅包含大写字母和小写字母.
单词的Volume代表: 这个单词中大写字母的个数
短文的Volume等于该短文包含的所有单词的Volume的最大值
你的目标是计算给定短文的Volume.
Input
第一行包含一个整数n (1 ≤ n ≤ 200) — 代表短文的长度.
第二行包含一行短文,由单个空格分开的一些单词s1, s2, ..., si组成,由大写字母和小写字母组成.
Output
输出一个整数 — 该短文的Volume.
Digit Sums
Time limit : 2sec / Memory limit
Score : 200
Problem Statement
Let S(n) denote the sum of the digits in the decimal notation of n. For example, S(101)=1+0+1=2.
Given an integer N, determine if S(N) divides N.
Constraints
- 1≤N≤109
Input
Input is given from Standard Input in the following format:
N
Output
If S(N) divides N, print Yes
; if it does not, print No
.
Sample Input 1
Copy
12
Sample Output 1
Copy
Yes
In this input, N=12. As S(12)=1+2=3, S(N) divides N.
Sample Input 2
Copy
101
Sample Output 2
Copy
No
As S(101)=1+0+1=2, S(N) does not divide N.
Sample Input 3
Copy
999999999
Sample Output 3
Copy
Yes
令S(N) : 十进制表示法中,N 的各位数字相加之和. 例如, S(101) = 1 + 0 + 1 = 2.
给你一个整数 N, 判断 S(N) 能否整除 N .
Constraints
1 <= N <= 10^9
Input
输入仅一行,一个整数N
Output
如果 S(N) 能整除 N, 输出 Yes; 否则, 输出 No.
根据题意直接做就行了
Generous Kefa
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
One day Kefa found n baloons. For convenience, we denote color of i-th baloon as si — lowercase letter of the Latin alphabet. Also Kefa has k friends. Friend will be upset, If he get two baloons of the same color. Kefa want to give out all baloons to his friends. Help Kefa to find out, can he give out all his baloons, such that no one of his friens will be upset — print «YES», if he can, and «NO», otherwise. Note, that Kefa's friend will not upset, if he doesn't get baloons at all.
Input
The first line contains two integers n and k (1 ≤ n, k ≤ 100) — the number of baloons and friends.
Next line contains string s
Output
Answer to the task — «YES» or «NO» in a single line.
You can choose the case (lower or upper) for each letter arbitrary.
Examples
Copy
4 2 aabb
Copy
YES
Copy
6 3 aacaab
Copy
NO
Note
In the first sample Kefa can give 1-st and 3-rd baloon to the first friend, and 2-nd and 4-th to the second.
In the second sample Kefa needs to give to all his friends baloons of color a, but one baloon will stay, thats why answer is «NO».
别想太多......
G - Godsend
Godsend
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Leha somehow found an array consisting of n
Input
First line of input data contains single integer n (1 ≤ n ≤ 106) — length of the array.
Next line contains n integers a1, a2, ..., an (0 ≤ ai ≤ 109).
Output
Output answer in single line. "First", if first player wins, and "Second" otherwise (without quotes).
Examples
Copy
4 1 3 2 3
Copy
First
Copy
2 2 2
Copy
Second
Note
In first sample first player remove whole array in one move and win.
In second sample first player can't make a move and lose.
H - Sorting Railway Cars
Sorting Railway Cars
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
An infinitely long railway has a train consisting of n cars, numbered from 1 to n
Input
The first line of the input contains integer n (1 ≤ n ≤ 100 000) — the number of cars in the train.
The second line contains n integers pi (1 ≤ pi ≤ n, pi ≠ pj if i ≠ j) — the sequence of the numbers of the cars in the train.
Output
Print a single integer — the minimum number of actions needed to sort the railway cars.
Examples
Copy
5 4 1 2 5 3
Copy
2
Copy
4 4 1 3 2
Copy
2
Note
In the first sample you need first to teleport the 4-th car, and then the 5-th car to the end of the train.
这一题是要找最长的连续递增子序列,自己想了好久没想出来,竞赛结束后看了网上大佬们写的代码,发现原来是这样做的,