爱上CF
Time Limit: 1000MS Memory limit: 65536K
题目描述
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>
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int a,b,sum = 0;
char str,x[100],c;
int chu[5],i;
int pp;
int a1,b1;
int t[5];
chu[0] = 500;
chu[1] = 1000;
chu[2] = 1500;
chu[3] = 2000;
chu[4] = 2500;
for(i=0;i<n;i++)
{
scanf("%d",&a);
scanf("%c",&c);
scanf("%d",&b);
getchar();
scanf("%c",&str);
getchar();
gets(x);
if(str == 'A')
{
if((strcmp(x,"AC") == 0))
{
if(a == 1)
{
pp = 120 + b*2;
}
else if(a == 0)
{
pp = b*2;
}
if(chu[0]-pp>=150)
{
chu[0] = chu[0] - pp;
}
else
{
chu[0] = 150;
}
sum = sum + chu[0];
t[0] = chu[0];
}
else if((strcmp(x,"WA")==0) ||(strcmp(x,"Hack")==0))
{
if(strcmp(x,"Hack")==0)
{
sum = sum - t[0];
}
if(chu[0]-50>=150)
{
chu[0] = chu[0] - 50;
}
else
{
chu[0] = 150;
}
}
else if(strcmp(x,"Successful Hack")==0)
{
sum = sum + 100;
}
else if(strcmp(x,"Unsuccessful Hack")==0)
{
sum = sum -50;
}
}
if(str == 'B')
{
if(strcmp(x,"AC") == 0)
{
if(a == 1)
{
pp = 240 + b*4;
}
else if(a == 0)
{
pp = b*4;
}
if(chu[1]-pp>=150)
{
chu[1] = chu[1] - pp;
}
else
{
chu[1] = 150;
}
sum = sum + chu[1];
t[1] = chu[1];
}
else if((strcmp(x,"WA")==0) ||(strcmp(x,"Hack")==0))
{
if(strcmp(x,"Hack")==0)
{
sum = sum - t[1];
}
if(chu[1]-50>=150)
{
chu[1] = chu[1] - 50;
}
else
{
chu[1] = 150;
}
}
else if(strcmp(x,"Successful Hack")==0)
{
sum = sum + 100;
}
else if(strcmp(x,"Unsuccessful Hack")==0)
{
sum = sum -50;
}
}
if(str == 'C')
{
if(strcmp(x,"AC") == 0)
{
if(a == 1)
{
pp = 480 + b*8;
}
else if(a == 0)
{
pp = b*8;
}
if(chu[2]-pp>=150)
{
chu[2] = chu[2] - pp;
}
else
{
chu[2] = 150;
}
sum = sum + chu[2];
t[2] = chu[2];
}
else if((strcmp(x,"WA")==0) ||(strcmp(x,"Hack")==0))
{
if(strcmp(x,"Hack")==0)
{
sum = sum - t[2];
}
if(chu[2]-50>=150)
{
chu[2] = chu[2] - 50;
}
else
{
chu[2] = 150;
}
}
else if(strcmp(x,"Successful Hack")==0)
{
sum = sum + 100;
}
else if(strcmp(x,"Unsuccessful Hack")==0)
{
sum = sum -50;
}
}
if(str == 'D')
{
if(strcmp(x,"AC") == 0 && t[3] == 0)
{
if(a == 1)
{
pp = 960 + b*16;
}
else if(a == 0)
{
pp = b*16;
}
if(chu[3]-pp>=150)
{
chu[3] = chu[3] - pp;
}
else
{
chu[3] = 150;
}
sum = sum + chu[3];
t[3] = chu[3];
}
else if((strcmp(x,"WA")==0) ||(strcmp(x,"Hack")==0))
{
if(strcmp(x,"Hack")==0)
{
sum = sum - t[3];
}
if(chu[3]-50>=150)
{
chu[3] = chu[3] - 50;
}
else
{
chu[3] = 150;
}
}
else if(strcmp(x,"Successful Hack")==0)
{
sum = sum + 100;
}
else if(strcmp(x,"Unsuccessful Hack")==0)
{
sum = sum -50;
}
}
if(str == 'E')
{
if(strcmp(x,"AC") == 0)
{
if(a == 1)
{
pp = 1920 + b*32;
}
else if(a == 0)
{
pp = b*32;
}
if(chu[4]-pp>=150)
{
chu[4] = chu[4] - pp;
}
else
{
chu[4] = 150;
}
sum = sum + chu[4];
t[4] = chu[4];
}
else if((strcmp(x,"WA")==0) ||(strcmp(x,"Hack")==0))
{
if(strcmp(x,"Hack")==0)
{
sum = sum - t[4];
}
if(chu[4]-50>=150)
{
chu[4] = chu[4] - 50;
}
else
{
chu[4] = 150;
}
}
else if(strcmp(x,"Successful Hack")==0)
{
sum = sum + 100;
}
else if(strcmp(x,"Unsuccessful Hack")==0)
{
sum = sum -50;
}
}
}
printf("%d\n",sum);
}
return 0;
}
#include<string.h>
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int a,b,sum = 0;
char str,x[100],c;
int chu[5],i;
int pp;
int a1,b1;
int t[5];
chu[0] = 500;
chu[1] = 1000;
chu[2] = 1500;
chu[3] = 2000;
chu[4] = 2500;
for(i=0;i<n;i++)
{
scanf("%d",&a);
scanf("%c",&c);
scanf("%d",&b);
getchar();
scanf("%c",&str);
getchar();
gets(x);
if(str == 'A')
{
if((strcmp(x,"AC") == 0))
{
if(a == 1)
{
pp = 120 + b*2;
}
else if(a == 0)
{
pp = b*2;
}
if(chu[0]-pp>=150)
{
chu[0] = chu[0] - pp;
}
else
{
chu[0] = 150;
}
sum = sum + chu[0];
t[0] = chu[0];
}
else if((strcmp(x,"WA")==0) ||(strcmp(x,"Hack")==0))
{
if(strcmp(x,"Hack")==0)
{
sum = sum - t[0];
}
if(chu[0]-50>=150)
{
chu[0] = chu[0] - 50;
}
else
{
chu[0] = 150;
}
}
else if(strcmp(x,"Successful Hack")==0)
{
sum = sum + 100;
}
else if(strcmp(x,"Unsuccessful Hack")==0)
{
sum = sum -50;
}
}
if(str == 'B')
{
if(strcmp(x,"AC") == 0)
{
if(a == 1)
{
pp = 240 + b*4;
}
else if(a == 0)
{
pp = b*4;
}
if(chu[1]-pp>=150)
{
chu[1] = chu[1] - pp;
}
else
{
chu[1] = 150;
}
sum = sum + chu[1];
t[1] = chu[1];
}
else if((strcmp(x,"WA")==0) ||(strcmp(x,"Hack")==0))
{
if(strcmp(x,"Hack")==0)
{
sum = sum - t[1];
}
if(chu[1]-50>=150)
{
chu[1] = chu[1] - 50;
}
else
{
chu[1] = 150;
}
}
else if(strcmp(x,"Successful Hack")==0)
{
sum = sum + 100;
}
else if(strcmp(x,"Unsuccessful Hack")==0)
{
sum = sum -50;
}
}
if(str == 'C')
{
if(strcmp(x,"AC") == 0)
{
if(a == 1)
{
pp = 480 + b*8;
}
else if(a == 0)
{
pp = b*8;
}
if(chu[2]-pp>=150)
{
chu[2] = chu[2] - pp;
}
else
{
chu[2] = 150;
}
sum = sum + chu[2];
t[2] = chu[2];
}
else if((strcmp(x,"WA")==0) ||(strcmp(x,"Hack")==0))
{
if(strcmp(x,"Hack")==0)
{
sum = sum - t[2];
}
if(chu[2]-50>=150)
{
chu[2] = chu[2] - 50;
}
else
{
chu[2] = 150;
}
}
else if(strcmp(x,"Successful Hack")==0)
{
sum = sum + 100;
}
else if(strcmp(x,"Unsuccessful Hack")==0)
{
sum = sum -50;
}
}
if(str == 'D')
{
if(strcmp(x,"AC") == 0 && t[3] == 0)
{
if(a == 1)
{
pp = 960 + b*16;
}
else if(a == 0)
{
pp = b*16;
}
if(chu[3]-pp>=150)
{
chu[3] = chu[3] - pp;
}
else
{
chu[3] = 150;
}
sum = sum + chu[3];
t[3] = chu[3];
}
else if((strcmp(x,"WA")==0) ||(strcmp(x,"Hack")==0))
{
if(strcmp(x,"Hack")==0)
{
sum = sum - t[3];
}
if(chu[3]-50>=150)
{
chu[3] = chu[3] - 50;
}
else
{
chu[3] = 150;
}
}
else if(strcmp(x,"Successful Hack")==0)
{
sum = sum + 100;
}
else if(strcmp(x,"Unsuccessful Hack")==0)
{
sum = sum -50;
}
}
if(str == 'E')
{
if(strcmp(x,"AC") == 0)
{
if(a == 1)
{
pp = 1920 + b*32;
}
else if(a == 0)
{
pp = b*32;
}
if(chu[4]-pp>=150)
{
chu[4] = chu[4] - pp;
}
else
{
chu[4] = 150;
}
sum = sum + chu[4];
t[4] = chu[4];
}
else if((strcmp(x,"WA")==0) ||(strcmp(x,"Hack")==0))
{
if(strcmp(x,"Hack")==0)
{
sum = sum - t[4];
}
if(chu[4]-50>=150)
{
chu[4] = chu[4] - 50;
}
else
{
chu[4] = 150;
}
}
else if(strcmp(x,"Successful Hack")==0)
{
sum = sum + 100;
}
else if(strcmp(x,"Unsuccessful Hack")==0)
{
sum = sum -50;
}
}
}
printf("%d\n",sum);
}
return 0;
}