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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()

mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1
    
print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
mod = N % 2
if mod == 0:
    x = N // 2
else:
    x = N // 2 + 1

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
def func(a, i):
    return {a[0]:i, a[1]:i+1, a[2]:i+2}
A = {}
for i in range(3):
    A.update(func(input().split(), 3*i))
N = int(input())
b = [A.get(input(), -1) for _ in range(N)]
bingo = [[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 bingo:
    if set(i) <= set(b):
        print("Yes")
        break
else:
    print("No")

Submission status: Runtime Error

Solution code:
v = []
m = [False for _ in range(9)]
for i in range(3):
    a, b, c = map(int, input().split())
    v += [a, b, c]

n = int(input())
for i in range(n):
    a = int(input())
    if a in v:
        m[v.index(a)] = True

def control():
    for i in range(3):
        if all(m[3*i:3*i+3]):
            return True
        if all(m[i::3]):
            return True

    if all(m[::4]) or all(m[2:8:2]):
        return True
    return False

print("Yes" if control() else "No")

Submission status: Runtime Error

Solution code:
N = input()

if N%2 == 0:
  ans = N//2
else:
  ans = N//2 + 1

return(ans)

Submission status: Runtime Error

Solution code:
import math

pages = input()
count = int(pages)

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

Submission status: Runtime Error

Solution code:
pages = input()
count = int(pages)

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

Submission status: Runtime Error

Solution code:
import math

n=input()

print(math.ceil(n/2))

Submission status: Runtime Error

Solution code:
pages = input()
count = int(pages)

if count %2 = 0 :
    print(count/2)

else :
    print((count + 1)/2)

Submission status: Runtime Error

Solution code:
from collections import defaultdict

n,m,k=map(int, input().split())  
friend=[[] for _ in range(n)]

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

par=[None]*n
frmember=defaultdict(int)

def dfs(v):
    if par[i]==None:
        par[v]=v
        frmember[par[v]]+=1
    for f in friend[v]:
        if par[f]==None:
            par[f]=par[v]
            frmember[par[v]]+=1
            dfs(f)

for i in range(n):
    if par[i]==None:
        dfs(i)

ans=[0]*n
for i in range(n):
    ans[i]+=frmember[par[i]]-len(friend[i])-1

for i in range(k):
    a,b=map(int, input().split()) 
    if par[a-1]==par[b-1]:
        ans[a-1]-=1
        ans[b-1]-=1

print(*ans)

Submission status: Runtime Error

Solution code:
import math

n=input()

print(math.ceil(n))

Submission status: Runtime Error

Solution code:
import sys
 
N,M = map(int,input().split())
s = []
c = []
if M >= 1:
    for i in range (M):
        s,c = map(int,input().split())
        s.append(s)
        c.append(c)
    
    for i in range(M):
        if s[i] == 1 and c[i] == 0:
            print("-1")
            sys.exit()
a = zip(s, c)
a.sort()
s, c = zip(*a)
s = list(s)
c = list(c)
    if M >= 2:
        for i in range(1,M):
            if s[i - 1] == s[i] and c[i - 1] != c[i]:
                print("-1")
                sys.exit()
        if s[M - 1] == s[M] and c[M - 1] != c[M]:
            print("-1")
            sys.exit()
    for i in range(M):
        cc = [0] * N
        cc[s[i] - 1] = c[i]
    for i in range(min(s[i])):
        cc[i] = 1
    print(cc)
if M == 0:
    cc = [0] * N
    cc[0] = 1
    print(cc)

Submission status: Runtime Error

Solution code:
n=input()

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int((input())

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

Submission status: Runtime Error

Solution code:
N = int((input())

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

Submission status: Runtime Error

Solution code:
N = int((input())

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

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
s,c=[],[]

for _ in range(m):
    a,b=map(int,input().split())
    a-=1
    s.append(a)
    c.append(b)
        
for ans in range(10**(n-1),10**n):
    st=str(ans)
    f=True    
    for i in range(m):
       if st[s[i]] != str(c[j]):
            f=False
          
    if f==True:
        print(ans)
        exit()

print(-1)

Submission status: Runtime Error

Solution code:
import math

N = input()
print(math.ceil(N/2))

Submission status: Runtime Error

Solution code:
n, m = map(int, input().split())
req = [list(map(int, input().split())) for i in range(m)]
for i in range(10000):
    st = str(i)
    if len(st) != n:
        continue
    ok = True
    for s, c in req:
        if int(st[s-1]) != int(c):
            ok = False
    if ok:
        print(st)
        exit(0)

print(-1)

Submission status: Runtime Error

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

guess = [] #答えの候補を保管
for i in range(N):
    guess.append(-1)
exits=True #答えが存在するか
ans=-1

for i in range(M):
    s,c=input().split()
    #桁数sを直感に一致させるために-1
    s,c=int(s)-1,int(c)
    if guess[s]==-1 or guess[s]>c:
        guess[s]=c

if guess[0]==0 or guess[0]==-1 or M==0:
    exits=False 

if exits:
    ans=0
    for i in range(N):
        ans+= guess[i]*(10**(N-i-1)) if not guess[i]==-1 else 0
	#1桁の場合はcがそのまま答え
    if N==1:
        ans=c

print(ans)

Submission status: Runtime Error

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

guess = [] #答えの候補を保管
for i in range(N):
    guess.append(-1)
exits=True #答えが存在するか
ans=-1

for i in range(M):
    s,c=input().split()
    #桁数sを直感に一致させるために-1
    s,c=int(s)-1,int(c)
    if guess[s]==-1 or guess[s]==c:
        guess[s]=c
    else:
        exits=False

if guess[0]==0 or guess[0]==-1 or M==0:
    exits=False 

if exits:
    ans=0
    for i in range(N):
        ans+= guess[i]*(10**(N-i-1)) if not guess[i]==-1 else 0
	#1桁の場合はcがそのまま答え
    if N==1:
        ans=c

print(ans)

Submission status: Runtime Error

Solution code:
print((N+1)//2)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = N / 2

if N % 2 == 0:
  print(N)
  
if N % 2 != 0:
  print(N+1)

Submission status: Runtime Error

Solution code:
import sys
import math
lines = sys.stdin.readlines()
line1 = lines.pop(0).split(' ')
#print(line1)
N = int(line1[0])
M = int(line1[1])

#print(N)
#print(M)

str = [10] * N
#print(str)
ans = []
flg = 0
flg2 = 0
for i in range(M):
  line = lines.pop(0).split(' ')
#  print(line)
  s = int(line[0])
  c = int(line[1])
#  print(s)
#  print(c)
#  print(str[s-1])
  if str[s-1] > c:
    str[s-1] = c

#print(str)
str = [0 if i == 10 else i for i in str]
#print(str)
if N == 3:
  ret = (int(str[0])*100 + int(str[1])*10 + int(str[2])) if int(str[0]) > 0 else -1
elif N ==2:
  ret = (int(str[0])*10 + int(str[1])) if int(str[0]) > 0 else -1
elif N ==1:
  ret = int(str[0])

print(ret)

Submission status: Runtime Error

Solution code:
n,m = map(int, input().split())

theNumber = [-1 for x in range(n)]
valid = True
for i in range(m):
    if (valid):
        s,c = map(int, input().split())
        if (s == 1 and c == 0):
            if (n != 1):
                valid = False
        elif theNumber[s-1] != -1 and theNumber[s-1] != c:
            valid = False
        else:
            theNumber[s-1] = c
    else:
        break

if (not valid):
    print(-1)
else:
    num = list(map(lambda x: 0 if x==-1 else x, theNumber))
    if (num[0] == 0 and n != 1):
        num[0] = 1
    print(''.join(map(str, num)))

Submission status: Runtime Error

Solution code:
import sys
import math
lines = sys.stdin.readlines()
line1 = lines.pop(0).split(' ')
#print(line1)
N = int(line1[0])
M = int(line1[1])

#print(N)
#print(M)

str = [0] * N
ans = []
flg = 0
flg2 = 0
for i in range(M):
  line = lines.pop(0).split(' ')
#  print(line)
  s = int(line[0])
  c = int(line[1])
#  print(s)
#  print(c)
  str[s-1] = c
#  print('str = ')
#  print(str)
  one = int(str[0])
  if N == 3:
    ret = one*100 + int(str[1])*10 + int(str[2])
    if int(str[1])>0:
      flg = 1
    else:
      flg = 2

    if int(str[2])>0:
      flg2 = 1
    else:
      flg2 = 2
  elif N == 2:
    ret = one*10 + int(str[1])
    if int(str[1]) > 0:
      flg = 1
    else:
      flg = 2
  else:
    ret = one
  ans.append(ret)

#print(ans)

for obj in ans[:]:
  if (obj / (10**(N-1))) < 1 and N > 1:
    ans.remove(obj)
    
  if N == 2:
    if flg == 1:
      a = obj % 10
      if a == 0:
#        print('リムーブ')
        ans.remove(obj)

  elif N == 3:
    if flg == 1 and flg2 ==1:
      print('リムーブ候補')
      print(obj)
      if obj % 100 == 0:
#        print('リムーブ')
        ans.remove(obj)
      elif math.floor(obj/10)  % 10 == 0:
#        print('リムーブ')
        ans.remove(obj)
    elif flg == 1 and flg2 ==0:
      if obj % 100 == 0:
        ans.remove(obj)
    elif flg == 0 and flg2 ==1:
#      print('リムーブ候補')
#      print(obj)
      b = obj % 10
#      print(b)
      if b == 0:
#        print('リムーブ')
        ans.remove(obj)

if not ans:
  print('-1')
else:
#  print(ans)
  print(min(ans))

Submission status: Runtime Error

Solution code:
a=int(input().split())
ans=a//2
if a%2 == 1:
  ans=ans+1
print(ans)

Submission status: Runtime Error

Solution code:
import sys
lines = sys.stdin.readlines()
line1 = lines.pop(0).split(' ')
#print(line1)
N = int(line1[0])
M = int(line1[1])

#print(N)
#print(M)

str = [0] * N
ans = []
flg = 0
flg2 = 0
for i in range(M):
  line = lines.pop(0).split(' ')
#  print(line)
  s = int(line[0])
  c = int(line[1])
#  print(s)
#  print(c)
  str[s-1] = c
#  print('str = ')
#  print(str)
  one = int(str[0])
  if N == 3:
    ret = one*100 + int(str[1])*10 + int(str[2])
    if int(str[1])>0:
      flg = 1
    if int(str[2])>0:
      flg2 = 1
  elif N == 2:
    ret = one*10 + int(str[1])
    if int(str[1]) > 0:
      flg = 1
  else:
    ret = one
  ans.append(ret)

#print(ans)

for obj in ans[:]:
  if (obj / (10**(N-1))) < 1 and N > 1:
    ans.remove(obj)
    
  if N == 2:
    if flg == 1:
      a = obj % 10
      if a == 0:
#        print('リムーブ')
        ans.remove(obj)

  elif N == 3:
    if flg == 1 and flg2 ==1:
#      print('リムーブ候補')
#      print(obj)
      if obj % 100 == 0:
#        print('リムーブ')
        ans.remove(obj)
      elif obj % 10 == 0:
#        print('リムーブ')
        ans.remove(obj)
    elif flg == 0 and flg2 ==1:
#      print('リムーブ候補')
#      print(obj)
      b = obj % 10
      print(b)
      if b == 0:
#        print('リムーブ')
        ans.remove(obj)

if not ans:
  print('-1')
else:
#  print(ans)
  print(min(ans))

Submission status: Runtime Error

Solution code:
import sys
lines = sys.stdin.readlines()
line1 = lines.pop(0).split(' ')
#print(line1)
N = int(line1[0])
M = int(line1[1])

#print(N)
#print(M)

str = [0] * N
ans = []
flg = 0
for i in range(M):
  line = lines.pop(0).split(' ')
#  print(line)
  s = int(line[0])
  c = int(line[1])
#  print(s)
#  print(c)
  str[s-1] = c
#  print('str = ')
#  print(str)
  one = int(str[0])
  if N == 3:
    ret = one*100 + int(str[1])*10 + int(str[2])
    if int(str[1])>0 or int(str[2])>0:
      flg = 1
  elif N == 2:
    ret = one*10 + int(str[1])
    if int(str[1]) > 0:
      flg = 1
  else:
    if one > 0:
      ret = one
  ans.append(ret)

#print(ans)
div = 1
if N == 3:
  div = 100
elif N == 2:
  div = 10

for obj in ans[:]:
  if (obj / (10**(N-1))) < 1:
    ans.remove(obj)
  elif flg == 1:
#   print('リムーブ候補')
#   print(obj)
#   print(div)
    a = obj % div
#    print(a)
    if a == 0:
#      print('リムーブ')
      ans.remove(obj)

if not ans:
  print('-1')
else:
#  print(ans)
  print(min(ans))

Submission status: Runtime Error

Solution code:
import sys
lines = sys.stdin.readlines()
line1 = lines.pop(0).split(' ')
#print(line1)
N = int(line1[0])
M = int(line1[1])

#print(N)
#print(M)

str = [0] * N
ans = []
flg = 0
for i in range(M):
  line = lines.pop(0).split(' ')
#  print(line)
  s = int(line[0])
  c = int(line[1])
#  print(s)
#  print(c)
  str[s-1] = c
#  print('str = ')
#  print(str)
  one = int(str[0])
  if N == 3:
    ret = one*100 + int(str[1])*10 + int(str[2])
    if int(str[1])>0 or int(str[2])>0:
      flg = 1
  elif N == 2:
    ret = one*10 + int(str[1])
    if int(str[1]) > 0:
      flg = 1
  else:
    if one > 0:
      ret = one
  ans.append(ret)

#print(ans)
div = 1
if N == 3:
  div = 100
elif N == 2:
  div = 10

for obj in ans[:]:
  if (obj / (10**(N-1))) < 1:
    ans.remove(obj)
  elif flg == 1:
#   print('リムーブ候補')
#   print(obj)
#   print(div)
    a = obj % div
    print(a)
    if a == 0:
#      print('リムーブ')
      ans.remove(obj)

if not ans:
  print('-1')
else:
#  print(ans)
  print(min(ans))

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(4100000)

line = input().split()
nPerson = int(line[0])
nFriend = int(line[1])
nBlock  = int(line[2])

friends = [[] for i in range(nFriend)]
for i in range(nFriend):
  line = input().split()
  friends[i] =[int(line[0]), int(line[1]) ]

blocks = [[] for i in range(nBlock)]
for i in range(nBlock):
  line = input().split()
  blocks[i] = [int(line[0]), int(line[1]) ]
  
connected = [[] for i in range(nPerson+1)]
  
for i in friends:
  if i[1] not in connected[i[0]]:
    connected[i[0]].append(i[1])
  if i[0] not in connected[i[1]]:
    connected[i[1]].append(i[0])

blocked = [[] for i in range(nPerson+1)]
for i in blocks:
  if i[1] not in blocked[i[0]]:
    blocked[i[0]].append(i[1])
  if i[0] not in blocked[i[1]]:
    blocked[i[1]].append(i[0])
  
for i in range(len(connected)):
  connected[i] = set(connected[i])
for i in range(len(blocked)):
  blocked[i] = set(blocked[i])
  
nCand = [0]*(nPerson+1)

def findCand(target,curPer):
  if visited[curPer] == True :
    return
  visited[curPer] = True
  if curPer not in connected[target] and curPer not in blocked[target]:
    nCand[target] += 1
  for i in connected[curPer]:
    findCand(target,i)

for i in range(1,nPerson+1):
  visited = [False]*(nPerson+1)
  visited[i] = True
  for j in connected[i]:
    findCand(i,j)

res = ""
for i in range(1,nPerson+1):
  res += str(nCand[i]) + " "
  
print(res)

Submission status: Runtime Error

Solution code:
n = int(input())

ans = n /2

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

Submission status: Runtime Error

Solution code:
N = int(input())

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

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(2147483647)
input = sys.stdin.readline
N, M, K = map(int, input().split())
graph = [[] for _ in range(N)]
block = [[] for _ in range(N)]
connected_components = []
count = 0
counts = [0 for _ in range(N)]
seen = [False for _ in range(N)]
def dfs(v, c, seen, origin):
    global count
    seen[v] = True
    for node in graph[v]:
        if seen[node] == True:
            continue
        if node not in block[origin]:
            count += 1
        dfs(node, c+1, seen, origin)
def dfs_connected(v, order):
    seen[v] = True
    connected_components[order].append(v)
    for node in graph[v]:
        if seen[node] == True:
            continue
        dfs_connected(node, order)
 
for Mi in range(M):
    a, b = map(int, input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
 
for Ki in range(K):
    a, b = map(int, input().split())
    block[a-1].append(b-1)
    block[b-1].append(a-1)
 
for v in range(N):
    if seen[v] == True:
        continue
    connected_components.append([])
    dfs_connected(v, v)
 
for components in connected_components:
    for component in components:
        seen = [False for _ in range(N)]
        count = 0
        dfs(component, count, seen, component)
        counts[component] = count-len(graph[component])
 
print(' '.join(map(str, counts)))

Submission status: Runtime Error

Solution code:
n,m= map(int,input().split())
check=[-1]*n
for i in range(m):
    s,c=map(int,input().split())
    s-=1
    if(check[s]!=-1 and check[s]!=c):
        print(-1)
        exit()
    check[s]=c
#print(check)
if(check[0]==0):
    if(n==1):
      print(0)
    else:
      print(-1)
    exit()
elif(check[0]==-1):
    check[0]=1

for i in range(n):
    if(check[i]==-1):
        check[i]=0
    print(check[i],end="")

Submission status: Runtime Error

Solution code:
def duplex(N):
    return N/2 if N%2 == 0 else (N+1)/

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
pages=N // 2
print(pages)

Submission status: Runtime Error

Solution code:
n,m=map(int,input().split())
L=[10]*n
for i in range(m):
	s,c=map(int,input().split())
	if L[s-1]==10 or L[s-1]==c:
		L[s-1]=c
	else:
		print('-1')
		exit()
if n==1:
	if L[0]==10:
		print(0)
		exit()
	else:
		print(L[0])
		exit()
else:
	if L[0]==10:
		L[0]=1
	elif L[0]==0:
		print('-1')
		exit()
	else:
		for i in range(1,n):
			if L[i]==10:
				L[i]=0
	print(''.join(map(str,L)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
if N%2 == 0:
  print(int(N/2))
else:
  print(int(round(N/2)))

Submission status: Runtime Error

Solution code:
N=101
if N%2 == 0:
  print(int(N/2))
else:
  print(int(round(N/2))

Submission status: Runtime Error

Solution code:
if N%2 == 0:
  print(N/2)
else:
  print(math.ceil(N/2))

Submission status: Runtime Error

Solution code:
if N%2 == 0:
  print(N/2)
else:
  print(ceil(N/2))

Submission status: Runtime Error

Solution code:
import numpy as np
from scipy.sparse.csgraph import shortest_path
N, M, K = tuple(map(int, input().split()))
friends = [list(map(int, input().split())) for _ in range(M)]
blocks = [list(map(int, input().split())) for _ in range(K)]

friend_matrix = np.zeros((N, N))

for friend in friends:
	friend_matrix[friend[0]-1, friend[1]-1] = 1
	friend_matrix[friend[1]-1, friend[0]-1] = 1

# matrix for direct friendship between 2
# print('friend_matrix')
# print(friend_matrix)

# matrix for friendship distance
friend_distance = shortest_path(friend_matrix)
# print('friend_distance')
# print(friend_distance)

def is_friend_candidate(a, b):
	if a == b:
		return False
	for block in blocks:
		if block == [a, b] or block == [b, a]:
			return False
	for friend in friends:
		if friend == [a, b] or friend == [b, a]:
			return False
	if friend_distance[a-1, b-1] == np.inf:
		return False
	return True

candidate_matrix = np.zeros((N, N))
for i in range(N):
	for other in range(N):
		if candidate_matrix[i, other] == 1:
			continue
		if is_friend_candidate(i+1, other+1):
			candidate_matrix[i, other] = 1
			candidate_matrix[other, i] = 1

# matrix for friendship candidate
# print('candidate_matrix')
# print(candidate_matrix)

# atcoder numpy is outdated
# print(np.__version__)
# candidate_counts = np.count_nonzero(candidate_matrix == 1, axis=0)
candidate_counts = []
for row in candidate_matrix:
	candidate_counts.append(np.count_nonzero(row == 1))

# print('candidate_counts')
# print(candidate_counts)
print(' '.join(map(str, candidate_counts)))

Submission status: Runtime Error

Solution code:
bingo = [list(map(int, input().split(" "))) for i in range(3)]
N = int(input())
b = [int(input()) for i in range(N)]

#list = [[0] * 3] * 3
list = [ [0]*3 for x in range( 0, 3 ) ]
flag = 0

# print(list)

for i in range(0, 3):
    for j in range(0, 3):
        for k in range(0, N):
            if bingo[i][j] == b[k]:
                list[i][j] = 1
                #print(list)
                #print(b[k])
# print(list)
# list = [[1,0,0], [1, 1, 0], [0,0,1]]

for i in range(0, 3):
    hantei = 0
    for j in range(0, 3):
        hantei = hantei + list[i][j]
    if hantei == 3:
        flag = 1
        break

for i in range(0, 3):
    hantei = 0
    for j in range(0, 3):
        hantei = hantei + list[j][i]
    if hantei == 3:
        flag = 1
        break

hantei = 0
for i in range(0, 3):
    hantei = hantei + list[i][i]
if hantei == 3:
    flag = 1

hantei = 0
for i in range(0, 3):
    hantei = hantei + list[i][2 - i]
if hantei == 3:
    flag = 1

if flag == 1:
    print('Yes')
elif flag == 0:
    print('No')

Submission status: Runtime Error

Solution code:
    N = int(input())
#A = list(map(int,input().split(' ')))

    print((N+1)//2)

Submission status: Runtime Error

Solution code:
A11,A12,A13 = map(int, input().split())
A21,A22,A23 = map(int, input().split())
A31,A32,A33 = map(int, input().split())
N = int(input())
b = [int(input()) for _ in range(N)]

cnt11=0
cnt12=0
cnt13=0
cnt21=0
cnt22=0
cnt23=0
cnt31=0
cnt32=0
cnt33=0

for i in range(N):
    if b[i]==A11:
        cnt11+=1
    elif b[i]==A12:
        cnt12+=1
    elif b[i]==A13:
        cnt13+=1
    elif b[i]==A21:
        cnt21+=1
    elif b[i]==A22:
        cnt22+=1
    elif b[i]==A23:
        cnt23+=1
    elif b[i]==A31:
        cnt31+=1
    elif b[i]==A32:
        cnt32+=1
    elif b[i]==A33:
        cnt33+=1
    else:
        pass

bingo=0
if cnt11>0:
    if((cnt12>0 and cnt13>0)or(cnt22>0 and cnt33>0)or(cnt21>0 and cnt31>0)):
        bingo+=1
    else:
        pass
elif cnt12>0:
    if (cnt22>0 and cnt32>0):
        bingo+=1
    else:
        pass
elif cnt13>0:
    if((cnt22>0 and cnt31>0)or(cnt23>0 and cnt33>0)):
        bingo+=1
    else:
        pass
elif cnt21>0:
    if(cnt22>0 and cnt23>0):
        bingo+=1
    else:
        pass
elif cnt31>0:
    if(cnt32>0 and cnt33>0):
        bingo+=1
    else:
        pass
else:
    pass
if bingo>0:
    print('Yes')
else:
    print('No')

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(5000)

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

friend_list = [0]*(N+1)
bad_list = [0]*(N+1)
group = {}

parent = [i for i in range(N+1)]

def union(x,y):
    x = find(x)
    y = find(y)
    parent[x] = y

def find(x):
    if parent[x] == x:
        return x
    else:
        parent[x]= find(parent[x])
        return parent[x]



for i in range(M):
    A,B = list(map(int,input().split(' ')))
    friend_list[A]+=1
    friend_list[B]+=1
    
    union(A,B)

for i in range(1,N+1):
    oya = find(i)
    parent[i] = oya
    #print(oya)
    if oya in group:
        group[oya] = group[oya]+1
    else:
        group[oya]=1

for i in range(K):
    A,B = list(map(int,input().split(' ')))
    if find(A)==find(B):
        bad_list[A]+=1
        bad_list[B]+=1
    
    #union(A,B)



#print(parent)
#print('parent')

#print('friend')
#print(friend_list)
#print('bad')
#print(bad_list) 
#print(group)

kouho = [0]*N

for i in range(1,N+1):
    oya = find(i)
    abc = group[oya]-friend_list[i]-bad_list[i]-1
    kouho[i-1] = abc

for k in kouho:
    print(k,end=" ")
print()

#print(parent)

Submission status: Runtime Error

Solution code:
n = input()

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

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:
main=readLn>>=print.ceiling.(/2)

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
let n = read_int ()

let () = n / 2 + (n mod 2) |> print_int; print_string "\n"

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:
n = input()
if n % 2 == 1:
  print((n // 2) + 1)
else:
  print(n // 2)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin>>N;
  cout<<N/2+N%2<<endl;
}

Submission status: Runtime Error

Solution code:
n,m,k=map(int,input().split())
w=[i for i in range(n+1)]
s=[1]*(n+1)
g=[list(map(int,input().split()))for i in range(n)]
def root(x):
    if w[x]==x:
        return x
    x=w[x]
    return root(w[x])
def unite(x,y):
    x=root(x)
    y=root(y)
    if x!=y:
        if s[x]<s[y]:
            w[x]=y
            s[y]+=1
        else:
            w[y]=x
            s[x]+=1
for i in range(m):
    a,b=g[i][0],g[i][1]
    unite(a,b)
for i in range(1,n+1):
    w[i]=root(i)
    s[i]=s[w[i]]
for i in range(m):
    s[g[i][0]]-=1
    s[g[i][1]]-=1
for i in range(k):
    a,b=map(int,input().split())
    if w[a]==w[b]:
        s[a]-=1
        s[b]-=1
for i in range(1,n+1):s[i]-=1
print(*s[1:])

Submission status: Runtime Error

Solution code:
import numpy as np

N = input()

num_paper = int(N) / 2
if (N % 2) > 0:
  num_paper += 1
else:
  pass

print(num_paper)

Submission status: Runtime Error

Solution code:
import numpy as np

N = input()

num_paper = N / 2
if (N % 2) > 0:
  num_paper += 1
else:
  pass

print(num_paper)

Submission status: Runtime Error

Solution code:
N, M = list(map(int, input().split()))
nums = [list(map(int, input().split())) for i in range(M)]
if [1, 0] in nums:
  print('-1')
  quit()
dic = {}

for (s, c) in nums:
  if s in dic and dic[s] != c:
    print('-1')
    quit()
  else:
    dic[s] = c
if N == 1:
  total = 0
else:
  total = 10**(N-1)    
for key in sorted(dic.keys()):
    if key == 1:
   		total = 10**(N-key)*dic[key]
    else:
        total += 10**(N-key)*dic[key]
print(total)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(100001)
N, M, K = map(int, input().split())

label = [-1] * N
n_label = [0] * N

F, B = {}, {}
for i in range(N):
    F[i] = set()
    B[i] = set()

for _ in range(M):
    x, y = map(int, input().split())
    F[x - 1].add(y - 1)
    F[y - 1].add(x - 1)

for _ in range(K):
    x, y = map(int, input().split())
    B[x - 1].add(y - 1)
    B[y - 1].add(x - 1)


def dfs(v, lab):
    if label[v] != -1:
        return 0
    label[v] = lab
    n_label[lab] += 1
    for n in F[v]:
        dfs(n, lab)
    return 1


# labeling
count = 0
for i in range(N):
    count += dfs(i, count)
n_label = n_label[:count]

# calc friend candidate
blocked = 0
for b in B[0]:
    if label[b] == label[0]:
        blocked += 1
print(n_label[label[0]] - 1 - len(F[0]) - blocked, end='')
for i in range(1, N):
    print(' ', end='')
    blocked = 0
    for b in B[i]:
        if label[b] == label[i]:
            blocked += 1
    print(n_label[label[i]] - 1 - len(F[i]) - blocked, end='')
print('')

Submission status: Runtime Error

Solution code:
import math

N = [int(input()) for i in range(100)]
min_page = math.ceil(N/2)
print(min_page)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = 3
S = [list(map(int, input().split())) for _ in range(N)]
n_guess = int(input())
guesses = set([int(input()) for _ in range(n_guess)])
dic = {}
for r in range(N):
  for c in range(N):
    dic[S[r][c]]=(r,c)

for g in guesses:
  if g in dic:
    (r, c) = dic[g]
    S[r][c] = -1

ans = 'No'
for i in range(N):
  if sum(S[i]) == -3:
    ans='Yes'
    
for i in range(N):
  if sum([S[_][i] for _ in range(N)]) == -3:
    ans='Yes'
    
if all([S[i][N-i-1]==-1 for i in range(N)]) or \
   all([S[i][i]==-1 for i in range(N)]):
   	ans = 'Yes'
print(ans)

Submission status: Runtime Error

Solution code:
page_N = input("Please Number")
min_page = round(page_N / 2)
print(min_page)

Submission status: Runtime Error

Solution code:
N = 3
S = [list(map(int, input().split())) for _ in range(N)]
n_guess = int(input())
guesses = set([int(input()) for _ in range(n_guess)])
dic = {}
for r in range(N):
  for c in range(N):
    dic[S[r][c]]=(r,c)

for g in guesses:
  if g in dic:
    (r, c) = dic[g]
    S[r][c] = -1
# print(S)
for i in range(N):
  if sum(S[i]) == -3:
    print('Yes')

    
for i in range(N):
  if sum([S[_][i] for _ in range(N)]) == -3:
    print('Yes')

    
if all([S[i][N-i-1]==-1 for i in range(N)]) or \
   all([S[i][i]==-1 for i in range(N)]):
   	print('Yes')
else:
	print('No')