zoj The 12th Zhejiang Provincial Collegiate Programming Contest Demacia of the Ancients
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5504
Time Limit: 2 Seconds Memory Limit: 65536 KB
There is a popular multiplayer online battle arena game called Demacia of the Ancients. There are lots of professional teams playing this game. A team will be approved as Level K if there are exact K team members whose match making ranking (MMR) is strictly greater than 6000.
You are given a list of teams. Please calculate the level of each team.
Input
There are multiple test cases. The first line of input contains an integer T indicating the number of test cases. For each test case:
The first line contains an integer N (1 <= N <= 10) indicating the number of team members.
The second line contains N integers representing the MMR of each team member. All MMRs are non-negative integers less than or equal to 9999.
Output
For each test case, output the level of the given team.
Sample Input
3
5
7986 6984 6645 6200 6150
5
7401 7377 6900 6000 4300
3
800 600 200
Sample Output
5
3
0 分析; 这个也是签到题。
就是找超出6000的个数。 AC代码:
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <list>
#include <iomanip>
#include <vector>
#pragma comment(linker, "/STACK:1024000000,1024000000")
#pragma warning(disable:4786) using namespace std; const int INF = 0x3f3f3f3f;
const int MAX = + ;
const double eps = 1e-;
const double PI = acos(-1.0); int a[MAX]; int main()
{
int T;
while(~scanf("%d",&T))
{
while(T --)
{
memset(a , , sizeof(a));
int n;
cin >> n;
int ans = , temp;
while(n --)
{
scanf("%d",&temp);
if(temp > )
ans ++;
}
cout << ans << endl;
}
}
return ;
}
zoj The 12th Zhejiang Provincial Collegiate Programming Contest Demacia of the Ancients的更多相关文章
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Capture the Flag
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5503 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Team Formation
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5494 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Beauty of Array
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5496 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Lunch Time
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5499 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest Convert QWERTY to Dvorak
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5502 The 12th Zhejiang Provincial ...
- zoj The 12th Zhejiang Provincial Collegiate Programming Contest May Day Holiday
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5500 The 12th Zhejiang Provincial ...
- zjuoj The 12th Zhejiang Provincial Collegiate Programming Contest Ace of Aces
http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5493 The 12th Zhejiang Provincial ...
- 140 - The 12th Zhejiang Provincial Collegiate Programming Contest(第二部分)
Floor Function Time Limit: 10 Seconds Memory Limit: 65536 KB a, b, c and d are all positive int ...
- 140 - The 12th Zhejiang Provincial Collegiate Programming Contest(浙江省赛2015)
Ace of Aces Time Limit: 2 Seconds Memory Limit: 65536 KB There is a mysterious organization c ...
随机推荐
- 用c++builder读取一个一行有多行变量的文件
文件内容如下: C DXDY.INP FILE, IN FREE FORMAT ACROSS COLUMNS for 83658 Active CellsC 2013-5-25 上午 10:43 ...
- strcpy 和 strnpy 区别
与strncpy的区别 第一种情况: 1 2 3 4 char* p="how are you ?"; char name[20]="ABCDEF ...
- spark之combineByKey
combineByKey def combineByKey[C](createCombiner: (V) => C, mergeValue: (C, V) => C, mergeCombi ...
- IOS 移除storyboard
我是IOS新手,都说storyboard是个好东西,但是我搞了一会始终没有搞懂,并且我觉得学习一门语言,使用类似以前网页三剑客这种所见所得工具,不太利于学习,所以我就想着移除storyboard 1: ...
- FastDFS分布式文件系统安装与使用(单节点)
http://blog.csdn.net/xyang81/article/details/52837974 http://download.csdn.net/detail/xyang81/966749 ...
- 兼容的获得event
function getEvent(e) { var e=window.event || event; return e.srcElement || e.target; }
- Cocos2d-JS引入资源
以图片为例: 创建项目后,把图片放入res文件夹,修改 app.js var HelloWorldLayer = cc.Layer.extend({ sprite:null, ctor:functio ...
- Linux centos关机与重启命令详解与实战
Linux centos重启命令: 1.reboot 2.shutdown -r now 立刻重启(root用户使用) 3.shutdown -r 10 过10分钟自动重启(root用户使用) 4.s ...
- imx6 KEY_ROW4 power output high fail
imx6 KEY_ROW4的pin设置成gpio之后,不能够输出高电平.解决方法记录于此. 参考链接: https://lists.yoctoproject.org/pipermail/meta-fr ...
- raspberryPi 拍照
调用python的库,学习raspberryPi的摄像头操作方法. 参考链接: https://www.raspberrypi.org/learning/getting-started-with-pi ...