Problem:


Score : 100 points

Problem Statement

Takahashi wants to print a document with N pages double-sided, where two pages of data can be printed on one sheet of paper.

At least how many sheets of paper does he need?

Constraints

N is an integer.

1 \leq N \leq 100

Input

Input is given from Standard Input in the following format:

N

Output

Print the answer.

Sample Input 1

5

Sample Output 1

3

By printing the 1-st, 2-nd pages on the 1-st sheet, 3-rd and 4-th pages on the 2-nd sheet, and 5-th page on the 3-rd sheet, we can print all the data on 3 sheets of paper.

Sample Input 2

2

Sample Output 2

1

Sample Input 3

100

Sample Output 3

50



Sample input:
5


Sample output:
3

Submission status: Runtime Error

Solution code:
N=input("")
try:N=int(N)
if 1<=N<=100:
  if N%2==0:
    N=N/2
    N=int(N)
    print(N)
  else:
    N=(N+1)/2
    N=int(N)
    print(N)
else:
  None
except:
  None

Submission status: Runtime Error

Solution code:
N=input("")
N=int(N)
if 1<=N<=100:
  if N%2=0:
    N=N/2
    N=int(N)
    print(N)
  else:
    N=(N+1)/2
    N=int(N)
    print(N)
else:
  None

Submission status: Runtime Error

Solution code:
n = input()

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

Submission status: Runtime Error

Solution code:
N =input()

if N.isdigit() and N >= 1 and  N <= 100:
  if N % 2 == 0:
    ans = N / 2
  else:
    ans = (N - 1) / 2 + 1
  print(ans)
else:
  print('error')

Submission status: Runtime Error

Solution code:
def resolve():
    N,M = list(map(int, input().split(' ')))
    K = [-1] * N
    for i in range(M):
        s, c = list(map(int, input().split(' ')))
        if K[s-1] != -1 and K[s-1] != c:
            print('-1')
            return
        K[s-1] = c
    if K[0] == 0:
        print('-1')
        return
    ans = ""
    if N==1:
        X = max(0, K[0])
        print(max(0, K[0]))
        return

    for i in range(N):
        if i==0 and K[i]==-1:
            ans += '1'
        elif K[i] == -1:
            ans += '0'
        else:
            ans += str(K[i])
    print(ans)

resolve()

Submission status: Runtime Error

Solution code:
import sys

N, M = [int(x) for x in input().split()]
gmin = 10 ** (N - 1)
gmin = 0 if gmin == 1 else gmin
gmax = 10 ** N - 1
check = []
#print(str(gmin) + ',' + str(gmax))

def numCheck(i, check):
  for j in check:
    s, c = j.split()
    t = int(s) - 1
    if int(str(i)[t]) == int(c):
      continue
    else:
      return False
  return True


for i in range(M):
  check.append(input())

for i in range(gmin, gmax):
  if numCheck(i, check):
    print(i)
    sys.exit()
  else:
    continue
print(-1)

Submission status: Runtime Error

Solution code:
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
for _ in range(n):
    b = int(input())
    for i in range(3):
        for j in range(3):
            if a[i][j] == b:
                a[i][j]=-1
for i in range(3):
    if a[i][0]==a[i][1]==a[i][2]==-1:
        print('Yes')
        exit()
    if a[0][i]==a[1][i]==a[2][i]==-1:
        print('Yes')
        exit()
if a[0][0]==a[1][1]==a[2][2]==-1 or a[0][2]==a[1][1]==a[2][0]==-1:
    print('Yes')
    exit()
print('No')

Submission status: Runtime Error

Solution code:
import sys
n = int(sys.stdin.readline())
rem = n%2
return n/2 + 1

Submission status: Runtime Error

Solution code:
N = input()

if N%2 == 0:
  print(N/2)
else:
  print(math.floor(N/2))

Submission status: Runtime Error

Solution code:
n = input()

if n % 2 == 1:
    print(n/2 + 1)
else:
    print(n/2)

Submission status: Runtime Error

Solution code:

from collections import deque


N, M, K = map(int, input().split())
friend = [list(map(int,input().split())) for _ in range(M)]
block = [list(map(int, input().split())) for _ in range(K)]
#sys.setrecursionlimit(2*N)
#print(friend)
#print(block)
graph = [[] for _ in range(N)]
bgraph = [[] for _ in range(N)]
cnt = []
for i in range(M):
    ii, jj = friend[i]
    graph[ii-1].append(jj-1)
    graph[jj-1].append(ii-1)

for i in range(K):
    ii, jj = block[i]
    bgraph[ii-1].append(jj-1)
    bgraph[jj-1].append(ii-1)

#print(graph)
#print(bgraph)

seen = [False for _ in range(N)]

def dfs(i):
    #if i not in bgraph[j]:
    #    seen[i]= True
    #else:
    #    seen[i]="block"
    #if graph[i]:
    #    for nec in graph[i]:
    #        if seen[nec] == False:
    #            dfs(nec,j)
    seen[i] = True
    que = deque([i])
    while que:

        neci = que.pop()
        for nec in graph[neci]:
            if seen[nec]== False:
                if nec not in bgraph[i]:
                    seen[nec]=True
                else:
                    seen[nec]="block"
                que.append(nec)

for i_n in range(N):
    seen = [False for _ in range(N)]
    dfs(i_n)
    #print(seen)
    cnt.append(seen.count(True) - 1 - len(graph[i_n]))

print(*cnt)

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
_i = [input().split() for _ in range(M)]

x, h = "", 0
for _ in range(1, N+1, 1):
	y, z = 0, 0
	for idx, _j in enumerate(_i):
		if str(_) == _j[0]:
			if y:
				if z != _j[1]:
					h += 1
					break
				else:
					y += 1
					continue
			else:
				x += str(_j[1])
				z = _j[1]
				y += 1
				continue
				
		elif idx != M - 1:
			continue
		elif not y:
			x += "0"
			

if not M:
	h = 1
if h:
	x = -1

x = int(x)
if x == -1:
	print("-1")
elif x == 0:
	print("-1")
else:
	print(str(x))

Submission status: Runtime Error

Solution code:
N, M = map(int, input().split())
_i = [input().split() for _ in range(M)]

x, h = "", 0
for _ in range(1, N+1, 1):
	y, z = 0, 0
	for idx, _j in enumerate(_i):
		if str(_) == _j[0]:
			if y:
				if z != _j[1]:
					h += 1
					break
				else:
					y += 1
					continue
			else:
				x += str(_j[1])
				z = _j[1]
				y += 1
				continue
				
		elif idx != M - 1:
			continue
		elif not y:
			x += "0"
			

if not M:
	h = 1
if h:
	x = -1

x = int(x)
if not x:
	print(-1)
else:
	print(x)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(4100000)

class Uf():
    def __init__(self, n):
        self.par = [-1]*N
 
    def root(self, x):
        if self.par[x] < 0:
            return x
        
        root_x = self.root(self.par[x])
        self.par[x] = root_x
        return root_x
    
    def merge(self, a, b):
        a, b = self.root(a), self.root(b)
        
        if a == b:
            return
            
        if self.par[a] > self.par[b]:
            a, b = b, a
        
        self.par[a] += self.par[b]
        self.par[b] = a
                 
    def isSame(self, a, b):
        return self.root(a) == self.root(b)
    
    def size(self, x):
        return -self.par[self.root(x)]


N, M, K  = map(int,input().split())

exep = [[] for i in range(N)]

uf = Uf(N)

for i in range(M):
    a, b  = map(int,input().split())
    a, b = a-1, b-1 
    exep[a].append(b)
    exep[b].append(a)
    uf.merge(a, b)

for i in  range(K):
    a, b  = map(int,input().split())
    a, b = a-1, b-1
    if not uf.isSame(a,b):
        continue
    exep[a].append(b)
    exep[b].append(a)

for i in range(N):
    print(uf.size(i) - 1 - len(exep[i]), end=" ")

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(4100000)

class Uf():
    def __init__(self, n):
        self.par = list(range(N))
 
    def root(self, x):
        if self.par[x] == x:
            return x
        
        root_x = self.root(self.par[x])
        self.par[x] = root_x
        return root_x
    
    def merge(self, a, b):
        root_a, root_b = self.root(a), self.root(b)
        
        if root_a == root_b:
            return
            
        if root_a > root_b:
            root_a, root_b = root_b, root_a
        
        self.par[root_a] = root_b
    
    def isSame(self, a, b):
        return self.root(a) == self.root(b)
    
    def size(self, x):
        return self.par.count(self.par[x])


N, M, K  = map(int,input().split())

exep = [[] for i in range(N)]

uf = Uf(N)

for i in range(M):
    a, b  = map(int,input().split())
    a, b = a-1, b-1 
    exep[a].append(b)
    exep[b].append(a)
    uf.merge(a, b)

for i in  range(K):
    a, b  = map(int,input().split())
    a, b = a-1, b-1
    if not uf.isSame(a,b):
        continue
    exep[a].append(b)
    exep[b].append(a)

for i in range(N):
    uf.root(i)

for i in range(N):
    print(uf.size(i) - 1 - len(exep[i]), end=" ")

Submission status: Runtime Error

Solution code:
def main():
  a = []
  ans = "No"
  hit_examples = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]]
  for i in range(3):
    a.extend(list(map(int, input().split())))
  n = int(input())
  b = []
  for i in range(n):
    b.append(int(input()))
  for b_value in b:
    for i in range(len(a)):
      if b_value == a[i]:
        a[i] = -1

  for hit_example in hit_examples:
    cnt = 0
    for i in range(len(a)):
      if a[i] == -1 and i in hit_example:
        cnt += 1
      if cnt == 3:
        ans = "Yes"
        print(ans)
        return
  print(ans)

if __name__ == '__main__':
  main()

Submission status: Runtime Error

Solution code:
n = int(input())

if n % == 2:
    print(int(n /2))
else:
    print_out = int(n / 2) + 1
    print(print_out)

Submission status: Runtime Error

Solution code:
import math
n=int(input())
print(marh.ceil(n/2)//1)

Submission status: Runtime Error

Solution code:
import math
n=int(input())
print(marh.ceil(n/2))

Submission status: Runtime Error

Solution code:
print(ceil(int(input())/2.0))

Submission status: Runtime Error

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from functools import *
from itertools import permutations,combinations,groupby
import sys
import bisect
import string
import math
import time
import random
def Golf():*a,=map(int,open(0))
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def I():return int(input())
def MI():return map(int,input().split())
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoI():return [ord(i)-97 for i in input()]
def ItoS(nn):return chr(nn+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def GGI(h,w,search=None,replacement_of_found='.',mp_def={'#':1,'.':0}):
#h,w,g,sg=GGI(h,w,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0}) # sample usage
    mp=[1]*(w+2)
    found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[1]+[mp_def[j] for j in s]+[1]
    mp+=[1]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(k,n=2):
    rt=[]
    for tb in range(n**k):
        s=[tb//(n**bt)%n for bt in range(k)]
        rt+=[s]
    return rt
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['YES','NO']
Yn=['Yes','No']
 
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**7)
input=lambda: sys.stdin.readline().rstrip()

def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True

n=I()
h=n+2
mp= [[-2]*h]+ [[-2]+[None]*n+[-2] for i in range(n)] + [[-2]*h] 
ch=[[None]*h for i in range(h)]
gl=[]
fv=[]
for i in range(n):
    a=LI()
    for j in range(n):
        r,c=a[2*j:2*j+2]
        if (r,c)==(-1,-1):
            mp[i+1][j+1]=-1
            fv.append((i+1)*h+(j+1))
        else:
            mp[i+1][j+1]=r*h+c
            if (i+1)*h+(j+1)==mp[i+1][j+1]:
                ch[i+1][j+1]='X'
                gl.append(mp[i+1][j+1])
#show(fv,gl)
dc={-1:'R',1:'L',-h:'D',h:'U'}
while gl:
    Q=[gl.pop()]
    while Q:
        q=Q.pop()
        r,c=q//h,q%h
        for i in [+1,-1,+h,-h]:
            nr,nc=(q+i)//h,(q+i)%h
            if mp[nr][nc]==mp[r][c] and ch[nr][nc]==None:
                ch[nr][nc]=dc[i]
                Q.append(q+i)
while fv:
    Q=[fv.pop()]
    while Q:
        q=Q.pop()
        r,c=q//h,q%h
        for i in [+1,-1,+h,-h]:
            nr,nc=(q+i)//h,(q+i)%h
            if mp[nr][nc]==mp[r][c] and ch[nr][nc]==None:
                ch[nr][nc]=dc[i]
                if ch[r][c]==None:
                    ch[r][c]=dc[-i]
                Q.append(q+i)

#show(h,n)
for i in mp:
    0#show(*i)
for i in range(1,n+1):
    for j in range(1,n+1):
        if ch[i][j]==None:
            print('INVALID')
            exit()
print('VALID')
for i in range(1,n+1):
    show(*ch[i][1:n+1])

Submission status: Runtime Error

Solution code:
n = int(input())
print(math.ceil(n/2))

Submission status: Runtime Error

Solution code:
print(math.ceil(n/2))

Submission status: Runtime Error

Solution code:
s=input()
if s+%2==0:
  print(s/2)
  else:
    print((s+1)/2)

Submission status: Runtime Error

Solution code:
N = input()
print(round((N/2)+0.01))

Submission status: Runtime Error

Solution code:
print(round((N/2)+0.01))

Submission status: Runtime Error

Solution code:
print(round(N/2+0.01))

Submission status: Runtime Error

Solution code:
print(N)

Submission status: Runtime Error

Solution code:
import math

print(math.floor(N / 2) + 1 if N % 2 else math.floor(N / 2))

Submission status: Runtime Error

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

S, C = [], []
for i in range(M):
  s, c = map(int, input().split())
  S += [s-1]
  C += [str(c)]
  
if N == 1:
  for i in range(10):
    flag = 1
  for m in range(M):
      if i_str[S[m]] != C[m]:
        flag = 0
        break
    if flag:
      print(i)
      break
  else:
    print(-1) 
else:
  for i in range(10**(N-1), 10**N):
    flag = 1
    i_str = str(i)
    for m in range(M):
      if i_str[S[m]] != C[m]:
        flag = 0
        break
    if flag:
      print(i)
      break
  else:
    print(-1)

Submission status: Runtime Error

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

S, C = [], []
for i in range(M):
  s, c = map(int, input().split())
  S += [s-1]
  C += [str(c)]
  
for i in range(10**(N-1), 10**N):
  flag = 1
  i_str = str(i)
  for m in range(M):
    if i_str[S[m]] != C[m]:
      flag = 0
      break
  if flag:
    print(i)
    break
else:
  print(-1)

Submission status: Runtime Error

Solution code:
n = int(input())
if n % 2 != 0:
  print(n/2+1)
 else:
  print(n/2)

Submission status: Runtime Error

Solution code:
import math
n = input()
n = math.ceil(n / 2)
print(n)

Submission status: Runtime Error

Solution code:
a = input().split(" ")
N = int(a[0])
M = int(a[1])
ans1 = 10
ans2 = 10
ans3 = 10
x = 0
for i in range(M):
    b = input().split(" ")
    c = int(b[0])
    d = int(b[1])
    if c == 1:
        if d == 0:
            if N == 1:
                ans1 = 0
            else:
                x = 1
        elif ans1 == 10:
            ans1 = d
        elif ans1 != d:
            x = 1
    elif c == 2:
        if ans2 == 10:
            ans2 = d
        elif ans2 != d:
            x = 1
    else:
        if ans3 == 10:
            ans3 = d
        elif ans3 != d:
            x = 1
if ans1 == 10:
    ans1 = 0
if ans2 == 10:
    ans2 = 0
if ans3 == 10:
    ans3 = 0

if x == 1:
    print(-1)
else:
    if N == 1:
        print(ans1)
    elif N == 2:
        if ans1 == 0:
            print(-1)
        else:
            print(str(ans1) + str(ans2))
    else:
        if ans1 == 0:
            print(-1)
        else:
            print(str(ans1) + str(ans2) + str(ans3))

Submission status: Runtime Error

Solution code:
a = input().split(" ")
N = int(a[0])
M = int(a[1])
ans1 = 10
ans2 = 10
ans3 = 10
x = 0
for i in range(M):
    b = input().split(" ")
    c = int(b[0])
    d = int(b[1])
    if c == 1:
        if d == 0:
            if N == 1:
                ans1 = 0
            else:
                x = 1
        elif ans1 == 10:
            ans1 = d
        elif ans1 != d:
            x = 1
    elif c == 2:
        if ans2 == 10:
            ans2 = d
        elif ans2 != d:
            x = 1
    else:
        if ans3 == 10:
            ans3 = d
        elif ans3 != d:
            x = 1
if ans1 == 10:
    ans1 = 0
if ans2 == 10:
    ans2 = 0
if ans3 == 10:
    ans3 = 0

if x = 1:
    print(-1)
else:
    if N == 1:
        print(ans1)
    elif N == 2:
        if ans1 == 0:
            print(-1)
        else:
            print(str(ans1) + str(ans2))
    else:
        if ans1 == 0:
            print(-1)
        else:
            print(str(ans1) + str(ans2) + str(ans3))

Submission status: Runtime Error

Solution code:
num=int(input())
i=0
while num=>2*int(i):
	i=i+1
print(i)

Submission status: Runtime Error

Solution code:
import math

a1 = list(map(int, input().rstrip().split()))
a2 = list(map(int, input().rstrip().split()))
a3 = list(map(int, input().rstrip().split()))
a = [a1,a2,a3]

m = [[0,0,0],[0,0,0],[0,0,0]]

n = int(input())
b = []
for i in range(n) :
    b = int(input())
    for j in range(3) :
        for k in range(3) :
            if a[j][k] == b :
                m[j][k] = 1

if m[0].count(1) == 3 :
    print('Yes')
elif m[1].count(1) == 3 :
    print('Yes')
elif m[2].count(1) == 3 :
    print('Yes')
elif m[0,0] == 1 and m[1,0] == 1 and m[2,0] ==1 :
    print('YES')
elif m[0,1] == 1 and m[1,1] == 1 and m[2,1] ==1 :
    print('YES')
elif m[0,2] == 1 and m[1,2] == 1 and m[2,2] ==1 :
    print('YES')
elif m[0,0] == 1 and m[1,1] == 1 and m[2,2] ==1 :
    print('YES')
elif m[0,2] == 1 and m[1,1] == 1 and m[2,0] ==1 :
    print('YES')
else :
    print('No')

Submission status: Runtime Error

Solution code:
import math

a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
a = [a1,a2,a3]

m = [[0,0,0],[0,0,0],[0,0,0]]

n = int(input())
b = []
for i in range(n) :
    b = int(input())
    for j in range(3) :
        for k in range(3) :
            if a[j][k] == b :
                m[j][k] = 1

if a[0].count(1) == 3 :
    print('Yes')
elif a[1].count(1) == 3 :
    print('Yes')
elif a[2].count(1) == 3 :
    print('Yes')
else :
    print('No')

Submission status: Runtime Error

Solution code:
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
a = [a1,a2,a3]

m = [[0,0,0],[0,0,0],[0,0,0]]

Submission status: Runtime Error

Solution code:
import math

a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
a = [a1,a2,a3]

m = [[0,0,0],[0,0,0],[0,0,0]]

n = int(input())
b = []
for i in range(n) :
    b = int(input())
    for j in range(3) :
        for k in range(3) :
            if a[j][k] == b :
                m[j][k] =

Submission status: Runtime Error

Solution code:
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
a = [a1,a2,a3]

m = [[0,0,0],[0,0,0],[0,0,0]]

n = int(input())
b = []
for i in range(n) :
    b = int(input())
    for j in range(3) :
        for k in range(3) :
            if a[j][k] == b :
                m[j][k] = 1

if a[0].count(1) == 3 :
    print('Yes')
elif a[1].count(1) == 3 :
    print('Yes')
elif a[2].count(1) == 3 :
    print('Yes')
else :
    print('No')

Submission status: Runtime Error

Solution code:
import math

a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
a = [a1,a2,a3]

m = [[0,0,0],[0,0,0],[0,0,0]]

n = int(input())
b = []
for i in range(n) :
    b = int(input())
    for j in range(3) :
        for k in range(3) :
            if a[j][k] == b :
                m[j][k] = 1

Submission status: Runtime Error

Solution code:
a = input().split(" ")
N = int(a[0])
M = int(a[1])
ans1 = 10
ans2 = 10
ans3 = 10
for i in range(M):
    b = input().split(" ")
    c = int(b[0])
    d = int(b[1])
    if c == 1:
        if d == 0:
            if N == 1:
                ans1 = d
        elif d < ans1:
            ans1 = d
    elif c == 2:
        if d < ans2:
            ans2 = d
    else:
        if d < ans3:
            ans3 = d
if ans1 == 10:
    ans1 = 0
if ans2 == 10:
    ans2 = 0
if ans3 == 10:
    ans3 = 0
if N == 1:
    print(ans1)
elif N == 2:
    if ans1 == 0:
        print(-1)
    else:
        print(str(ans1) + str(ans2))
else:
    if ans1 == 0:
        print(-1)
    else:
        print(str(ans1) + str(ans2) + str(ans3))

Submission status: Runtime Error

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

n, m = input().split(" ")
n = int(n)
m = int(m)
s_len = []
c_len = []
dig = 10**(n-1)

for i in range(m):
    tmp = input().split(" ")
    s_len.append(int(tmp[0]))
    c_len.append(int(tmp[1]))

c_t = 0
for i in c_len:
    c_t += int(i)

for i in range(dig-1, dig*10):
    flag = False
    for j,s in enumerate(s_len):
        if str(i)[s-1] != str(c_len[j]) and flag == False:
            flag = True
            break
    if flag==False:
        print(i)
        exit()

print("-1")

Submission status: Runtime Error

Solution code:
N = map(int, input())
if N % 2 == 0:
    print(int(N / 2))
else:
    print(int(N // 2 + 1))

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<algorithm>
#include <iostream> 
#include <algorithm> 
#include<string>
#include<queue>
#include<utility>
#include<fstream>
#include<queue>
#include<set>
#include<stack>
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long int
#define I(a) scanf("%d",&a)
#define I2(a,b) scanf("%d%d",&a,&b)
#define I3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define L(a) scanf("%lld",&a)
#define L2(a,b) scanf("%lld%lld",&a,&b)
#define L3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define PI(a) printf("%d",a)
#define PL(a) printf("%lld",a)
#define PT(t) printf("Case %d: ",t)
#define PB push_back
#define x first
#define y second
#define xx first.first
#define xy first.second
#define yx second.first
#define yy second.second
#define SC scanf
#define PC printf
#define NL printf("\n")
#define SET(a) memset(a,0,sizeof a)
#define SETR(a) memset(a,-1,sizeof a)
#define SZ(a) ((int)a.size())-1
#define f(i,a,b) for(int i=a;i<=b; i++)
#define fr(i,a,b) for(int i=a;i<=b; i++)
#define frr(i,a,b) for(int i=a;i>=b; i--)
#define frv(i,a)  for(int i=0;i<a.size();i++)
#define pi 2.0*acos(0.0)
#define R(a) freopen(a, "r", stdin);
#define W(a) freopen(a, "w", stdout);
#define CB(x) __builtin_popcount(x)
#define STN(a) stringtonumber<ll>(a)
#define lol printf("BUG\n")
#define Endl "\n"
#define mk make_pair
using namespace std;
template <class T> inline T BM(T p, T e, T M)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    }
    return (T)ret;
}
template <class T> inline T gcd(T a, T b)
{
    if(b == 0)return a;
    return gcd(b, a % b);
}
template <class T> inline T mdINV(T a, T M)
{
    return BM(a, M - 2, M);
}
template <class T> inline T PW(T p, T e)
{
    ll ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p);
        p = (p * p);
    }
    return (T)ret;
}
 
 
template <class T>bool ISLEFT(T a, T b, T c)
{
    if(((a.xx - b.xx) * (b.yy - c.yy) - (b.xx - c.xx) * (a.yy - b.yy)) < 0.0)return 1;  //Uporer dike //A,b,c, x okkher ordera sorted
    else return 0;
}
 
 
typedef pair<int,int >P;
//////////////////////////
/////////////////////////
int main(){
    int n;
    cin>>n;
    cout<<(n+1)/2<<endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
N = map(int, input())
if N % 2 == 0:
    print(N / 2)
else:
    print(N // 2 + 1)

Submission status: Runtime Error

Solution code:
N = map(int, input())
N = N / 2
if N % 2 == 1:
    print(N + 1)
else:
    print(N)

Submission status: Runtime Error

Solution code:
N = map(int, input())
if N % 2 == 0:
    print(N / 2)
else:
    print(N / 2 + 1 )

Submission status: Runtime Error

Solution code:
N = map(int, input().split())
if N % 2 == 1:
    print(N / 2 + 1)
else:
    print(N / 2 )

Submission status: Runtime Error

Solution code:
N = map(int, input().split())
if N % 2 = 1:
    print(N / 2 + 1)
else:
    print(N / 2 )

Submission status: Runtime Error

Solution code:
N = map(int, input().split())
if N % 2 = 0:
    print(N / 2)
else:
    print(N / 2 + 1)

Submission status: Runtime Error

Solution code:
n =int(input())
ans = n // 2

if ans = n % 2 == 0:
  print(ans)
else:
  print(ans+1)

Submission status: Runtime Error

Solution code:
import math
a1 = list(map(int, input().split())) 
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
a = [a1,a2,a3]

N = int(input())

b = []
for i in range(N) :
    b.append(int(input()))

m = [[0,0,0],[0,0,0],[0,0,0]]

for i in range(N) :
    for j in range(3) :
        for k in range(3) :
            if b[i] == a[j][k] :
                m[j][k] = 1
                
if  m[0].count(1) == 3 or \
    m[1].count(1) == 3 or \
    m[2].count(1) == 3 or \
    [x[0] for x in m].count(1) == 3 or \
    [x[1] for x in m].count(1) == 3 or \
    [x[2] for x in m].count(1) == 3 or \
    (m[0][0] == 1 and m [1][1] == 1 and m [2][2] == 1) or \
    (m[2][0] == 1 and m [1][1] == 1 and m [2][0] == 1) :
    print('Yes')
else :
    print('No')

Submission status: Runtime Error

Solution code:
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
N = int(input())
i = 0
j = 0
k = 0

while N > 0:
  dice = int(input())
  while i < 3:
    if A[i] == int(dice):
      A[i] = "z"
      i = i + 1
  while j < 3:
    if B[j] == dice:
      B[j] = "z"
      j = j + 1
  while k < 3:
    if C[k] == dice:
      C[k] = "z"
      k = k + 1
  N = N - 1
      
if A[0] == A[1] == A[2] == "z" or B[0] == B[1] == B[2] == "z" or C[0] == C[1] == C[2] == "z" or A[0] == B[0] == C[0] == "z" or A[1] == B[1] == C[1] == "z" or A[2] == B[2] == C[2] == "z" or A[0] == B[1] == C[2] == "z" or A[2] == B[1] == C[0] == "z":
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
S = list(input())
Q = int(input())
Q_list = [input().split() for _ in range(Q)]
t_list = []
for q in Q_list:
  type = int(q[0])
  if(type==1):
    S[int(q[1])-1] = q[2]
  else:
    s, e = int(q[1]), int(q[2])
    t = 0
    str_list = []
    t = len(np.unique(S[s-1:e]))
    t_list.append(t)
[print(t) for t in t_list]

Submission status: Runtime Error

Solution code:
n = input()
print((n+1)//2)

Submission status: Runtime Error

Solution code:
x = input()
if (x % 2 == 0):
  y = x // 2
else:
  y = x//2 + 1

print(y)

Submission status: Runtime Error

Solution code:
x = input()
y = x // 2
if(x % 2 != 0):
  y += 1
  
print(y)

Submission status: Runtime Error

Solution code:
print(int(input())//2 + 1) if int(input()) % 2 else print(int(input())//2)

Submission status: Runtime Error

Solution code:
print(int(input())//2 + 1) if n % 2 else print(int(input())//2)

Submission status: Runtime Error

Solution code:
num = input()
if num % 2 == 0:
  print(num/2);
else:
  print(num+1/2);

Submission status: Runtime Error

Solution code:
kekka = ""
num = []
hantei = "OK"
INF = input().split()
gyosu = int(INF[1])
keta = int(INF[0])
out = []
for l in range(keta):
  out.append(0)


for i in range(gyosu):
  num.append([int(j) for j in input().split()])

for j in range(gyosu - 1):
  for k in range(gyosu - 1):
    if num[j][0] == num[k + 1][0]:
      if num[j][1] != num[k + 1][1]:
        hantei = "NG"
          
  if num[j][0] == keta:
    if num[j][1] == 0:
      hantei ="NG"

Submission status: Runtime Error

Solution code:
kekka = ""
num = []
hantei = "OK"
INF = input().split()
gyosu = int(INF[1])
keta = int(INF[0])
out = []
for l in range(keta):
  out.append(0)


for i in range(gyosu):
  num.append([int(j) for j in input().split()])

for j in range(gyosu - 1):
  for k in range(gyosu - 1):
    if num[j][0] == num[k + 1][0]:
      if num[j][1] != num[k + 1][1]:
        hantei = "NG"
          
  if num[j][0] == keta:
    if num[j][1] == 0:
      hantei ="NG"

if hantei == "NG":
  print("-1")
else:
  for m in range(gyosu):
    out[(num[m][0] - 1)] = num[m][1]
    #print(out)

Submission status: Runtime Error

Solution code:
kekka = ""
num = []
hantei = "OK"
INF = input().split()
gyosu = int(INF[1])
keta = int(INF[0])
out = []
for l in range(keta):
  out.append(0)


for i in range(gyosu):
  num.append([int(j) for j in input().split()])

for j in range(gyosu - 1):
  for k in range(gyosu - 1):
    if num[j][0] == num[k + 1][0]:
      if num[j][1] != num[k + 1][1]:
        hantei = "NG"
          
  if num[j][0] == keta:
    if num[j][1] == 0:
      hantei ="NG"

if hantei == "NG":
  print("-1")
else:
  for m in range(gyosu):
    out[(num[m][0] - 1)] = num[m][1]
    #print(out)

  
  
if hantei == "OK":
  print(kekka)

Submission status: Runtime Error

Solution code:
kekka = ""
num = []
hantei = "OK"
INF = input().split()
gyosu = int(INF[1])
keta = int(INF[0])
out = []
for l in range(keta):
  out.append(0)


for i in range(gyosu):
  num.append([int(j) for j in input().split()])

for j in range(gyosu - 1):
  for k in range(gyosu - 1):
    if num[j][0] == num[k + 1][0]:
      if num[j][1] != num[k + 1][1]:
        hantei = "NG"
          
  if num[j][0] == keta:
    if num[j][1] == 0:
      hantei ="NG"

if hantei == "NG":
  print("-1")
else:
  for n in range(keta):
    kekka = kekka + str(out[n])
    if n == 0 and keta != 1 :
      print("-1")
      hantei = "NG"
  
  
if hantei == "OK":
  print(kekka)

Submission status: Runtime Error

Solution code:
kekka = ""
num = []
hantei = "OK"
INF = input().split()
gyosu = int(INF[1])
keta = int(INF[0])
out = []
for l in range(keta):
  out.append(0)


for i in range(gyosu):
  num.append([int(j) for j in input().split()])

for j in range(gyosu - 1):
  for k in range(gyosu - 1):
    if num[j][0] == num[k + 1][0]:
      if num[j][1] != num[k + 1][1]:
        hantei = "NG"
          
  if num[j][0] == keta:
    if num[j][1] == 0:
      hantei ="NG"

Submission status: Runtime Error

Solution code:
kekka = ""
num = []
hantei = "OK"
INF = input().split()
gyosu = int(INF[1])
keta = int(INF[0])
out = []
for l in range(keta):
  out.append(0)


for i in range(gyosu):
  num.append([int(j) for j in input().split()])

for j in range(gyosu - 1):
  for k in range(gyosu - 1):
    if num[j][0] == num[k + 1][0]:
      if num[j][1] != num[k + 1][1]:
        hantei = "NG"
          
  if num[j][0] == keta:
    if num[j][1] == 0:
      hantei ="NG"

if hantei == "NG":
  print("-1")
else:
  for m in range(gyosu):
    out[(num[m][0] - 1)] = num[m][1]
    #print(out)
if hantei == "OK":
  print(kekka)