Category: python
The problem is from codeforces: http://codeforces.com/contest/263/problem/A It looks complex but in fact it is not. There is only one ‘1’ element in this fixed-5X5 matrix. The shortest path to the …
I participated in Codeforces online contest yesterday and was trying to solve this problemusing DFS (Depth-First-Search). I got somehow stuck in the WA3 (Wrong Answer Test 3). I checked …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/262/B Two hints used to solve this problem are greedy and sorted numbers. The greedy approach turns negative numbers one by one in non-decreasing order …
The problem is from codeforces: http://www.codeforces.com/problemset/problem/262/A #!/usr/bin/env python n, k = map(int, raw_input().split()) s = raw_input().split() ans = 0 for x in s: ans += 1 if x.count('4') + x.count('7') …
The Problem is from codeforces: http://www.codeforces.com/problemset/problem/5/A In Python, there is no explicit EOF, therefore, to read until the end of input stream, one can check the input string, and check …