E - What Is Your Grade?
E - What Is Your Grade?
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Description
This is a ballad(歌谣)well known in colleges, and you must care about your score in this exam too. How many points can you get? Now, I told you the rules which are used in this course.
There are 5 problems in this final exam. And I will give you 100 points if you can solve all 5 problems; of course, it is fairly difficulty for many of you. If you can solve 4 problems, you can also get a high score 95 or 90 (you can get the former(前者) only when your rank is in the first half of all students who solve 4 problems). Analogically(以此类推), you can get 85、80、75、70、65、60. But you will not pass this exam if you solve nothing problem, and I will mark your score with 50.
Note, only 1 student will get the score 95 when 3 students have solved 4 problems.
I wish you all can pass the exam!
Come on!
Input
A test case starting with a negative integer terminates the input and this test case should not to be processed.
Output
Sample Input
4
5 06:30:17
4 07:31:27
4 08:12:12
4 05:23:13
1
5 06:30:17
-1
Sample Output
100
90
90
95 100 //题目意思搞了好久才懂,不懂英语真难玩啊。
有点类似ACM排名
第一行代表有多少个人,然后是每个人的成绩,做了几个题,用时多少。做了5个,不管用时,都是100,少做1个扣10分,没做不管用时都是50分,做了相同题目的,用时排在一半之前加5分,例如 4个人都做4个,前两个 95分,后两个 90 分, 3个人做 4 个,只有第一个 95 分,后两个90分。 //可以dp,可以模拟,然后我果断选了模拟。。。
有几重循环,竟然还是 0ms 有点惊讶
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std; struct People
{
int num;
int t;
int h,m,s;
int fen;
}people[]; int cmp(People a,People b)
{
if (a.t!=b.t)
return a.t>b.t; if (a.h!=b.h) //用时少在前面
return a.h<b.h;
if (a.m!=b.m)
return a.m<b.m;
return a.s<b.s;
} int main()
{
int n;
int i,j,k;
while (scanf("%d",&n)!=EOF)
{
if (n<) break; for (i=;i<=n;i++)
{
scanf("%d %d:%d:%d",&people[i].t,&people[i].h,&people[i].m,&people[i].s);
people[i].num=i;
}
sort(people+,people+n+,cmp); for (i=;i<=n;i++)
{
if (people[i].t!=)
break;
else
people[i].fen=;
} int star=i; for (i=;i>=;i--)//做题数
{
for (j=star;j<=n;j++) //找到做题数相同的一块 str - (j-1)
if (people[j].t!=i)
break; int mid=(star+j-)/;
if ((star+j-)%==)
mid--; for (k=star;k<j;k++)
{
if (k<=mid)
people[k].fen=+i*+;
else
people[k].fen=+i*;
}
star=j;
if (star>n) break;
} for (j=star;j<=n;j++) people[j].fen=; if (n==&&people[].t!=&&people[].t!=) people[].fen+=; for (i=;i<=n;i++)
{
for (j=;j<=n;j++)
{
if (people[j].num==i)
{
printf("%d\n",people[j].fen);
break;
}
}
}
printf("\n");
}
return ;
}
E - What Is Your Grade?的更多相关文章
- kaungbin_DP S (POJ 3666) Making the Grade
Description A straight dirt road connects two fields on FJ's farm, but it changes elevation more tha ...
- POJ 3666 Making the Grade
Description A straight dirt road connects two fields on FJ's farm, but it changes elevation more tha ...
- CF719C. Efim and Strange Grade[DP]
C. Efim and Strange Grade time limit per test 1 second memory limit per test 256 megabytes input sta ...
- POJ3666Making the Grade[DP 离散化 LIS相关]
Making the Grade Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6445 Accepted: 2994 ...
- [CareerCup] 15.7 Student Grade 学生成绩
15.7 Imagine a simple database storing information for students' grades. Design what this database m ...
- 英语语法 It all started the summer before second grade when our moving van pulled into her neighborhood
It all started the summer before second grade when our moving van pulled into herneighborhood It all ...
- FPGA speed grade
Altera的-6.-7.-8速度等级逆向排序,Xilinx速度等级正向排序. 不很严密地说,“序号越低,速度等级越高”这是Altera FPGA的排序方法, “序号越高,速度等级也越高”这是Xili ...
- HDU 5038 Grade(分级)
Description 题目描述 Ted is a employee of Always Cook Mushroom (ACM). His boss Matt gives him a pack of ...
- hdu---(5038)Grade(胡搞)
Grade Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others)Total Sub ...
- A-Making the Grade(POJ 3666)
Making the Grade Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4656 Accepted: 2206 ...
随机推荐
- 路由器漏洞复现分析第三弹:DVRF INTRO题目分析
这个项目的目的是来帮助人们学习X86_64之外其他架构环境,同时还帮助人们探索路由器固件里面的奥秘. 本文通过练习DVRF 中INTRO 部分的题目来学习下MIPS 结构下的各种内存攻击. DVRF: ...
- lua基础【三】唯一数据结构table表
--[[ 数据结构table对象(一种动态分配的对象) lua中的表操作.table类型实现了"关联数组的". "关联数组是一种具有特殊索引方式的数组" 能够通 ...
- pl/sql(2)
1.存储过程 (1)存储过程的创建及改动 语法: CREATE [OR REPLACE] PROCEDURE procedure_name [(parameter_name [IN | OUT | I ...
- vscode - emmet失效?
把emmet设置覆盖为用户.
- MonoBehaviour.FixedUpdate 固定更新
function FixedUpdate () : void Description描述 This function is called every fixed framerate frame, if ...
- foreach 加& 什么意思?
foreach 加&遍历的同时改变原数组即修改数据或者增加数据 foreach 加& 什么意思? 注意:如果我要改变数组某一个值 直接遍历的话原数组是不会变的 下面提供两种方法 1.我 ...
- iOS语言本地化,中文显示
尽管一直相信xcode肯定提供有语言本地化的设置地方,可是一直也没凑着去改.非常多的汉化,还是使用代码去控制:比方navagition的return使用代码改动为"返回"! 近期在 ...
- hdu 2871 Memory Control(线段树)
题目链接:hdu 2871 Memory Control 题目大意:模拟一个内存分配机制. Reset:重置,释放全部空间 New x:申请内存为x的空间,输出左地址 Free x:释放地址x所在的内 ...
- 如何在 Linux 下大量屏蔽恶意 IP 地址
很多情况下,你可能需要在Linux下屏蔽IP地址.比如,作为一个终端用户,你可能想要免受间谍软件或者IP追踪的困扰.或者当你在运行P2P软件时.你可能想要过滤反P2P活动的网络链接.如果你是一名系统管 ...
- xcode 项目证书跟签名都正确的时候,还报证书错误
原因,安装证书错误,导致无法匹配证书, 方案:删除原来的证书,重新安装 打开终端 1.cd Library/ 2.cd MobileDevice/ 3.open Provisioning\ Profi ...