TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n = k()
a = l()

i=1
while i < n:
    if a[i] == a[i+1]:
        ans += 1
        i += 1
    i += 1

print(ans)


import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

n = k()
a = l()

i=1
while i < n:
    if a[i] == a[i-1]:
        ans += 1
        i += 1
    i += 1

print(ans)


Verdicts: Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
n = int(input())
a = list(map(int,input().split()))
a.append(10**10)
counter = 1
ans = 0
for i in range(n):
    if a[i] == a[i+1]:
        counter += 1
    else:
        if counter %2 == 0 and counter != 1 :
            ans += counter/2
        elif counte %2 != 0 and counter != 1:
            ans += int(counter/2)
        counter = 1
print(int(ans))


n = int(input())

a = list(map(int,input().split()))
a.append(10**10)
counter = 1
ans = 0
for i in range(n):
    if a[i] == a[i+1]:
        counter += 1
    else:
        if counter %2 == 0 and counter != 1 :
            ans += counter/2
        elif counte %2 != 0 and counter != 1:
            ans += int(counter/2)
        counter = 1
print(int(ans))

n = int(input())
a = list(map(int,input().split()))
a.append(10**10)
counter = 1
ans = 0
for i in range(n):
    if a[i] == a[i+1]:
        counter += 1
    else:
        if counter %2 == 0 and counter != 1 :
            ans += counter/2
        elif counter %2 != 0 and counter != 1:
            ans += int(counter/2)
        counter = 1
print(int(ans))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
n = int(input())
slime = [int(x) for x in input().split()]

pre = slime[0]
border = [i for i in range(n-1) if slime[i] != slime[i+1]]


if border:
  count = sum([(border[i+1] - border[i]) // 2 for i in range(len(border) - 1)])
else:
  count = n // 2
print(count) 

n = int(input())
slime = [int(x) for x in input().split()]
border = [0] + [i+1 for i in range(n-1) if slime[i] != slime[i+1]]

if len(border):
  border.append(n)
  count = sum([(border[i+1] - border[i]) // 2 for i in range(len(border) - 1)])
else:
  count = n // 2

print(count)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
n = input()
a=list(map(int, input().split()))
t=a[0]
s=0
Ans=0
for i in range(1,n):
  if t==a[i]:
    s+=1
  else:
    Ans+=s//2
    s=0
  t=a[i]
print(Ans)
  
  
  

n = int(input())
a=list(map(int, input().split()))
t=a[0]
s=0
Ans=0
for i in range(1,n):
  if t==a[i]:
    s+=1
  else:
    Ans+=s//2
    s=0
  t=a[i]
print(Ans)
  
  
  


x = int(input())
b =0
a=list(map(int, input().split()))
if x == 2 and a[0]==a[1]:b=1
a.insert(0,-1)
a.append(-1)
a.append(-2)
i = 2
while i <=x:
    if a[i] == a[i+1]:
        if a[i] == a[i-1]:b+=1
        else:b+=1
        a[i] = -3
        i+=1
    i+=1
print(b)

x = int(input())
b =0
a=list(map(int, input().split()))
if x == 2 and a[0]==a[1]:b=1
a.insert(0,-1)
a.append(-1)
a.append(-2)
i = 2
while i <=x:
    if a[i] == a[i-1]:
        if a[i] == a[i+1]:b+=2
        else:b+=1
        a[i] = -3
        i+=1
    i+=1
print(b)

n = int(input())
a=list(map(int, input().split()))
t=a[0]
s=1
Ans=0
for i in range(1,n):
  if t==a[i]:
    s+=1
  else:
    Ans+=s//2
    s=1
  t=a[i]
print(Ans)
  
  
  


n = int(input())
a=list(map(int, input().split()))
t=a[0]
s=1
Ans=0
for i in range(1,n):
  if t==a[i]:
    s+=1
  else:
    Ans+=s//2
    s=1
  t=a[i]
Ans+=s//2
print(Ans)
  
  
  


Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))

cnt = 0
pre = 0
for i in range(n):
    if prev == a[i]:
        cnt += 1
        prev = 0
    else:
        prev = a[i]

print(cnt)

n = int(input())
a = list(map(int, input().split()))

cnt = 0
prev = 0
for i in range(n):
    if prev == a[i]:
        cnt += 1
        prev = 0
    else:
        prev = a[i]

print(cnt)

Verdicts: Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
n = int(input())
arr = list(map(int, input().split()))
from numpy import random
b = 0
for i in range (len(a) - 1) :
  if a[i] == a[i + 1]:
    b += 1
    a[i + 1] = random.randint(10000)
print(b)


from numpy import random
n = int(input())
a = list(map(int, input().split()))
b = 0
for i in range (len(a) - 1) :
  if a[i] == a[i + 1]:
    b += 1
    a[i + 1] = random.randint(10000)
print(b)


Verdicts: Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))

i=1
count=0

while i<n:
  if a[i]=a[i-1]:
    count+=1
    i+=2
  else:
    i+=1

print(count)

n = int(input())
a = list(map(int,input().split()))

i = 1
count = 0

while i < n:
  if a[i] = a[i-1]:
    count += 1
    i += 2
    else:
      i += 1

print(count)

n=int(input())
a=list(map(int,input().split()))

i=1
count=0

while i<n:
  if a[i]==a[i-1]:
    count+=1
    i+=2
  else:
    i+=1

print(count)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
n = int(input())
a = list(map(int,input().split()))

c = 0
i = 0
ans = 0
while i < n:
    if a[i] == a[i+1]:
        c += 1
        i += 1
    else:
        ans += c//2
        c = 0
        i += 1
print((ans+c//2,ans)[c==0])

n = int(input())
a = list(map(int,input().split()))

c = 0
i = 0
ans = 0
while i < n-1:
    if a[i] == a[i+1]:
        c += 1
        i += 1
    else:
        ans += (c+1)//2
        c = 0
        i += 1
print((ans+(c+1)//2,ans)[c==0])

Verdicts: Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
N = int(input())
L = list(map(int, input().split()))
d = [(L[i+1]-L[i]) for i in range(len(L)-1)]
b = False
c = 0
ans = 0
for i in d:
    if i==0:
        b = True
    else :
        b = False
    if b:
        c += 1
    else :
        ans += (-(-c//2))
        c = 0
print(ans)

N = int(input())
L = list(map(int, input().split()))
d = [(L[i+1]-L[i]) for i in range(len(L)-1)]
b = False
c = 0
ans = 0
for i in d:
    if i==0:
        b = True
    else :
        b = False
    if b:
        c += 1
    else :
        ans += (-(-c//2))
        c = 0
if b:
    ans += (-(-c//2))
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]

count = 0
tmp = 1
for i in range(1, N+1):
    if A[i] == A[i - 1]:
        tmp += 1
    else:
        
        count += tmp // 2
        tmp = 1  

print(count)


#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(input())
A = [int(i)for i in input().split()]

count = 0
i = 1
while i <= (N-1):
    if A[i] == A[i - 1]:
        j = i + 1
        if j <= (N-1):
            while True:
                if A[j] == A[j - 1]:
                    count += 1
                    j += 1
                else:
                    count += 2
                    i = j
                    break
        else:
            count += 2
            break
    else:
        i += 1

print(count // 2)


#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(input())
A = [list(map(int, input().split())) for _ in range(N)]

count = 0
tmp = 1
for i in range(1, N):
    if A[i] == A[i - 1]:
        tmp += 1
    else:
        
        count += tmp // 2
        tmp = 1  

print(count)


#!/usr/bin/env python
# -*- coding: utf-8 -*-

N = int(input())
A = [int(i) for i in input().split()] + [0]

count = 0
tmp = 1
for i in range(1, N+1):
    if A[i] == A[i - 1]:
        tmp += 1
    else:
        
        count += tmp // 2
        tmp = 1  

print(count)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
iN = int(input())
aS = map(int,input().split())

iCounter = 0
for i in range(1,iN-1):
  if aS[i] == aS[i-1]:
    if aS[i] == aS[i+1]:
      aS[i] += 1
      iCounter += 1
    else:
      iU = max(aS[i],aS[i+1])
      if iU < 10000:
        iU += 1
      else:
        while iU not in aS[i:i+2]:
          iU -= 1
      aS[i] = iU
      iCounter += 1
print(iCounter)

iN = int(input())
aS = [int(x) for x in input().rstrip().split()]







iCounter = 0
if iN == 2:
    if aS[0] == aS[1]:
        iCounter += 1
else:
    for i in range(1,iN-1):
        if aS[i] == aS[i-1]:
            if aS[i] == aS[i+1]:
                if aS[i] < 10000:
                    aS[i] += 1
                else:
                    aS[i] -= 1
                iCounter += 1
            else:
                iU = max(aS[i],aS[i+1])
                if iU < 10000:
                    iU += 1
                else:
                    iU -= 1
                    if iU == min(aS[1],aS[i+1]):
                        iU -= 1
                aS[i] = iU
                iCounter += 1
    if aS[iN-2] == aS[iN-1] :
        iCounter += 1
print(iCounter)


Verdicts: Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
n=int(input())
from itertools import groupby as gb
ans=0
for a,b in gb(list(map(int,input().split()))):
    ans+=b//2
print(ans)

n=int(input())
from itertools import groupby as gb
ans=0
for a,b in gb(list(map(int,input().split()))):
    ans+=len(list(b)) //2
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
N = int(input())
l = list(map(int,input().split(" ")))
num_n =[]
i=1
for j in range(N-1):
    if l[j] == l[j+1]:
        i+=1
    else:
        num_n.append(int(i/2))
        i=1
print(sum(num_n))

N = int(input())
l = list(map(int,input().split(" ")))
num_n =[]
i=1
for j in range(N-1):
    if l[j] == l[j+1]:
        i+=1
    else:
        num_n.append(int(i/2))
        i=1
num_n.append(int((i+0.1)/2))
print(sum(num_n))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
a = [0] + a
for i in range(n):
    if a[i+1] == a[i]:
        a[i] = -1
print(a.count(-1))

n = int(input())
a = list(map(int, input().split()))
a = [0] + a
for i in range(n):
    if a[i+1] == a[i]:
        a[i+1] = -1
print(a.count(-1))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
import math
n = int(input())
A = [int(i) for i in input().split()]
cnt, ans = 0, 0
for i in range(n):
  if A[i] == A[i+1]:
    cnt += 1
  else:
    ans += math.floor((cnt+1)/2)
    cnt = 0
print(ans)

import math
n = int(input())
A = [int(i) for i in input().split()]
cnt, ans = 0, 0
for i in range(n-1):
  if A[i] == A[i+1]:
    cnt += 1
    if i == n-2:
      ans += math.floor((cnt+1)/2)
  else:
    ans += math.floor((cnt+1)/2)
    cnt = 0
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
T = int(input())
a = []
for i in range(T):
    a.append(list(map(int, input().split())))
for r in a:
    s, b, c, d = r[0], r[1], r[2], r[3]
    mod_list = []
    if (s < b) or (b>d):
        print('No')
        continue
    if (c>b):
        print('Yes')
        continue
    while True:
        s = s%b
        if s > c:
            print('No')
            break
        s += d
        if s in mod_list:
            print('Yes')
            break
        mod_list.append(s)

T = int(input())
a = []
for i in range(T):
    a.append(list(map(int, input().split())))
for r in a:
    s, b, c, d = r[0], r[1], r[2], r[3]
    mod_list = []
    if (s < b) or (b>d):
        print('No')
        break
    if (c>b):
        print('Yes')
        break
    while True:
        s = s%b
        if s > c:
            print('No')
            break
        s += d
        if s in mod_list:
            print('Yes')
            break
        mod_list.append(s)

N = map(int, input())
a = list(map(int, input().split()))
all_set = set(range(1, 10000))

use_set = list(set(all_set - set(a)))

count = 0
for i in range(len(a)-1):
    if a[i] == a[i+1]:
        a[i+1] = use_set[0]
        use_set = use_set[1:]
        count += 1
    
print(count)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
N = input()
data = input().split()
bef = -1
count = 0
result = 0

for i in range(len(data)):
	t = int(data[i])
	if bef != t:
		if count > 1:
			result += int(count) / 2
			print(result)
		count = 1
		bef = t
	else:
		count += 1

if count > 1:
	result += int(count / 2)
print(result)

N = input()
data = input().split()
bef = -1
count = 0
result = 0

for i in range(len(data)):
	t = int(data[i])
	if bef != t:
		if count > 1:
			result += int(count) / 2
		count = 1
		bef = t
	else:
		count += 1

if count > 1:
	result += int(count / 2)
print(result)

N = input()
data = input().split()
bef = -1
count = 0
result = 0

for i in range(len(data)):
	if bef != data[i]:
		if count > 1:
			result += int(count) / 2
		count = 1
		bef = data[i]
	else:
		count++

print(result)

N = input()
data = int(input().split())
bef = -1
count = 0
result = 0

for i in range(len(data)):
	if bef != data[i]:
		if count > 1:
			result += int(count) / 2
		count = 1
		bef = data[i]
	else:
		count++

print(result)

N = input()
data = input().split()
bef = -1
count = 0
result = 0

for i in range(len(data)):
	t = int(data[i])
	if bef != t:
		if count > 1:
			result += int(count / 2)
		count = 1
		bef = t
	else:
		count += 1

if count > 1:
	result += int(count / 2)
print(result)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
n=int(input())
a=[]
a=map(int,input().split())
ans=0
flag=0
changeflag=[]
changeflag.append(0)
for i in range(n-1):
    if a[i]==a[i+1]:
        if i==0:
            changeflag.append(1)
            ans+=1
        elif changeflag[i-1]==1:
            changeflag.append(0)
        else:
            ans+=1
            changeflag.append(1)
    else:
        changeflag.append(0)
print(ans)


n=int(input())
a=list(map(int,input().split()))
ans=0
changeflag=[]
for i in range(n-1):
    if a[i]==a[i+1]:
        if i==0 or changeflag[i-1]==0:
            changeflag.append(1)
        else:
            changeflag.append(0)
    else:
        changeflag.append(0)
print(changeflag.count(1))


Verdicts: Runtime Error

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
tmp = 1
res = 0
for i in range(1,n):
  if a[i-1] == a[i]:
    tmp += 1
  else:
    res += tmp//2
    tmp = 1
print(res)

n = int(input())
a = list(map(int, input().split()))
tmp = 1
res = 0
for i in range(1,n):
  if a[i-1] == a[i]:
    tmp += 1
  else:
    res += tmp//2
    tmp = 1
res += tmp//2
print(res)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi lives in another world. There are slimes (creatures) of 10000 colors in this world. Let us call these colors Color 1, 2, ..., 10000.  Takahashi has N slimes, and they are standing in a row from left to right. The color of the i-th slime from the left is a_i. If two slimes of the same color are adjacent, they will start to combine themselves. Because Takahashi likes smaller slimes, he has decided to change the colors of some of the slimes with his magic.  Takahashi can change the color of one slime to any of the 10000 colors by one spell. How many spells are required so that no slimes will start to combine themselves?

Submission attempts (in order):
def main(n: int, a: list):
    prev = [0, 0]
    ans = 0

    for _a in a:
        if _a == prev[0]:
            if prev[1] % 2 == 0:
                ans += 1

            prev[1] += 1
        else:
            prev = [_a, 0]

    print(ans)


if __name__ == '__main__':
    n = int(input())
    a = map(int(input().split()))

    main(n, a)


def main(n: int, a: list):
    prev = [0, 0]
    ans = 0

    for _a in a:
        if _a == prev[0]:
            if prev[1] % 2 == 0:
                ans += 1

            prev[1] += 1
        else:
            prev = [_a, 0]

    print(ans)


if __name__ == '__main__':
    n = int(input())
    a = map(int, input().split())

    main(n, a)


Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length 2N consisting of lowercase English letters.  There are 2^{2N} ways to color each character in S red or blue. Among these ways, how many satisfy the following condition?    * The string obtained by reading the characters painted red **from left to right** is equal to the string obtained by reading the characters painted blue **from right to left**.

Submission attempts (in order):
from collections import defaultdict
N = int(input())
S = input()
countp = defaultdict(int)
counts = defaultdict(int)
prefix = S[:N]
suffix = S[2*N-1:N-1:-1]
for i in range(1 << (N - 1)):
    p1 = ''
    s1 = ''
    p2 = ''
    s2 = ''
    for j in range(N):
        if (1 << j) & i:
            p1 += prefix[j]
            s1 += suffix[j]
        else:
            p2 += prefix[j]
            s2 += suffix[j]
    countp[(p1, p2)] += 1
    countp[(p2, p1)] += 1
    counts[(s1, s2)] += 1
    counts[(s2, s1)] += 1
    

print(countp, counts)

ans = 0
for k, v in countp.items():
    ans += v * counts[k]

print(ans)

from collections import defaultdict
N = int(input())
S = input()
countp = defaultdict(int)
counts = defaultdict(int)
prefix = S[:N]
suffix = S[2*N-1:N-1:-1]
for i in range(1 << (N - 1)):
    p1 = ''
    s1 = ''
    p2 = ''
    s2 = ''
    for j in range(N):
        if (1 << j) & i:
            p1 += prefix[j]
            s1 += suffix[j]
        else:
            p2 += prefix[j]
            s2 += suffix[j]
    countp[(p1, p2)] += 1
    countp[(p2, p1)] += 1
    counts[(s1, s2)] += 1
    counts[(s2, s1)] += 1
    

# print(countp, counts)

ans = 0
for k, v in countp.items():
    ans += v * counts[k]

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length 2N consisting of lowercase English letters.  There are 2^{2N} ways to color each character in S red or blue. Among these ways, how many satisfy the following condition?    * The string obtained by reading the characters painted red **from left to right** is equal to the string obtained by reading the characters painted blue **from right to left**.

Submission attempts (in order):
N = int(input())
S = input()
S_l = S[:N]
S_r = S[N:][::-1]
dict_l = {}
dict_r = {}
ans = 0
for num in range(2**N):
  tmpl_1 = ""
  tmpl_2 = ""
  tmpr_1 = ""
  tmpr_2 = ""
  for n in range(N):
    if (num >> (N-1-n) & 1):
      tmpl_1 += S_l[n]
      tmpr_1 += S_r[n]
    else:
      tmpl_2 += S_l[n]
      tmpr_2 += S_r[n]
  dict_l[[tmpl_1,tmpl_2]] = dict_l.get([tmpl_1,tmpl_2], 0) + 1
  dict_r[[tmpr_1,tmpr_2]] = dict_r.get([tmpr_1,tmpr_2], 0) + 1
for k, v in dict_l.items():
  ans += v*dict_r.get(k,0)
print(ans)


N = int(input())
S = input()
S_l = S[:N]
S_r = S[N:][::-1]
dict_l = {}
dict_r = {}
ans = 0
for num in range(2**N):
  tmpl_1 = ""
  tmpl_2 = ""
  tmpr_1 = ""
  tmpr_2 = ""
  for n in range(N):
    if (num >> (N-1-n) & 1):
      tmpl_1 += S_l[n]
      tmpr_1 += S_r[n]
    else:
      tmpl_2 += S_l[n]
      tmpr_2 += S_r[n]
  dict_l[tmpl_1+"_"+tmpl_2] = dict_l.get(tmpl_1+"_"+tmpl_2, 0) + 1
  dict_r[tmpr_1+"_"+tmpr_2] = dict_r.get(tmpr_1+"_"+tmpr_2, 0) + 1
for k, v in dict_l.items():
  ans += v*dict_r.get(k,0)
print(ans)



Verdicts: Runtime Error

Accepted
Problem: You are given a string S of length 2N consisting of lowercase English letters.  There are 2^{2N} ways to color each character in S red or blue. Among these ways, how many satisfy the following condition?    * The string obtained by reading the characters painted red **from left to right** is equal to the string obtained by reading the characters painted blue **from right to left**.

Submission attempts (in order):
from collections import defaultdict as dd

n = int(input())
_s = list(map(ord, list(input())))
s,t = _s[:n], _s[:n-1:-1]
d = dict()
mod = 10**9 + 9

def get(st):
  for bit in range(1<<n):
    u = v = 0
    for j,e in enumerate(s):
      if bit & (1<<j):
        u = (u*100 + e)%mod
      else:
        v = (v*100 + e)%mod
    yield (u,v)

ans = 0
d = dd(int)
for x in get(s): d[x] += 1
for x in get(t): ans += d[x]
print(ans)

from collections import defaultdict as dd

n = int(input())
_s = list(map(ord, list(input())))
s,t = _s[:n], _s[:n-1:-1]
d = dict()
mod = 10**9 + 9

def get(st):
  for bit in range(1<<n):
    u = v = 0
    for j,e in enumerate(st):
      if bit & (1<<j):
        u = (u*100 + e)%mod
      else:
        v = (v*100 + e)%mod
    yield (u,v)

ans = 0
d = dd(int)
for x in get(s): d[x] += 1
for x in get(t): ans += d[x]
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length 2N consisting of lowercase English letters.  There are 2^{2N} ways to color each character in S red or blue. Among these ways, how many satisfy the following condition?    * The string obtained by reading the characters painted red **from left to right** is equal to the string obtained by reading the characters painted blue **from right to left**.

Submission attempts (in order):
import itertools
N=int(input())
S=input()
ans=0
L=dict()
R=dict()
for seq in itertools.product([0,1],repeat=N):
    T0=""
    T1=""
    T2=""
    T3=""
    for i in range(N):
        if seq[i]==0:
            T0+=S[i]
            T2+=S[-i-1]
        else:
            T1+=S[i]
            T3+=S[-i-1]
    a0=len(T0)
    a1=len(T1)
    a2=len(T2)
    a3=len(T3)
    L[(T0,T1)]=L.get((T0,T1),0)+1
    R[(T0,T1)]=R.get((T0,T1),0)+1
for tup in L:
    if tup in R:
        ans+=L[tup]*R[tup]
print(ans)


import itertools
import bisect
N=int(input())
S=input()
ans=0
L=dict()
R=dict()
for seq in itertools.product([0,1],repeat=N):
    T0=""
    T1=""
    T2=""
    T3=""
    for i in range(N):
        if seq[i]==0:
            T0+=S[i]
            T2+=S[-i-1]
        else:
            T1+=S[i]
            T3+=S[-i-1]
    a0=len(T0)
    a1=len(T1)
    a2=len(T2)
    a3=len(T3)
    if (T0,T1) in L:
        L[(T0,T1)]+=1
    else:
        L[(T0,T1)]=1
    if (T2,T3) in R:
        R[(T2,T3)]+=1
    else:
        R[(T2,T3)]=1
for tup in L:
    if tup in R:
        ans+=L[tup]*R[tup]
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: You are given a string S of length 2N consisting of lowercase English letters.  There are 2^{2N} ways to color each character in S red or blue. Among these ways, how many satisfy the following condition?    * The string obtained by reading the characters painted red **from left to right** is equal to the string obtained by reading the characters painted blue **from right to left**.

Submission attempts (in order):
import collections

n = int(input())
s = input()

s1 = s[:n]
s2 = s[-1:-(n + 1):-1]

s_1 = collections.defaultdict(int)
s_2 = collections.defaultdict(int)
for i in range(2 ** n):
    bin_i = bin(i + 2 ** n)
    sequence1 = ""
    sequence1_inverse = ""
    sequence2 = ""
    sequence2_inverse = ""
    for j in range(n):
        if bin_i[j + 3] == "1":
            sequence1 += s1[j]
            sequence2 += s2[j]
        else:
            sequence1_inverse += s1[j]
            sequence2_inverse += s2[j]
    s_1[(sequence1, sequence1_inverse)] += 1     
    s_2[(sequence2, sequence2_inverse)] += 1
ans = 0
print(ans)




import collections

n = int(input())
s = input()

s1 = s[:n]
s2 = s[-1:-(n + 1):-1]

s_1 = collections.defaultdict(int)
s_2 = collections.defaultdict(int)h
for i in range(2 ** n):
    bin_i = bin(i + 2 ** n)
    sequence1 = ""
    sequence1_inverse = ""
    sequence2 = ""
    sequence2_inverse = ""
    for j in range(n):
        if bin_i[j + 3] == "1":
            sequence1 += s1[j]
            sequence2 += s2[j]
        else:
            sequence1_inverse += s1[j]
            sequence2_inverse += s2[j]
    s_1[sequence1 + "-" + sequence1_inverse] += 1     
    s_2[sequence2 + "-" + sequence2_inverse] += 1
ans = 0
for i in dict(s_1):
    ans += s_1.get(i, 0) * s_2.get(i, 0)
    
print(ans)


import collections

n = int(input())
s = input()

s1 = s[:n]
s2 = s[-1:-(n + 1):-1]

s_1 = collections.defaultdict(int)
s_2 = collections.defaultdict(int)
for i in range(2 ** n):
    bin_i = bin(i + 2 ** n)
    sequence1 = ""
    sequence1_inverse = ""
    sequence2 = ""
    sequence2_inverse = ""
    for j in range(n):
        if bin_i[j + 3] == "1":
            sequence1 += s1[j]
            sequence2 += s2[j]
        else:
            sequence1_inverse += s1[j]
            sequence2_inverse += s2[j]
    s_1[sequence1 + "-" + sequence1_inverse] += 1     
    s_2[sequence2 + "-" + sequence2_inverse] += 1
ans = 0
for i in dict(s_1):
    ans += s_1.get(i, 0) * s_2.get(i, 0)
    
print(ans)


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: You are given a string S of length 2N consisting of lowercase English letters.  There are 2^{2N} ways to color each character in S red or blue. Among these ways, how many satisfy the following condition?    * The string obtained by reading the characters painted red **from left to right** is equal to the string obtained by reading the characters painted blue **from right to left**.

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

sl = s[:n]
sr = s[:n-1:-1]

from collections import Counter
l = Counter()
r = Counter()

from itertools import product
for m in product([False, True], repeat=n):
  key = [sl[i] for i in range(n) if not m[i]]
  key += ['-']
  key += [sl[i] for i in range(n) if m[i]]
  l[''.join(key)] += 1
  
  key = ''.join([sr[i] for i in range(n) if not m[i]])
  key += '-'
  key += ''.join([sr[i] for i in range(n) if m[i]])
  r[key] += 1
  
ans = sum(l[lk] * r[lk] for lk in l.keys())
print(l)
print(ans)

n = int(input())
s = input()

sl = s[:n]
sr = s[n:][::-1]

from collections import Counter
l = Counter()
r = Counter()

from itertools import product
for m in product([False, True], repeat=n):
  key = [sl[i] for i in range(n) if not m[i]]
  key += ['-']
  key += [sl[i] for i in range(n) if m[i]]
  l[''.join(key)] += 1
  
  key = [sr[i] for i in range(n) if not m[i]]
  key += ['-']
  key += [sr[i] for i in range(n) if m[i]]
  r[''.join(key)] += 1
  
ans = sum(l[lk] * r[lk] for lk in l.keys())

print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
N=int(input())
if N % 2 = 0:
  print(N)
else:
  print(N*2)

N=int(input())
if N // 2 = 0:
  print(N)
else:
  print(2*N)

N=int(input())
if N // 2 = 0:
  print(N)
else:
  print(N*2)

N=int(input())
if N % 2 == 0:
  print(N)
else:
  print(N*2)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
n=int(input())
if n%2=0:
  print(n)
else:
  print(2*n)

n=int(input())
if n%2==0:
  print(n)
else:
  print(2*n)

Verdicts: Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
n = int(input()) 
row = map(int, input().split())
max = row[0]
min = 0

for i in range(n-1):
    if(row[i] < row[i+1]):
        max = row[i+1]

for i in range(n-1):
    if(row[i] > row[i+1]):
        min = row[i+1]

print(max-min)
    




if N%2==0:
    print(2)
else:
    print(2*N)

n = int(input()) 
row = input().split()
max = row[0]
min = row[0]


    for i in range(n-1):
        if(max < row[n-1]):
            max = row[n-1]


    for i in range(n-1):
        if(min > row[n-1]):
            min = row[n-1]


print (min)
    




n = int(input()) 
row = input().split()
max = row[0]
min = row[0]

for j in range(n-1):
    for i in range(n-1):
        if(row[j] < row[i+1]):
            max = row[i+1]


    for i in range(n-1):
        if(min > row[n-1]):
            min = row[n-1]


print (int(max)-int(min))
    



n = int(input()) 
row = input().split()
max = row[0]
min = row[0]


for i in range(n-1):
        if(max < row[i]):
            max = row[i]

for i in range(n-1):
        if(min > row[i]):
            min = row[i]


print (int(max)-int(min))
    





n = int(input()) 
row = input().split()
max = row[0]
min = row[0]

for i  in range(n-1):
    if(row[i] < row[i+1]):
        max = row[i+1]

for i in range(n-1):
    if(row[i] > row[i+1]):
        min = row[i+1]


print(int(max)-int(min))
    


n = int(input())

if (n%2 == 0):
    print(n)
else:
    print(2*n)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def main():
	N = input()
	while i % 2 == 0:
      i = N / 2
	print(i*2)

if __name__ == '__main__':
	main()



#!/usr/bin/env python3
# -*- coding: utf-8 -*-
 
def main():
	N = int(input())
	if N % 2 == 0:
		print(int(N))
	else:
		print(int(N*2))
 
if __name__ == '__main__':
	main()

Verdicts: Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
from statistics import median

n = input()
a = list(map(int, input().split()))

b = [v - (i + 1) for i, v in enumerate(a)]

median = int(median(b))

c = sum(abs(v - median) for v in b)

print(c)


n = int(input())

if n % 2 == 0:
    print(n)
else:
    print(n * 2)

Verdicts: Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
n=int(input())
if n%2:
  print(n)
else:
  print(n*2)

n=int(input())
if n%2:
  print(n*2)
else:
  print(n)

Verdicts: Wrong Answer

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
# -*-coding=utf-8-*-
n = int(input))
if n%2:
    n *= 2
print(n)

line = input()
X = [int(n) for n in line.split()]

smaller_divisible_number = X
if num%2 != 0:
    smaller_divisible_number *= 2
print(smaller_divisible_number)

#!/usr/bin/env python3
numero = int(input("escreva o numero "))
if (numero % 2) == 0:
  print(numero)
else:
  print(numero * 2)


line = input()
num = [int(n) for n in line.split()][0]
print(num)
smaller_divisible_number = num
if num%2 != 0:
    smaller_divisible_number *= 2
print(smaller_divisible_number)

a = int(input())

if a % 2:
    print(a*2)
else:
    print(a)


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
n=int(input())
A=list(map(int,input().split()))
q=0
Z=[]
for b in range(max(A)-min(A)):
  q=0
  for j in range(n):
    q+=abs(A[j]-b-min[A]-j-1)
  Z.append(q)
print(min(Z))


n=int(input())
if n%2==0:
  print(n)
else:
  print(n*2)


Verdicts: Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

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

if N%==0:
  print(N)
else:
  print(2*N)

N=int(input())

if N%2==0:
  print(N)
else:
  print(2*N)

Verdicts: Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
n = int(input())
n_list = list(map(int,input().split()))
n_list.sort()
print(n_list[-1] - n_list[0])

n = input()
if n%2 == 0:
  print(n)
else :
  print(n*2)

n = int(input())
if n%2 == 0:
  print(n)
else :
  print(n*2)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

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

if n % 2 == 0:
  print(n)
else:
  print(n * 2)

n = int(input())

if n % 2 == 0:
  print(n)
else:
  print(n * 2)

Verdicts: Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
n=input()
if n%2 == 0:
 print(n)
else:
 print(n*2)

n = int(input())
if n % 2 == 0:
  print(n)
else:
  print(n*2)

Verdicts: Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
xN =int(input())
l = N * 2
if N % 2 == 0:
    print(N)
else:
    print(N*2)

N =int(input())
l = N * 2
if N % 2 == 0:
    print(N)
else:
    print(N*2)
# if 2 * N % 0 and N * N % 0

Verdicts: Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = A[i] - i - 1
A = sorted(A)
medN = N//2
x = 0
for i in range(N):
    x = x + abs(A[i] - A[medN])
print(x)

N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    A[i] = A[i] - i-1
sorted(A)
halfN = int(N/2)
x = 0
for i in range(N):
    x = x + abs(A[i] - A[halfN])
print(x)

N = int(input())
z = N
if N % 2 != 0:
    z = 2 * N
print(z)


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
n = int(input(9))
if n % 2 == 0:
    print(n)
else:
    print(n*2)

n = int(input())
if n % 2 == 0:
    print(n)
else:
    print(n*2)


Verdicts: Wrong Answer

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
k = 0
S = 0

if N%2 == 0:
    k = (N+1)*N//2
else:
    k = (N+1)*(N//2)+(N+1)//2

Sum_A = sum(A)    
b = (sum_A-k)//N

print(sum_A-(b*N+k))

N = int(input())
if N%2 == 0:
    print(N)
else:
    print(N*2)

Verdicts: Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
n = int(input())
a = sorted(map(int,input().split()))
print(a[n-1]-a[0])

n = int(input())
if n % 2 == 0:
	print(n)
else:
  	print(n*2)

Verdicts: Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
N=int(input())
if N%2=0:
    ans=N
else:
    ans=N*2
print(ans)

N=int(input())
if N%2==0:
    ans=N
else:
    ans=N*2
print(ans)


Verdicts: Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
n=int(input())
if n%2==0:
  print(n)
else:
  print(2n)

n=int(input())
if n%2==0:
  print(n)
else:
  print(2*n)

Verdicts: Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
N=int(input())
a=list (map(int,input().split()))
abs_list=[]
for b in range(-max(a),max(a)):
	c=0
	for i in range(N):
		c=abs(a[i]-(b+i+1))+c	
	abs_list.append(c)		
print(min(abs_list))	

N=int(input())
a=list (map(int,input().split()))
abs_list=[]
for b in range(-max(a),max(a)):
	c=0
	for i in range(N):
		c=abs(a[i]-(b+i+1))+c	
	abs_list.append(c)	
print(abs_list)	
print(min(abs_list))	

N=int(input())
if N%2==0:
	print(N)
else:
	print	(2*N)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
n=int(input())
if n%2==0:print(n)
else:print(n//2)

n=int(input())
if n%2==0:print(n)
else:print(2*n)

Verdicts: Wrong Answer

Accepted
Problem: You are given a positive integer N. Find the minimum positive integer divisible by both 2 and N.

Submission attempts (in order):
a=2
b=int(input())
x=a*b
if a>b:
    tmp=a
    b=a
    a=tmp
r=b%a
while r!=0:
    a=b
    b=r
    r=a%b
print(x/b)

n = int(input())
if n % 2 == 0:
    print(str(n))
else:
    print(str(n*2))

Verdicts: Wrong Answer

Accepted