TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
n = int(input())

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

n = int(input())

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

n = int(input())

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

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
n=int(input())
ret = n*(n+1)//2
ret -= 3*(1+n//3)//2
ret -= 5*(1+n//5)//2
ret += 15*(1+n//15)//2
print(ret)

#!/usr/bin python3
# -*- coding: utf-8 -*-

import sys
input = sys.stdin.readline

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

if __name__ == '__main__':
    main()

Verdicts: Wrong Answer

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

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

print(sum([x for x in range(a,int(input())+1) if (x%3!=0)and(x%5!=0)]))

print(sum([x for x in range(1,int(input())+1) if (x%3!=0)and(x%5!=0)]))

Verdicts: Wrong Answer

Runtime Error

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

Submission attempts (in order):
n = int(input())

totalsum = []

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:
        totalsum.append(i)

print(sum(totalsum))

n = int(input())

total = []

for i in range(1, n + 1):
    if i % 15 == 0:
        "FizzBuzz"
    elif i % 5 == 0:
        "Buzz"
    elif i % 3 == 0:
        "Fizz"
    else:
        total.append(i)

print(sum(total))

Verdicts: Wrong Answer

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

Submission attempts (in order):
a=int(input())
b=((a//3)*(3+(3*(a//3))))*(1/2)
c=((a//5)*(5+(5*(a//5))))*(1/2)
d=((a//15)*(15+(15*(a//15))))*(1/2)
e=(a*(1+a)*(1/2))-(b+c-d)
print(e)

a=int(input())
b=((a//3)*(3+(3*(a//3))))*(1/2)
c=((a//5)*(5+(5*(a//5))))*(1/2)
d=((a//15)*(15+(15*(a//15))))*(1/2)
e=(a*(1+a)*(1/2))-(b+c-d)
print(e)

a=int(input())
b=((a//3)*(3+(3*(a//3))))*(1/2)
c=((a//5)*(5+(5*(a//5))))*(1/2)
d=((a//15)*(15+(15*(a//15))))*(1/2)
e=(a(1+a)*(1/2))-(b+c-d)
print(e)

a=int(input())
b=((a//3)*(3+(3*(a//3))))*(1/2)
c=((a//5)*(5+(5*(a//5))))*(1/2)
d=((a//15)*(15+(15*(a//15))))*(1/2)
e=(a*(1+a)*(1/2))-(b+c-d)
print(int(e))

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

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

Submission attempts (in order):

s = int(input())
print(s)
ans =0

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


s = int(input())
ans =0

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())

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

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

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

print(A)

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
n = int(input())
print(sum([i for i in range(1, n+1) if and i%5 != 0 and i%3 != 0]))

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


Verdicts: Runtime Error

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

Submission attempts (in order):
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)

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

Verdicts: Runtime Error

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

Submission attempts (in order):
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))

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

Verdicts: Runtime Error

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

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

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

Verdicts: Runtime Error

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

Submission attempts (in order):
x = input()
N = 0

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

x = int(input())
N = 0
 
for i in range(1,x+1):
    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)

Verdicts: Runtime Error

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

Submission attempts (in order):
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)

N=int(input())

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

Verdicts: Runtime Error

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

Submission attempts (in order):
n = int(input())
ans = 0
for i in range(1,n+1):
  if n%3 and n%5:
    ans += i
print(ans)


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


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


Verdicts: Wrong Answer

Wrong Answer

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

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

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


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

print(sum)

Verdicts: Runtime Error

Wrong Answer

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

Submission attempts (in order):
n=int(input())
sum=0

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


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


Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())

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

N = int(input())

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
K = 0
for i in range(N)
    s = i % 3
    t = i % 5
    if s !=0 and t != 0:
        K += i
print(K)


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

print(K)

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

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
N = int(input())
print(["FizzBuzz" if n % 15 == 0 else "Fizz" if n % 3 == 0 else "Buzz" if n % 5 == 0 else n for n in range(1,N)])



N = int(input())
a = [0 if i % 3 == 0 or i % 5 == 0 else i for i in range(1,N+1)]
print(sum(a))



Verdicts: Wrong Answer

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

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
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)

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
def S(n):
    return N/2 * (1+N//n)
print(S(1) - S(3) - S(5) + S(15))

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(input())
n3 = n/3
n5 = n/5
n15 = n/15
def sum(k):
    return k*(k+1)/2
ans = sum(n)+15*sum(n15)-3*sum(n3)-5*sum(n5)
print(ans)


n = int(input())
print(n-n/3-n/5+n/15)


n = int(input())
n3 = n//3
n5 = n//5
n15 = n//15
def sum(k):
    return k*(k+1)//2
ans = sum(n)+15*sum(n15)-3*sum(n3)-5*sum(n5)
print(ans)


Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
sum([i for i in range(1, 1+int(input())) if i%3 * i%5]) 

print(sum([i for i in range(1, 1+int(input())) if i%3 * i%5]))

Verdicts: Wrong Answer

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

Submission attempts (in order):
number = int(input())
result = []

for i in range(1, number + 1):
    if number % 3 == 0 and i % 5 == 0:
        print("FizzBuzz")
    elif i % 3 ==0:
        print("Fizz")
    elif i % 5 == 0:
        print("Buzz")
    else:
        result.append(i)

print(sum(result))

N = int(input())
sum = 0

for i in range(1,N+1):
        if i % 3 == 0 and i % 5 == 0:
            i = ["FizzBuzz"]
        elif i % 3 == 0:
            i = ["Fizz"]
        elif i % 5 == 0:
            i = ["Buzz"]
    # if i % 3 == 0 and i % 5 == 0:
        else:
            sum += i
print(sum)

Verdicts: Wrong Answer

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

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


print(cnt)


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

print(cnt)

Verdicts: Wrong Answer

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

Submission attempts (in order):
# coding: utf-8
# Your code here!

def main():
    number = int(input())
    answear = sum([result for result in range(number) if result % 3 != 0 or result % 5 != 0])
    print(answear)
if __name__ == "__main__":
    main()
    

# coding: utf-8
# Your code here!
def main():
    numbers = int(input())
    result = 0
    for number in range(1,numbers+1):
        if number % 3 != 0 and number % 5 != 0:
            result += number
    print(result)
    
if __name__ == "__main__":
    main()
    


Verdicts: Wrong Answer

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

Submission attempts (in order):
print(sum([i for i in (list(range(1,int(input())+1)) if i % 3 != 0 and i % 5 != 0]))


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


n=list(range(1,int(input())+1))
print(sum([i for i in n if i%3!=0andi%5!=0]))


n=list(range(1,int(input())+1))
print(sum[i for i in n if i % 3 != 0 and i % 5 != 0])

n=list(range(1,int(input())+1))
print(sum([i for i in n if i%3!=0and i%5!=0]))


Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
N = int(input())
ls = []

for i in range(N+1):
  if i % 3 != 0 or i % 5 != 0:
    ls.append(i)

print(sum(ls))


N = int(input())
ls = []

for i in range(N+1):
  if i % 3 != 0 and i % 5 != 0:
    ls.append(i)

print(sum(ls))


Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
N3 = N//3
N5 = N//5
N15 = N//15

S = N * (N+1) / 2
S3 = N3 * (N3+1) / 2 *3
S5 = N5 * (N5+1) / 2 *5
S15 = N15 * (N15+1) / 2 *15

sum = S - (S3 + S5 -S15)
print(sum)

N = int(input())
N3 = N//3
N5 = N//5
N15 = N//15

S = N * (N+1) // 2
S3 = N3 * (N3+1) // 2 *3
S5 = N5 * (N5+1) // 2 *5
S15 = N15 * (N15+1) // 2 *15

sum = S - (S3 + S5 -S15)
print(sum)

Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(inupt())
sum = 0
for i in range(1, n+1):
  if n % 3 == 0 or n % 5 == 0:
    sum += i
    
print(sum)

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

Verdicts: Runtime Error

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

Submission attempts (in order):
n = int(input())

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

n = int(input())

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

Verdicts: Runtime Error

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

Submission attempts (in order):
a=int(input())
b=0
for i in range(a):
  if a%3!=0 and a%5!=0:
    b=b+i
print(b)

a=int(input())

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

print(b)

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())

ans = 0

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

N = int(input())

ans = 0

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]

N = getInput()[0]
sums = 0
for i in range(1, N+1):
    if i%3 == 0 or i%5 == 0:
        continue
    else:
        sums += i


print(sum(list(i for i in range(int(input())+1) if i%3 > 0 < i%5)))

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = eval(input())
k=0
for i in range(0,N):
  if i%3!=0 or i%5!=0:
   k = k+1
print (k)

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

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

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N = int(input())

s = 0
for i in range(N):
  x = i+1
  if x // 3 == 0 or x // 5 == 0:
    continue
  s += x
  
print(s)

N = int(input())

s = 0
for i in range(N):
  x = i+1
  if x % 3 == 0 or x % 5 == 0:
    continue
  s += x
  
print(int(s))

Verdicts: Wrong Answer

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

Submission attempts (in order):
user = int(input())
container = []
for i in range(1, user+1):
    if (i % 3) == 0 or (i % 5) == 0:
        continue
    container.append(i)

user = int(input())
container = []
for i in range(1, user+1):
    if (i % 3) == 0 or (i % 5) == 0:
        continue
    container.append(i)
print(sum(container))

Verdicts: Wrong Answer

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

Submission attempts (in order):
a=int(input())
anser=0
for i in range(a+1):
  print(i)
  if i%3!=0 and i%5!=0:
    anser+=i
print(anser)


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

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


Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
n = int(input())
result = 0

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


n = int(input())
result = 0

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


n = int(input())
ans = 0

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

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
n = int(input())
result = 0
for i in range(n):
    if(i%3 !=0 and i % 5 !=0):
            result += i
print(i)


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


Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(input())
f = n//3
s_f = 3*f*(f+1)/2
b = n//5
s_b = 5*b*(b+1)/2
fb = n//15
s_fb = 15*fb*(fb+1)/2
print(n*(n+1)/2-s_f-s_b+s_fb)

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())

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

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)



N = int(input())

count = 0
for i in range(int(N)+1):
    if i % 15 == 0:
        continue
    elif i % 5 ==0:
        continue
    elif i % 3 ==0:
        continue
    else:
        count += i
print(count)



Verdicts: Wrong Answer

Wrong Answer

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

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

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



Verdicts: Runtime Error

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

Submission attempts (in order):
n = int(input())

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

n = int(input())
number_list = []
for i in range(1, n + 1):
    if i % 15 == 0:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    else:
        number_list.append(i)

print(sum(number_list))

Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(input())

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

print(cnt)


n = int(input())

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

print(cnt)


Verdicts: Wrong Answer

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

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
n=input()
sum1=0
for i in range(n):
    if not(i%3==0 or i%5==0):
        sum1=sum1+i
    else:
        sum1=sum1
print(sum1)

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

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

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
n=int(input())
N=0
for i in range(1,N+1):
  if not i%3==0 and not i%5==0:
    N+=i

print(N)

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

print(N)

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
A=N//3
B=N//5
AanB=N//15
Ssum=(1+N)*N*(1/2)
Asum=(1+A)*A*(1/2)*3
Bsum=(1+B)*B*(1/2)*5
AanBsum=(1+AanB)*AanB*(1/2)*15
print(Ssum-Asum-Bsum-AanBsum)

N = int(input())
A=N//3
B=N//5
AanB=N//15
Ssum=(1+N)*N*(1/2)
Asum=(1+A)*A*(1/2)*3
Bsum=(1+B)*B*(1/2)*5
AanBsum=(1+AanB)*AanB*(1/2)*15
print(Ssum-Asum-Bsum+AanBsum)

N=int(input())

A=N//3
B=N//5
AanB=N//15
Ssum=(1+N)*N*(1/2)
Asum=(1+A)*A*(1/2)*3
Bsum=(1+B)*B*(1/2)*5
AanBsum=(1+AanB)*AanB*(1/2)*15
print(int(Ssum-Asum-Bsum+AanBsum))

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
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

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

Verdicts: Runtime Error

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

Submission attempts (in order):
input=int(input())

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

input=int(input())

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
import numpy as np

n = input()
N = int(n)

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

import numpy as np
 
n = input()
N = int(n)
 
s = np.sum([i for i in range(N+1) if (i%3!=0)and(i%5!=0)])
print(s)

Verdicts: Wrong Answer

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

Submission attempts (in order):
N=int(input())
ans = 0
for i in range(1,N+1):
  if i%3!=0 or i%5!=0:
    ans = ans + i
print(ans)

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

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

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
num = int(input())
if num % 15 == 0 :
    print("FizzBuzz")
elif num % 3 == 0:
    print("Fizz")
elif num % 5 == 0:
    print("Buzz")
else:
    print(num)

num = int(input())

div = num // 15

count = 60 *  div ** 2

if num % 15 != 0:
    for i in range(div*15+1,num+1):
        if i%3!=0 and i%5!=0:
            count += i
print(count)

Verdicts: Wrong Answer

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

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

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)

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)

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
a=int(input())
fizzbuzz = 0
for i in range(1,a+1):
  if (i%3) == 0:
      fizzbuzz += i
  elif (i%5) == 0:
      fizzbuzz += i
all_ = (1+a)*a/2
print(all_-fizzbuzz)

a=int(input())
fizzbuzz = 0
for i in range(1,a+1):
  if (i%3) == 0:
      fizzbuzz += i
  elif (i%5) == 0:
      fizzbuzz += i
all_ = (1+a)*a/2
print(int(all_-fizzbuzz))

Verdicts: Wrong Answer

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

Submission attempts (in order):
U = int(input())
k = 0
l = 0
m = 0
for i in range(1, U + 1) :
  if i / 3 == 0 and i/5 == 0:
    k += i
    break
  elif i / 3 == 0:
    l += i
    break
  elif i / 5 == 0:
    m += i
    break
  else:
    k += 0
print(int(U) - int(l + m - k))


N = int(input())
total = 0
for i in range(1, N + 1):
  if i % 3 ==0 and i % 5:
    continue
  elif i % 5 == 0:
    continue
  elif i % 3 == 0:
    continue
  else:
    total += i
    
print(total)

Verdicts: Wrong Answer

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

Submission attempts (in order):
import sys
a = sys.argv[1]
t= sum([i for i in range(int(a)+1) if i %5 != 0 and i %3 != 0])
print(t)


a = input()
t= sum([i for i in range(int(a)+1) if i %5 != 0 and i %3 != 0])
print(t)

Verdicts: Runtime Error

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

Submission attempts (in order):
N = input()
N = int(N)
 
allsum = (N+1)*int(N/2)
 
fum = int(N / 3)
bsum = int(N / 5)
fbsum = int(N / 15)
 
print(allsum-fsum*3-bsum*5+fbsum*15)

N = input()
N = int(N)

allsum = int( (N + 1) * N / 2 )
#print(allsum)

f = int(N / 3)
b = int(N / 5)
fb = int(N / 15)


#print(f)
#print(b)
#print(fb)

fsum = int((f+1)*f/2)*3
bsum = int((b+1)*b/2)*5
fbsum = int((fb+1)*fb/2)*15

print(allsum - fsum - bsum + fbsum)

Verdicts: Runtime Error

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

Submission attempts (in order):
n = int(input())
a = []
for i in range(n):
    if (i+1) % 15 == 0:
        a.insert(i+1,"FizzBuzz") 
    elif (i+1) % 3 == 0:
        a.insert(i+1,"Fizz") 
    elif (i+1)% 5 == 0:
        a.insert(i+1,"Buzz") 
    else:
        a.append(i+1)
        
b = [num for num in a if isinstance(num, int)]
sum(b)

n = int(input())
a = []
for i in range(n):
    if (i+1) % 15 == 0:
        a.insert(i+1,"FizzBuzz") 
    elif (i+1) % 3 == 0:
        a.insert(i+1,"Fizz") 
    elif (i+1)% 5 == 0:
        a.insert(i+1,"Buzz") 
    else:
        a.append(i+1)
        
b = [num for num in a if isinstance(num, int)]
print(sum(b))

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
s = 0
for i in range(N + 1):
    n = i + 1
    if n % 3 != 0 and n % 5 != 0:
        s += n
print(s)


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


Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
a = list()
for i in range(1,N):
    if i %3 != 0 and i%5 != 0:
        a.append(i)
    else:
        continue
#print(a)
sum(a)

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted