We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #1: Multiples of 3 and 5
Project Euler #1: Multiples of 3 and 5
Contest ends in
Sort by
recency
|
1363 Discussions
|
Please Login in order to post a comment
Guys, I am new here. Please help me. I wrote some code for Euler#1 that succeeded with the majority of the test cases, but failed on 2. How can I find out what value of n the test cases are failing on? I have tested the code thoroughly and can't find a problem. Thanks :)
why is my code not being accepted? for(int i=0;i
t = int(input().strip()) for a0 in range(t): m = int(input().strip()) n=m-1 k=n//3 l=n//5 o=n//15 k1=3*((k*(k+1))//2) l1=5*((l*(l+1))//2)-15*((o*(o+1))//2) print(k1+l1)