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())
list = []
list1 = []
for i in range(1, n):
    if i%5==0 and i%3==0:
        list.append('FizzBuzz')
    elif i%3==0:
        list.append('Fizz')
    elif i%5==0:
        list.append('Buzz')
    else:
        list.append(i)
for j in list:
    if isinstance(j, int):
        list1.append(j)

print(sum(list1))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
q = int(input())

sum = 0
for num in range(1, q):
    if num % 3 == 0:
        pass
    elif num % 5 == 0:
        pass
    else:
        sum += num

print(sum)

Submission status: Wrong Answer

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

print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

print(total)

Submission status: Wrong Answer

Solution code:
n = int(input())

sums = 0

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

print(sums)

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:
s=int(input())
count=int(1)
sum=int(0)
while(count!=s):
    if count%3!=0 and count%5!=0:
        sum+=int(count)
    count+=1
print(int(sum))

Submission status: Wrong Answer

Solution code:

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

b = sum(other)

print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())
lsum = []
for i in range(1, n+1):
    if i % 3 or i % 5 == 0:
        pass
    else:
        lsum.append(i)
print(sum(lsum))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    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)
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np
#N=map(int, input().split())
N=int(input())
count=0
for i in range(0,N):
    if i%3!=0 and i%5!=0:
        count=int(count+i)
print(count)

Submission status: Wrong Answer

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

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:
import math
import sys
def getN():
    return int(input())

def getIntList():
    return list(map(int, input().split()))

def main():
    
    N = getN()

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

    return

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
a=n//3
ans=(a+1)*a//2*3
b=n//5
ans+=(b+1)*b//2*5
c=n//15
ans-=(c+1)*c//2*15
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(math.floor(sum))

Submission status: Wrong Answer

Solution code:
N = int(input())

sm = 0

for a in range(N):
    if a%5 == 0 and a%3 == 0:
        continue
    elif a%5 == 0:
        continue
    elif a%3 == 0:
        continue
    else:
        sm += a

print(sm)

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+1):
  if (getParity(i)):
      ans += i
print(ans)

Submission status: Wrong Answer

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

        List += [i]
    else:
        continue
print(sum(List))

Submission status: Wrong Answer

Solution code:
ans=0
N=int(input())
if N<=0:
    exit()
elif N>=1000001:
    exit()
else:

    for n in range(1,N):
        if n%15==0:
            n=str("FizzBuzz")
        elif n%3==0:
            n=str("Fizz")
        elif n%5==0:
            n=str("Buzz")
        else:
            ans=ans+n

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

Submission status: Wrong Answer

Solution code:


N = int(input())

fizzbuzz = []

for i in range(1, N):
    if i % 3 == 0 or 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())
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_all=N*(N-1)//2
sum_Fizz=3*(N//3)*(N//3-1)//2
sum_Buzz=5*(N//5)*(N//5-1)//2
sum_FizzBuzz=15*(N//15)*(N//15-1)//2
print(sum_all-sum_Fizz-sum_Buzz+sum_FizzBuzz)

Submission status: Wrong Answer

Solution code:
inputno = input()

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

Submission status: Wrong Answer

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

for i in range(N):
    S.append(i)

for i in range(N):
    if S[i] % 3 > 0 and S[i] % 5 > 0:
        ans += S[i]

print(ans)

Submission status: Wrong Answer

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

print(sum)

Submission status: Wrong Answer

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

print(int(n))

Submission status: Wrong Answer

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

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

print(result)

Submission status: Wrong Answer

Solution code:
import numpy as np
 
N = int(input())
array = np.arange(1, N+1)
fizz_buzz = np.array([i for i in array if i%3 == 0 or i%5 == 0])
 
print(np.sum(array) - np.sum(fizz_buzz))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

print(fb)

Submission status: Wrong Answer

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

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


print(round(s_sum+f_sum-sf_sum))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**7)
N=int(input())
n=list()
m=list()
for i in range(N):
    if(i%3==0 or i%5==0):
        n.append(i)
    else:
        m.append(i)
print(sum(m))

Submission status: Wrong Answer

Solution code:
n=int(input())
o=list(i for i in range(1,n+1))
sum=0
l=[]
for j in o:
    if j % 5 == 0 or j % 3 == 0:
        o.remove(j)
for k in o:
    sum+=k
print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
ns = set()
for i in range(N):
    if not(i%3==0 or i%5==0):
        ns.add(i)
print(sum(ns))

Submission status: Wrong Answer

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

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

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%3==0 and i%5==0):
        continue
    res += i
print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())
o=list(i for i in range(1,n+1))
sum=0
l=[]
for j in o:
    if j % 5 == 0 or j % 3 == 0:
        o.remove(j)
for k in o:
    sum+=k
print(sum)
print(o)

Submission status: Wrong Answer

Solution code:
#B

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

Submission status: Wrong Answer

Solution code:
import sys; sys.setrecursionlimit(2147483647); input = sys.stdin.readline
from math import floor, ceil, sqrt, factorial, log
from collections import Counter, defaultdict, deque
from operator import itemgetter
INF = float('inf'); MOD = 10**9+7
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(MI())
def LIR(n): return [LI() for i in range(n)]
def IS(): return input().rstrip()

def main():
    N = I()
    l = []
    for i in range(N):
        if i % 3 == 0: pass
        elif i % 5 == 0: pass
        else: l.append(i)
    print(sum(l))
    
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
 
org_sum = 1/2 * N * (N+1)
div3 = N // 3
sum3 = 3/2 * div3 * (div3+1)
div5 = N // 5
sum5 = 5/2 * div5 * (div5+1)
div15 = N // 15
sum15 = 15/2 * div15 * (div15+1)
 
print(org_sum - sum3 - sum5 + sum15)

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:
            b += i

print(b)

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+1):
  if (getParity(i) == -1):
      ans += i
print(ans)

Submission status: Wrong Answer

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

for i in range(1, N+1):
    if i % 3 == 0 or i % 5 == 0:
        pass
    else:
        list_a.append(int(i))

print(list_a)
print(sum(list_a))

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 = 15

a = n//15
b = n//3
c = n//5
d,e,f,g = 0,0,0,0

for i in range(n+1):
    d = d+i
for j in range(a+1):
    e = e+j
for k in range(b+1):
    f = f+k
for l in range(c+1):
    g = g+l

h = d-(f*3)-(g*5)+(e*15)
print(int(h))

Submission status: Wrong Answer

Solution code:
s=int(input())
sum=0
for i in range(1, s):
    if 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:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

N = int(read())
x = np.arange(1, N + 1, dtype=np.int64)
x[::3] = 0
x[::5] = 0
print(x.sum())

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000)
n = int(input())
a = 0
for i in range(n):
    if (i % 3 !=0) and (i % 5 !=0):
        a += i
    else:
        continue
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def fizz_buzz(n):
    total = 0
    for i in range(1,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())
a = []
for i in range(1,N):
  if i%3==0 or i%5==0:
    pass
  else:
    a.append(i)
print(sum(a))

Submission status: Wrong Answer

Solution code:
N = input()
N = int(N)
fizbuz = []
for i in range(1,N):
    if i % 3 == 0 and i % 5 == 0:
        # fizbuz[i] = 'FizzBuzz'
        fizbuz.append(0)
    elif i % 3 == 0:
        # fizbuz[i] = 'Fizz'
        fizbuz.append(0)
    elif i % 5 == 0:
        # fizbuz[i] = 'Buzz'
        fizbuz.append(0)
    else:
        fizbuz.append(i)
result = 0
for i in fizbuz:
    result += i
print(result)

Submission status: Wrong Answer

Solution code:
N = int(input())
s = 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:
        s += i
print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

T = 0
if N == 1:
	print(1)
elif N == 2:
	print(3)
else:
	for i in range(N):
		if i % 3 != 0 and i % 5 != 0:
			T += i
		print(T)

Submission status: Wrong Answer

Solution code:
def check(q):
    if q % 15 == 0:
        return 0
    elif q %5 == 0:
        return 0
    elif q % 3 == 0:
        return 0
    else:
        return q

a = int(input())
b = 0

if a <= 10000000 and a >= 1:

    for i in range(a):
        b += check(i)
 
print(b)

Submission status: Wrong Answer

Solution code:
a = list(map(int, input().split()))
b = 0
for i in range(a[0]):
    if i % 15 == 0:
        b = b
    elif i % 3 == 0:
        b = b
    elif i % 5 == 0:
        b = b
    else:
        b += i
print(b)

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:
input=int(input())

output=0
a=0
for i in range(input):
    if i%3==0 & i%5==0:
        a=a
    elif i%3==0:
        a=a
    elif i%5==0:
        a=a
    else:
        output=output+i
print(output)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(input())

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

print(sum - 266666333332)

Submission status: Wrong Answer

Solution code:
N = int(input())

print(
    sum(
        filter(
            lambda x: bool(x % 3) and bool(x % 5),
            range(1, N)
        )
    )
)

Submission status: Wrong Answer

Solution code:
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

N = I()
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 fizzbuzz_sum(n):
    result = 0
    for num in range(n):
        rn = num+1
        if rn % 3 == 0 or rn % 5 == 0:
            result += rn
    return result

n = int(input())
print(fizzbuzz_sum(n))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
n = int(sys.stdin.readline())
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())
sum = 0
for x in range(n):
  if x%3 == 0 or x%5 ==0:
    pass
  else:
    sum = sum + x
print(sum)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    ary = [i for i in range(n) if not((i % 3 == 0) or (i % 5 == 0))]
    print(sum(ary))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
inputNumber = int(input())
storage = []
fizzBuzz = []
for i in range(inputNumber +1):
    storage.append(i)
    if i % 3 == 0 or i % 5 == 0:
        fizzBuzz.append(i)
print(sum(fizzBuzz))

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
# 入力全てを整数に変換したものの配列を受け取る
def LI(): return list(map(int, sys.stdin.readline().split()))
# 入力全てを整数に変換して1引いたものの配列を受け取る
def LLI(rows_number): return [LI() for _ in range(rows_number)]

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:
from collections import deque

N = int(input())

q = deque()

for a in range(N):
    if a%5 == 0 and a%3 == 0:
        continue
    elif a%5 == 0:
        continue
    elif a%3 == 0:
        continue
    else:
        q.append(a)

sm = sum(q)
print(sm)

Submission status: Wrong Answer

Solution code:
ans=0
N=int(input())
for n in range(1,N):
    if n%15==0:
        n=str("FizzBuzz")
    elif n%3==0:
        n=str("Fizz")
    elif n%5==0:
        n=str("Buzz")
    else:
        ans=ans+n

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list()

for i in range(1,N+1):
    print(i)
    if i % 3 == 0:
        continue
    if i % 5 == 0:
        continue
    else:
        a.append(i)
# print(a)
print(sum(a))

Submission status: Wrong Answer

Solution code:
N = int(input())

k15 = N // 15
m = N - (15 * k15)

k3 = m // 3
k5 = m // 5

def sigma(n):
  ans = n * (n + 1) / 2
  return ans

sum = 3 * sigma((5 * k15) + k3) + 5 * sigma((3 * k15) + k5) - 15 * sigma(k15)

print(int(sum))

Submission status: Wrong Answer

Solution code:
n = int(input())
lst = list(range(n))

ans = 0
for i in range(len(lst)):
    if lst[i] % 3 != 0 and lst[i] % 5 != 0:
        ans += lst[i]

print(ans)

Submission status: Wrong Answer

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

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

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:
        sum+=i

 
print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
a=n*(n+1)/2
b=n//3
c=n//5
d=n//15
print(a-b-c+d)

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:
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(round(sum))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(0, N):
    if i % 3 == 0 or i % 5 == 0:
        pass
    else:
        list_a.append(int(i))

print(sum(list_a))

Submission status: Wrong Answer

Solution code:
n = input()

ans = 0
for i in range(0, int(n)):
    r3 = i % 3
    r5 = i % 5

    if not (((r3 == 0) and (r5 == 0)) or (r3 == 0) or (r5 == 0)):
        ans += i

print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
s=int(input())
count=1
sum=0
while(count!=s):
    if count%3!=0 and count%5!=0:
        sum+=count
    count+=1
print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())

FB = []
for i in range(N):
    if i % 3 == 0 or i % 5 == 0:
        FB.append(0)
    else:
        FB.append(i)
    i = i + 1

S = sum(FB)
print(S)

Submission status: Wrong Answer

Solution code:
N  = int(input())
num3 = N//3
sum3 = 3*num3*(num3+1)//2
num5 = N//5
sum5 = 5*num5*(num5+1)//2
num15 = N//15
sum15 = 15*num15*(num15+1)//215

_sum = N*(N+1)//2

print(_sum-sum3-sum5+sum15)

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(1,N)]
print(sum(n_list))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)

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())
last_fizz = (N // 3) * 3
last_buzz = (N // 5) * 5
last_fibu = (N // 15) * 15

N_sum = N * (N + 1) / 2
if N >= 3:
  fizz_sum = (N // 3) * (3 + last_fizz) / 2
  N_sum -= fizz_sum
if N >= 5:
  buzz_sum = (N // 5) * (5 + last_buzz) / 2
  N_sum -= buzz_sum
if N >= 15:
  fibu_sum = (N // 15) * (15 + last_fibu) / 2
  N_sum += fibu_sum
print(N_sum)

Submission status: Wrong Answer

Solution code:
s=int(input())
list=[]
h=0
for i in range(1,s):
    if i%3!=0 and i%5!=0:
        list.append(i)
for j in list:
    h=h+j
print(h)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list()

for i in range(1,N):
    if i % 3 == 0:
        continue
    if i % 5 == 0:
        continue
    else:
        a.append(i)
# print(a)
print(sum(a))

Submission status: Wrong Answer

Solution code:
N = int(input())
 
L = []
for i in range(1, N+1):
    if i % 15 == 0:
        L.append(i)
    elif i % 3 == 0:
        L.append(i)
    elif i % 5 == 0:
        L.append(i)
 
print(sum(L))

Submission status: Wrong Answer

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

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

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0

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

Submission status: Wrong Answer

Solution code:
n = int(input())
count = 0
tenwari = n%10
baiwari = n%100
ichi = tenwari
jyu = (baiwari-tenwari)//10
hyaku = (n-jyu*10-ichi)//100

if ichi != 7:
  count = count + 1
if jyu != 7:
  count = count + 1
if hyaku != 7:
  count = count + 1
  
if count == 3:
  print('No')
else:
  print('Yes')

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10**6)
N=int(input())
n=list()
m=list()
for i in range(N):
    if(i%3==0 or i%5==0):
        n.append(i)
    else:
        m.append(i)
print(sum(m))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

total = (n+1)*int(n/2) + n%2 * (n+1)/2
bai3 = 3 * (n/3 /2 * (n/3 + 1))
bai5 = 5 * (n/5 /2 * (n/5 + 1))
bai15 = 15 * (n/15 /2 * (n/15 + 1))

# n/2(n+1)
print(int(total - bai3 - bai5 + bai15))

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:
    continue
  else: 
    sum += i

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
n = int(sys.stdin.readline())
t = 0
for i in range(n):
  if i%3 != 0 or i%5 != 0:
    t += i
print(t)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 0
for x in range(1,N+1):
    if(x % 3 == 0):
        ans += 0
    elif(x % 5 ==0):
        ans += 0
    else:
        ans += x
        print(x)

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
n=list()
m=list()
for i in range(N):
    if(i%3==0 or i%5==0):
        n.append(i)
    else:
        m.append(i)
print(sum(m))

Submission status: Wrong Answer

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

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 = int(input())
a = list()

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

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
    elif i%3 !=0:
        sum+=i
    elif  i%5 !=0:
        sum+=i
 
print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())

lst_3 = list(range(n))
lst_5 = list(range(n))
lst_15 = list(range(n))
del lst_3[3::3]
del lst_5[5::5]
del lst_15[15::15]

lst = list(set(lst_3) & set(lst_5) & set(lst_15))

s = 0
for i in range(len(lst)):
    if lst[i] % 3 != 0 and lst[i] % 5 != 0:
        s += lst[i]

print(s)

Submission status: Wrong Answer

Solution code:
N = int(input())
 
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:
    FizzBuzz.append(i)

print(sum(FizzBuzz))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
i = int(input())
t1=0.5*i*(i+1)

i3=int(i/3)
t3=0.5*i3*(i3+1)*3

i5=int(i/5)
t5=0.5*i5*(i5+1)*5

i15=int(i/15)
t15=0.5*i15*(i15+1)*15

ans=int(t1-t3-t5+15)
print(ans)

Submission status: Wrong Answer

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

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = 0
x = int(n / 15)
for i in range(x):
    ans += 15 + i * 8 * 15

amari = n % 15

plus = int(n / 15) * 15

if amari == 1:
    ans += plus + 1
elif amari == 2 or amari == 3:
    ans += plus + plus + 3
elif amari == 4 or amari == 5 or amari == 6:
    ans += plus + plus + plus + 7
elif amari == 7:
    ans += plus + plus + plus + plus + 14
elif amari == 8 or amari == 9 or amari == 10:
    ans += plus + plus + plus + plus + plus + 22
elif amari == 11 or amari == 12:
    ans += plus + plus + plus + plus + plus + plus + 33
elif amari == 13:
    ans += plus + plus + plus + plus + plus + plus + plus + 46
elif amari == 14:
    ans += plus + plus + plus + plus + plus + plus + plus + plus + 60

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
b = [i+1 for i in range(N)]
a = np.array(b)

c =[]

for i in range(N):
    if a[i] % 3 == 0:
        c.append(a[i])
    if a[i] % 5 == 0:
        c.append(a[i])
    if a[i] % 15 == 0:
        c.append(-a[i])

sum(c)

Submission status: Wrong Answer

Solution code:
import numpy as np

if __name__ == "__main__":
    N = int(input())
    num_ls = np.arange(0,N)
    n = num_ls[(num_ls % 5 != 0) & (num_ls % 3 != 0) & (num_ls % 15 != 0)].astype(np.float64)
    ret = 0
    ret = sum(n)
    print(int(ret))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
 
L = []
for i in range(1, N+1):
    if i % 15==0:
        L.append(i)
    if i%3==0:
        L.append(i)
    elif i%5==0:
        L.append(i)
 
print(sum(L))