Shorter
This commit is contained in:
parent
2c6dc6e8be
commit
f02578eae0
|
@ -1,4 +1,4 @@
|
||||||
def chk(k):
|
def f(k):
|
||||||
a,b,c=*map(int,k[0].split('-')),k[1][0]
|
a,b,c=*map(int,k[0].split('-')),k[1][0]
|
||||||
return (k[2][a-1]==c)^(k[2][b-1]==c)
|
return (k[2][a-1]==c)^(k[2][b-1]==c)
|
||||||
print(sum(chk(x.split()) for x in open("/dev/stdin").readlines()))
|
print(sum(f(x.split()) for x in open("/dev/stdin").readlines()))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user