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:
#!/usr/bin/env python
import sys
from collections import Counter
from itertools import permutations, combinations
from fractions import gcd
from math import ceil, floor
sys.setrecursionlimit(10 ** 6)

def input():
    return sys.stdin.readline()[:-1]

def main():
     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__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
kazuof3 = N // 3
kazuof5 = N // 5
kazuof15 = N//15

ans = N * (N + 1) / 2 - kazuof3 * (kazuof3 + 1) * 3 / 2 - kazuof5 * (kazuof5 + 1) * 5 / 2 + kazuof15 * (kazuof15 + 1) * 15 / 2
print(ans)

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

total = 0
three = 3 
five = 5
for i in range(1, n + 1):
    if i == three:
        three += 3 
        continue 
    if i == five:
        five += 5
        continue 
    total += i 

print(total)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

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

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())
i = 0
result = 0
while i < N:
    if i % 3 != 0 and i % 5 != 0:
        result += i
    i += 1
print(result)

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
#B
N = int(input())
sn = 0
for x in range(1,N):
    if x % 3 !=0 and x %5 != 0:
        sn +=x
print(sn)

Submission status: Wrong Answer

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

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

print(sum)

Submission status: Wrong Answer

Solution code:
print(len([i for i in range(1, int(input())+1) if i%3 and i%5]))

Submission status: Wrong Answer

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

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())
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())
l=[]
for i in range(n):
    if i%3 != 0 and i%5 !=0:
        l.append(i)

print(sum(l))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

n = int(input())

ans = []
for i in range(n):
    if i % 3 == 0 and 1 % 5 == 0:
        fizzbuzz = 0
    elif i % 3 == 0:
        fizzbuzz = 0
    elif i % 5 == 0:
        fizzbuzz = 0
    else:
        ans.append(i)

print(sum(ans))

Submission status: Wrong Answer

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

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 += 1
    
print(cnt)

Submission status: Wrong Answer

Solution code:
N = int(input())

def check(N):
    if N%3==0:
        return False
    if N%5==0:
        return False
    return True

ans = 0
for i in range(N):
    if check(i):
        ans += i
        
print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

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

    print(sum)

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

    def fiz(k):
        l = k // 60 * 15
        m = k % 60
        ary = [1,2,0,4,0,0,7,8,0,0,11,0,13,14,0][:m]
        return l + sum(ary)

    print(fiz(n))

if __name__ == '__main__':
    main()

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

# 標準入力 <int>
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 % 15 == 0:
        continue
    elif i % 3 == 0:
        continue
    elif i % 5 == 0:
        continue
    else:
        sum += i
print(sum)

Submission status: Wrong Answer

Solution code:
s=[0,1,3,3,7,7,7,14,22,22,22,33,33,46,60]
n=int(input())
print(60*(n//15)+s[n%15])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

fizzbuzzlist = range(N)
fizzbuzzlist = [i for i in fizzbuzzlist if i % 3 != 0]
fizzbuzzlist = [i for i in fizzbuzzlist if i % 5 != 0]

print(str(sum(fizzbuzzlist)))

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

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

ans = []
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:
        ans.append(i)
print(sum(ans))

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys


def in_ctrl():
    _input = [_.rstrip() for _ in sys.stdin.readlines()]
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    N = int(_input[0])
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    return N


def out_ctrl(s):
    print(s)


if __name__ == "__main__":
    N = in_ctrl()
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = 0
    for n in range(N+1):
        if n%3+n%5 != 0:
            cnt += n
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    out_ctrl(n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
sum_ = 0
while n:
  if i % 15 == 0:
    n -= 1
  elif i % 3 != 0 and i % 5 != 0:
    sum_ += i
  i += 1
print(sum_)

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline  # 改行コード「\n」を呼んでしまうため、文字数など、注意！！

n = int(input().replace("\n",""))

anslist = []

for i in range(1, n):
    if (i % 3 == 0) and (i % 5 == 0):
        continue
        # print('FizzBuzz', end=' ')
    elif i % 3 == 0:
        continue
        # print('Fizz', end=' ')
    elif i % 5 == 0:
        continue
        # print('Buzz', end=' ')
    else:
        anslist.append(i)
        # print(i, end=' ')

print(sum(anslist))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

i = 0
ans = 0
while i < N:
    if i % 3 == 0 or i % 5 == 0:
        ans += 0

    else:
        ans += i

    i += 1

print(ans)

Submission status: Wrong Answer

Solution code:
s = input()
n=int(s)
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())
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:
li=[]
n=int(input())
for i in range(n):
  if i%3!=0 and i%5!=0:
    li.append(i)
print(sum(li))

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

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

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:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    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 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%3==0:
        continue
    if i%5==0:
        continue
    ans+=i
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    result = 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:
            result += i
    print(result)


if __name__ == "__main__":
    main()

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())
a=[]
for i in range(n):
    if i%3!=0 and i%5!=0:
        a.append(i)
print(sum(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 = int(input())
a=0
for i in range(N):
    if i%3==0:
        continue
    if i%5==0:
        continue
    a+=i
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    n = int(input())
    if "7" in str(n):
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = int(input())

sum_all = s*(s+1)/2
num_fizz = s//3
sum_fizz = 3*num_fizz*(num_fizz+1)/2
num_buzz = s//5
sum_buzz = 5*num_buzz*(num_buzz+1)/2
num_fb = s//15
sum_fb = 15*num_fb*(num_fb+1)/2

print(sum_all - sum_fizz - sum_buzz + sum_fb)

Submission status: Wrong Answer

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

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

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

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin
import math
import fractions

n = int(stdin.readline().rstrip())

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

print(cnt)

Submission status: Wrong Answer

Solution code:
import sys, re
import math
 
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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

# 整数リストを連結表示    print(''.join(map(str, list)))

# -*- coding: utf-8 -*-

n = INT()
sum = 0

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

print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/python3
N = int(input())
wa = 0
for i in range(N):
    if i % 3 != 0 and i % 5 != 0:
        wa += i
print(wa)

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

Submission status: Wrong Answer

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

n = int(input())

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

print(ans)

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

Submission status: Wrong Answer

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


main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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(n):
    if i % 3 != 0 and i % 5 != 0:
        a = a + i
print(a)

Submission status: Wrong Answer

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

print(answer)

Submission status: Wrong Answer

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

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

ans = 0
for i in range(1,n):
    if i % 3 == 0 or i % 5 == 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) 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 % 3 == 0 or i % 5 == 0:
        continue
    ans += i

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

s = [i for i in range(1,n+1)]
print(sum(s))

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 0
for n in range(1,N+1):
  if n%3==0 and n%5==0:
    pass
  else:
    ans += n
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import re
import math
import itertools
from copy import deepcopy
import random
from heapq import heappop,heappush
import time
import os
import queue
import sys
import datetime
from functools import lru_cache
readline=sys.stdin.readline
sys.setrecursionlimit(2000)
#import numpy as np
alphabet="abcdefghijklmnopqrstuvwxyz"
mod=int(10**9+7)
inf=int(10**20)
def yn(b):
    if b:
        print("yes")
    else:
        print("no")
def Yn(b):
    if b:
        print("Yes")
    else:
        print("No")
def YN(b):
    if b:
        print("YES")
    else:
        print("NO")
class union_find():
    def __init__(self,n):
        self.n=n
        self.P=[a for a in range(N)]
        self.rank=[0]*n
 
    def find(self,x):
        if(x!=self.P[x]):self.P[x]=self.find(self.P[x])
        return self.P[x]
 
    def same(self,x,y):
        return self.find(x)==self.find(y)
 
    def link(self,x,y):
        if self.rank[x]<self.rank[y]:
            self.P[x]=y
        elif self.rank[y]<self.rank[x]:
            self.P[y]=x
        else:
            self.P[x]=y
            self.rank[y]+=1
 
    def unite(self,x,y):
        self.link(self.find(x),self.find(y))
 
    def size(self):
        S=set()
        for a in range(self.n):
            S.add(self.find(a))
        return len(S)
def is_power(a,b):#aはbの累乗数か
    now=b
    while now<a:
        now*=b
    if now==a:return True
    else:return False
def bin_(num,size):
    A=[0]*size
    for a in range(size):
        if (num>>(size-a-1))&1==1:
            A[a]=1
        else:
            A[a]=0
    return A
def fac_list(n,mod_=0):
    A=[1]*(n+1)
    for a in range(2,len(A)):
        A[a]=A[a-1]*a
        if(mod>0):A[a]%=mod_
    return A
def comb(n,r,mod,fac):
    if(n-r<0):return 0
    return (fac[n]*pow(fac[n-r],mod-2,mod)*pow(fac[r],mod-2,mod))%mod
def next_comb(num,size):
    x=num&(-num)
    y=num+x
    z=num&(~y)
    z//=x
    z=z>>1
    num=(y|z)
    if(num>=(1<<size)):return False
    else:
        return num
def get_primes(n,type="int"):
    A=[True]*(n+1)
    A[0]=False
    A[1]=False
    for a in range(2,n+1):
        if A[a]:
            for b in range(a*2,n+1,a):
                A[b]=False
    if(type=="bool"):return A
    B=[]
    for a in range(n+1):
        if(A[a]):B.append(a)
    return B
def is_prime(num):
    if(num<=2):return False
    i=2
    while i*i<=num:
       if(num%i==0):return False
       i+=1
    return True
def ifelse(a,b,c):
    if a:return b
    else:return  c
def join(A,c=" "):
    n=len(A)
    A=list(map(str,A))
    s=""
    for a in range(n):
        s+=A[a]
        if(a<n-1):s+=c
    return s
def factorize(n,type_="dict"):
    b = 2
    list_ = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            list_.append(b)
        b+=1
    if n > 1:list_.append(n)
    if type_=="dict":
        dic={}
        for a in list_:
            if a in dic:
                dic[a]+=1
            else:
                dic[a]=1
        return dic
    elif type_=="list":
        return list_
    else:
        return None
def floor_(n,x=1):
    return x*(n//x)
def ceil_(n,x=1):
    return x*((n+x-1)//x)
#################################### ########
n=int(input())
for i in range(1,n+1):
    if i%15==0:
        print("FizzBuzz")
    elif i%5==0:
        print("Buzz")
    elif i%3==0:
        print("Fizz")
    else:
        print(i)

Submission status: Wrong Answer

Solution code:
import sys
import math

from collections import defaultdict
from collections import deque
def load(vtype=int):
    return vtype(input().strip())
def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]
def exit():
    import sys
    sys.exit(0)
def perm_sub(li, used):
    if len(li) == len(used):
        return [deque()]
    k = []
    for i in range(len(li)):
        if i in used:
            continue
        used.add(i)
        sub_list = perm_sub(li, used)
        for sub in sub_list:
            sub.appendleft(li[i])
        k.extend(sub_list)
        used.discard(i)
    return k
def perm_li(li):
    return perm_sub(li, set())
def perm_n(n):
    return perm_sub(list(range(n)), set())
def join_i(li, sep=""):
    return sep.join([str(e) for e in li])
def li2n(li):
    n, base = 0, 1
    for i in range(len(li)-1, -1, -1):
        n += li[i] * base
        base *= 10
    return n
def sli2ili(li):
    return [int(s) for s in li] 
def prime_list(n):
    li = [i for i in range(2, n+1)]
    for i in range(len(li)):
        if li[i] >= int(math.sqrt(n)):
            break
        if li[i] == -1:
            continue
        for j in range(i+1, len(li)):
            if li[j] % li[i] == 0:
                li[j] = -1
    return [n for n in li if n != -1]
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    while True:
        r = a % b
        if r == 0: return b
        a, b = b, r
def lcm(a, b):
    return int(a * b / gcd(a,b))
def all_subset(li):
    s = []
    n = len(li)
    for bit in range(0, (1<<(n+1))):
        ss = set()
        for i in range(0, n):
            if (bit & (1 << i)):
                ss.add(li[i])
        s.append(ss)
    return s
def factorial(n):
    if n == 1:
        return 1
    return n * factorial(n-1)
def mCn(m, n):
    def factorial_ntimes(m, n):
        r = 1
        while n:
            r *= m
            m -= 1
            n -= 1
        return r
    return int(factorial_ntimes(m, n) / factorial(n))


n = load()
s = 0
for i in range(1, n):
    if i % 3 == 0 or i % 5 == 0:
        pass
    else:
        s += i

print(s)

Submission status: Wrong Answer

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

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

print(res)

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

Submission status: Wrong Answer

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

def main():
    N = int(input())
    print(Main(N))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = int(input())
if num % 15 == 0 :
    print("FizzBuzz")
elif num % 3 == 0:
    print("Fizz")
elif num % 5 == 0:
    print("Buzz")
else:
    print(num)