Created
June 21, 2014 17:52
-
-
Save anonymous/a6daaedabf97d3b9171e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vst = [0 for i in range(0,31)] | |
ans = [0] | |
def dfs(last, cont, count): | |
if cont >= 5: return | |
if count == 13: | |
""" | |
for i in range(1, 31): | |
if vst[i] != 0: | |
print i, | |
print '' | |
""" | |
ans[0] = ans[0]+1 | |
print ans[0] | |
return | |
if last == 30: return | |
vst[last+1] = 1 | |
dfs(last+1, cont+1, count+1) | |
vst[last+1] = 0 | |
tmp = last+5 | |
if tmp > 30: tmp=30 | |
for i in range(last+2, tmp): | |
vst[i] = 1 | |
dfs(i, 1, count+1) | |
vst[i] = 0 | |
for i in range(1, 30): | |
vst[i]=1 | |
dfs(i, 1, 1) | |
vst[i]=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment