2010-04-08から1日間の記事一覧
Obsession with RobotsRRUULLDでもBUGと返さなければいけない。スタート地点から1つ上に行けばゴール地点。 path = raw_input() pos = (0,0) visit = set() visit.add(pos) for c in path: if c == "L": t = (pos[0]+1,pos[1]) if c == "R": t = (pos[0]-1,…
Train and Peter import re x = raw_input() y = raw_input() z = raw_input() m1 = re.search(y+".*"+z,x) m2 = re.search(z[::-1]+".*"+y[::-1],x) if m1 and not m2: print "forward" if not m1 and m2: print "backward" if m1 and m2: print "both" if …
Aをノーミス、Bを1ミスで解いて、レーティング1622。
Theater Square n,m,a = [int(x) for x in raw_input().split()] print ((n+a-1)/a)*((m+a-1)/a)