本文主要是介绍爱上CF,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
<span style="color: rgb(58, 128, 0); ">Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^</span>
<span style="color: rgb(58, 128, 0); ">Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^</span>
题目描述
CF,codeforces不是Crossfire。身为一个Acmer,RE大神与Soaring大神最喜欢做每五天一次的CF,从11:30到1:30,然后和逗比学长们一起等着跑数据等到两点半,然后再一起嘲笑一坨学长和柴爷,实在是人生一大快事。
但是Triple_S队的另一员——Winddreams,竟然还不会算CF的单局积分。实在是略萌啊。身为队长的RE大神只能把CF的详细规则再给Winddreams讲一遍了。
CF中共A,B,C,D,E五道题,其初始分分别为500,1000,1500,2000,2500。
比赛共两个小时,每过一分钟每道题目的分数分别下降2,4,8,16,32分。例如你在00:08的时候提交A题,就会获得484分。
比赛中对于不成功的提交(统称为WA)将扣掉该题50分;每道题的分数是单独的,如果没有AC不管这道题WA几次,不会扣总分。而且每道题的最低得分为150分,当分数降低至150分时,不在进行分数削减。
比赛中还有一种叫做HACK的玩法,就是在锁定自己的题目代码后,你可以查看他人的代码,如果别人的代码有漏洞你可以出一组测试数据证明他是错的,如果你成功了(Successful Hack)你讲获得100分,如果你失败了(Unsuccessful Hack)你将被扣50分。同理,你也可以被Hack如果你被Hack成功了(Hack)将视为该题WA。
由于最近RE大神和Soaring要忙一下补觉的问题,所以,需要你来为Winddreams写一个程序来计算得分情况。
输入
多组输入。输入一个T(T<=50)表示有T个操作,在接下来的T行里,每行输入三个个变量(中间用空格隔开),分别是时间t(XX:XX),题目No(A,B,C,D,E)以及题目返回结果E(WA ,AC,Hack,Successful Hack,Unsuccessful Hack)。
输出
最终得分。
示例输入
19 00:03 A AC 00:10 B WA 00:12 B WA 00:13 B AC 00:30 C WA 00:40 B Hack 00:45 B WA 00:45 B WA 00:46 B WA 00:47 B WA 00:48 B WA 00:48 B WA 00:50 B WA 00:54 B WA 00:55 B WA 00:57 B WA 00:59 B AC 01:10 A Successful Hack 01:49 B Unsuccessful Hack
示例输出
694
提示#include<stdio.h>
#include<string.h>
char a[30],b;
int jilu[6];
int fenshu[6];
int main()
{int m,time1,time2,s=0,i,j;while(~scanf("%d",&m)){s=0;memset(fenshu,0,sizeof(fenshu));memset(jilu,0,sizeof(jilu));for(j=0; j<m; j++){scanf("%d:%d%*c",&time1,&time2);scanf("%c%*c",&b);gets(a);if(b=='A'){if(strcmp(a,"WA")==0){jilu[0]++;}else if(strcmp(a,"Successful Hack")==0){s+=100;}else if(strcmp(a,"Unsuccessful Hack")==0){s-=50;}else if(strcmp(a,"AC")==0){fenshu[0]+=(500-50*jilu[0]-(time1*60+time2)*2);if(fenshu[0]<150)fenshu[0]=150;}else if(strcmp(a,"Hack")==0){fenshu[0]=0;jilu[0]++;}}else if(b=='B'){if(strcmp(a,"WA")==0){jilu[1]++;}else if(strcmp(a,"Successful Hack")==0){s+=100;}else if(strcmp(a,"Unsuccessful Hack")==0){s-=50;}else if(strcmp(a,"AC")==0){fenshu[1]+=(1000-50*jilu[1]-(time1*60+time2)*4);if(fenshu[1]<150)fenshu[1]=150;}else if(strcmp(a,"Hack")==0){fenshu[1]=0;jilu[1]++;}}else if(b=='C'){if(strcmp(a,"WA")==0){jilu[2]++;}else if(strcmp(a,"Successful Hack")==0){s+=100;}else if(strcmp(a,"Unsuccessful Hack")==0){s-=50;}else if(strcmp(a,"AC")==0){fenshu[2]+=(1500-50*jilu[2]-(time1*60+time2)*8);if(fenshu[2]<150)fenshu[2]=150;}if(strcmp(a,"Hack")==0){fenshu[2]=0;jilu[2]++;}}else if(b=='D'){if(strcmp(a,"WA")==0){jilu[3]++;}else if(strcmp(a,"Successful Hack")==0){s+=100;}else if(strcmp(a,"Unsuccessful Hack")==0){s-=50;}else if(strcmp(a,"AC")==0){fenshu[3]+=(2000-50*jilu[3]-(time1*60+time2)*16);if(fenshu[3]<150)fenshu[3]=150;}else if(strcmp(a,"Hack")==0){fenshu[3]=0;jilu[3]++;}}else if(b=='E'){if(strcmp(a,"WA")==0){jilu[4]++;}else if(strcmp(a,"Successful Hack")==0){s+=100;}else if(strcmp(a,"Unsuccessful Hack")==0){s-=50;}else if(strcmp(a,"AC")==0){fenshu[4]+=(2500-50*jilu[4]-(time1*60+time2)*32);if(fenshu[4]<150)fenshu[4]=150;}else if(strcmp(a,"Hack")==0){fenshu[4]=0;jilu[4]++;}}}for(i=0; i<5; i++)if(fenshu[i]>=0)s+=fenshu[i];printf("%d\n",s);}return 0;
}
就是一道迷你题目
#include<stdio.h>
#include<string.h>
char a[30],b;
int jilu[6];
int fenshu[6];
int main()
{int m,time1,time2,s=0,i,j;while(~scanf("%d",&m)){s=0;memset(fenshu,0,sizeof(fenshu));memset(jilu,0,sizeof(jilu));for(j=0; j<m; j++){scanf("%d:%d%*c",&time1,&time2);scanf("%c%*c",&b);gets(a);if(b=='A'){if(strcmp(a,"WA")==0){jilu[0]++;}else if(strcmp(a,"Successful Hack")==0){s+=100;}else if(strcmp(a,"Unsuccessful Hack")==0){s-=50;}else if(strcmp(a,"AC")==0){fenshu[0]+=(500-50*jilu[0]-(time1*60+time2)*2);if(fenshu[0]<150)fenshu[0]=150;}else if(strcmp(a,"Hack")==0){fenshu[0]=0;jilu[0]++;}}else if(b=='B'){if(strcmp(a,"WA")==0){jilu[1]++;}else if(strcmp(a,"Successful Hack")==0){s+=100;}else if(strcmp(a,"Unsuccessful Hack")==0){s-=50;}else if(strcmp(a,"AC")==0){fenshu[1]+=(1000-50*jilu[1]-(time1*60+time2)*4);if(fenshu[1]<150)fenshu[1]=150;}else if(strcmp(a,"Hack")==0){fenshu[1]=0;jilu[1]++;}}else if(b=='C'){if(strcmp(a,"WA")==0){jilu[2]++;}else if(strcmp(a,"Successful Hack")==0){s+=100;}else if(strcmp(a,"Unsuccessful Hack")==0){s-=50;}else if(strcmp(a,"AC")==0){fenshu[2]+=(1500-50*jilu[2]-(time1*60+time2)*8);if(fenshu[2]<150)fenshu[2]=150;}if(strcmp(a,"Hack")==0){fenshu[2]=0;jilu[2]++;}}else if(b=='D'){if(strcmp(a,"WA")==0){jilu[3]++;}else if(strcmp(a,"Successful Hack")==0){s+=100;}else if(strcmp(a,"Unsuccessful Hack")==0){s-=50;}else if(strcmp(a,"AC")==0){fenshu[3]+=(2000-50*jilu[3]-(time1*60+time2)*16);if(fenshu[3]<150)fenshu[3]=150;}else if(strcmp(a,"Hack")==0){fenshu[3]=0;jilu[3]++;}}else if(b=='E'){if(strcmp(a,"WA")==0){jilu[4]++;}else if(strcmp(a,"Successful Hack")==0){s+=100;}else if(strcmp(a,"Unsuccessful Hack")==0){s-=50;}else if(strcmp(a,"AC")==0){fenshu[4]+=(2500-50*jilu[4]-(time1*60+time2)*32);if(fenshu[4]<150)fenshu[4]=150;}else if(strcmp(a,"Hack")==0){fenshu[4]=0;jilu[4]++;}}}for(i=0; i<5; i++)if(fenshu[i]>=0)s+=fenshu[i];printf("%d\n",s);}return 0;
}
这篇关于爱上CF的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!