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 ...
随机推荐
- net.sf.json.JSONException: There is a cycle in the hierarchy!错误解决方案
net.sf.json.JSONException: There is a cycle in the hierarchy!错误解决方案 今天在用List集合转换成json数组的时候发生了这个错误,这个 ...
- sql 查询重复的数据
select * from yryz_role_partner where user_id in (select user_id from yryz_role_partner group by use ...
- 单片机小白学步系列(十三) 点亮第一个LED——好的開始,成功的一半
前面介绍了非常多概念知识.做了非常多准备工作,从这一节開始,我们正式開始单片机的学习.我们将使用单片机完毕一项非常easy的工作:点亮一个发光二极管(即LED:Light-Emitting Diode ...
- 倒计时:CountDownLatch(火箭发射前的准备)读书笔记
这是一个非常实用的多线程控制工具类,经典的场景就是 火箭发射,在火箭发射前,为了保证万无一失,往往还要进行各项设备,仪器的检查,只有等待所有的检查完毕后,引擎才能点火, CountDown ...
- CCF计算机职业资格认证 2015年3月第2题 数字排序 解法和思路
问题描写叙述 给定n个整数,请统计出每一个整数出现的次数.按出现次数从多到少的顺序输出. 输入格式 输入的第一行包括一个整数n,表示给定数字的个数. 第二行包括n个整数.相邻的整数之间用一个空格分隔, ...
- <p>在我们的实际软件项目中,管理团队事实上比写代码或者实现一个客户的需求更为的有挑战性。由于编程实际上是和机器打交道,而和机器打交道,仅仅要你符合机器预定的逻辑,</p>
在我们的实际软件项目中,管理团队事实上比写代码或者实现一个客户的需求更为的有挑战性. 由于编程实际上是和机器打交道.而和机器打交道,仅仅要你符合机器预定的逻辑, 一步步迈向解决这个问题的道路上一点都不 ...
- 用二十秒记住几个PHP基础知识点
数组: 索引数组:数组的键是整数的数组,从0開始. 关联数组:数组的键是字符串的数组 //索引数组 $arr=array('I','love','you'); //关联数组 $arr0=array(' ...
- ORACLE截取字符串
每行显示固定字符串,截取字符串 方法一:在循环里面输出 DECLARE l_char VARCHAR2 (3000 ) := 'ORACLEEB电子商务套件SSYSTEMg ...
- 浅析VS2010反汇编 VS 反汇编方法及常用汇编指令介绍 VS2015使用技巧 调试-反汇编 查看C语言代码对应的汇编代码
浅析VS2010反汇编 2015年07月25日 21:53:11 阅读数:4374 第一篇 1. 如何进行反汇编 在调试的环境下,我们可以很方便地通过反汇编窗口查看程序生成的反汇编信息.如下图所示. ...
- Github上的PHP开源资源汇总
依赖管理 ——用于依赖管理的包和框架 Composer/Packagist : 一个包和依赖管理器 Composer Installers: 一个多框架Composer库安装器 Pickle: 可以 ...