-
Notifications
You must be signed in to change notification settings - Fork 0
/
laddu.c
58 lines (45 loc) · 1.07 KB
/
laddu.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
main()
{
int t,rank,laddu,d,i,activity=0,ans;
char str[100];
scanf("%d",&t);
while(t--)
{
laddu=0;
scanf("%d %s",&activity,str);
if(strcmp(str,"NON_INDIAN")==0)
{
d=400;
}
else
d=200;
while(activity--)
{
scanf("%s",str);
if(strcmp(str,"CONTEST_WON")==0)
{
laddu=laddu+300;
scanf("%d",&rank);
if (rank<20)
{
laddu=laddu+(20-rank);
}
}
else if(strcmp(str,"TOP_CONTRIBUTOR")==0)
laddu=laddu+300;
else if(strcmp(str,"BUG_FOUND")==0)
{
scanf("%d",&rank);
if(rank>=50 && rank<=1000)
laddu=laddu+rank;
}
else if(strcmp(str,"CONTEST_HOSTED")==0)
laddu=laddu+50;
}
ans=laddu/d;
printf("%d\n",ans);
}
}