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
Sort by
recency
|
1458 Discussions
|
Please Login in order to post a comment
Make sure to use floor div or else some tests using very large numbers wont work :'( Took me a while to find out... (Was just using int on the result before lol)
import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;
public class Solution {
}
import math import os import random import re import sys
def res(x,n): q = (n-1)//x return x*q*(q+1)//2
if name == 'main': t = int(input().strip())
I am facing problem with Test Cases 2 and 3. I tried to check various boundary cases, but could not find the error. Could anyone please help? Here's my code in python:
handle long only: