エンジニア死滅シタ世界之学べない学校 [MISSION LEVEL: C]-Python3

答案

# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ!!

N=input()
w_a=0
w_b=0
gpc_dict={
    "gg":0,"cc":0,"pp":0,"gc":1,
    "cp":1,"cg":-1,"pc":-1,
    "pg":1,"gp":-1,
}

for i in range(int(N)):
    ab=input()
    new_ab=ab.replace(" ","")
    who_win=gpc_dict.get(new_ab)
    if who_win>0:
        w_a+=1
    elif who_win<0:
        w_b+=1
print(w_a)
print(w_b)

posted @ 2019-10-13 01:00  公众号python学习开发  阅读(166)  评论(0编辑  收藏  举报