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:

n = int(input())

total = 0

for i in range(0, n):

    if i % 3 != 0 and i % 5 != 0 :
        total = total + i

print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    import math
    import sys

    input = sys.stdin.readline

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
number_list = []
summury = 0
for i in range(N):
  if (i+1) % 3 != 0 or (i+1) % 5 != 0:
    number_list.append(i+1)
    
for i in range(len(number_list)):
  summury += number_list[i]

print(summury)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

a = N//15
b = N%15
c = 0

for i in range(b+1):
  if i%3!=0 and i%5!=0:
    c=c+i+15*a

ans=(120*(a*(a-1)/2))+60*(a)+c

print(ans)

Submission status: Wrong Answer

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

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())
a = 0
for i in range(n):
    if not (i%3 == 0 or i%5 == 0 or i%15 == 0):
        a += i
print(a)

Submission status: Wrong Answer

Solution code:
N=int(input())
s=(N*(N-1))/2-(int(N/3)*3+3)*int(N/3)/2-(int(N/5)*5+5)*int(N/5)/2+(int(N/15)*15+15)*int(N/15)/2


print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
import numpy as np
 
N = INT()
A = np.arange(N+1)
A = list(A)
 
for i in range(N+1):
  if A[i]%3 == 0 or A[i]%5 == 0:
    A[i]=0
    
print(sum(A))
print(A)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
num = int(input())
syou = math.floor(num/15)
amari = num % 15
sum = 0

list = [1,2,0,4,0,0,7,8,0,0,11,0,13,14,0]
if syou >=1:
    sum += 60 + 120* (syou-1)

    for i in range(amari):
        sum += list[amari-1] + 15 * (syou-1)

    print(sum)

else:
    for d in range(num):
        sum += list[d]
    print(sum)

Submission status: Wrong Answer

Solution code:
s=int(input())
k=0
for x in range(s):
    if x%3!=0 and x%5!=0:
        k+=x
print(k)

Submission status: Wrong Answer

Solution code:
N = int(input())
n_list = [0 if (n % 15 == 0 or n % 3 == 0 or n % 5 == 0) else n for n in range(N)]
print(sum(n_list))

Submission status: Wrong Answer

Solution code:
def main():
    i = int(input())
    s = 0
    for j in range(1, i):
        if j % 3 == 0 and s % 5 == 0:
            pass  # FizzBuzz
        elif j % 3 == 0:
            pass  # Fizz
        elif j % 5 == 0:
            pass  # Buzz
        else:
            s += j
    print(s)


main()

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:
    count+=i
print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
count = 0
for i in range(N):
    if i %3 != 0:
        if i%5 != 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 or i % 5 == 0:
    pass
  else:
    sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
print("\n".join(["FizzBuzz" if n % 15 == 0 else "Fizz" if n % 3 == 0 else "Buzz" if n % 5 == 0 else str(n) for n in range(1,N+1)]))

Submission status: Wrong Answer

Solution code:
import numpy as np

n = input()
N = int(n)

s = np.sum([i for i in range(N+1) if (i%3==0)and(i%5==0)])
print(s)

Submission status: Wrong Answer

Solution code:
a=int(input())

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

print(b)

Submission status: Wrong Answer

Solution code:
n=int(input())

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

Submission status: Wrong Answer

Solution code:
N = int(input())

import math
 
a = N // 3
b = N // 5
c = N // 15
 
d = 3*a*(a+1)/2
e = 3*b*(b+1)/2
f = 3*c*(c+1)/2
 
g = N*(N+1)/2
 
print(math.floor(g-d-e+f))

Submission status: Wrong Answer

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

for i in range(N):
    if i % 5 != 0 and i % 3 != 0 and i % 15 != 0:
        num += i
        #f = i
        #print(f)
print(num)

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:
#!/usr/bin/env python3
import sys

def solve(N: int):
    ans=0
    for i in range(N):
        ans+=i if i%3!=0 and i%5!=0 else 0
    print(ans)
    return

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

b = 0

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

print(b)

Submission status: Wrong Answer

Solution code:
N = int(input())
output_list = []

for i in range(N):
  if i % 3 == 0 or i % 5 == 0 or i % 15 == 0:
    pass
  else:
    output_list.append(i)
  
print(sum(output_list))

Submission status: Wrong Answer

Solution code:
N = eval(input("Enter sonething: "))
k=0
for i in range(0,N):
  if i%3!=0 and i%5!=0:
      k=k+i
print (k)

Submission status: Wrong Answer

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


print(K)

Submission status: Wrong Answer

Solution code:
m = int(input())
     
def fizz_buzz(i):
  fizz = i % 3
  buzz = i % 5
      
  return (fizz > 0) & (buzz > 1)
     
res = 0
     
for i in range(m):
  use_i = i+1
  if fizz_buzz(use_i):
    res += use_i
        
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)


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


main()

Submission status: Wrong Answer

Solution code:
N = int(input())
sum = 0
for i in range (N):
    if i%5 ==0 or i%3 ==0:
        continue
    else:
        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:
    sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
i = int(input())

total = 0

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
sum = n*(n-1)/2
for i in range(n):
    if i%3 == 0 or i%5 == 0:
        sum-=i
print(int(sum))

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:

import sys
sys.setrecursionlimit(10**6)
N = int(input())

fizzbuzz = []

for i in range(1, N):
    if i % 15 == 0:
        fizzbuzz.append('0')
    elif i % 3 == 0:
        fizzbuzz.append('0')
    elif i % 5 == 0:
        fizzbuzz.append('0')
    else:
        fizzbuzz.append(str(i))

num = [int(s) for s in fizzbuzz]
print(int(sum(num)))

Submission status: Wrong Answer

Solution code:
n = int(input())

total = 0
for num in range(0,n):

    if num % 15 == 0:
        continue
    if num % 3 == 0:
        continue
    if num % 5 == 0:
        continue

    total += num

print(total)

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 = ans + i
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

Not_Fizzbuzz = []

for i in range(N):
    if i % 3 == 0 and i % 5 == 0:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    else:
        Not_Fizzbuzz.append(i)


print(sum(Not_Fizzbuzz))

Submission status: Wrong Answer

Solution code:
a = int(input())

b = 0

for i in range(0,a):
    if i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else:
        b += i

print(b)

Submission status: Wrong Answer

Solution code:
N = int(input())  #スペース抜きの複数行,１文字ずつ

A = []
for i in range(1,N):
#    print(i)
    if i % 3 != 0 and i % 5 != 0:
        #print(i)
        A.append(i)
        #print(A)

print(sum(A))

Submission status: Wrong Answer

Solution code:
import sys
import numpy as np


def solve(N: int):
    FB = list(range(N))
    FB = np.array(FB)

    FB = FB[(FB % 3 != 0) & (FB % 5 != 0) ]

    FB = FB.tolist()

    S = sum(FB)

    print(S)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A=int(input())
Sum= A*(A+1)/2
B=(A//3)
C=(A//5)
D=(A//15)

E=B*(6+(B-1)*3)/2
F=C*(10+(C-1)*5)/2
G=D*(30+(D-1)*15)/2

print(Sum-E-F+G)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
  
set3 = set(range(0, a+1, 3))
set5 = set(range(0, a+1, 5))
seta = set(range(0, a+1))

print(set3, set5)

print(sum(seta-set3-set5))

Submission status: Wrong Answer

Solution code:
N = int(input())
 
ans = 0
 
for i in range(N):
  if i % 3 != 0:
    if 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 and i != 5:
        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:
        _sum += i
 
print(_sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = 31
N_list = [1,3,3,7,7,7,14,22,22,22,33,33,46,60,60]
N_add15 = [1,2,2,3,3,3,4,5,5,5,6,6,7,8,8]


num_15 = N // 15

n_list = N_list[N%15-1] + 15 * N_add15[N%15-1] * (num_15)

if(N < 16):
    ans = N_list[N-1]
else:
    ans = num_15 * num_15 * 60 + n_list

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

for i in range(N):
    if (i % 15 == 0) or (i % 3 == 0) or (i % 5 == 0):
        continue
    else:
        ans += i


print(ans)

Submission status: Wrong Answer

Solution code:
import math

x=int(input())
s=math.floor(x/3)
f=math.floor(x/5)
sf=math.floor(x/15)

s_sum=3*s*(s+1)/2
f_sum=5*f*(f+1)/2
sf_sum=15*sf*(sf+1)/2

sum=s_sum+f_sum-sf_sum
print(sum)

Submission status: Wrong Answer

Solution code:
num = int(input())

count = 0

temp = num // 15
if 0 < temp:
    count += (2 * temp - 1) * 60
dev = num % 15
for x in range(1,dev + 1):
    if x % 3 != 0 and x % 5 != 0:
        count += x + temp*15
print(count)

Submission status: Wrong Answer

Solution code:
def fizz_buzz(n):
    total = 0
    for i in range(n):
        if i % 15 == 0:
            continue
        elif i % 3 == 0:
            continue
        elif i % 5 == 0:
            continue
        else:
            total += i
    return total


if __name__ == "__main__":
    n = int(input())
    print(fizz_buzz(n))

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
for i in range(N):
    if i%3 == 0 and i%5 ==0:
        pass
    elif i%3 == 0:
        pass
    elif i%5 == 0:
        pass
    else:
        ans = ans + i

print(ans)

Submission status: Wrong Answer

Solution code:
a = (int(input()) + 1)
ans = 0

for i in range(1, a):
    if i % 15 == 0:
        ans += i
    elif i % 3 == 0:
        ans += i
    elif 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%15==0:
        continue
    elif i % 5==0 or i%3==0:
        continue
    else:
        sum+=i
print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def SuminCluster(num,C):
    if num>=15:
        return 60
    sum = 0
    for i in range(num):
        if i%3==0 or i%5==0:
            pass
        else:
            sum+=i
            sum+=C*15
    return sum

N = int(input())
C = N//15
A = N%15
FBSum = C*C*60+SuminCluster(A,C)
# for i in range(15):
#     print("FBSum: ",SuminCluster(i,C))
print(FBSum)

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())
ans = 0
for num in range(N):
    if (num % 3 != 0) and (num % 5 != 0):
        ans = ans + num
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

cnt = 0

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

print(cnt)

Submission status: Wrong Answer

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

print(array)
value=sum(array)
print(value)

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 += i
print(s)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

N = int(input())

a = N*(N+1)//2
b = 9*(N//3)*(N//3+1)//2
c = 25*(N//5)*(N//5+1)//2
d = 225*(N//15)*(N//15+1)//2

print(a-b-c+d)

Submission status: Wrong Answer

Solution code:
def is_fb(i):
    if i % 3 == 0:
        return True
    if i % 5 == 0:
        return True
    return False

N = int(input())

print(sum([a for a in range(1, N - 1) if not is_fb(a)]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
c = []
for i in range(1,3*n):
    if i%3 != 0 and i%5 != 0:
        c.append(i)
sum(c)

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())
add=0
for i in range(1,n):
    if i%3!=0 and i%5!=0:
        add+=i
print(add)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
a = int(input())

b = 0

for i in range(0,a):
    print(i)
    if i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else:
        b += i

print(b)

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())

sumsum = 0
for i in range(N):
    
    val = i+1
    if val % 3 == 0 & val % 5 == 0:
        
        print('FizzBuzz')
    
    elif val % 3 == 0:
        
        print('Fizz')
    
    elif val % 5 == 0:
        
        print('Buzz')
        
    else:
        
        sumsum += val
        
print(sumsum)

Submission status: Wrong Answer

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

for i in range(N):
    if not i%3==0:
        if not i%5==0:
            sum += i

print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
import numpy as np
 
N = INT()
A = np.arange(N)
A = list(A)
 
for i in range(N):
  if A[i]%3 == 0 or A[i]%5 == 0:
    A[i]=0
    
print(sum(A))

Submission status: Wrong Answer

Solution code:
N,=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
for i in range(1,N+1):
    if (i % 15==0):
        print("FizzBizz")
    elif(i % 5==0):
        print("Fizz")
    elif(i % 3==0):
        print("Bizz")
    else:
        print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(cnt)

Submission status: Wrong Answer

Solution code:
def solve():

    N = int(input())

    ans = 0
    for i in range(N):
        if i % 15 == 0:
            pass
        elif i % 3 == 0:
            pass
        elif i % 5 == 0:
            pass
        else:
            ans += i

    print(ans)


if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = n*(n+1)//2
d = n//3
ans -= 3*(d+1)*d//2
e = n//5
ans -= 5*(e+1)*e//2
f = n//15
ans -= 15*(f+1)*f//2
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

s = (n//15)*60 + (n//15)*(n//15 - 1)*60

for i in range(n-(n%15), n):
    if i % 5 != 0 and i % 3 != 0:
        print(i)
        s += i

print(s)

Submission status: Wrong Answer

Solution code:
a = int(input())
sum = 0
list_number = []
for i in range(a):
    list_number.append(i)
for i in list_number:
    if i % 3 == 0 and i % 5 == 0:
        list_number.remove(i)
for i in list_number:
    if i % 3 == 0:
        list_number.remove(i)
for i in list_number:
    if i % 5 == 0:
        list_number.remove(i)
for i in list_number:
    sum = sum + i
print(list_number)
print(sum)

Submission status: Wrong Answer

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

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:
def extract(seq):
    arr = []
    for i in seq:
        if i % 3 == 0 or i % 5 == 0:
            continue
        else:
            arr.append(i)
    return sum(arr)


n = int(input())
print(extract(range(n)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import sys
import collections
N=int(input())
K=N*(N+1)/2-3*(N//3)*((N//3)+1)/2-5*(N//5)*((N//5)+1)/2+15*(N//15)*((N//15)+1)/2
print(K)

Submission status: Wrong Answer

Solution code:
def sum(x):
    a=int(x//3)
    b=int(x//5)
    c=int(x//15)
    sall=int((1+x)*(x/2))
    print(sall)
    s3=int((3*(a-1)+6)*(a/2))
    print(s3)
    s5=int((5*(b-1)+10)*(b/2))
    print(s5)
    s15=int((15*(c-1)+30)*(c/2))
    print(s15)
    ans=int(s15-s3-s5+sall)
    print(ans)
n=int(input())
sum(n)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())

    def fizzbuzz(i):
        if i % 3 == 0 and i % 5 == 0:
            return 'FizzBuzz'
        elif i % 3 == 0:
            return 'Fizz'
        elif i % 5 == 0:
            return 'Buzz'
        else:
            return i
    def is_int(v):
        return isinstance(v, int)
    ans = 0
    for k in range(N):
        if is_int(fizzbuzz(k)):
            ans += fizzbuzz(k)
    print(ans)
    return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
seq = []
for i in range(n):
    if not (i % 3 == 0 or i % 5 == 0):
        seq.append(i)


print(sum(seq))

Submission status: Wrong Answer

Solution code:
fizz = []
buzz = []
fizzbuzz = []
other = []
n = int(input())
for i in range(n):
    if (i % 3 != 0) & (i % 5 != 0):
        other.append(i)

b = 0
for i in range(len(other)):
    b += other[i]

print(b)

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:
num=int(input())
if num%15==0:
  num=num/15
  print(int(num*(num+1)*15/2))
elif num%15==2:
  num=(num-2)/15
  print(int(num*(num+1)*15/2)+num*30+2)
elif num%15==4:
  num=(num-4)/15
  print(int(num*(num+1)*15/2)+num*120+7)
elif num%15==1:
  num=(num-1)/15
  print(int(num*(num+1)*15/2)+num*15+1)
elif num%15==7:
  num=(num-7)/15
  print(int(num*(num+1)*15/2)+num*210+14)
elif num%15==8:
  num=(num-8)/15
  print(int(num*(num+1)*15/2)+num*240+22)
elif num%15==11:
  num=(num-11)/15
  print(int(num*(num+1)*15/2)+num*330+33)
elif num%15==13:
  num=(num-13)/15
  print(int(num*(num+1)*15/2)+num*390+46)
elif num%15==14:
  num=(num-14)/15
  print(int(num*(num+1)*15/2)+num*420+60)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def getParity( n ): 
    parity = 0
    while n: 
        parity = ~parity 
        n = n & (n - 1) 
    return parity 
  
  
n = int(input())
ans = 0
for i in range(n):
  if (getParity(i) == -1):
      ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

s = 0

for i in range(1, n):
    if (i % 3 != 0 and i % 5 != 0):
        s += i
    else:
        continue
    
print(s)

Submission status: Wrong Answer

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

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:
user = int(input())
container = []
for i in range(1, user+1):
    if (i % 3) == 0 or (i % 5) == 0:
        continue
    container.append(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

cnt = 0

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

print(n * (n - 1) // 2 - cnt)

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())
c=0
for i in (0,n):
  if i%3==0 and i%5==0:
    c+=i
print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = []

for i in range(N):
    N_3 = i % 3
    N_5 = i % 5
    if N_3 != 0 and N_5 != 0:
        ans.append(i)

print(sum(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())

print(sum([x for x in range(1, N) if x % 3 and x % 5]))

Submission status: Wrong Answer

Solution code:
n = int(input())
fizz = 0
buzz = 0
fizzbuzz = 0
num_sum = 0
for num in range(n):
    if(num%3 == 0):
        fizz += num
    if(num%5 == 0):
        buzz += num
    if(num%3 == 0 and num%5==0):
        fizzbuzz += num
    num_sum += num
ans = num_sum - fizz - buzz + fizzbuzz
print(ans)

Submission status: Wrong Answer

Solution code:

n=int(input())

res=0

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

Submission status: Wrong Answer

Solution code:
#B
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())
l = []
a = 0
for i in range(n):
    if i%3 == 0 or i%5 == 0 or i%15 == 0:
        a+=1
    else:
        l.append(i)
print(sum(l))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

n = int(input())

total = 0

for i in range(0, n):

    if i % 3 != 0 and i % 5 :
        total = total + i

print(total)

Submission status: Wrong Answer

Solution code:
from sys import stdin

# 1行だけ読むやつ

N = int(stdin.readline().rstrip().split()[0])
Sum = 0

for i in range(1, N+1):
    if i % 3 == 0 or i % 5 == 0 or i % 15 == 0:
        continue
    else:
        Sum += i
        print(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):
        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:
        sum += i

print(sum)

Submission status: Wrong Answer

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

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=1000000
n=N//15
ans=60*(n**2)
if N%15==1:
	ans+=(1+15*(n))
elif N%15==2 or N%15==3:
	ans+=(3+30*(n))
elif N%15==4 or N%15==5 or N%15==6:
	ans+=(7+45*(n))
elif N%15==7:
	ans+=(14+60*(n))
elif N%15==8 or N%15==9 or N%15==10:
	ans+=(22+75*(n))
elif N%15==11 or N%15==12:
	ans+=(33+90*(n))
elif N%15==13:
	ans+=(46+105*(n))
elif N%15==14:
	ans+=(60+120*(n))
print(ans)