Problem:


Score : 100 points

Problem Statement

Given is an integer N.

Takahashi chooses an integer a from the positive integers not greater than N with equal probability.

Find the probability that a is odd.

Constraints

1 \leq N \leq 100

Input

Input is given from Standard Input in the following format:

N

Output

Print the probability that a is odd.
Your output will be considered correct when its absolute or relative error from the judge's output is at most 10^{-6}.

Sample Input 1

4

Sample Output 1

0.5000000000

There are four positive integers not greater than 4: 1, 2, 3, and 4. Among them, we have two odd numbers: 1 and 3. Thus, the answer is \frac{2}{4} = 0.5.

Sample Input 2

5

Sample Output 2

0.6000000000

Sample Input 3

1

Sample Output 3

1.0000000000



Sample input:
4


Sample output:
0.5000000000

Submission status: Runtime Error

Solution code:
n = int(input())
	if n%2 == 0;
  		y = n/2
	if round(n/2)<(n/2):
    	y=round((n+1)/2)
	print(str(y/n))

Submission status: Runtime Error

Solution code:
x= int(input())
y = round(x/2)
return y/x

Submission status: Runtime Error

Solution code:
x = round(n /2)
return x

Submission status: Runtime Error

Solution code:
def main():
    N,M=map(int,input().split())
    L=2**N
    dp=[10**7 for i in range(L)]
    dp[0]=0


    for i in range(M):
        a, _ = map(int, input().split())
        key=sum([2**(int(i)-1) for i in input().split()])
        for j in range(L):
                q=j|key
                dp[q]=min(dp[j]+a,dp[q])


    ans=dp[L-1]
    print(ans if ans<10**7 else -1)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def main():
    N,M=map(int,input().split())
    L=2**N
    dp=[10**10 for i in range(L)]
    dp[0]=0


    for i in range(M):
        a, _ = map(int, input().split())
        key=sum([1<<(int(i)-1) for i in input().split()])
        for j in range(L):
                q=j|key
                dp[q]=min(dp[j]+a,dp[q])


    ans=dp[L-1]
    print(ans if ans<10**10 else -1)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N,M=map(int,input().split())
a=[]
for i in range(M):
    tmp=list(map(int,input().split()))
    tmpc=list(map(int,input().split()))
    c=0
    for j in range(len(tmpc)):
        c+=2**(tmpc[j]-1)
    tmp[1]=c
    a+=[tmp]


dp=[[10**10 for j in range(2**N)] for i in range(M)]
dp[0][0]=0
dp[0][a[0][1]]=a[0][0]


for i in range(1,M):
    dp[i]=dp[i-1]
    for j in range(2**N):
        if dp[i-1][j]<10**10:
            q=j|a[i][1]
            dp[i][q]=min(dp[i-1][j]+a[i][0],dp[i][q])

ans=dp[M-1][2**N-1]
print(ans if ans<10**10 else -1)

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
print((a % 2).mean())

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
print(np.mean([*map(lambda x: x % 2, np.arange(1, N+1))]))

Submission status: Runtime Error

Solution code:
import numpy as np
import pandas as pd
N = int(input())
print(pd.Series(np.arange(1, N+1)).map(lambda x: x % 2).mean())

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
r = ""
for i in range(N):
  r+= str(A.index(i+1)+1)
  r+= " "
print(r)

Submission status: Runtime Error

Solution code:
A, B = map(int, raw_input().split())

divisor = []

for i in xrange(2, min(A,B)):
    if A % i == 0 and B % i == 0:
        divisor.append(i)
        A /= i
        B /= i
        while (A%i == 0) or (B%i == 0):
            A /= i
            B /= i
    
print len(divisor)+1

Submission status: Runtime Error

Solution code:
n=int(input())
ans=0
for i in n:
  if i%2==1:
    ans+=1
print(ans/n)

Submission status: Runtime Error

Solution code:
a,b = map(int,input().split())
if a*b%2==0:
    print("Even")
else:
    print("Odd")

Submission status: Runtime Error

Solution code:
a=int(input())
if a%2==0:
  print(0.5)
ifelse a==1:
  print(1)
else:
  print(2/3)

Submission status: Runtime Error

Solution code:
a=int(input())
if a%2==0:
  print(0.5)
ifelse a==1:
  print(1)
else:
  print(float(2/3))

Submission status: Runtime Error

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

if a % 2 == 1:
    print(a/N)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
lst=[]
while A>1 and B>1
    if A%i==0 and B%i==0:
        flag=1
        for l in lst:
            if i%l==0:
                flag=0
                break
        if flag:
            A=A//i
            B=B//i
            lst.append(i)

lst+=[1]
#print(lst)
print(len(lst))

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())
lst=[]
for i in range(2,int(min(A,B)**.5+1)):
    if A%i==0 and B%i==0:
        flag=1
        for l in lst:
            if i%l==0:
                flag=0
                break
        if flag:
            lst.append(i)

lst+=[1]
#print(lst)
print(len(lst))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
for i in range(1,n+1):
  ans=a.index(i)+1
  print(ans)

Submission status: Runtime Error

Solution code:
from math import sqrt

a,b = map(int,input().split())
 
L = []
 
if a < b: a,b = b,a
while b!=0:
    r = a%b
    a,b = b,r
 
G = a
 
for i in range(2,int(sqrt(G))+1):
    if G%i==0:
        L.append(i)
        while G%i==0:
            G/=i

if G!=1:
    L.append(G)

print(len(L)+1)

Submission status: Runtime Error

Solution code:
from math import sqrt

a,b = map(int,input().split())

L = []

if a < b: a,b = b,a
while b!=0:
    r = a%b
    a,b = b,r

G = a

for i in range(2,G+1):
    for j in L:
        if i%j==0: 
            break
    else:
        if G%i==0: 
            L.append(i)

print(len(L)+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = gets.to_i
count = 0
1.upto(n).each do |i|
  count += 1 if i.odd?
end

puts count/n.to_f

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
ANS = 0
Mylist = list(map(int, input().split()))
for i in range(N):
  if Mylist[i] >= K:
   	ANS += 1
print(ANS)

Submission status: Runtime Error

Solution code:
#n,k分ける
n,k=map(int, input().split())
#Aで数えるなら
A=list(map(int, input().split()))
count=0
#ｎ人いてて、ｋより高い人を抽出
for i in range(n):
    if A[i]>=k:
        count+=1
print(count)

Submission status: Runtime Error

Solution code:
n=int(input())
l=list(map(int,input().split()))
l2=[0]*(n+1)
for i,j in enumerate(l,1):
    l2[j]=i
l2.remove(0)    
print(' '.join(map(str,l2)))

Submission status: Runtime Error

Solution code:
n=input()
if n%2==0:
  print0.5
else:
  print (n+1)*1.0/2/n

Submission status: Runtime Error

Solution code:
n = int(input())

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

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

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

print(odd / N)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
nums = filter(lambda x: x % 2 != 0, range(1, N + 1))
print(len(nums) / float(N))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())

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

Submission status: Runtime Error

Solution code:
import math
import fractions
A,B = map(int,input().split())

maxn=fractions.gcd(A,B)
list=[]
def isPrime(n):
    if n == 2:
        return True
    if n % 2 == 0:
        return False

    m = math.floor(math.sqrt(n)) + 1
    for p in range(3, m, 2):
        if n % p == 0:
            return False
        return True
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    return divisors

yaku=make_divisors(maxn)
for i in range(len(yaku)):
    if isPrime(yaku[i]):
        list.append(yaku[i])

print(len(list))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
print(len([x for x in h if x >= k])

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
a = 0
for index, x in enumerate(h):
  if x == k:
    a += index
    break
print(n - a)

Submission status: Runtime Error

Solution code:
n, k = map(int, input().split())
h = list(map(int, input().split()))
h.sort()
for index, x in enumerate(h):
  if x == k:
    print(n - index)
    break

Submission status: Runtime Error

Solution code:
def main():
    n  =int(input())
    students = list(map(int,input().split()))
    number = [i for i in range(1,n+1)]
    students_number = []
    for i in range(n):
        students_number.append([students[i]] + [number[i]])
    sorted_students_number = sorted(students_number,key = lambda x:x[0])
    ans = [i[1] for i in sorted_students_number]
    print(*ans)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
from operator import itemgetter
n = int(input())
A = input().split()
for i in range(n):
  A[i] = [int(A[i]),i+1]
A = sorted(A, key=itemgetter(0))
for a in A[:-1]:
  print(a[1],end=" ")
print(A[-1][1])

Submission status: Runtime Error

Solution code:
def main():
    n  =int(input())
    students = list(map(int,input().split()))
    number = [i for i in range(n)]
    students_number = []
    for i in range(n):
        students_number.append([students[i]] + [number[i]])
    sorted_students_number = sorted(students_number,key = lambda x:x[0])
    ans = [i[1] for i in sorted_students_number]
    print(*ans)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
from operator import itemgetter
n = int(input())
A = input().split()
for i in range(n):
  A[i] = [int(A[i]),i+1]
A = sorted(A, key=itemgetter(0))
for a in A:
  print(a[1],end=" ")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = map(int,input().split(" "))
if n==1:
    print("1.0")
elif n%2 == 0:
    print("0.5")
else:
    print("0.6")

Submission status: Runtime Error

Solution code:
a = map(int,input().split(" "))
if a==1:
    print("1")
elif a%2 == 0:
    print("0.5")
else:
    print("0.6")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
odd = 0
for i in range(n+1):
  odd += 1 if i%2
print(odd/n)

Submission status: Runtime Error

Solution code:
n = int(input())
odd = 0
for i in range(n+1):
  odd += i if i%2:
print(int(odd/n)

Submission status: Runtime Error

Solution code:
A,B = map(int,input().split())
def prime_number_set(n):
  N = n
  result = set()
  for i in range(2,int(N**0.5)+1):
    while n%i == 0:
      n /= i
      result.add(i)
    if n <= 1:
      break
  return result

arrayA = prime_number_set(A)
arrayB = prime_number_set(B)
array = arrayA & arrayB
print(len(array)+1)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
lis = list(map(int, input().split()))
count = 0
for i in range(N):
    if lis[i] >= K:
        count += 1
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
def gcd(x,y):
    if(y==0):
        return x
    return gcd(y,x%y)

def factorize(n):
    i=2
    count = 1 
    while(i*i<=n):
        if(n%i): 
            ++i
            continue
        else:
            ++count
            while(n%i):
                n/=i
            ++i
    return count 
a,b = map(int,input().split())
A = factorize(gcd(a,b))

print(A)

Submission status: Runtime Error

Solution code:
import fractions
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

a,b = map(int,input().split())
A = prime_factorize(fractions.gcd(a,b))

print(len(A)+1)

Submission status: Runtime Error

Solution code:
N, K=map(int, input().split())
h=list(map(int, input().split()))
count=0

for i in range(N):
    if K <= h[i]:
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
import random

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

Submission status: Runtime Error

Solution code:
N,M = input().split()
N,M = int(N),int(M)
a = [0 for i in range(M)]
b = [[] for i in range(M)]

for k in range(M):
    a[k],b_ = input().split()
    a[k],b_ = int(a[k]),int(b_)
    
    b[k] = input().split()
    b[k] = [int(j)-1 for j in b[k]] 
#print(b)
def box(i,bo):#i :i番目の鍵 b空いている宝箱
    #if(0 not in bo):
        #i=M
        #return 0
    #elif(i==M and 0 in bo):
        #return 1e+20
    
    if(i==M):
        if(0 in bo):
            return 1e+20
        else:
            return 0
    else:
        if(0 not in bo):
            return 0
    
        else:
        
            p1 = box(i+1,bo)

            new_bo = bo.copy()
            for k in range(len(b[i])):
                new_bo[b[i][k]] += 1

            p2 = box(i+1,new_bo)+a[i]
            return min([p1,p2])
        
box_ = [0 for i in range(N)]
num = box(0,box_)
if(num>=1e+20):
    print(-1)
else:
    print(num)
    
#宝箱はN(<=12)個

Submission status: Runtime Error

Solution code:
N=int(input())
S=list(map(int,input().split(" ")))
jisho={}
for i in S:
    a=S.index(i)+1
    jisho[a]=i
jisho=sorted(jisho.items(), key=lambda x:x[1])
for i in range(0,len(jisho)):
    print(jisho[i][0],end=" ")

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

Submission status: Runtime Error

Solution code:
n=int(inpout())
if n%2==0:
  print(0.5)
else:
  print((n+1)/(2*n))

Submission status: Runtime Error

Solution code:
n=int(inpout())
if n%2==0:
    print(0.5)
else:
    print((n+1)/(2*n))

Submission status: Runtime Error

Solution code:
n=int(input())
if n%2==0:
    return(0.5)
else:
    return((n+1)/(2*n))

Submission status: Runtime Error

Solution code:
n=int(input())
if n%2==0:
  return(0.5)
else:
  return((n+1)/(2*n))

Submission status: Runtime Error

Solution code:
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac
import fractions
from functools import reduce
from operator import mul
import bisect
import sys
import logging
import heapq
import itertools

logging.basicConfig(level=logging.ERROR)

input = sys.stdin.readline

setrecursionlimit(1000000)


def main():
	a,b = map(int,input().split())
	g = gcd([a,b])
	l = factorization(g)
	print(len(l)+1 if len(l) != 1 else 1)

def factorization(n):
	arr = []
	temp = n
	for i in range(2, int(-(-n**0.5//1))+1):
		if temp%i==0:
			cnt=0
			while temp%i==0:
				cnt+=1
				temp //= i
			arr.append([i, cnt])

	if temp!=1:
		arr.append([temp, 1])

	if arr==[]:
		arr.append([n, 1])

	return arr

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(numbers):
	return reduce(fractions.gcd, numbers)

def lcm(numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

class PriorityQueue():
	def __init__(self):
		self.queue = []
	def push(self,i):
		heapq.heappush(self.queue,-i)
	def pop(self):
		return -1 * heapq.heappop(self.queue)
	def sum(self):
		return -sum(self.queue)

main()

Submission status: Runtime Error

Solution code:
A, B = map(int, input().split())
while A % B != 0:
	A, B = B, A % B
G = B
ans = 1
list = [2]
for i in range(3, G + 1):
	chk = True
	for j in list:
		if i % j == 0:
			chk = False
	if chk == True:
		list.append(i)
for k in list:
	if G % k == 0:
		ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

if N%2 == 0:
    print(0.5000)
else:
    print(((N-1)//(2*N))

Submission status: Runtime Error

Solution code:
n=int(input())
A=[[int(i)] for i in input().split()]

for i in range(n):
  A[i].append(i)
A=sorted(A, key=lambda x:x[0])
B=[A[i][1]+1 for i in range(n)]

print(*B)

Submission status: Runtime Error

Solution code:
# D - Disjoint Set of Common Divisors
A, B = map(int, input().split())

from fractions import gcd

# nの素数判定
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

# nの約数列挙
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            ass.append(n//i)
    return ass #sortされていない

ans = 0
gcd1 = gcd(A, B)
for i in divisor(gcd1):
    if is_prime(i):
        ans += 1

print(ans+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

lst1 = []
lst2 = []
A1,B1 = map(int, input().split(" "))

A = factorization(A1)
B = factorization(B1)

for i in range(len(A)):
    lst1.append(A[i][0])

for i in range(len(B)):
    lst2.append(B[i][0])
# print(lst1)
# print(lst2)

lst1_set = set(lst1)
lst2_set = set(lst2)

result_set = lst1_set & lst2_set


# print(result_set)
if A1 == 0 or B1 == 0:
    print(0)
elif A1 == 1 and B1 == 1:
    print(1)
else:
    print(len(result_set) + 1)

Submission status: Runtime Error

Solution code:
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

lst1 = []
lst2 = []
A1,B1 = map(int, input().split(" "))

A = factorization(A1)
B = factorization(B1)

for i in range(len(A)):
    lst1.append(A[i][0])

for i in range(len(B)):
    lst2.append(B[i][0])
# print(lst1)
# print(lst2)

lst1_set = set(lst1)
lst2_set = set(lst2)

result_set = lst1_set & lst2_set


# print(result_set)
if (A1 == 0 or B1 == 0):
    print(0)
else:
    print(len(result_set) + 1)

Submission status: Runtime Error

Solution code:
N=int(input())
nums = [int(x) for x in input().split()]

ans = [0]*N
for i in nums:
    ans[i-1] = nums.index(i)+1

print(*ans)

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, M = MAP()
dp = [INF]*(1<<N)
dp[0] = 0

for _ in range(M):
	a, b = MAP()
	c = LIST()
	d = 0
	for x in c:
		d += 1<<(x-1)

	for j in range(1<<N):
		tmp = j|d
		dp[tmp] = min(dp[tmp], dp[j]+a)

if dp[-1] == INF:
	print(-1)
else:
	print(dp[-1])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
for i in range(1,n+1):
  cnt+=i%2
  
print(cnt/n)

Submission status: Runtime Error

Solution code:
n=int(input())
if n%2=0:
  print(0.5)
elif:
  print ((n//2)/n)

Submission status: Runtime Error

Solution code:
n=int(input())
if n%2=0:
  print 0.5
elif:
  print ((n//2)/n)

Submission status: Runtime Error

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

for i in range(N):
  B[i] = A.index(i+1) + 1
  
  
print(*B)

Submission status: Runtime Error

Solution code:
import sys

Num = int(sys.stdin.readline().rstrip())
list_stu_Num = list(sys.stdin.readline().rstrip().split())
list_stu_Num_int = [int(s) for s in list_stu_Num]
list_attend_stu = None
for i in range(1, Num + 1):
    for l in range(0, Num):
        if list_stu_Num_int[l] == i:
            if not list_attend_stu:
                list_attend_stu = list(str(l + 1))
            else:
                list_attend_stu.append(l + 1)
print(*list_attend_stu)

Submission status: Runtime Error

Solution code:
import sys

Num = int(sys.stdin.readline().rstrip())
Num_str = str(Num)
list_stu_Num = list(sys.stdin.readline().rstrip().split())
list_stu_Num_int = [int(s) for s in list_stu_Num]
list_attend_stu = None
for i in range(1, Num + 1):
    for l in range(0, Num):
        if list_stu_Num_int[l] == i:
            if not list_attend_stu:
                list_attend_stu = list(str(l + 1))
            else:
                list_attend_stu.append(l + 1)
print(*list_attend_stu)

Submission status: Runtime Error

Solution code:
import sys

Num = int(sys.stdin.readline().rstrip())
#Num_str = str(Num)
list_stu_Num = list(sys.stdin.readline().rstrip().split())
list_stu_Num_int = [int(s) for s in list_stu_Num]
list_attend_stu = None
for i in range(1, Num + 1):
    for l in range(0, Num):
        if list_stu_Num_int[l] == i:
            if not list_attend_stu:
                list_attend_stu = list(str(l + 1))
            else:
                list_attend_stu.append(l + 1)
print(*list_attend_stu)

Submission status: Runtime Error

Solution code:
import sys

Num = int(sys.stdin.readline().rstrip())
list_stu_Num = list(sys.stdin.readline().rstrip().split())
list_stu_Num_int = [int(s) for s in list_stu_Num]
list_attend_stu = None
for i in range(1, Num + 1):
    for l in range(0, Num):
        if list_stu_Num_int[l] == i:
            if not list_attend_stu:
                list_attend_stu = list(str(l + 1))
            else:
                list_attend_stu.append(l + 1)
print(*list_attend_stu)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
if (N+1)/2 == N/2:
  p=float(0.5000000)
else:
  p=float((N-1)/2N)
print(p)

Submission status: Runtime Error

Solution code:
N=int(input())
if N = N/2:
  p=float(0.5000000)
else:
  p=float((N-1)/2N)
print(p)

Submission status: Runtime Error

Solution code:
N = int(input())

if N == 1:
  print(1)
else if N % 2 = 1:
  print(0.6)
else:
  print(0.5)

Submission status: Runtime Error

Solution code:
N, K = map(int, input().split())
H = list(map(int, input().split()))

ans = 0
for i in range(N):
    if H[i] >= K:
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split(" "))))
b = list(np.argsort(a) + 1)
b = [str(s) for s in b]
print(" ".join(b))

Submission status: Runtime Error

Solution code:
import math

def factorization(n):
    arr = []
    tmp = n
    for div in range(2, int(-(-n**0.5//1))+1):
        if tmp % div == 0:
            cnt = 0
            while tmp % div == 0:
                cnt += 1
                tmp //= div
            arr.append([div, cnt])

    if tmp != 1:
        arr.append([tmp, 1])

    if len(arr) == 0:
        arr.append([n, 1])

    return arr

if __name__ == '__main__':
    A, B = map(int, input().split())
    gcd = math.gcd(A, B)
    if gcd == 1:
        print(1)
        exit()
    facts = factorization(gcd)
    print(len(facts) + 1)

Submission status: Runtime Error

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

for i in range(N):
    for j in range(N):
        if A[j]==i+1:
            print(j+1)

Submission status: Runtime Error

Solution code:
N,K = [int(input()) for i in range(2)]
h = list(map(int, input().split()))
 
num =0
for i in range(N):
    if h[i]>K or h[i] == K:
        num =num+ 1
print(num)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

i=0
L=[]

while 2*i+1 < N:
    j = 2*i+1
    L.extend([j])
    i += 1
a = int(len(L))
pro = N/a
print(pro)

Submission status: Runtime Error

Solution code:
N=float(input())
count=0
for i in range(N):
    if(i%2==0):
        count+=1

print(count/N)

Submission status: Runtime Error

Solution code:
N = input()

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

Submission status: Runtime Error

Solution code:
N = input('')

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from fractions import gcd
A, B = map(int,input().split())
C = gcd(A,B)
C0 = C

p = {}
for i in range(2,10**6):
    if C % i == 0:
        p[i] = 0
        while C % i == 0:
            C //= i
            p[i] += 1
    if i * i > C0:
        break
if C != 0:
  p[C] = 1

print(len(p) + 1)

Submission status: Runtime Error

Solution code:
n=int(input())
for i in range(n):
  if i%2!=0:
    odd+=1
 
print(odd/n)

Submission status: Runtime Error

Solution code:
N = input()
1<= N(int) <=100

if N(int) % 2 ==0:
  print(float(1/2))

else:
  N(int) % 2 !=0:
  x = (N(int)+1)/2
  print(float(x/N(int)))

Submission status: Runtime Error

Solution code:
N = input()
1<= N(int) <=100

if N(int) % 2 ==0:
  print(float(1/2))

else:
  N(int) % 2 !=0:
  x = N(int) - (N(int)+1)/2
  print(float(x/N(int)))

Submission status: Runtime Error

Solution code:
1<= N(int) <=100

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

else:
  N(int) % 2 !=0:
  x = N(int)- (N(int)+1)/2
  print(x/N(int))

Submission status: Runtime Error

Solution code:
import random

N = input()
1<= N(int) <=100

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

else:
  N(int) % 2 !=0:
  x = N(int)- (N(int)+1)/2
  print(x/N(int))

Submission status: Runtime Error

Solution code:
N = input()
1<=N(int)<=100

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b = map(int,input().split())
if a < b:
    buf = a
    a = b
    b = buf
while b != 0:
    a, b = b, a % b
gcd = a
count = 1
if gcd % 2 == 0:
    count += 1
if gcd % 3 == 0:
    count += 1


def hantei(num):
    flag = True
    for i in range(2, int(num**0.5+1)):
        if num % i == 0:
            flag = False
    return flag


for i in range(5, gcd + 1):
    if gcd % i == 0 and hantei(i) == True:
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
A,B=map(int,input().split())

def get_cd(x1,x2):
    cd=[]
    for i in range(1,min(x1,x2)+1):
        if x1%i==0 and x2%i==0:
            cd.append(i)
    return cd

cd_AB=get_cd(A,B)

for j in range (0,len(cd_AB)-1):
    for k in range(j+1,len(cd_AB)):
            if(len(get_cd(cd_AB[j],cd_AB[k]))>1):
                cd_AB[k]=0

print(len(cd_AB)-cd_AB.count(0))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
  1 N = int(input())
  2 if N % 2 == 0:
  3     a = N / 2
  4 else:
  5     a = (N + 1) / 2
  6 print(1 / N * a)

Submission status: Runtime Error

Solution code:
  1 N = int(input())
  2 if N % 2 == 0:
  3     a = N / 2
  4 else:
  5     a = (N + 1) // 2
  6 print(1 / N * a)

Submission status: Runtime Error

Solution code:
  1 N = int(input())
  2 if N % 2 == 0:
  3     a = N / 2
  4 else:
  5     a = N // 2 + 1
  6 print(1 / N * a)

Submission status: Runtime Error

Solution code:

s = input().split()
n=int(s[0])

s=(input().split())

list=[[0 for i in range(2)] for j in range(n)]


for i in range(n):
    list[i][1]=i
    list[i][0]=int(s[i])

list.sort()

#print('list = {}'.format(list))
answer=[]
for i in range(n):
    print(list[i][1]+1)
    #list.append(list[i][1]+1)

#print(answer)