暑期个人赛--第一场--A -
来源:互联网 发布:git安装教程mac 编辑:程序博客网 时间:2024/06/09 04:53
A. 学姐的桌面 2014新生暑假个人排位赛01
时间限制 1000 ms 内存限制 65536 KB
题目描述
学姐在加入集训队之后,学习了使用ubuntu系统来做题,但是没有了360电脑管家,学姐再也没办法看到她的飞速电脑开机到底虐了全国多少人。作为一个电脑高手,学姐花了几分钟黑到了360的数据库拿到了全国360用户的开机时间,现在学姐想自己算算到底打败了百分之多少的人?
输入格式
输入有多组数据。首先给出数据组数
输出格式
每组数据一行,输出学姐打败了全国百分之多少的用户,精确到小数点后两位。
输入样例
15 31 1 2 2 3
输出样例
80.00%
赛中提交:一次A
一下是AC代码
#include "iostream"#include "string.h"#include "stdio.h"#include "stdlib.h"#include "math.h"#include "string"#include "vector"#include "list"#include "map"#include "queue"#include "stack"#include "bitset"#include "algorithm"#include "numeric"#include "functional" using namespace std;int times[100008]; int main(){ int T; scanf("%d",&T); while(T--){ int n,t,i; char c='%'; scanf("%d %d",&n,&t); for(i=0;i<n;i+=1){ scanf("%d",×[i]); } sort(times,times+n); for(i=0;i<n&×[i]<t;i+=1){ ; } printf("%.2f%c\n",100*((float)i)/((float)n),c); } return 0;}
0 0
- 暑期个人赛--第一场--A -
- 暑期个人赛第一场
- 暑期个人赛--第一场--E
- 暑期个人赛--第一场--B
- 暑期个人赛--第一场--C
- 暑期个人赛--第一场--D
- 暑期个人赛--第三场--A
- 暑期个人赛--第四场--A
- 暑期个人赛--第五场--A
- 暑期个人赛--第二场--A
- 暑期个人赛--第六场--A
- 暑期个人赛--第八场--A
- 暑期个人赛--第十场--A
- 暑期个人赛--第九场--A
- 中石油 暑期集训个人赛第一场 题解
- 暑期个人赛--第三场--E(待A)
- 暑期个人赛--第三场--E(待A....)
- 暑期个人赛--第四场--D(待A)
- URL是什么
- 把UML概念融合到整个软件设计过程
- 导航管理的制作
- C++输入输出运算符重载
- 工作中的感悟 (三)三个月碎碎念篇
- 暑期个人赛--第一场--A -
- C++程序设计课程
- 有关条件编译、extern的问题
- mac eclipse 编码 GBK
- HDU 3746 Cyclic Nacklace //深刻理解next数组
- 内核模块学习
- 几款百度竞价点击软件测评来一发
- Firefox必备的24款web开发插件
- FreeBSD 平台 OpenVPN 的安装、配置客户端和服务端