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:
print((input() + 1) // 2)

Submission status: Runtime Error

Solution code:
n = int(intput())
res = n // 2
if n % 2 == 1:
  res += 1
print(res)

Submission status: Runtime Error

Solution code:
n = int(intput())
res = n // 2
if n % 2 == 1:
  res += 1
print(res)

Submission status: Runtime Error

Solution code:
n = int(intput())
res = n // 2
if res % 2 == 1:
  res += 1
print(res)

Submission status: Runtime Error

Solution code:
n = int(intput())

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

Submission status: Runtime Error

Solution code:
n = int(input())

res = n //2 

if n%2 == 1:
  res += 1
  
return res

Submission status: Runtime Error

Solution code:
n = int(input())

res = n//2
if res % 2 == 1:
  res += 1

return res

Submission status: Runtime Error

Solution code:
a1=list(map(int,input().split()))
a2=list(map(int,input().split()))
a3=list(map(int,input().split()))
 
for j in range(int(input())):
    X=int(input())
    for i in range(3):
        if X in a1:
            num=a1.index(X)
            a1[num]=[0]
        
        elif X in a2:
            num=a2.index(X)
            a2[num]=[0]
            
        elif X in a3:
            num=a3.index(X)
            a3[num]=[0]
        
        
        
C=False
for i in range(3):
    if a1.count(0)==3 or a2.count(0)==3 or a3.count(0)==3 or a1[0]==a2[0]==a3[0]==[0] or a1[1]==a2[1]==a3[1]==[0] or a1[2]==a2[2]==a3[2]==[0] or a1[0]==a2[1]==a3[2]==[0] or a1[0]==a2[1]==a3[2]==[0] or a1[2]==a2[1]==a3[0]==[0]:
        C=True
 
if C==True:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
N=input()

math.ceil(N)

Submission status: Runtime Error

Solution code:
s = int(input())
print(s/?2 + s%2)

Submission status: Runtime Error

Solution code:
s = input()
print(s/2 + s%2)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print(math.ceil(input()))

Submission status: Runtime Error

Solution code:
    op = [list(map(int, inp.split())) for inp in open(0)]
    a = [op[0], op[1], op[2]]
    n = int(op[3][0])
    b = []
    for i in range(n):
      b.append(int(op[4 + i][0]))
      for j in range(3):
        for k in range(3):
          if a[j][k] == b[i]:
            a[j][k] = -1
    res = 'No'
    for i in range(3):
      if a[0][i] == a[1][i] == a[2][i] == -1:
        res = 'Yes'
      if a[i][0] == a[i][1] == a[i][2] == -1:
        res = 'Yes'
    if a[0][0] == a[1][1] == a[2][2] == -1:
      res = 'Yes'
    if a[2][0] == a[1][1] == a[0][2] == -1:
      res = 'Yes'
    print(res)

Submission status: Runtime Error

Solution code:
from collections import defaultdict
import sys
import time

sys.setrecursionlimit(2000)
N, M, K = [int(i) for i in input().split(" ")]

class UnionNode():
    def __init__(self, number):
        self.number = number
        self.volume = 1
        self.master = None

    @property
    def rootnum(self):
        return self.root.number

    @property
    def root(self):
        if self.master:
            return self.master.root
        else:
            return self


    def same(self, target):
        if self.root == target.root:
            return True
        else:
            return False

    def unite(self, target):
        seroot = self.root
        taroot = target.root
        if seroot.number == taroot.number:
            pass
        else:
            #print(f"unite {target.rootnum}({target.root.volume}), {self.rootnum}({self.root.volume})")
            if seroot.number < taroot.number:
                seroot.volume += taroot.volume
                taroot.master = seroot
            else:
                taroot.volume += seroot.volume
                seroot.master = taroot

nodes = [UnionNode(i) for i in range(N)]

outlist = defaultdict(lambda :[])

for i in range(M):
    s = input()
    a, b = s.split(" ")
    a = int(a) - 1
    b = int(b) - 1
    nodes[a].unite(nodes[b])
    outlist[a].append(b)
    outlist[b].append(a)

for i in range(K):
    s = input()
    a, b = s.split(" ")
    a = int(a) - 1
    b = int(b) - 1
    outlist[a].append(b)
    outlist[b].append(a)

result = []
for i in range(N):
    node = nodes[i]
    ret = node.root.volume - 1
    for out in outlist[i]:
        if nodes[out].rootnum == node.rootnum:
            ret -=1
    result.append(ret)

#for i in range(100):
#    print(result[i])

print(" ".join([str(i) for i in result]))

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)

def friends(friend, array, i, label, t):
    for j in range(len(friend[i])):
        if label[friend[i][j] - 1] == 0:
            label[friend[i][j] - 1] = label[i]
            array.append(friend[i][j] - 1)
            return friends(friend, array, friend[i][j] - 1, label, t + 1)
    
    if t != 1:
        array.pop(-1)
        return friends(friend, array, array[t - 1], label, t - 1)
    else:
        return label   
        
n, m, k = map(int, input().split())
a = [0] * m
b = [0] * m
c = [0] * k
d = [0] * k

label = [0] * n
kosu_label = 1

block = [0] * n

ans = [0] * n

for i in range(m):
    a[i], b[i] = map(int, input().split())
    
for i in range(k):
    c[i], d[i] = map(int, input().split())
    
friend = [[] for i in range(n)]
    
for i in range(m):
    friend[a[i] - 1].append(b[i])
    friend[b[i] - 1].append(a[i])

for i in range(n):
    if label[i] == 0:
        label[i] = kosu_label
        label = friends(friend, [-1, i], i, label, 1)
            
    kosu_label = kosu_label + 1

label_s = [0] * kosu_label

for i in range(n):
    label_s[label[i]] = label_s[label[i]] + 1
    
for w in range(k):
    if label[c[w] - 1] == label[d[w] - 1]:
        block[c[w] - 1] = block[c[w] - 1] + 1
        block[d[w] - 1] = block[d[w] - 1] + 1
            
for i in range(n):
    ans[i] = label_s[label[i]] - len(friend[i]) - block[i] - 1
    print(ans[i], end = ' ')

Submission status: Runtime Error

Solution code:
class UnionFind:
    def __init__(self, n):
        self.n = n
        self.parents = [-1]*n
 
    def find(self, x):
        if(self.parents[x] < 0):
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
 
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
 
        if(self.parents[x] > self.parents[y]):
            x,y = y,x        
        self.parents[x] += self.parents[y]
        self.parents[y] = x
 
    def issame(self, x, y):
        return self.find(x) == self.find(y)
 
    def count(self,x):
        return -self.parents[self.find(x)]
 
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
 
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
 
    def __str__(self):
        return '\n'.join('{}: {}'.format(root, self.members(root)) for root in self.roots())
 
n,m,k = map(int, input().split(" "))
 
uf_friend = UnionFind(n+1)
uf_block = UnionFind(n+1)
count = [0]*(n+1)
for i in range(m):
    a,b = map(int, input().split(" "))
    uf_friend.union(a, b)
    count[a] += 1
    count[b] += 1
 
for i in range(k):
    a,b = map(int, input().split(" "))
    if(uf_friend.issame(a,b)):
        count[a] += 1
        count[b] += 1
 
result = [0]*n
for i in range(1,n+1):
    result[i-1] = uf_friend.count(i) - count[i] - 1
 
print(*result)

Submission status: Runtime Error

Solution code:
class UnionFind:
    def __init__(self, n):
        self.n = n
        self.parents = [-1]*(n+1)
 
    def find(self, x):
        if(self.parents[x] < 0):
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
 
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
 
        if(self.parents[x] > self.parents[y]):
            x,y = y,x        
        self.parents[x] += self.parents[y]
        self.parents[y] = x
 
    def issame(self, x, y):
        return self.find(x) == self.find(y)
 
    def count(self,x):
        return -self.parents[self.find(x)]
 
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
 
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
 
    def __str__(self):
        return '\n'.join('{}: {}'.format(root, self.members(root)) for root in self.roots())
 
n,m,k = map(int, input().split(" "))
 
uf_friend = UnionFind(n+1)
uf_block = UnionFind(n+1)
count = [0]*(n+1)
for i in range(m):
    a,b = map(int, input().split(" "))
    uf_friend.union(a, b)
    count[a] += 1
    count[b] += 1
 
for i in range(k):
    a,b = map(int, input().split(" "))
    if(uf_friend.issame(a,b)):
        count[a] += 1
        count[b] += 1
 
result = [0]*n
for i in range(1,n+1):
    result[i-1] = uf_friend.count(i) - count[i] - 1
 
print(*result)

Submission status: Runtime Error

Solution code:
class UnionFind:
    def __init__(self, n) -> None:
        self.n = n
        self.parents = [-1] * n
    
    def find(self, x):
        if (self.parents[x] < 0):
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        
        self.parents[x] += self.parents[y]
        self.parents[y] = x
    
    def issame(self, x, y):
        return self.find(x) == self.find(y)
    
    def count(self, x):
        return -self.parents[self.find(x)]
    
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
    
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
    
    def __str__(self):
        return '\n'.join('{}: {}'.format(root, self.members(root)) for root in self.roots())

n, m, k = map(int, input().split(' '))

uf_friend = UnionFind(n+1)
count = [0] * (n+1)
for i in range(m):
    a, b = map(int, input().split(' '))
    uf_friend.union(a, b)
    count[a] += 1
    count[b] += 1

for i in range(k):
    a, b = map(int, input().split(' '))
    if uf_friend.issame(a, b):
        count[a] += 1
        count[b] += 1

result = [0] * n
for i in range(1, n+1):
    result[i - 1] = uf_friend.count(i) - count[i] - 1

print(*result)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
num=[]
for i in range(3):
    array = list(map(int, input().strip().split()))
    num.append(array)
N = int(input())
a = [int(input()) for i in range(N)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if a[i] == num[j][k]:
                num[j][k] = False
bingo = 0
for m in range(3):
    if num[0][m] == num[1][m] == num[2][m] == False:bingo = 1

for n in range(3):
    if num[n][0] ==  num[n][1] ==  num[n][2] == 0:bingo = 1 
if num[0][0] == num[1][1] == num[2][2] == 0 :bingo = 1
if num[0][2] == num[1][1] == num[2][0] == 0 :bingo = 1

if bingo == 1:print("Yes")
elif bingo == 0:print("No")

Submission status: Runtime Error

Solution code:
num=[[]]
for i in range(3):
    array = list(map(int, input().strip().split()))
    num.append(array)
N = int(input())
a = [int(input()) for i in range(N)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if a[i] == num[j][k]:
                num[j][k] = False
bingo = 0
for m in range(3):
    if num[0][m] == num[1][m] == num[2][m] == False:bingo = 1

for n in range(3):
    if num[n][0] ==  num[n][1] ==  num[n][2] == 0:bingo = 1 
if num[0][0] == num[1][1] == num[2][2] == 0 :bingo = 1
if num[0][2] == num[1][1] == num[2][0] == 0 :bingo = 1

if bingo == 1:print("Yes")
elif bingo == 0:print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include<iostream>
using namespace std;

int main(){
    int a;
    cin>>a;
    cout<<(a+2-1)/2<<endl;
    return 0;

}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
s=input()
a=int(s)
d=a/2
e=(a+1)/2

if a%=2:
    print(d)
else :
    print(e)

Submission status: Runtime Error

Solution code:
print(-~(int(input()//2))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
A1=[int(e) for e in input().split()]
A2=[int(f) for f in input().split()]
A3=[int(g) for g in input().split()]
N=int(input())
for i in range(N):
    b=int(input())
    for j in range(3):
        if b==A1[j]:
            A1[j]= -1
        elif b==A2[j]:
            A2[j]= -1
        elif b==A3[j]:
            A3[j]= -1
if A1[0]==-1 and A2[0]==-1 and A3[0]==-1:
    print('Yes')
elif A1[1]==-1 and A2[1]==-1 and A3[1]==-1:
    print('Yes')
elif A1[2]==-1 and A2[2]==-1 and A3[2]==-1:
    print('Yes')
elif A1[0]==-1 and A1[1]==-1 and A1[2]==-1:
    print('Yes')
elif A2[0]==-1 and A2[1]==-1 and A2[2]==-1:
    print('Yes')
elif A3[0]==-1 and A3[1]==-1 and A3[2]==-1:
    print('Yes')
elif A1[0]==-1 and A2[1]==-1 and A3[2]==-1:
    print('Yes')
elif A3[0]==-1 and A2[1]==-1 and A1[2]==-1:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.root = [-1]*n
    self.rank = [0]*n
    
  def find_root(self, e):
    if self.root[e] < 0:
      return e
    else:
      r = self.find_root(self.root[e])
      self.root[e] = r
      return r
    
  def combine(self, e1, e2):
    root1 = self.find_root(e1)
    root2 = self.find_root(e2)
    if root1 == root2:
      pass
    elif self.rank[root1] < self.rank[root2]:
      self.root[root1] += self.root[root2]
      self.root[root2] = root1
      self.rank[root1] = self.rank[root2] + 1
    elif self.rank[root2] < self.rank[root1]:
      self.root[root2] += self.root[root1]
      self.root[root1] = root2
      self.rank[root2] = self.rank[root1] + 1
    else:
      self.root[root2] += self.root[root1]
      self.root[root1] = root2
      self.rank[root2] += 1
      
  def in_the_same_group(self, e1, e2):
      r1 = self.find_root(e1)
      r2 = self.find_root(e2)
      if r1 == r2:
        return True
      return False
  

NMK = input().split()
N = int(NMK[0])
M = int(NMK[1])
K = int(NMK[2])
uf = UnionFind(N)
from collections import defaultdict
friend_list = [0]*N
for _ in range(M):
  AB = input().split()
  A = int(AB[0])-1
  B = int(AB[1])-1
  uf.combine(A,B)
  friend_list[A] += 1
  friend_list[B] += 1

block_list = [0]*N
for _ in range(K):
  CD = input().split()
  C = int(CD[0])-1
  D = int(CD[1])-1
  if uf.in_the_same_group(C, D):
    block_list[C] += 1
    block_list[D] += 1

cnt = defaultdict(int)
ans = []
for i in range(N):
  cnt[i] = -uf.root[uf.find_root(i)] - 1 - friend_list[i] - block_list[i]
  ans.append(str(cnt[i]))

print(" ".join(ans))

Submission status: Runtime Error

Solution code:
def make_label(x, y, a, b, label, m):
    h = False
    g = []
    for i in range(m):
        if a[i] == x and label[b[i] - 1] == 0:
            label[b[i] - 1] = y
            g.append(b[i])
            h = True
        elif b[i] == x and label[a[i] - 1] == 0:
            label[a[i] - 1] = y
            h = True
            g.append(a[i])
        
    if h:
        for i in range(len(g)):
            return make_label(g[i], y, a, b, label, m)
    else:
        return label  
        


n, m, k = map(int, input().split())
a = [0] * m
b = [0] * m
c = [0] * k
d = [0] * k

label = [0] * n
kosu_label = 1

friend = [0] * n
block = [0] * n

ans = [0] * n

for i in range(m):
    a[i], b[i] = map(int, input().split())
    
for i in range(k):
    c[i], d[i] = map(int, input().split())
    
for i in range(n):
    if label[i] == 0:
        label[i] = kosu_label
        label = make_label(i + 1, kosu_label, a, b, label, m)
        kosu_label = kosu_label + 1

label_s = [0] * kosu_label

for i in range(n):
    label_s[label[i]] = label_s[label[i]] + 1
    
for i in range(n):
    for j in range(m):
        if a[j] == i + 1 or b[j] == i + 1:
            friend[i] = friend[i] + 1
    for w in range(k):
        if (c[w] == i + 1 or d[w] == i + 1) and label[c[w] - 1] == label[d[w] - 1]:
            block[i] = block[i] + 1
    ans[i] = label_s[label[i]] - friend[i] - block[i] - 1

for i in range(n):
    print(ans[i], end = '')

Submission status: Runtime Error

Solution code:
N=input()
1<=N<=100
ans=(N+1)//2
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
b=[list(map(int,input().split())) for i in range(M)]
lists=[0,0,0]
import sys
for i1 in range(0,M):
  for i2 in range(i1,M):
    if b[i1][0]==b[i2][0] and b[i1][1]!=b[i2][1]:
      print (-1)
      sys.exit()
    else:
      lists[b[i1][0]-1]=b[i1][1]
for i3 in range(M):
  if b[i3][0]==4-N and b[i3][1]==0:
    print (-1)
    sys.exit()
s=0
for i in range(3):
  s=s+lists[i]*10**(2-i)
if s>=10**N:
  print (-1)
elif s<10**(N-1):
  s=s+10**(N-1)
  print (s)
else:
  print (s)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

A = np.empty(9)
b = np.empty(10)
place = ''

for i in range(0,7,3):
  A[i], A[i+1], A[i+2] = map(int,input().split())

N = int(input())

for n in range(N):
  b[n] = int(input())
  for j in range(9):
  	if b[n] == A[j]:
  		place = place + ' ' + str(j)

ans='No'

for i in range(0,7,3):
  if str(i) and str(i+1) and str(i+2) in place:
  	ans = 'Yes'

for i in range(3):
  if str(i) and str(i+3) and str(i+6) in place:
  	ans = 'Yes'

if '0' and '4' and '8' in place:
	ans = 'Yes'
if '2' and '4' and '6' in place:
	ans = 'Yes'

print(ans)

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
numbers=[' ',]*N
kotae=0
for a in range(M):
    suuji=[]
    s,c=input().split()
    if numbers[int(s)-1]==' ':
        numbers[int(s)-1]=c
    else:
        if numbers[int(s)-1]==c:
            continue
        else:
            print('-1')
            kotae+=1
            break

for a in range(3):
    if numbers[a]==' ':
        numbers[a]=0
if numbers[0]==0:
    del numbers[0]
    if numbers[0]==0:
        del numbers[0]
        if numbers[0]==0:
            del numbers[0]
if kotae==0:
    if len(numbers)!=N:
        print('-1')
    else:
       moji=''
       for a in numbers:
           moji+=str(a)
       print(int(moji))

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
a=0
ans=[]
for _ in range(n):
  ans.append('a')
for i in range(m):
  s,c=map(int,input().split())
  if ans[s-1]!='a' and ans[s-1]!=str(c):
    a=-1
  ans[s-1]=str(c)
if ans[0]=='a' and n!=1:
  ans[0]='1'

if ans[0]=='0' and n!=1:
  a=-1
if ans[0]=='a' and n==1:
  ans[0]='0'
for j in range(n):
  if ans[j]=='a':
    ans[j]='0'
if a==-1:
  print(a)
else:
  print(''.join(ans))

Submission status: Runtime Error

Solution code:
import sys

ar = []
x = sys.stdin.readline()
x = x.split(' ')
(n,m)=[int(str) for str in x]

ret = 0
chk = []
for i in range(m):
  x = sys.stdin.readline()
  x = x.split(' ')
  (s,c)=[int(str) for str in x]
  if not ( s in chk):
    if(n-s>=0):
      ret += c*10**(n-s)
      chk.append(s)
  else:
      if( c != int(ret/10**(n-s))):
        print("-1")
        exit(0)

if( ret == 0 and n == 1):
  print("0")
  exit(0)
if( ret < 10**(n-1)):
  if not ( n-1 in chk):
    print(ret+10**(n-1))
  else:
    print("-1")
else:
  print(ret)
sys.stdout.flush()

Submission status: Runtime Error

Solution code:
import sys

ar = []
x = sys.stdin.readline()
x = x.split(' ')
(n,m)=[int(str) for str in x]

ret = 0
chk = []
for i in range(m):
  x = sys.stdin.readline()
  x = x.split(' ')
  (s,c)=[int(str) for str in x]
  if not ( s in chk):
    if(n-s>=0):
      ret += c*10**(n-s)
      chk.append(s)
  else:
      if( c != int(ret/10**(n-s))):
        print("-1")
        exit(0)


if( ret == 0 and n == 1):
  print("0")
  exit(0)
if( ret < 10**(n-1)):
  if not ( n-1 in chk):
    print(ret+10**(n-1))
  else:
    print("-1")
else:
  print(ret)
sys.stdout.flush()

Submission status: Runtime Error

Solution code:
import sys
from io import StringIO
import unittest


def exists(value, n, ms, cs):
    if len(value) != n:
        return False
    if all([value[i - 1] == c for i, c in zip(ms, cs)]):
        return True
    return False


def unzip(li):
    return list(map(list, zip(*li)))


def resolve():
    result = -1
    inputs = sys.stdin
    n, m = [int(e) for e in inputs.readline().split()]
    if m == 0:
        print(0)
        return
    m = [input().split() for e in range(m)]
    ms, cs = unzip(m)
    ms = [int(e) for e in ms]

    for i in range(1000):
        if exists(str(i), n, ms, cs):
            result = i
            break
    print(result)
resolve()

Submission status: Runtime Error

Solution code:
import sys
from io import StringIO
import unittest


def exists(value, n, ms, cs):
    if len(value) != n:
        return False
    if all([value[i - 1] == c for i, c in zip(ms, cs)]):
        return True
    return False


def unzip(li):
    return list(map(list, zip(*li)))


def resolve():
    result = -1
    inputs = sys.stdin
    n, m = [int(e) for e in inputs.readline().split()]
    if m == 0:
        print(0)
        return
    m = [input().split() for e in range(m)]
    ms, cs = unzip(m)
    ms = [int(e) for e in ms]

    for i in range(1000):
        if exists(str(i), n, ms, cs):
            result = i
            break
    print(result)

resolve()

Submission status: Runtime Error

Solution code:
n = int(input())
print(n\\2)

Submission status: Runtime Error

Solution code:
A=[list(map(int,input().strip().split())) for n in range(3)]
A_input=[]
for n in range(3):
    for m in range(3):
        A_input.append(A[n][m])
N=int(input())
b=[int(input()) for n in range(N)]

def bingo_judge(A_input,b):
    bingo=0
    judge_list=[0,0,0,0,0,0,0,0,0]
    for number in b:
        for i in range(9):
            if number==A_input[i]:
                judge_list[i]=1
            else:
                pass
    #horizonal
    for i in range(3):
        if judge_list[3*i]*judge_list[3*i+1]*judge_list[3*i+2]==1:
            bingo=1
        else:
            pass
    #vertical
    for i in range(3):
        if judge_list[i]*judge_list[i+3]*judge_list[i+6]==1:
            bingo=1
        else:
            pass
    #diagonal
    if judge_list[0]*judge_list[4]*judge_list[8]==1:
        bingo=1
    if judge_list[2]*judge_list[4]*judge_list[6]==1:
        bingo=1
    #test display
    # judge_disp=[[judge_list[i+3*n] for i in range(3)] for n in range(3)] 
    # print(*judge_disp,sep="\n")
    
    return bingo

def main():
    ans=bingo_judge(A_input,b)
    if ans==1:
        print("yes")
    elif ans==0:
        print("No")
main()

Submission status: Runtime Error

Solution code:
n = int(input())
if n % 2 == 1:
  print (n-1) /2
print(n/2)

Submission status: Runtime Error

Solution code:
N = int(input())

if N.odd:
  N += 1

ans = N / 2

print(ans)

Submission status: Runtime Error

Solution code:
# coding: utf-8

in = int(input())

out = int(in / 2)
if (out % 2 != 0):
    out += 1

print out

Submission status: Runtime Error

Solution code:
import math

ans = (N+1) // 2
print(ans
     )

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(Input())
if N%2=0:
    print(N/2)
else:
    print((N-1)/2)

Submission status: Runtime Error

Solution code:
N=Input()
if N%2=0:
    print(N/2)
else:
    print((N+1)/2)

Submission status: Runtime Error

Solution code:
n11, n12, n13 = map(int,input().split())
n21, n22, n23 = map(int,input().split())
n31, n32, n33 = map(int,input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
r = input()
for i in range(int(r)):
  nums[input()] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
n11, n12, n13 = map(int,input().split())
n21, n22, n23 = map(int,input().split())
n31, n32, n33 = map(int,input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
r = input()
for i in range(int(r)):
  nums[input()] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
n11, n12, n13 = map(int,input().split())
n21, n22, n23 = map(int,input().split())
n31, n32, n33 = map(int,input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
r = input()
for i in range(int(r)):
  nums[int(input())] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
n11, n12, n13 = map(int,input().split())
n21, n22, n23 = map(int,input().split())
n31, n32, n33 = map(int,input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
r = input()
for i in range(int(r)):
  nums[input()] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
n11, n12, n13 = map(int,input().split())
n21, n22, n23 = map(int,input().split())
n31, n32, n33 = map(int,input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
for i in range(int(input())):
  nums[input()] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
n11, n12, n13 = (input().split())
n21, n22, n23 = (input().split())
n31, n32, n33 = (input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
r = input()
for i in range(int(r)):
  nums[input()] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
N, M, K = map(int, input().split())
friend = [[] for _ in range(N+1)]
block = [[] for _ in range(N+1)]

for i in range(M):
  A,B = map(int, input().split())
  friend[A].append(B)
  friend[B].append(A)

for i in range(K):
  C,D = map(int, input().split())
  block[C].append(D)
  block[D].append(C)
#print(friend)
#print(block)

#import queue
grouping = [False]*(N+1)
#print(grouping)
grouping[0] = True
group = [0]*(N+1)
g_num = 0
g_cnt = []
for i in range(1,N+1):
  cnt = 0
  if grouping[i] == True:
    continue 
  group[i] = g_num
  grouping[i] = True
  #q = queue.Queue()
  #q.put(i)
  stack = [i]
  #while not q.empty():
  while len(stack)>0:
    #print('v:',visited)
    #p = q.get()
    p = stack.pop()
    for f in friend[p]:
      #print(p,f)
      if grouping[f]==False:
        #q.put(f)
        stack.append(f)
        group[f]=g_num
        grouping[f] =True
        cnt += 1
  g_num += 1
  g_cnt.append(cnt)
  #print('g:',grouping)
ans = []
for i in range(1,N+1):
  c = g_cnt[group[i]]-len(friend[i])
  for b in block[i]:
    if group[b]==group[i]:
      c -= 1
  ans.append(c)
print(*ans)

Submission status: Runtime Error

Solution code:
n11, n12, n13 = (input().split())
n21, n22, n23 = (input().split())
n31, n32, n33 = (input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
for i in range(int(input())):
  nums[input()] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
n11, n12, n13 = (input().split())
n21, n22, n23 = (input().split())
n31, n32, n33 = (input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
for i in range(int(input())):
  nums[input()] = 0
flag = False
for(l in lines):
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("No")
else:
  print("Yes")

Submission status: Runtime Error

Solution code:
n11, n12, n13 = (input().split())
n21, n22, n23 = (input().split())
n31, n32, n33 = (input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
for(i in range(int(input()))):
  nums[input()] = 0
flag = False
for(l in lines):
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("No")
else:
  print("Yes")