2012-07-01から1日間の記事一覧

ARC#005 C - 器物損壊!高橋君 ( Search and destroy )

器物損壊!高橋君 ( Search and destroy )道への移動は距離0、壁への移動は距離2と考えて、幅優先探索。 # coding: utf-8 H,W = [int(x)+6 for x in raw_input().split()] c = ["#"*W]*3+["###"+raw_input()+"###" for y in range(H-6)]+["#"*W]*3 D = [[9]*…

ARC#005 B - P-CASカードと高橋君 ( This story is a fiction )

P-CASカードと高橋君 ( This story is a fiction ) x,y,W=raw_input().split() x=int(x);y=int(y) dx=1 if W[0]=="R" else -1 if W[0]=="L" else 0 dy=1 if W[-1]=="D" else -1 if W[-1]=="U" else 0 c = [raw_input() for i in range(9)] p = "" for i in r…

ARC#005 A - 大好き高橋君 ( Love me do )

大好き高橋君 ( Love me do ) input();print [w in["TAKAHASHIKUN","Takahashikun","takahashikun"]for w in raw_input()[:-1].split()].count(True)