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 ...
随机推荐
- pdo封装类
<?php //http://www.imavex.com/php-pdo-wrapper-class/ class db extends PDO { private $error; priva ...
- jQuery.mobile.activePage获取当点活动的page
<!doctype html> <html lang="en"> <head> <meta charset="utf-8&quo ...
- 使用dotTrace6.0进行内存分析
dotTrace6.0提供了内存分析功能,统计抓取的时间段内各个堆栈执行过程中使用的内存大小,按照堆栈执行情况树状排序:和它之前提供的时间统计类似,粗截了几个页面,希望对大家有所帮助. 下载安装Jet ...
- php源码安装
要用swoole,首先需要有PHP环境.由于swoole的某些特性,最好是能够从源码编译安装PHP,这样在使用过程中可以避免很多不必要的错误.PHP下载地址:http://php.net/在这里挑选你 ...
- html代码转义到js时,往往会遇到问题,这代码实现html和js互转
这段代码是直接可以用的,大家不妨试试.<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " ...
- node.js学习路线图
http://www.admin10000.com/document/4624.html
- Java 进程(转)
转自http://jiangshuiy.iteye.com/blog/1674235 PS:今天做android助手项目的时候,发现adb push命令执行会卡死,最后发现不能用waitfor阻塞等待 ...
- {$ecs_css_path}
includes里的init.php的187-194行 if (!empty($_CFG['stylename'])) { $smarty->assign('ecs_css_path', 'th ...
- AFN 加Header
AFHTTPSessionManager * manager = [AFHTTPSessionManager manager]; manager.responseSerializer.acceptab ...
- 【Android Studio快捷键】之导入相应包声明(import packages)
可能import 单个声明的快捷键大家都很容易找到,Alt+Enter.但是如果我要一次性import文件中所有的声明,这个快捷键是什么呢,找啊找的,就是没找到,以前在Eclipse是Ctrl+1,但 ...