The problem is from codeforces http://www.codeforces.com/problemset/problem/12/A
This is probably the easiest problem I’ve ever seen in codeforces…. no tricks, no math or algorithms. It is very straightforward.
The python solution is cooked in seconds. 🙂
r1 = raw_input() r2 = raw_input() r3 = raw_input() def chk(): return (r1[0] == r3[2]) and (r1[1] == r3[1]) and (r1[2] == r3[0]) and (r2[0] == r2[2]) if chk(): print "YES" else: print "NO"
It is noted that in python the logic operations are similar to Pascal, which are English words ‘and‘, ‘or‘ … It is defined as such probably because of the easiness to understand, unlike the ‘&&’, ‘||’ in C-like languages.
–EOF (The Ultimate Computing & Technology Blog) —
GD Star Rating
loading...
187 wordsloading...
Last Post: Codeforces: A. Sleuth
Next Post: Database Optimisation Script in PHP