Skip to content

Instantly share code, notes, and snippets.

@gauravkoradiya
Created April 26, 2020 09:45
Show Gist options
  • Save gauravkoradiya/f7bfe3274594f6ac79bba2655137c4a9 to your computer and use it in GitHub Desktop.
Save gauravkoradiya/f7bfe3274594f6ac79bba2655137c4a9 to your computer and use it in GitHub Desktop.
Codechef_DSA01 - Laddu - Problem Code: LADDU
# cook yur dish here
# https://www.codechef.com/LRNDSA01/problems/LADDU
def LADDU_ACCURAL_SYSTEM(activity):
if activity[0] == 'CONTEST_WON':
return 300 + ((20 - int(activity[1])) if int(activity[1])<20 else 0)
if activity[0] == 'TOP_CONTRIBUTOR':
return 300
if activity[0] == 'BUG_FOUND':
return int(activity[1])
if activity[0] == 'CONTEST_HOSTED':
return 50
def main():
for _ in range(int(input())):
num_activity, region = input().split()
total = 0
for _ in range(int(num_activity)):
total += LADDU_ACCURAL_SYSTEM(activity = input().split())
if region == 'NON_INDIAN':
print((total - (total % 400)) // 400)
else:
print((total - (total % 200)) // 200)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment