You are viewing a single comment's thread. Return to all comments →
import math f=math.factorial result=[] tc=int(raw_input()) for i in range(tc): n_row,n_col=raw_input().split(' ') count=0 for r in range(int(n_row)): c=0 while c<int(n_col) and c<r+1: value=(f(r)/(f(c)*f(r-c))) if value%7!=0: count=count+1 c=c+1 result.append(count) for i in result: print i
I'm getting timed out!
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #148: Exploring Pascal's triangle.
You are viewing a single comment's thread. Return to all comments →
I'm getting timed out!