Laddu DSA Learning [Contest 1] Python 3 Whats wrong with the code?

Solution (WA)[Laddu Problem DSA Learning]
Problem : https://www.codechef.com/LRNDSA01/problems/LADDU

from sys import stdin,stdout
T=int(stdin.readline())
for i in range(T):
    res=0
    N=[str(x) for x in stdin.readline().split()]
    s=''
    Dict=dict()
    for j in range(int(N[0])):
        s=stdin.readline().split()
        if len(s)==1:
            Dict[s[0]]=''
        elif len(s)==2:
            Dict[s[0]]=s[1]
    Location=N[1]
    if "CONTEST_WON" in Dict.keys():
        res=res+300
        if int(Dict["CONTEST_WON"])<=20:
            res=res+20-int(Dict["CONTEST_WON"])
    if "TOP_CONTRIBUTOR" in Dict.keys():
        res=res+300
    if "BUG_FOUND" in Dict.keys():
        res=res+int(Dict["BUG_FOUND"])
    if "CONTEST_HOSTED" in Dict.keys():
        res=res+50
    if Location=="INDIAN":
        print(int(res/200))
    else:
        print(int(res/400))
1 Like

A problem link would be nice, too

An activity could happen multiple times, for example, you could be top contributor more than once.

1 Like

Thank you

Thank you for changing it - I saw your post was initially incredibly messy, then you actually fixed it, that’s awesome :slight_smile: