-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpromote.py
More file actions
19 lines (15 loc) · 841 Bytes
/
promote.py
File metadata and controls
19 lines (15 loc) · 841 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# import time
# start_time = time.time()
with open("promote.in","r") as f_in:
bronze_before, bronze_after = map(int,f_in.readline().strip("\n").split())
silver_before, silver_after = map(int, f_in.readline().strip("\n").split())
gold_before, gold_after = map(int, f_in.readline().strip("\n").split())
platinum_before, platinum_after = map(int, f_in.readline().strip("\n").split())
gold_to_platinum = platinum_after - platinum_before
silver_to_gold = gold_after - gold_before + gold_to_platinum
bronze_to_silver = silver_after - silver_before + silver_to_gold
with open("promote.out", "w") as f_out:
f_out.write(str(bronze_to_silver) + "\n")
f_out.write(str(silver_to_gold) + "\n")
f_out.write(str(gold_to_platinum) + "\n")
# print("time elapsed: {:.2f}s".format(time.time() - start_time))