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())
l = [i for i in range(N+1)  if i % 3 == 0 or i % 5 == 0]
print(l)
print(sum(l))

N = int(input())

l = []
for i in range(N+1):
    if not i % 3 == 0 and not i % 5 == 0:
        l.append(i)
print(l)

N = int(input())
l = [i for i in range(N+1)  if not i % 3 == 0 and not i % 5 == 0]
print(sum(l))

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

a = n//15
b = n//3
c = n//5

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

n = int(input())

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

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

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

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

N = int(input())

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

N = int(input())

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

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

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):
    i=int(input())
    i1=i*(i+1)/2
    i2=i//3
    i3=i//5
    i4=i2*(i2+1)/2
    i5=i3*(i3+1)/2
    i6=i//15
    i7=i6*(i6+1)/2
    print(i1-i4-i5+i6)

i=int(input())
i1=i*(i+1)/2
i2=i//3
i3=i//5
i4=i2*(i2+1)/2
i5=i3*(i3+1)/2
i6=i//15
i7=i6*(i6+1)/2
print(i1+i4+i5-i6)

i=int(input())
i1=i*(i+1)/2
i2=i//3
i3=i//5
i4=i2*(i2+1)/2
i5=i3*(i3+1)/2
i6=i//15
i7=i6*(i6+1)/2
print(i1-i4-i5+i7)

i=int(input())
i1=i*(i+1)//2
i2=i//3
i3=i//5
i4=i2*(i2+1)//2
i5=i3*(i3+1)//2
i6=i//15
i7=i6*(i6+1)//2
print(i1-i4*3-i5*5+i7*15)

Verdicts: Runtime Error

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):
import math
from functools import reduce


def gcd(*numbers):
    return reduce(math.gcd, numbers)

k=int(input())
ans=0
for i in range(1,k+1):
    for j in range(1,k+1):
        for l in range(1,k+1):
            ans+=gcd(i,j,k)
            #print(gcd(i,j,l))
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

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

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

N = int(input())
b = 0

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


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


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

print(sum(total))


n = int(input())
a = 0

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

print(a)

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


N = int(input())
b = 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:
         b =  b+ i



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


n = int(input())
a = 0

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

print(a)

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



total = []

N = int(input())

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

print(sum(total))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

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 = input()
sum = 0

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



n = int(input())
sum = 0

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

n = int(input())+1
i,sum = 1,0
while i<n:
  if i%3!=0 and i%5!=0: sum+=i
  i+=1
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=N//15
P=[1,2,4,7,8,11,13,14]
Q=0

if S==0:
    if N < 2:
        D=1
    if N < 3:
        D=2
    if N < 7:
        D=7
    if N < 8:
        D=14
    if N < 11:
        D=22
    if N < 12:
        D=33
    if N < 14:
        D=46
    if N < 15:
        D=60
    print(D)
else:
    T=S-1
    D=(60+60+15*T*8)*S//2
    N1=N-15*S
    if N1 <2:
        D=D+1
    if N1 < 3:
        D=D+P[0]+P[2]
    if N1 < 7:
        D=D+7
    if N1 < 8:
        D=D+14
    if N1 < 11:
        D=D+22
    if N1 < 12:
        D=D+33
    if N1 < 14:
        D=D+46
    if N1 < 15:
        D=D+60
    print(D)

N=int(input())
S=N//15
P=[1,2,4,7,8,11,13,14]
P2=[3,5,6,9,10,12]
Q=0
D=0
if S==0:
    for i in range(1,N+1):
        if i in P2:
            continue
        else:
            D=D+i
else:
    T=S-1
    D=(60+60+15*T*8)*S//2
    N1=N-15*S
    for i in range(1,N1+1):
        if i in P2:
            continue
        else:
            D=D+i+15*S

print(D)
    


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

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


N = list(map(int, input().split()))

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


N = int(input())

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


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

n = int(input())
a = list(range(1,n+1))
ans = sum(a) - sum(list(range(0, n+1, 3))) - sum(list(range(0, n+1, 5))) + sum(list(range(0, n+1, 15)))
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())
ans = 0
for i in range(N):
    if i % 3 == 0 or i % 5 != 0:
        ans += i

print(ans)


N = int(input())

l = [int(x) for x in list(str(N))]

if 7 in l:
    print("Yes")
else:
    print("No")

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

n = int(input())
sum = 0

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

a=0
for i in range(1,int(input())+1):
  a+=(not (i%3==0 or i%5==0))*i
print(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(n+1):
  if i%3!=0 or i%5!=0:
    sum+=i
    
print(sum)

n = int(input())
sum = 0

i=1
while(i<n+1):
  if i%3==0 or i%5==0:
    pass
  else:
    sum+=i
  i+=1
    
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):
x = int(input())
sum = 0

for num in range(1,x+1):
    print(num)
    sum = sum + num
    if  num%3 == 0 or num%5 == 0:
        sum = sum - num 
     
       
    

print(sum)

x = int(input())
sum = 0

for num in range(1,x+1):
    sum = sum + num
    if  num%3 == 0 or num%5 == 0:
        sum = sum - num 
     
       
    

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

N=int(input())
ans=0
for i in range(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):
sum([n for n in range(1, int(inpt())) if (n%3!=0) and (n%5!=0)])

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

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

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

n = int(input())

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

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

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

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

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

sum=0

for i in int(n):
  if (i%3!=0)&(i%5!=0):
    sum+=i
print(sum)

n=input()
 
sum=0
 
for i in range(1,int(n)+1):
  if (i%3!=0)&(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())
total=0
for i in range(0,n+1):
    if (i%3==0 and i%5==0) or i%3==0 or i%5==0:
        total+=0
    else:
        print(i)
        total+=i
print(total)

n=int(input())
total=0
for i in range(0,n+1):
    if (i%3==0 and i%5==0) or i%3==0 or i%5==0:
        total+=0
    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):
n=input()
n.remove('Buzz')
n.remove('Fizz')
n.remove('FizzBuzz')
print(sum(n))

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

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


n=int(input())
a=1
b=0
while True:
	if a%3!=0 and a%5!=0:
		b+=a
	if a==n:
		break
	a+=1
print(b)


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


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


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

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


Verdicts: 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):
for number in range(1, 30 + 1):
    if (number % 3 == 0) and (number % 5 == 0):
        print('FizzBuzz')
    elif number % 3 == 0:
        print('Fizz')
    elif number % 5 == 0:
        print('Buzz')
    else:
        print(str(number))



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



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

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())
li=[]
for i in range(1,n+1):
    if not i%3==0 or i%5==0:
        li.append(i)
    else:
        li=li
print(sum(li))

n=int(input())
li=[]
i=0
while i<=n:
    if i%3!=0 and i%5!=0:
        li.append(i)
        i+=1
        continue
    else:
        i+=1
        continue
else:
    print(sum(li))

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):
 = int(input())
l = [i for i in range(1, n+1)]
nl = []
    
for a in l:
     if a%15 != 0 or a%5 != 0 or a%3 != 0:
     	nl.append(a)
print(sum(nl))
  


n = int(input())
l = [i for i in range(1, n+1)
nl = []
    
for a in l:
     if a%15 != 0 or a%5 != 0 or a%3 != 0:
     	nl.append(a)
print(sum(nl))
  

n = int(input())
l = [i for i in range(1, n+1)]
nl = []
    
for a in l:
     if a%15 != 0 or a%5 != 0 or a%3 != 0:
     	nl.append(a)
print(sum(nl))
  

n = int(input())
l = [i for i in range(1, n + 1)]
nl = []

for a in l:
    if (a % 5 != 0) and (a % 3 != 0):
        nl.append(a)

print(sum(nl))


Verdicts: Runtime Error

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):
s=int(input())
list=[]
h=0
for i in range(1,s):
    if i%3!=0 or i%5!=0:
        list.append(i)
for j in list:
    h=h+j
print(h)

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

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

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

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

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

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

print(j)



N = int(input())

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

print(j)



N = int(input())

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

print(j)



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())
n3 = n // 3
n5 = n // 5
n15 = n // 15

print(n*(n+1)/2 + 3*n3*(n3+1)/2 + 5*n5*(n5+1)/2 - 15*n15*(n15+1)/2)

n = int(input())
n3 = n // 3
n5 = n // 5
n15 = n // 15

print(n*(n+1)/2 - 3*n3*(n3+1)/2 - 5*n5*(n5+1)/2 + 15*n15*(n15+1)/2)

n = int(input())

n3 = n // 3
n5 = n // 5
n15 = n // 15

print(n*(n + 1)//2 - 3*n3*(n3 + 1)//2 - 5*n5*(n5 + 1)//2 + 15*n15*(n15 + 1)//2)

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

import math


text = 0
count = 0


n = int(input())


while count < n:
    if (count % 3 != 0) or (count % 5 != 0):
        text = text + count
    count += 1


print(text)



text = 0
count = 0


n = int(input())


while count < n:
    count += 1
    if (count % 3 != 0) and (count % 5 != 0):
        text = text + count


print(text)


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

N = int(input())
total = 0
for i in range(1, N+1):
  if i%3==0 and i%5==0:
    continue
  elif i%3==0:
    continue
  elif i%5==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):
n = int(input())
sum = 0
for i in range(1 , n + 1 ):
    if (i % 3 != 0) and (i % 5 != 0):
        sum += 1

print(sum)

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)

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

print(sum)

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

n = int(input())
list = []

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

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

print(sum)

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)

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)

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

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(list.append(i))
print(sum(list))

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

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

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


N= int(input())

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

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


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

ans=0

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


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

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


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

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

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

def f(num):
  return num*(num+1)/2

n1 = int(n/3)
n2 = int(n/5)
n3 = int(n/15)

sm = f(n)- 3*f(n1)-5*f(n2) + 15*f(n3)
# f(n)- 3*f(int(n/3))

print(sm)

n = int(input())

def f(num):
  return num*(num+1)/2

n1 = int(n/3)
n2 = int(n/5)
n3 = int(n/15)

sm = f(n)- 3*f(n1)-5*f(n2) + 15*f(n3)
# f(n)- 3*f(int(n/3))

print(int(sm))

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

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

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())
m = 100000
ans = 0
cnt3 = 0
cnt5 = 0
for i in range(n):
  if i%3 == 0:
    cnt3 += i//3
  elif i%5 == 0:
    cnt5 += i//5

if n%2 == 0:
  S = (n+1)*n//2
else:
  S = (n+1)*n//2 + (n+1)//2

print(S - cnt3*3 - cnt5*5)


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

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

n = int(input())
sum = 0
for i in range(1, n + 1):
    if i % 3 != 0 and 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())
fizzbuzz = [i for i in range(n+1) if i%5!=0 and i%3!=0]
print(sum(fizzbuss))

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

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

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

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

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


n = int(input())
s = []
for i in range(n):
  if not i%3 and i%5==0:
       s.append(i)
print(sum(s))
    
    


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

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: 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 = 31
N_list = [1,3,3,7,7,7,14,22,22,22,33,33,46,60,60]
N_add15 = [1,2,2,3,3,3,4,5,5,5,6,6,7,8,8]


num_15 = N // 15

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

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

print(ans)

N = int(input())

N_list = [1,3,3,7,7,7,14,22,22,22,33,33,46,60,60]
N_add15 = [1,2,2,3,3,3,4,5,5,5,6,6,7,8,8]


num_15 = N // 15

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

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

print(ans)


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 = input()
lists = [i+1 for i in range(a)]
for t in lists:
  if t % 5 == 0:
    lists.remove(t)
  elif t % 3 ==0:
    lists.remove(t)
    
print(sum(lists))

a = int(input())
lists = [i+1 for i in range(a)]
for t in lists:
  if t % 5 == 0:
    lists.remove(t)
  elif t % 3 ==0:
    lists.remove(t)
    
print(sum(lists))

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

print(sum(lists))

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

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

Verdicts: Wrong Answer

Accepted
Problem: Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}.  Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.

Submission attempts (in order):
n = int(input())
i = 1
j = 1
k = 1
ans = 0
while i < n+1:
    j = 1
    while j < n+1:
        k = 1
        p = gcd(i,j)
        while k < n+1:
            if (p-1)*(k-1) == 0:
                ans += 1
            else:
                ans += gcd(k,p)
            k += 1
        j += 1
    i += 1
print(ans)

def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)

G = []
i,j = 1,1
while i < 201:
    j = 1
    g0 = []
    while j < 201:
        g0.append(gcd(i,j))
        j += 1
    g0 = tuple(g0)
    G.append(g0)
    i += 1
n = int(input())
i = 1
j = 1
k = 1
ans = 0
while i < n+1:
    j = 1
    while j < n+1:
        k = 1
        p = G[i-1][j-1]
        while k < n+1:
            ans += G[k-1][p-1]
            k += 1
        j += 1
    i += 1
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}.  Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.

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

from fractions import gcd


d = {}
d2 = {}

def f(x, y, z):
    s = gcd(x, y)
    t = gcd(s, z)
    return t

ans = 0
for i in range(1, K+1):
    for j in range(i, K+1):
        for k in range(j, K+1):
            if i == j == k:
                ans += f(i, j, k)
            elif i == j or j == k:
                ans += 3 * f(i, j, k)
            else:
                ans += 6 * f(i, j, k)

print(ans)

K = int(input())

# from fractions import gcd
from math import gcd



#     return r

ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            # ans += f(i, j, k)
            ans += gcd(gcd(i, j), k)

print(ans)

Verdicts: Time Limit Exceeded

Accepted
Problem: Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}.  Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.

Submission attempts (in order):
a = int(input())
from math import gcd
b = 0
for i in range(1, n + 1):
  for j in range(1, n + 1):
    for k in range(1, n + 1):
      b += gcd(gcd(i, j), k)
      
print(b)

a = int(input())
from math import gcd
b = 0
for i in range(1, a + 1):
  for j in range(1, a + 1):
    for k in range(1, a + 1):
      b += gcd(gcd(i, j), k)
      
print(b)

Verdicts: Runtime Error

Accepted
Problem: Find \displaystyle{\sum_{a=1}^{K}\sum_{b=1}^{K}\sum_{c=1}^{K} \gcd(a,b,c)}.  Here \gcd(a,b,c) denotes the greatest common divisor of a, b, and c.

Submission attempts (in order):
from functools import reduce
from math import gcd


k = int(input())
l = range(1, k+1)
s = 0

for a in l:
    for b in l:
        for c in l:
            l = [a, b, c]
            g = reduce(gcd, l)
            s += g
            
print(s)

from math import gcd

k = int(input())
range(1, k+1)

l1 = range(1, k+1)
def loop(s):
    for a in l1:
        for b in l1:
            for c in l1:
                l2 = (a, b, c)
                g1 = gcd(a,b)
                g2 = gcd(g1, c)
                s += g2
    return s

print(loop(0))

Verdicts: Wrong Answer

Accepted