Problem:


Score : 200 points

Problem Statement

Let us define the FizzBuzz sequence a_1,a_2,... as follows:

If both 3 and 5 divides i, a_i=\mbox{FizzBuzz}.

If the above does not hold but 3 divides i, a_i=\mbox{Fizz}.

If none of the above holds but 5 divides i, a_i=\mbox{Buzz}.

If none of the above holds, a_i=i.

Find the sum of all numbers among the first N terms of the FizzBuzz sequence.

Constraints

1 \leq N \leq 10^6

Input

Input is given from Standard Input in the following format:

N

Output

Print the sum of all numbers among the first N terms of the FizzBuzz sequence.

Sample Input 1

15

Sample Output 1

60

The first 15 terms of the FizzBuzz sequence are:

1,2,\mbox{Fizz},4,\mbox{Buzz},\mbox{Fizz},7,8,\mbox{Fizz},\mbox{Buzz},11,\mbox{Fizz},13,14,\mbox{FizzBuzz}

Among them, numbers are 1,2,4,7,8,11,13,14, and the sum of them is 60.

Sample Input 2

1000000

Sample Output 2

266666333332

Watch out for overflow.



Sample input:
15


Sample output:
60

Submission status: Wrong Answer

Solution code:
from sys import stdin

def I(): return int(stdin.readline().rstrip())


n = I()

l = []

ans = 0
for i in range(n):
    if i%3 != 0 and i%5 != 0:
            l.append(i)
            ans += i

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

total = 0

for i in range(1, n):
    if not (i % 3 == 0 or i % 5 == 0):
        total += i

print(total)

Submission status: Wrong Answer

Solution code:
N = int(input())
sum = 0

for i in range(1, N):
  if i % 3 == 0:
    pass
  elif i % 5 == 0:
    pass
  else:
    sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
#B
N = int(input())
A = list(range(1, N + 1))
ans = 0
for a in A:
    if (a % 3 == 0) or (a % 5 == 0):
        pass
    else:
        ans += A[a - 1]
print(A)

Submission status: Wrong Answer

Solution code:
#B
N = int(input())
A = list(range(1, N + 1))
ans = 0
for a in A:
    if (a % 3 == 0 and a % 5 == 0) or (a % 3 == 0) or (a % 5 == 0):
        pass
    else:
        ans += A[a - 1]
print(A)
print(ans)

Submission status: Wrong Answer

Solution code:
#B
N = int(input())
A = list(range(1, N))
ans = 0
for a in A:
    if (a % 3 == 0 and a % 5 == 0) or (a % 3 == 0) or (a % 5 == 0):
        pass
    else:
        ans += A[a - 1]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(range(1, N))
ans = 0
for a in A:
    if (a % 3 == 0 and a % 5 == 0) or (a % 3 == 0) or (a % 3 == 0):
        pass
    else:
        ans += A[a - 1]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[0 for i in range(n)]
for i in range(n): #0,1,
    if i%3!=0 and i%5!=0:
        a[i]=int(i)

print(sum(a))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[0 for i in range(n)]
for i in range(n):
    if i%3!=0 and i%5!=0:
        a[i]=int(i)

print(sum(a))

Submission status: Wrong Answer

Solution code:
N = int(input())
S =0
for i in range(N):
    if (i%3==0) and (i%5==0):
        S = S 
    elif i%3==0:
        S = S
    elif i%5==0:
        S = S
    else:
        S = S + i
print(S)

Submission status: Wrong Answer

Solution code:
def solve(string):
    return str(sum(i for i in range(int(string) + 1) if i % 3 > 1 and i % 5 > 1))


if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=0
for i in range (n):
  if i%3==0 or i%5==0:
    continue
  a+=i
print(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(1, n):
	if i % 3 != 0 and i % 5 != 0:
		ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans = 0
for i in range(N):
  if i % 15 != 0 and i % 5 != 0 and i % 3 != 0:
    ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
c = 0
for i in range(int(input())):
  if (i%3!=0)&(i%5!=0):
    c += i
print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
sum = 0
for i in range(1, N+1):
    if (i%3)*(i%5):
        sum += 1

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
sum = 0
for i in range(N):
    if i%3 != 0 and i%5 != 0:
        sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
sum = 0
for i in range(N):
    if (i%3)*(i%5):
        sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

for i in range(N):
    if((i%3 != 0) & (i%5 != 0)):
        ans += i

print(ans)

Submission status: Wrong Answer

Solution code:
print(sum(i for i in range(int(input())) if i % 3 != 0 and i % 5 != 0))

Submission status: Wrong Answer

Solution code:
ans = 0
for i in range(1,int(input())+1):
    if i%15 == 0:
        ans += 8
    elif i%3==0 or i%5 == 0:
        ans += 4
    else:
        ans += i
        
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

sum = 0
for i in range(N):
    j = i + 1
    if (j % 3 != 0) and (j % 5 != 0):
        print(j)
        sum += j

print(sum)

Submission status: Wrong Answer

Solution code:
import sys
import math
readline = sys.stdin.readline


def main():
    n = int(readline().rstrip())
    allSum = n * (n + 1) // 2
    threeNum = math.floor(n / 3)
    threeSum = 3 * threeNum * (threeNum + 1) // 2
    fiveNum = math.floor(n / 5)
    fiveSum = 5 * fiveNum * (fiveNum + 1) // 2
    bothNum = math.floor(n / 15)
    bothSum = 15 * bothNum * (bothNum + 1) // 2
    print(allSum, bothSum, threeSum, fiveSum)
    print(allSum + bothSum - threeSum - fiveSum)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
num = (int)(input())
fb = []
for i in range(num):
  if i % 3 != 0 and i % 5 != 0:
    fb.append(i)
print(sum(fb))

Submission status: Wrong Answer

Solution code:
n = int(input())
suma = 0
for i in range(n):
    if not (i % 3 == 0 and i % 5 == 0 or i % 3 == 0 or i % 5 == 0):
        suma = i + suma
print(suma)

Submission status: Wrong Answer

Solution code:
N = int(input())
sum = 0
for i in range(N):
  if i%3 != 0 and i%5 != 0:
    sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
for i in range(1, N+1):
  if N%3 != 0 and N%5 != 0:
    count = count + i
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
for i in range(1, N+1):
  if N%3 != 0 and N%5 != 0:
    count = count + 1
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())

list = [i for i in range(1, N+1) if not (i % 3 == 0 or i % 5 ==0)]
print(list)
print(sum(list))

Submission status: Wrong Answer

Solution code:
i=int(input())
a=0
while i+1>1:
    i-=1
    if i%3==0 and i%5==0:
        pass
    elif i%3==0:
        pass
    elif i%5==0:
        pass
    else:
        a+=i
print(a)

Submission status: Wrong Answer

Solution code:
print(sum(i for i in range(int(input()))if(i%3!=0)and(i%5!=0)))

Submission status: Wrong Answer

Solution code:
n = int(input())
answer = 0
for i in range(1, n + 1):
    if i % 3 and i % 5:
        answer += i
        print(i)
print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
none_num = [i for i in range(1, N+1) if i%3 != 0 and i%5 != 0]
none = sum(none_num)

Submission status: Wrong Answer

Solution code:
n = int(input())

t = 0
for i in range(n):
    if i%3==0:
        continue
    elif i%5==0:
        continue
    else:
        t += i
print(t)

Submission status: Wrong Answer

Solution code:
n = int(input())

t = 0
for i in range(n):
    if i%3 ==0 and i%5 ==0:
        continue
    elif i%3==0:
        continue
    elif i%5==0:
        continue
    else:
        t += i
print(t)

Submission status: Wrong Answer

Solution code:
n = int(input())

sum = 0
for i in range(n):
    if(i % 3 != 0 and i % 5 != 0):
        sum = sum + i

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())

num = 0
for i in range(1, N):
   if i % 3 != 0 and i % 5 != 0:
       num += i

print(num)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = int(0)
for i in range(1, N):
    if (i % 3 != 0) & (i % 5 != 0) :
        count += i

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = int(0)
for i in range(N):
    if (i % 3 != 0) & (i % 5 != 0) :
        count += i

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0

for i in range(1,N+1):
    if i % 3 == 0 or i % 5 == 0:
        ans += i

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

s = 0
for i in range(n):
    if not (i % 3 == 0 or i % 5 == 0):
        s += i
        
print(s)

Submission status: Wrong Answer

Solution code:
n=int(input())
total=0
for i in range(0,n+1):
    if (i%3==0 and i%5==0) or i%3==0 or i%5==0:
        total+=0
    else:
        print(i)
        total+=i
print(total)

Submission status: Wrong Answer

Solution code:
n=int(input())
cnt=0
for i in range(n):
  if i%3!=0 and i%5!=0:
    cnt+=i
    
print(cnt)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans =0
for i in range(0,n):
   if  i % 3!=0 and i % 5!=0:
    ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
ans =0
for i in range(0,n):
   if  i % 3!=0 and i % 5!=0:
    ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
sum = 0
for i in range(n):
    if i%5!=0 and i%3!=0:
        sum = sum + i
print(sum)

Submission status: Wrong Answer

Solution code:

N = int(input())
ans = 0
i = 1
while i < N:
    if i % 3 !=0 and i%5!=0 and not (i%3==0 and i%5==0 ):
        ans+=i
    i+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(n):
	if i % 3 == 0 or i % 5 == 0 or i % 15 == 0:
		continue
	else:
		ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(n):
	if i % 3 == 0 or i % 5 == 0:
		continue
	else:
		ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
FizzBuzz = []
Fizz = []
Buzz = []
ano = []
plus = 0
for i in range(N+1):
    if i % 3 == 0 and i % 5 == 0:
        FizzBuzz.append(i)
    elif i % 3 == 0:
        Fizz.append(i)
    elif i % 5 == 0:
        Buzz.append(i)
    else:
        ano.append(i)
for a in FizzBuzz:
    plus += a
for x in Fizz:
    plus += x
for j in Buzz:
    plus += j
print(plus)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
for i in (1,n+1):
  if i%3!=0 and i%5!=0:
    ans+=i
print(ans)

Submission status: Wrong Answer

Solution code:
import math
from functools import reduce

k = int(input())
sum = 0


def gcd(*numbers):
    return reduce(math.gcd, numbers)


for a in range(1, k + 1):
    for b in range(1, k + 1):
        for c in range(1, k + 1):
            sum += gcd(a, b, c)
print(sum)

Submission status: Wrong Answer

Solution code:
n =int(input())
sum = 0
for i in range(1, n):
    if i % 3 != 0 and i % 5 != 0:
        sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
sum = 0
for i in range(1, N+1) :
    if (i%3) != 0 and (i%5) != 0 :
        print(i)
        sum = sum + int(i)
print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
sum = 0
for i in range(1, n):
    if i % 3 != 0 and i % 5 != 0:
        sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
sum = 0
for i in range(1, n):
    if i % 3 == 0 and i % 5 == 0:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    else:
        sum+= i
print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
s = 0
for i in range(n):
  if i % 3 == 0:
    pass
  elif i % 5 == 0:
    pass
  else:
    s = s + i
print(s)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
for i in range (N+1):
  if i%3!=0 and i%5!=0:
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
for i in range (N+1):
  if i%3!=0 and i%5!=0:
    ans+=0
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
sum = 0

for i  in range (n):
    if (i%3==0 and i%5==0) or i%3==0 or i%5==0:
        continue
    else:
        sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
N = 1000000#int(input())
a = list(range(1,N+1))
N_3 = N//3
N_5 = N//5
for i in range(1,N_3+1):
    a[3*i-1] = 0
for i in range(1,N_5+1):
    a[5*i-1] = 0
print(sum(a))

Submission status: Wrong Answer

Solution code:
# coding: utf-8

N=int(input().rstrip())
count = 0


for a in range(1,N):
    if a%3!=0 and a%5 !=0:
        count += a
print(count)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

N=int(input().rstrip())
count = 0
for a in range(N+1):
    if a%3 == 0 or a%5 == 0:
        count += a
print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
x=0
for i in range(0,n):
  if i%3==0 or i%5==0:
    x=x
  else:
    x=x+i

print(x)

Submission status: Wrong Answer

Solution code:
n = int(input())
count=0
for i in range(n):
    if  i%5 != 0 and  i%3 != 0:
        count += i
print(count)

Submission status: Wrong Answer

Solution code:
N=int(input())
sum=0
for i in range(N):
  if i%3 !=0 and i%5 !=0 :
    sum+=i

print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())

list = []

count = 1

for i in range(n):
  if count % 15 == 0:
    list.append(count)
  count += 1
    
print(sum(list))

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
for n in range(N):
  if n%5!=0 and n%3!=0:
    ans+=n
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=[i for i in range(N+1)]
for i in range(N+1):
  if i%3==0 or i%5==0:
    a[i]=0
sum(a)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
i = 1
while i < n:
  if i%3 != 0 and i%5 != 0:
    ans += i
  i += 1
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
n3 = n // 3
n5 = n // 5
n15 = n // 15

print(n*(n+1)/2 - 3*n3*(n3+1)/2 - 5*n5*(n5+1)/2 + 15*n15*(n15+1)/2)

Submission status: Wrong Answer

Solution code:
n = int(input())
n3 = n // 3
n5 = n // 5
n15 = n // 15

print(n*(n+1)/2 + 3*n3*(n3+1)/2 + 5*n5*(n5+1)/2 - 15*n15*(n15+1)/2)

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(range(1, n+1))
B = list()
for i in range(1, n+1):
    if i % 5 == 0 or i % 3 == 0:
        continue
    B.append(i)
ans = list(set(A) - set(B))
print(sum(ans))

Submission status: Wrong Answer

Solution code:
n = int(input())
total = 0
for i in range(n+1):
  if n % 3 != 0 and n % 5 != 0:
    total += n
    
print(total)

Submission status: Wrong Answer

Solution code:
N=int(input())

print(sum(i for i in range(1,N+1) if i%3==0 or  i%5==0))

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    print(sum([i for i in range(1, n) if i%3 and i%5]))

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
a=int(input())
b=[]
for i in range(a):
    if i%3==0 or i%5==0:
        continue
    else:
        b.append(i)
print(sum(b))

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
for i in range(n):
  if (i % 3 != 0) and (i % 5 != 0):
    count += i
print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
for i in range(n):
  if (n % 3 != 0) and (n % 5 != 0):
    count += i
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
Sum = int(0)
for i in range(N):
  if i%5 != 0 and i%3 != 0:
    Sum = Sum + i
print(Sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
Sum = 0
for i in range(N):
  if i%5 != 0 and i%3 != 0:
    Sum = Sum + i
print(Sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
Sum = 0
Sumlist = []
for i in range(N):
  Sum = Sum + i
for i in range(N):
  if i%5 == 0 and i%3 == 0:
    Sumlist.append(i)
for i in range(N):
  if i%5 == 0 and i%3 != 0:
    Sumlist.append(i)
for i in range(N):
  if i%5 != 0 and i%3 == 0:
    Sumlist.append(i) 
print(Sum-sum(Sumlist))

Submission status: Wrong Answer

Solution code:
# input
n = int(input())
sum = 0

# judge
for i in range(n+1):
    if ((i % 15 == 0) or (i % 3 == 0) or (i % 5 == 0)):
        sum += i

# output
print(sum)

Submission status: Wrong Answer

Solution code:
# input
n = int(input())
sum = 0
# judge
for i in range(n+1):
    if ((i % 15 == 0) or (i % 3 == 0) or (i % 5 == 0)):
        sum += i

# output
print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
f = n//3
s_f = 3*f*(f+1)/2
b = n//5
s_b = 5*b*(b+1)/2
fb = n//15
s_fb = 15*fb*(fb+1)/2
print(n*(n+1)/2-s_f-s_b+s_fb)

Submission status: Wrong Answer

Solution code:
#-*- coding: utf-8 -*-
n = int(input())
sum = 0
for i in range(1,n):
    if i % 3 != 0 and i % 5 != 0 and i % 15 != 0:
        sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
#-*- coding: utf-8 -*-
n = int(input())
sum = 0
for i in range(1,n):
    if i % 3 != 0 and i % 5 != 0:
        sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())

Sum = (1+N)*N/2
Fizz = ((1+N//3)*N//3)/2*3
Buzz = ((1+N//5)*N//5)/2*5
FizzBuzz = ((1+N//15)*N//15)/2*15

print (int(Sum-Fizz-Buzz+FizzBuzz))

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for x in range(n):
    if x % 3 == 0 or x % 5 == 0:
        pass
    else:
        ans += x
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for x in range(n):
    if not (x % 3 == 0 or x % 5 == 0):
        ans += x
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
s=0
for i in range(1,n+1):
  if i%3==0 and i%5==0:
    s+=i
print(s)

Submission status: Wrong Answer

Solution code:
N = int(input())
result = 0

for i in range(N+1):
    if i % 3 != 0 and i % 5 != 0:
        result += i
        print(i)
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())
result = 0

for i in range(N):
    if i % 3 != 0 and i % 5 != 0:
        result += i
print(result)

Submission status: Wrong Answer

Solution code:
N=int(input())
L=[1,2,0,4,0,0,7,8,0,0,11,0,13,14,0]
a=N//15
b=180*a-120
c=N-15*a
X=0
for i in range(c):
  X=X+L[i]
S=L[0:c+1]
m=S.count(0) 
print(b+X+15*a*(c-m))

Submission status: Wrong Answer

Solution code:
N=int(input())
L=[1,2,0,4,0,0,7,8,0,0,11,0,13,14,0]
a=N//15
b=180*a-120
c=N-15*a
X=0
for i in range(c):
  X=X+L[i]
print(b+15*a*c+X)

Submission status: Wrong Answer

Solution code:
N=int(input())
L=[1,2,0,4,0,0,7,8,0,0,11,0,13,14,0]
a=N//15
b=120*a-60
c=N-15*a
X=0
for i in range(c):
  X=X+L[i]
print(b+15*a*c+X)

Submission status: Wrong Answer

Solution code:
N=int(input())
L=[1,2,0,4,0,0,7,8,0,0,11,0,13,14,0]
a=N//15
b=120*a-60
c=N-15*a
X=0
for i in range(c):
  X=X+L[i]
print(b+X)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=0
for i in range(N):
    if i%3!=0 and i%5!=0:
        ans+=i
print(str(ans))

Submission status: Wrong Answer

Solution code:
N = input()
n = int(N)
summ = 0
tsum = 0
for i in range(n):
    if i % 3 == 0 and i % 5 == 0 :
        summ = summ + i
    if i % 3 == 0 and i % 5 != 0 :
        summ = summ + i
    if i % 3 != 0 and i % 5 == 0 :
        summ = summ + i
    tsum = tsum + i
print(tsum-summ)

Submission status: Wrong Answer

Solution code:
N = int(input())

sum = 0

for i in range(1, N):
    if i % 3 != 0 and i % 5 != 0:
        sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
n =  int(input())
sum = 0
for i in range(n):
    if i % 3 == 0 and i % 5 == 0:
        # print('FizzBuzz')
        pass
    elif i % 3 == 0:
        # print('Fizz')
        pass
    elif i % 5 == 0:
        # print('Buzz')
        pass
    else:
        # print(i)
        sum += i

print(sum)

Submission status: Wrong Answer

Solution code:


sum = 0
num = int(input(""))
for i in range(num):
    if i % 3 == 0:
        i = "Fizz"
    elif i % 5 == 0:
        i = "Buzz"
    elif i % 3 == 0 and i % 5 == 0:
        i = "FizzBuzz"
    else:
        sum = sum + i
print(sum)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
if N >= 2 :
    An = np.empty(N+2)
    #An = [[] for _ in range(1,N+2)]
    #print(An)
    for s in range(1,N+1) :
        #print(s)
        if s%3 != 0 and s%5 != 0 :
            An[s] = int(s) 
            #print(s)
            print(An[s])
    ans = np.sum(An)
else:
    ans = int(1)

print (int(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

N_list = list(range(1, N + 1))

ans = 0

for i in N_list:
    if not i % 3 == 0 or i % 5 == 0:
        ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
sums = 0
for i in range(a):
  if (i+1)%3!=0 and (i+1)%5!=0:
    sums+=i
print(sums)

Submission status: Wrong Answer

Solution code:
a = int(input())
sums = 0
for i in range(a):
  if i%3!=0 and i%5!=0:
    sums+=i
print(sums)

Submission status: Wrong Answer

Solution code:
N = int(input())

x = 0

for i in range(N):
  if i % 3 != 0 and i % 5 != 0:
    x += i
print(x)

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
	n = int(input())
	ans = 0
	for i in range(n):
		if (i % 3 != 0) and (i % 5 != 0):
			ans += i
	print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

sum = 0
for i in range(1, N + 1):
    if i % 3 == 0 or i % 5 == 0 or i % 15 == 0:
        sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
def resolve():
    n=int(input())
    ans=0

    for i in range(n):
        if i%3!=0 and i%5!=0:
            ans+=i
    print(ans)
if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
#B
n = int(input())

ans = 0
for i in range(n+1):
    if i % 3 == 0 or i % 5 == 0:
        continue
    else:
        ans += i
        print(ans)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(n):
  if (i % 3 != 0 and i % 5 != 0):
    ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    ans = 0
    for i in range(n):
        if((i%3!=0)and(i%5!=0)):
            ans = ans + i
    print(ans)
main()

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    print(int( ((n*(n+1))/2) - (3*(((n/3)*((3+n)/3))/2)) -  (5*(((n/5)*((5+n)/5))/2)) + (15*(((n/15)*((15+n)/15))/2)) ))
main()

Submission status: Wrong Answer

Solution code:
n = int(input())
fizz_buzz_sum = 0

for i in range(n):
    if (i % 3 == 0 and i % 5 == 0) or i % 3 == 0 or i % 5 == 0:
        pass
    else:
        fizz_buzz_sum += i

print(fizz_buzz_sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 0
li = list(range(1,n))
for i in range(n - 1) :
    if li[i] % 3 == 0 or li[i] % 5 == 0:
        pass
    
    else:
        x += li[i]
print(x)

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 0
li = list(range(1,n))
for i in range(n - 1) :
    if li[i]  % 3 == 0 and li[i]  % 5 != 0:
        li[i] = "Fizz"
    
    elif li[i]  % 3 != 0 and li[i]  % 5 == 0: 
        li[i] = "Buzz"
    
    elif li[i]  % 3 == 0 and li[i]  % 5 == 0:
        li[i] = "FizzBuzz"
    
    else:
        x += li[i]
print(x)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = 0
for i in range(N+1):
    if not i % 3==0 or not i % 5 == 0:
        a += i
print(a)

Submission status: Wrong Answer

Solution code:
N = input()
fizz = list()
for i in range(int(N)):
    if not i // 3==0 and not i//5==0:
        fizz.append(i)
print(sum(fizz))

Submission status: Wrong Answer

Solution code:
N = input()
fizz = list()
for i in range(int(N)):
    if i // 3 == 0 and i // 5 == 0:
        continue
    elif i // 3 == 0: 
        continue
    elif i // 5 == 0:
        continue
    else:
        fizz.append(i)
print(sum(fizz))

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0

for i in range(n):
    if i % 3 != 0 and i % 5 != 0:
        ans += i

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
sum = 0
for i in range(N):
	if (i+1) % 5 != 0 and (i+1) % 3 != 0:
		sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
sum = 0
for i in range(N):
	if i % 5 != 0 and i % 3 != 0:
		sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
a=int(input())
ans=0
for i in range(a):
    if i%3!=0 and i%5!=0:
        ans+=i
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
e = []
m = []
for i in range(n):
    if i % 15 == 0:
        e.append(i)
    elif i % 3 == 0:
        e.append(i)
    elif i % 5 == 0:
        e.append(i)
    else:
        m.append(i)
print(sum(m))

Submission status: Wrong Answer

Solution code:
N=int(input())
sum=0
for i in range(N):
    if i%3!=0 and i%5!=0:
        sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 0
for i in range(0,n):
  if i % 3 == 0 or i % 5 ==0:
    a = a
  else:
    a = a+i
    
print(a)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for i in range(1, N+1):
  if not (i%3==0 or i%5==0 or i%15==0):
    ans += i
print(i)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
for i in range(n):
  if not (i % 3 == 0 or i % 5 == 0):
    ans += i

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
sum = 0
for i in range(1,N):
  if i % 3 != 0 and i % 5 != 0:
    sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
sum = 0
for i in range(1,N):
  if not (i % 3 == 0 or i % 5 == 0):
    sum += i

print(sum)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
sum = 0
for i in range(1,N):
	if not (i % 3 == 0 or i % 5 == 0):
  		sum += i

# 出力
print(sum)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
for i in range(n):
  if i%3!=0 and i%5!=0:
    ans+=i
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

l = []

for i in range(N):
    if i % 15 == 0:
        continue
    elif i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else: l.append(i)
    
print(sum(l))

Submission status: Wrong Answer

Solution code:
N = int(input())
A=[i for i in range(N) if not(i%3==0 or i%5==0)]
print(str(sum(A)))

Submission status: Wrong Answer

Solution code:
N = int(input())
A=[i for i in range(N) if not(i%3==0 or i%5==0)]
#print(A)
print(sum(A))

Submission status: Wrong Answer

Solution code:
N = int(input())
A=[i for i in range(N) if not(i%3==0 or i%5==0)]
print(sum(A))

Submission status: Wrong Answer

Solution code:
N = int(input())

print(sum(filter(lambda x : (x%3 != 0) and (x%5 !=0), range(N))))

Submission status: Wrong Answer

Solution code:
N = int(input())

print(sum(filter(lambda x : (x%3 != 0) and (x%5 !=0), range(N))))

Submission status: Wrong Answer

Solution code:
N = int(input())

print(sum(filter(lambda x : (x%3 != 0) or (x%5 !=0), range(N))))

Submission status: Wrong Answer

Solution code:
N = int(input())
print(N//15*3)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
total = 0
for i in range(1, N):
    if i % 3 and i % 5:
        total += i
print(total)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
# assert 1 <= N <= 10**6
total = 0
for i in range(1, N):
    if not (i % 3 == 0 or i % 5 == 0):
        # if i % 3 and i % 5:
        total += i
print(total)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
total = 0
for i in range(1, N):
    if not (i % 3 == 0 or i % 5 == 0):
        total += i
print(total)

Submission status: Wrong Answer

Solution code:
N=int(input())
Fizzbuzz=[]
for i in range(N):
  if i%3!=0 and i%5!=0:
      Fizzbuzz.append(i)
print(sum(Fizzbuzz))

Submission status: Wrong Answer

Solution code:
n = int(input())
sum = 0
for i in range(n):
    if not i%3==0 and not i%5==0 and not i%15==0: 
        sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
sum = 0
for i in range(n):
    if not i%3==0 and not i%5==0: 
        sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

N = int(input())
ans = 0
for i in range(N):
    if i % 3 == 0 or i % 5 == 0:
        pass
    else:
        ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
for i in range(1,N):
    if(i%3==0 and i%5==0):
        a=1
    elif(i%3==0):
        a=1
    elif(i%5==0):
        a=1
    else:
        count=count+i

print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for i in range(N+1):
  if i%3!=0 or i%5!=0:
    ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
n = input()
kei = 0

for i in range(int(n)):
    if i%3 != 0 and i%5 != 0:
        kei += i

print(kei)

Submission status: Wrong Answer

Solution code:
N = int(input())
An = [[] for _ in range(N)]
for s in range(N) :
    if s%3 == 0 :
        An[s] = 0 
    elif s%5 == 0 :
        An[s] = 0
    else:
        An[s] = s 

ans = int(sum(An))

print (ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
An = [[] for _ in range(N)]
for s in range(N) :
    if s%3 == 0 :
        An[s] = 0 
    elif s%5 == 0 :
        An[s] = 0
    else:
        An[s] = s 

ans = sum(An)

print (ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def judge(x):
  if x % 15 == 0:
    return 0
  elif x % 3 == 0:
    return 0
  elif x % 5 == 0:
    return 0
  else:
    return x

l =[]
for i in range(1,N+1):
  l.append(i)
  
print(sum(l))

Submission status: Wrong Answer

Solution code:
N = int(input())

def judge(x):
  if x % 15 == 0:
    return 0
  elif x % 3 == 0:
    return 0
  elif x % 5 == 0:
    return 0
  else:
    return x

l =[]
i = 0
for i in range(N):
  l.append(i)
  
print(sum(l))

Submission status: Wrong Answer

Solution code:
def judge(x):
    y = 0
    if x%3==0 or x%5==0:
        y = 1

    return y

n = int(input())
ans = 0

for i in range(n):
    num = i+1

    if judge(num)==1:
        ans += num

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
def S(n):
    return N/2 * (1+N//n)
print(S(1) - S(3) - S(5) + S(15))

Submission status: Wrong Answer

Solution code:
x = int(input())
sum = 0

for num in range(1,x+1):
    print(num)
    sum = sum + num
    if  num%3 == 0 or num%5 == 0:
        sum = sum - num 
     
       
    

print(sum)

Submission status: Wrong Answer

Solution code:
x = int(input())
sum = 0

for num in range(1,x):
   
    sum = sum + num
    if  num%3 == 0 or num%5 == 0:
        sum = sum - num 
     
       
    

print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
result = 0

for i in range(1, n + 1):
  if not i % 3 == 0 and i % 5 == 0:
    result += i
    
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
result = 0

for i in range(1, n + 1):
  if not i % 3 == 0 or i % 5 == 0:
    result += i
    
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())
warikirenai = []
for i in range(N):
    if (i%3 != 0) & (i%5 != 0):
        warikirenai.append(i)
        
print(sum(warikirenai))

Submission status: Wrong Answer

Solution code:
N = int(input())
F =list(range(1,N))
B =[i for i in F if i%3 != 0 and i%5 != 0]

print(sum(B))