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: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from functools import lru_cache
import bisect
import re
import queue
from decimal import *


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [int(input()) for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def solve():
    N = Scanner.int()
    ans = 0
    for i in range(1, N+1):
        if i % 3 == 0 or i % 5 == 0:
            continue
        ans += i
    print(ans)


def main():
    # sys.stdin = open("sample.txt")
    solve()


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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


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


N = int(input())

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

print(ans)

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
ef to_fizzbuzz(number):
    if number % 15 == 0:
        return 'FizzBuzz'

    if number % 3 == 0:
        return 'Fizz'

    if number % 5 == 0:
        return 'Buzz'

    else:
        return str(number)
        # return i

def main():
    N = int(input())
    # FizzBuzz含む文字列
    fblist = []
    for number in range(1, 10**6):
        result = to_fizzbuzz(number)
        fblist.append(result)

        # print(fblist)

    # Ｎ項目までの数列
    n_list = fblist[0:N]
    # Ｎ項まで　かつ　数字のみの数列

    n_numlist = []

    for s in n_list:
        if s.isdigit() == True:
            n_numlist.append(int(s))

    print(sum(n_numlist))

main()

Submission status: Runtime Error

Solution code:
for i in range(1, N + 1):
    if (i % 3 == 0) and (i % 5 == 0):
        print('FizzBuzz')
    elif i % 3 == 0:
        print('Fizz')
    elif i % 5 == 0:
        print('Buzz')
    else:
        print(str(number))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if(1 <= N <= 10 ** 6):

 for i in range(1 , n + 1 ):
    if (i % 3 == 0) and (i % 5 == 0):
        n = "FizzBuzz"
    elif (i % 3 == 0):
        n = "Fizz"
    elif (i % 5 == 0):
        n = "ZBuzz"
    else:
        sum += 1

print(sum)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
n=int(input())

for i in n:
  
    if i %15==0:
        print('Fizz Buzz')
    elif i % 3==0:
        print('Fizz')
    elif i % 5 ==0:
        print('Buzz')
    else:
        print(i)

Submission status: Runtime Error

Solution code:
# 1 <= N <= 1000000
N = int(input())

total = []

# N項目までに含まれる->N項目は含まない。だからN項目は+1で外す。
for x in range(1, N+1):
    if x % 15 == 0:
        "FizzBuzz"
    elif x % 5 == 0:
        "Buzz"
    elif x % 3 == 0:
        "Fizz"
    else:
        print(total)
        total.append(x) #リストに加える
print(sum(total))

Submission status: Runtime Error

Solution code:
# 1 <= N <= 1000000
N = int(input())

total = []

# N項目までに含まれる->N項目は含まない。だからN項目は+1で外す。
for x in range(1, N+1):
    if x % 15 == 0:
        "FizzBuzz"
    elif x % 5 == 0:
        "Buzz"
    elif x % 3 == 0:
        "Fizz"
    else:
        print(total)
        total.append(x) #リストに加える
print(sum(total))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range (1,N+1):
    if i % 3 == 0 and i % 5 == 0:
        a = 'FizzBuzz'
    elif i % 3 == 0:
        a = 'Fizz'
    elif i % 5 == 0:
        a = 'Buzz'
    else:
         a = a + i

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
¥N=int(input())
F=N//3
B=N//5
fb=N//15
S=(N*(N+1))//2
Fizz=(3*F*(F+1))//2
Buzz=(5*B*(B+1))//2
FizzBuzz=(15*fb*(fb+1))//2
print(S-Fizz-Buzz+FizzBuzz)

Submission status: Runtime Error

Solution code:
N=int(input())

sum=0
while a in range(N+1):
  if a%3 !=0 and a%5 !=0:
    sum=sum+a
    a = a + 1
  else:a=a+1
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
N = int(input().split())

print(sum([n + 1 for n in range(N) if (n + 1) % 3 != 0 and (n + 1) % 5 != 0]))

Submission status: Runtime Error

Solution code:
import sys
n = int(sys.stdin)
print(sum(i for i in range(1, n + 1) if i % 3 and i % 5))

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=map(int,input().split())
for i in range(n):
    if (i%3==0) and (i%5==0):
        print("FizzBuzz")
    elif (i%3==0) and (i%5!=0):
        print("Fizz")
    elif (i%3!=0) and (i%5==0):
        print("Buzz")
    else:
        print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())

ans=0

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

Submission status: Runtime Error

Solution code:
if score (i%3==0,i%5==0):
    print(f'{score}=FissBuss')
    
    else:
      if score (i%3==0):
        print(f'{score}=Fiss')
        
        else:
          if score (i%5==0):
          print(f'{score}=Buss')
          
          amount += i
          
          print (num)

Submission status: Runtime Error

Solution code:
if score (i%3==0,i%5==0):
    print(f'{score}=FissBuss')
    
    else:
      if score (i%3==0):
        print(f'{score}=Fiss')
        
        else:
          if score (i%5==0):
          print(f'{score}=Buss')
          
          num +=i
          
          print (num)

Submission status: Runtime Error

Solution code:
if score in scores:

if score (i%3==0,i%5==0):
 
    print(f'{score}=FissBuss')
    
    else:
      if score (i%3==0):
        print(f'{score}=Fiss')
        
        else:
          if score (i%5==0):
          print(f'{score}=Buss')
          
          num +=i
          
          print (num)

Submission status: Runtime Error

Solution code:
if score (i%3==0,i%5==0):
    print(f'{score}=FissBuss')
    
    else:
      if score (i%3==0):
        print(f'{score}=Fiss')
        
        else:
          if score (i%5==0):
          print(f'{score}=Buss')
          
          num +=i
          
          print (num)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
ans = []
for i in range(1,N+1):
    if i % 3 == 0 and i % 5 == 0:
        continue
    elif i % 3 == 0 and i % 5 != 0:
        continue
    elif i % 5 == 0 and i % 3 != 0:
        continue
    else:
        ans.appned(i)
print(sum(ans))

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

ans = 0

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

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())
s=[]
for i in range(1:n+1):
  if a%3==0:
    continue
  elif a%5==0:
    continue
  else
  	s.append(i)
print(sum(s))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
seq = [i for in range(1,N) 
count = 0
for t in range(len(seq)):
  if seq[t]%3 != 0 or seq[t]%5 != 0:
       count += seq[t]
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
print(a)
if a[-m] > 1 / (4 * m):
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main(){
	int n;
	cin >> n;
	long long cnt = 0;
	for(int i = 1;i<=n;i++){
		if(i%3==0 || i%5==0){
		}
		else{
			cnt += i;
		}
	}
	cout << cnt << endl;
}

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

Solution code:
N = input()

k = N // 3
l = N // 5
m = N // 15

sum = (N * (N + 1) / 2) - (3 * (-1 + 3**k)/2) - (5 * (-1 + 5**l)/4) + (15 * (-1 + 15**k)/14)
print(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range[n+1]:
  if i%3==1 or i%3==2:
    if i%5==1 or i%5==2 or i%5==3 or i%5==4:
      sum+=i
print sum

Submission status: Runtime Error

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

for i in range(n+1):
  if i%3==1 or i%3==2:
    if i%5==1 or i%5==2 or i%5==3 or i%5==4:
      sum+=i
print sum

Submission status: Runtime Error

Solution code:
FizzBuzz = int(input())

Sum = []
for i in range(FizzBizz):
    if FizzBuzz[i] % 3 == 0 and FizzBuzz[i] % 5 == 0:
        Sum.append(i)
    else:
        Sum.append(0)
print(sum(Sum))

Submission status: Runtime Error

Solution code:
# -*- coding: <encoding name> -*-

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

Submission status: Runtime Error

Solution code:
# -*- coding: <encoding name> -*-

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

Submission status: Runtime Error

Solution code:
n=int(input())
a=[0 for i in range(n)]
for i in range(n+1): #0,1,2,3,…n-1,n+1-1:nが3でも5でも割り切れない場合range(n)ではダメ
    if i%3!=0 and i%5!=0:
        a[i]=int(i)

print(sum(a))

Submission status: Runtime Error

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

print(sum(a))

Submission status: Runtime Error

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

Submission status: Runtime Error

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


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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
total = 0
for i in range(1,N + 1):
    if i % 3 == 0 or i % 5 == 0:
        continue
    t = t + i
print(total)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()

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

Submission status: Runtime Error

Solution code:
N = input()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=input()

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

print(ans)

Submission status: Runtime Error

Solution code:
print("Yes" if input().find("7") >= 0 else "No")
n = int(input()) + 1
a = set(range(0, n))
fs = set(range(0, n, 3))
bs = set(range(0, n, 5))
print(sum(a - fs - bs))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = input()
sum = 0

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input)

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

Submission status: Runtime Error

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

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

print(sum)

Submission status: Runtime Error

Solution code:
import numpy
a = np.array([i for i in range(1, int(input())+1)])
print(a[np.where((a % 3 != 0) & (a % 5 !=0))].sum())

Submission status: Runtime Error

Solution code:
n=int(input())
an=[a for a in range(1,n+1)]
o=[]
def ass(an):
    for c in an
        if c%3==0 or c%5==0:
             continue
        else:
            o.append(c)
    return sum(o)
print(ass(an))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = map(int,input().split())
fizz = list()
for i in range(N):
    if i // 3 == 0 and i // 5 == 0:
        i = FizzBuzz
    elif i // 3 == 0: 
        i = Fizz
    elif i // 5 == 0:
        i = Buzz
    else:
        fizz.append(i)
print(sum(fizz))

Submission status: Runtime Error

Solution code:
N = map(int,input().split())
fizz = list()
for i in range(N):
    if i // 3 = 0 and i // 5 = 0:
        i = FizzBuzz
    elif i // 3 = 0 
        i = Fizz
    elif i // 5 = 0
        i = Buzz
    else:
        fizz.append(i)
print(sum(fizz))

Submission status: Runtime Error

Solution code:
n=input(a)
n.remove('Buzz','Fizz','FizzBuzz')
print(sum(n))

Submission status: Runtime Error

Solution code:
n=input()
n.remove('Buzz')
n.remove('Fizz')
n.remove('FizzBuzz')
print(sum(n))

Submission status: Runtime Error

Solution code:
n=input()
n.remove('Buzz','Fizz','FizzBuzz')
print(sum(n))

Submission status: Runtime Error

Solution code:
N = int(input())

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

Submission status: Runtime Error

Solution code:
N = int(input())
if N >= 2 :
    An = [[] for _ in range(1,N)]
    #print(An)
    for s in range(1,N) :
        #print(s)
        if s%3 == 0 :
            An[s] = 0 
        elif s%5 == 0 :
            An[s] = 0
        else:
            An[s] = int(s) 
            #print(s)
            #print(An[s])
    ans = int(sum(An))
else:
    ans = int(1)

print (ans)

Submission status: Runtime Error

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

N = inputI()

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

Submission status: Runtime Error

Solution code:
N = int(input())
S = 0
for i in range(N):
    if i+1%3 and i+1%5 or i+1%3 or i+1%5:
        break
    else:
        global S = S+1+i

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

#入力
n = int(input())

#要素数の確認
def element_check(before,after,matirx):
    diff = after - before
    if diff == 1:
        a = np.delete(matirx,-1)
        return a
    if diff == 2:
        a = np.delete(matirx,-1)
        b = np.delete(a,-1)
        return b

#3の倍数をFに変更
def multiples_3(matrix):
    #列ベクトルを削除(3列目)
    m_de = np.delete(fizzbuzz_list, [2, 3], axis=1)
    #Fの列ベクトルを作成
    f_list = np.zeros(j,dtype = object).reshape(-1, 1)
    f_list.fill("F")
    #結合
    result = np.concatenate([m_de, f_list], 1)
    return result

#列を計算(繰り上げ)
j = -(-n // 3)

#1からnまでの配列を作成
fizzbuzz_list = np.arange(1,n+1,dtype=object)
#要素数
before_size = fizzbuzz_list.size
#3*n行列に変更
fizzbuzz_list.resize((j,3))

#3の倍数をFに変更
fizzbuzz_list = multiples_3(fizzbuzz_list)

#5の倍数をBに変更
n_b_1 = np.arange(3,j,5)
n_b_2 = np.arange(1,j,5)

fizzbuzz_list[n_b_1,0] = "B"
fizzbuzz_list[n_b_2,1] = "B"

#15の倍数をFBに変更
n_fb = np.arange(4,j,5)
fizzbuzz_list[n_fb,2] = "FB"

#要素をチェック
result = element_check(before_size,fizzbuzz_list.ravel().size,fizzbuzz_list.ravel())

print(np.sum(result))

# np.where(fizzbuzz_list[:,2:3],fizzbuzz_list,"F")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))

ans = 0

A_even = A[0::2] # 0,2,4... (奇数のときn+1個)
A_odd  = A[1::2] # 1,3,5... (奇数のときn個)

A_even_sum = [0 for i in range(len(A_even))]
A_odd_sum  = [0 for i in range(len(A_odd))]

for i in range(len(A_even)):
    if(i==0):
        A_even_sum[i] = A_even[i]
    else:
        A_even_sum[i] = A_even_sum[i-1] + A_even[i]

for i in range(len(A_odd)):
    if(i==0):
        A_odd_sum[i] = A_odd[i]
    else:
        A_odd_sum[i] = A_odd_sum[i-1] + A_odd[i]

if(N%2 == 0):
    # 偶数個の場合
    n = int(N/2)
    
    n = n / 0
    
    # A_evenの(0からi-1まで)、A_oddから(iからn-1まで)を選択する

    ans = max(A_even_sum[n-1],A_odd_sum[n-1])

    if(n == 1):
        ans = max(A)
    else:
        for i in range(1,n):
            new_ans = A_even_sum[i-1] + A_odd_sum[n-1] - A_odd_sum[i-1]
            if(new_ans > ans):
                ans = new_ans
                
else:
    # 奇数個の場合
    n = int((N-1)/2)
    
    # 1.A_evenのみから選択→最も小さい1個を除外したものが最適
    if(n == 1):
        ans = max(A)
    else:
        ans = A_even_sum[n] - min(A_even)
    
    # 1-1. A_oddのみから全部選択
    ans = max(ans,A_odd_sum[n-1])
    
    # 2.A_even(0からn_s-1まで) → A_odd(n_sからn_e-1まで) → A_even(n_e+1からnまで) と選択する
    # n_s≧1, n_e≦n-1, n_e＞n_s
    
    if(n >= 3):
        flag = 0
        ans2 = 0
        n_e_max = 0
        
        # まず、n_s=1とおいて、A_oddの終点を定める
        n_s = 1
        for n_e in range(2,n):
            new_ans2 = A_even_sum[n_s-1] + A_even_sum[n] - A_even_sum[n_e] + A_odd_sum[n_e-1] - A_odd_sum[n_s-1]
            if(flag == 0):
                flag = 1
                n_e_max = n_e
                ans2 = new_ans2
            elif(new_ans2 > ans2):
                n_e_max = n_e
                ans2 = new_ans2
        
        # 次に、n_sを変化させて考える
        for n_s in range(1,n_e_max):
            new_ans2 = A_even_sum[n_s-1] + A_even_sum[n] - A_even_sum[n_e_max] + A_odd_sum[n_e_max-1] - A_odd_sum[n_s-1]            
            if(new_ans2 > ans2):
                ans2 = new_ans2
        
        ans = max(ans,ans2)
        
        
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

count = 0

for i in range(N):
	num = int(input())
    if num % 3 == 0 and num % 5 == 0:
    	continue
    elif num % 3 == 0:
    	continue
    elif num % 5 == 0:
    	continue
    else:
    	count += num

print(count)

Submission status: Runtime Error

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

#文字になるときpass
for i in range(N):
    if i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    elif i % 15 == 0 :
        pass
    else:
         sum +=  i

print(sum)

Submission status: Runtime Error

Solution code:
N = map(int,input().split())
sum = 0

#文字になるときpass
for i in range(N):
    if i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    elif i % 15 == 0 :
        pass
    else:
         sum +=  i

print(sum)