ICPC 7014 Ideal Scoreboard

2024-05-31 13:38
文章标签 icpc scoreboard ideal 7014

本文主要是介绍ICPC 7014 Ideal Scoreboard,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

Professor Boffin is a regional contest director of ACM ICPC. He loves watching and analyzing the scoreboard during the contest. He believes that the scoreboard is ideal when all these criteria hold together: • Each team has solved at least one problem. • No team has solved all the problems. • Each problem is solved by at least one team. • No problem is solved by all the teams.
Obviously, the scoreboard is not ideal at the beginning of the contest, but it may become ideal during the contest. The scoreboard may remain ideal through the end of the contest, or it may lose this property some time later during the contest. In the latter case, it can be shown that it will never become ideal any more. Given the list of the submissions in a regional contest, you must determine the interval in which the scoreboard was ideal.
Input
The input consists of several test cases. Each test case starts with a line containing 3 space- separated integers T, P, and S which represent the number of teams, problems, and submissions respectively (1 ≤ T ≤ 150, 1 ≤ P ≤ 15, 0 ≤ S ≤ 5000). Each of the next S lines represents a contest submission with 4 space-separated parameters
• teamID: the identifier of the team, an integer in the range [1..T]. • problemID: the identifier of the problem, an uppercase letter from the first P letters of English alphabet. • submission−time: the time of submission, in ‘HH:MM:SS’ format, all 3 parts are exactly 2 digits (00 ≤ HH ≤ 05, 00 ≤ MM,SS ≤ 59). • result: the result of the submission. It can be one of the following sentences:
– Yes: Only this case shows that the corresponding team has successfully solved the problem. – No - Compilation Error: Unsuccessful submission due to a compilation error in the submitted program. – No - Wrong Answer: Unsuccessful submission since the submitted program had a wrong output. – No - Run-time Error: Unsuccessful submission due to a run-time error during the execution of the submitted program. – No - Time Limit Exceeded: Unsuccessful submission since the execution of the submitted program did not finish in the time limit. – No - Presentation Error: Unsuccessful submission due to a formatting error in the output of the submitted program.
No two submissions have the same time. The input terminates with a line containing ‘0 0 0’ which should not be processed as a test case.
Output
For each test case, output a line containing the ideal-interval of the corresponding contest. The interval must be provided with two times in exact ‘HH:MM:SS’ format (as described in the input). The first time shows the moment the scoreboard becomes ideal, and the second time shows the moment the scoreboard is not ideal anymore. If the scoreboard remains ideal through the end of the contest, the second time must be ‘--:--:--’. If the scoreboard never becomes ideal throughout the contest, both times must be ‘--:--:--’.
Sample Input
2 3 5 1 A 00:10:05 Yes 2 A 00:15:15 No - Wrong Answer 1 C 01:01:01 Yes 2 B 02:20:00 Yes 1 B 03:10:00 Yes 2 3 5 1 A 00:10:05 Yes 2 A 00:15:15 No - Wrong Answer 1 C 01:01:01 Yes 2 B 02:20:00 Yes 1 B 03:10:00 No - Wrong Answer 2 3 5 1 A 00:10:05 Yes 1 C 01:01:01 Yes 2 A 00:15:15 No - Wrong Answer 1 B 03:10:00 Yes 2 B 04:20:00 Yes 0 0 0
Sample Output

02:20:00 03:10:00 02:20:00 --:--:---:--:-- --:--:-


题意:给定一场比赛的情况。满足以下四个条件的时间为ideal时间。

• Each team has solved at least one problem. • No team has solved all the problems. • Each problem is solved by at least one team. • No problem is solved by all the teams.

求一场比赛的时候,满足IDEA的时间段。

#include<cstdio>
#include<algorithm>
#include<cstring>
#include<iostream>#define N 150005
#define M 305
int table[200][20];
using namespace std;
int t,p,s;
int flag11,flag12,flag13,flag21,flag22,flag23;
typedef struct ed
{int num_team,num_p,t1,t2,t3,time;
}ed;
ed ans[6000];
int solve()
{//int cnt;for(int i = 1;i<=t;i++){cnt = 0;for(int j = 0;j < p;j++){if(table[i][j]!=-1)cnt++;}//cout<<cnt<<endl;if(cnt>0&&cnt<p)continue;elsereturn 0;}for(int i = 0;i<p;i++){cnt = 0;for(int j = 1;j <= t;j++){if(table[j][i]!=-1)cnt++;	}//cout<<cnt<<endl;if(cnt>0&&cnt<t)continue;elsereturn 0;}return 1;
}
bool cmmp(ed a,ed b)
{return a.time<b.time;
}
int main()
{while(scanf("%d%d%d",&t,&p,&s)==3){if(t==0&&p==0&&s==0)break;memset(table,-1,sizeof(table));memset(ans,-1,sizeof(ans));flag11 = -1;flag21 = -1;int tt = 0;for(int i = 0;i<s;i++){int num_team,num_p,num_time,t1,t2,t3;char num_pro;string ss;scanf("%d %c %d:%d:%d ",&num_team,&num_pro,&t1,&t2,&t3);cin >> ss;if(ss=="Yes"){num_p = num_pro-'A';num_time = ((t1*60)+t2)*60+t3;ans[tt].num_team = num_team;ans[tt].num_p = num_p;ans[tt].t1 = t1;ans[tt].t2 = t2;ans[tt].t3 = t3;ans[tt].time = num_time;tt++;}else{cin>>ss;cin >>ss;if(ss=="Time")cin >> ss;cin>>ss;}}sort(ans,ans+tt,cmmp);for(int i = 0;i<tt;i++){table[ans[i].num_team][ans[i].num_p] = ans[i].time;int k;k = solve();//cout<<"///"<<k<<endl;if(k&&flag11==-1){flag11 = ans[i].t1;flag12 = ans[i].t2;flag13 = ans[i].t3;}if(k==0&&flag11!=-1&&flag21==-1)//这里还有一个条件FLLAG21==-1忘了加,所以一直WA{flag21 = ans[i].t1;flag22 = ans[i].t2;flag23 = ans[i].t3;}}if(flag11==-1)cout<<"--:--:-- ";elseprintf("%02d:%02d:%02d ",flag11,flag12,flag13);//cout<<flag11<<":"<<	flag12<<":"<<flag13<<" ";if(flag21==-1)cout<<"--:--:--\n";elseprintf("%02d:%02d:%02d\n",flag21,flag22,flag23);//	cout<<flag21<<":"<<	flag22<<":"<<flag23<<endl;}return 0;
} 


这篇关于ICPC 7014 Ideal Scoreboard的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1018083

相关文章

2014年ACM/ICPC亚洲区现场赛广州赛区总结

本来不想提这件事的,后来学姐找我谈心时提到这件事,我突然意识到在这件事情上我错了一次,明明答应的去参加这场比赛,最后临时决定不去......其实中间有很多很多原因 1:我和tyh,sxk临时不去主要是广州太远,我们身上money不够,呵呵。。。别笑我们,你以为我们是高富帅啊,去一趟广州消费要2个月的生活费,奖学金又没发,你让我找我妈要她辛辛苦苦挣来的工资吗?!从哈尔滨到广州单来回的火车票每个人就

[UVM]6.component driver monitor sequencer agent scoreboard env test

1.知识点回顾 (1)component需要有parent,因为参加构成组件,所以需要(继承); (2)object与component之间间隔report_object。 2.组件家族 (1)构建寄存器模型 :uvm_reg_predictor;激励器:driver/random_stimulus/sequencer_base/sequencer;监测器:monitor;

2020年ICPC南京站 补题记录

文章目录 A - Ah, It's Yesterday Once More(构造)E - Evil Coordinate(构造)F - Fireworks(概率+三分)H - Harmonious Rectangle(打表)K - K Co-prime Permutation(签到)L - Let's Play Curling(贪心+签到)M - Monster Hunter(树形dp)

2014 ACM-ICPC World Final Info board

现在是2014年6月26日00:07:21,同样也是2014年acm wf结束的当晚,几家欢喜几家愁,真的是不知道最近在干些什么就是懈怠了也木有以前那种干劲了,恩,这么说吧就是游戏玩起来了,暑假有时候是需要节制的否则这个暑假就这么浪费了有些可惜,着实是这么表示,而且2015年的亚洲区会在NEU举办,下面附张榜单,哎其他的就不说什么了,表示到了这个时候追悔莫及还是可以的只要不继续越陷越深就好了。缓步

ideal的安装流程

一流程图: 双击进入安装界面 安装完成。

HDU 5240 E - Exam(2015 ACM-ICPC China Shanghai Metropolitan Programming Contest)

题目链接:click here~~ 【题目大意】DRD要参加考试,考试前需要ri个准备时间,考试在ei时间后开始,考试持续li时间,给出多场考试时间安排表,问能否通过所有考试? 【解题思路】不知道是不是数据水还是题目就是这样的,直接判断ri和ei输出结果居然就过了,如果在现场赛能有这样的人品就好了。。 代码: #include <stdio.h>#include <math.h>#

HDU 5444 Elven Postman (2015 ACM/ICPC Asia Regional Changchun Online)

【题目链接】:click here~~ 【题目大意】: HDU 5444 题意:在最初为空的二叉树中不断的插入n个数。对于每个数,从根节点开始判断,如果当前节点为空,就插入当前节点,如果当前节点不为空,则小于当前节点的值,插入右子树,否则插入左子树。 接着q次询问,每次询问一个值在二叉树中从根节点开始的查找路径。 3 直接用二叉树模拟整个插入和询问的过程 代码:

HDU 5533 Dancing Stars on Me (2015ACM/ICPC亚洲区长春 计算几何)

【题目链接】:click here~~ 【题目描述】: Dancing Stars on Me Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 141    Accepted Submission(s): 96

HDU 5538 House Building(2015ACM/ICPC亚洲区长春几何体表面积)

【题目链接】:click here~~ 【题目描述】: House Building Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 119    Accepted Submission(s): 97 Probl

HDU 5532 Almost Sorted Array (2015ACM/ICPC长春LIS)

【题目链接】:click here~~ 【题目描述】: Almost Sorted Array Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission(s): 272    Accepted Submission(s): 132