TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Given is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the edges are described by a grid of characters S. If S_{i,j} is `1`, there is an edge connecting Vertex i and j; otherwise, there is no such edge.  Determine whether it is possible to divide the vertices into non-empty sets V_1, \dots, V_k such that the following condition is satisfied. If the answer is yes, find the maximum possible number of sets, k, in such a division.    * Every edge connects two vertices belonging to two "adjacent" sets. More formally, for every edge (i,j), there exists 1\leq t\leq k-1 such that i\in V_t,j\in V_{t+1} or i\in V_{t+1},j\in V_t holds.

Submission attempts (in order):
print(-1)

n = int(input())
S = [list(input()) for i in range(n)]
e = [[] for i in range(n)]
count = [0]*n
for i in range(n):
    count[i] = S[i].count("1")
    for j in range(i+1,n):
        if S[i][j] == "1":
            e[i].append(j)
            e[j].append(i)

m = min(count)
ans = float("INF")
for i in range(n):
    if count[i] != m:
        continue
    dis = [float("INF")]*n
    dis[i] = 0
    check = True
    l = [i]
    d = 0
    while check:
        nl = []
        for j in l:
            for nex in e[j]:
                if dis[nex] < d-1 or dis[nex] == d:
                    check = False
                    break
                if dis[nex] == float("INF"):
                    nl.append(nex)
                    dis[nex] = d+1
            if check == False:
                break
        if check == False:
            d = float("INF")
            break
        if nl:
            l = nl
            d += 1
        else:
            break
    if d != float("INF"):
        ans = max(ans,d+1)
print(ans if ans < float("INF") else -1)

n = int(input())
S = [list(input()) for i in range(n)]
e = [[] for i in range(n)]
count = [0]*n
for i in range(n):
    count[i] = S[i].count("1")
    for j in range(i+1,n):
        if S[i][j] == "1":
            e[i].append(j)
            e[j].append(i)

m = min(count)
ans = 0
for i in range(n):
    dis = [float("INF")]*n
    dis[i] = 0
    check = True
    l = [i]
    d = 0
    while check:
        nl = []
        for j in l:
            for nex in e[j]:
                if dis[nex] < d-1 or dis[nex] == d:
                    check = False
                    break
                if dis[nex] == float("INF"):
                    nl.append(nex)
                    dis[nex] = d+1
            if check == False:
                break
        if check == False:
            d = float("INF")
            break
        if nl:
            l = nl
            d += 1
        else:
            break
    if d != float("INF"):
        ans = max(ans,d+1)
print(ans if ans != 0 else -1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Given is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the edges are described by a grid of characters S. If S_{i,j} is `1`, there is an edge connecting Vertex i and j; otherwise, there is no such edge.  Determine whether it is possible to divide the vertices into non-empty sets V_1, \dots, V_k such that the following condition is satisfied. If the answer is yes, find the maximum possible number of sets, k, in such a division.    * Every edge connects two vertices belonging to two "adjacent" sets. More formally, for every edge (i,j), there exists 1\leq t\leq k-1 such that i\in V_t,j\in V_{t+1} or i\in V_{t+1},j\in V_t holds.

Submission attempts (in order):
N = int(input())
graph = [[0] * N for i in range(N)]

for i in range(N):
    S = list(input())
    for j in range(N):
        graph[i][j] = int(S[j])
group = [-300] * N
group[0] = 1

answer = 0
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        if graph[i][j]:
            if group[j] == -300:
                group[j] = (group[i] + 1) % 2
            elif group[j] % 2 == group[i] % 2:
                print(i, j)
                print(-1)
                exit()

N = int(input())
graph = [[0] * N for i in range(N)]

for i in range(N):
    S = list(input())
    for j in range(N):
        graph[i][j] = int(S[j])
group = [-300] * N
group[0] = 1

answer = 0
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        if graph[i][j]:
            if group[j] == -300:
                group[j] = (group[i] + 1) % 2
            elif group[j] % 2 == group[i] % 2:
                print(-1)
                exit()


N = int(input())
graph = [[300] * (N+1) for _ in range(N+1)] 
edges = []
for i in range(N+1):
    graph[i][i] = 0
for i in range(1, N+1):
    S = list(str(input()))
    for j in range(len(S)):
        if S[j] == '1':
            edges.append((i, j+1))
            graph[i][j+1] = graph[j+1][i] = 1
for k in range(N+1):
    for i in range(N+1):
        for j in range(i+1, N+1):
            x = graph[i][k] + graph[k][j]
            if x < graph[i][j]:
                graph[i][j] = graph[j][i] = x

colors = [None] * (N+1)
colors[1] = 0
que = [1]
while que:
    x = que.pop()
    for i in range(1, N+1):
        if graph[x][i] != 1 or x == i:
            continue
        if colors[i] is None:
            colors[i] = 1 - colors[x]
            que.append(i)


is_bg = all(colors[a] != colors[b] for a, b in edges)
if not is_bg:
    print(-1)
    exit()
print(max(max(x[1:]) for x in graph[1:]) + 1)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Given is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the edges are described by a grid of characters S. If S_{i,j} is `1`, there is an edge connecting Vertex i and j; otherwise, there is no such edge.  Determine whether it is possible to divide the vertices into non-empty sets V_1, \dots, V_k such that the following condition is satisfied. If the answer is yes, find the maximum possible number of sets, k, in such a division.    * Every edge connects two vertices belonging to two "adjacent" sets. More formally, for every edge (i,j), there exists 1\leq t\leq k-1 such that i\in V_t,j\in V_{t+1} or i\in V_{t+1},j\in V_t holds.

Submission attempts (in order):
sin/agc039 >>> cat b.py 
from collections import deque
import sys
sys.setrecursionlimit(10**7)
N = int(input())
S = [input().strip() for _ in range(N)]
C = [0]*N

flg = False
for sp, row in enumerate(S):
    if flg:
        break

    if row.count('1') == 1 or sp == len(S)-1:
        flg = True

        # start BFS
        C[sp] = 1
        q = deque([])
        for i, v in enumerate(row):
            if v == '1':
                q.append(int(i))

        cnt = 0 # length
        c = -1 # color
        while q:
            cnt += 1
            for i in range(len(q)):
                np_ind = q.popleft()
                if C[np_ind] == -c:
                    print(-1)
                    exit()
                elif C[np_ind] == c:
                    pass
                else:
                    C[np_ind] = c
                    for i, v in enumerate(S[np_ind]):
                        if v == '1':
                            q.append(int(i))
            c *= -1

print(cnt)

from collections import deque
import sys
sys.setrecursionlimit(10**7)
N = int(input())
S = [input().strip() for _ in range(N)]

flg = False
max_cnt = 1
for sp, row in enumerate(S):
    # start BFS
    C = [0]*N
    C[sp] = 1
    q = deque([])
    for i, v in enumerate(row):
        if v == '1':
            q.append(int(i))

    cnt = 1 # length
    c = -1 # color
    while q:
        for i in range(len(q)):
            np_ind = q.popleft()
            if C[np_ind] == -c:
                print(-1)
                exit()
            elif C[np_ind] == c:
                pass
            else:
                C[np_ind] = c
                for i, v in enumerate(S[np_ind]):
                    if v == '1' and C[i] == 0:
                        q.append(int(i))
        cnt += 1
        c *= -1
    if max_cnt < cnt:
        max_cnt = cnt

print(max_cnt)

Verdicts: Runtime Error

Accepted
Problem: Given is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the edges are described by a grid of characters S. If S_{i,j} is `1`, there is an edge connecting Vertex i and j; otherwise, there is no such edge.  Determine whether it is possible to divide the vertices into non-empty sets V_1, \dots, V_k such that the following condition is satisfied. If the answer is yes, find the maximum possible number of sets, k, in such a division.    * Every edge connects two vertices belonging to two "adjacent" sets. More formally, for every edge (i,j), there exists 1\leq t\leq k-1 such that i\in V_t,j\in V_{t+1} or i\in V_{t+1},j\in V_t holds.

Submission attempts (in order):
import scipy.sparse.csgraph as c,numpy
_,*s=open(0)
s=numpy.int32([list(t[:-1])for t in s])
m=c.floyd_warshall(s)
i=m[0]%2<1
j=i^True
print(s[i][:,i].any()|s[j][:,j].any()and-1or m.max()+1)

import scipy.sparse.csgraph as c,numpy
m=c.dijkstra(s:=numpy.int8([[*t[:-1]]for t in open(0)][1:]))
i=m[0]%2<1
print(-any(s[j][:,j].any()for j in(i,i^True))or-~int(m.max()))

Verdicts: Wrong Answer

Accepted
Problem: Given is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the edges are described by a grid of characters S. If S_{i,j} is `1`, there is an edge connecting Vertex i and j; otherwise, there is no such edge.  Determine whether it is possible to divide the vertices into non-empty sets V_1, \dots, V_k such that the following condition is satisfied. If the answer is yes, find the maximum possible number of sets, k, in such a division.    * Every edge connects two vertices belonging to two "adjacent" sets. More formally, for every edge (i,j), there exists 1\leq t\leq k-1 such that i\in V_t,j\in V_{t+1} or i\in V_{t+1},j\in V_t holds.

Submission attempts (in order):
#  --*-coding:utf-8-*--


def f(N, S, st):
    R = [0]*(N)

    Q = set([st])
    R[st] = 1
    idx = 1
    cnt = 0

    while(len(Q) > 0):
        Q2 = set()
        cnt += 1
        idx += 1
        
        for i in Q:
            for j, s in enumerate(S[i]):
                if s == '1':
                    if R[j] == idx - 1:
                        return -1
                    elif R[j] == 0:
                        R[j] = idx
                        Q2.add(j)
                    
        Q = Q2
        
    return cnt
        


def g(N, S):
    m = 0

    for i in range(N):
        k = f(N, S, i)
        if k == -1:
            return -1

        m = max(m, k)

    return m



def main():
    N = int(input())
    S = list(input() for _ in range(N))

    print(g(N, S))





#  --*-coding:utf-8-*--


def f(N, S, st):
    R = [0]*(N)

    Q = set([st])
    R[st] = 1
    idx = 1
    cnt = 0

    while(len(Q) > 0):
        Q2 = set()
        cnt += 1
        idx += 1
        
        for i in Q:
            for j, s in enumerate(S[i]):
                if s == '1':
                    if R[j] == idx - 1:
                        return -1
                    elif R[j] == 0:
                        R[j] = idx
                        Q2.add(j)
                    
        Q = Q2
        
    return cnt
        


def g(N, S):
    m = 0

    for i in range(N):
        k = f(N, S, i)
        if k == -1:
            return -1

        m = max(m, k)

    return m



def main():
    N = int(input())
    S = list(input() for _ in range(N))

    print(g(N, S))





if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: Given is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the edges are described by a grid of characters S. If S_{i,j} is `1`, there is an edge connecting Vertex i and j; otherwise, there is no such edge.  Determine whether it is possible to divide the vertices into non-empty sets V_1, \dots, V_k such that the following condition is satisfied. If the answer is yes, find the maximum possible number of sets, k, in such a division.    * Every edge connects two vertices belonging to two "adjacent" sets. More formally, for every edge (i,j), there exists 1\leq t\leq k-1 such that i\in V_t,j\in V_{t+1} or i\in V_{t+1},j\in V_t holds.

Submission attempts (in order):
import numpy as np
import sys
from scipy.sparse.csgraph import floyd_warshall, csgraph_from_dense
N = int(input())
S = np.frombuffer(sys.stdin.buffer.read(),
                  dtype='S1').reshape(N, -1)[:, :N].astype(int)
G = csgraph_from_dense(S)
F = floyd_warshall(G).astype(int)
F2 = F % 2
I0 = np.where(F2[0] == 0)
I1 = np.where(F2[0] == 1)
if (S[I0][:, I0] == 0).all() and (S[I1][:, I1] == 0).all():
    print(F.max() + 1)
    exit()
print(-1)


import numpy as np
import sys
from scipy.sparse.csgraph import floyd_warshall, csgraph_from_dense
N = int(sys.stdin.buffer.readline())
S = np.frombuffer(sys.stdin.buffer.read(),
                  dtype='S1').reshape(N, -1)[:, :N].astype(int)
G = csgraph_from_dense(S)
F = floyd_warshall(G).astype(int)
F2 = F % 2
I0 = np.where(F2[0] == 0)
I1 = np.where(F2[0] == 1)
if (S[I0][:, I0] == 0).all() and (S[I1][:, I1] == 0).all():
    print(F.max() + 1)
    exit()
print(-1)


Verdicts: Runtime Error

Accepted
Problem: Given is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the edges are described by a grid of characters S. If S_{i,j} is `1`, there is an edge connecting Vertex i and j; otherwise, there is no such edge.  Determine whether it is possible to divide the vertices into non-empty sets V_1, \dots, V_k such that the following condition is satisfied. If the answer is yes, find the maximum possible number of sets, k, in such a division.    * Every edge connects two vertices belonging to two "adjacent" sets. More formally, for every edge (i,j), there exists 1\leq t\leq k-1 such that i\in V_t,j\in V_{t+1} or i\in V_{t+1},j\in V_t holds.

Submission attempts (in order):



N = int(input())
E = [[] for i in range(N)]
G = [None] * N
INF = 10 ** 9
for i in range(N):
  edges = input()
  G[i] = list(map(int,list(edges)))
  G[i] = list(map(lambda x:INF if x == 0 else x,G[i]))
  for j in range(len(edges)):
    if edges[j] == "1":
      E[i].append(j)

color = [-1 for i in range(N)]
from collections import deque
q = deque([])

q.append([0,0])

while q:
  v,bit = q.popleft()
  if color[v] != -1:
    
    if color[v] == bit: 
      continue
    else: 
      print(-1)
      exit(0)
  
  color[v] = bit
  children = E[v]
  for child in children:
    q.append([child,bit^1])




for k in range(N):
  for i in range(N):
    for j in range(N):
      G[i][j] = min(G[i][j],G[i][k] + G[k][j])

ans = 0
for i in range(N):
  for j in range(N):
    if ans < G[i][j]:
      ans = G[i][j]
      
print(ans + 1)




N = int(input())
E = [[] for i in range(N)]
G = [None] * N
INF = 10 ** 9
for i in range(N):
  edges = input()
  G[i] = list(map(int,list(edges)))
  G[i] = list(map(lambda x:INF if x == 0 else x,G[i]))
  for j in range(len(edges)):
    if edges[j] == "1":
      E[i].append(j)

color = [-1 for i in range(N)]
from collections import deque
q = deque([])

q.append([0,0])

while q:
  v,bit = q.popleft()
  if color[v] != -1:
    
    if color[v] == bit: 
      continue
    else: 
      print(-1)
      exit(0)
  
  color[v] = bit
  children = E[v]
  for child in children:
    q.append([child,bit^1])




import numpy as np
from scipy.sparse.csgraph import shortest_path
from scipy.sparse.csgraph import floyd_warshall
from scipy.sparse.csgraph import csgraph_from_dense

G = csgraph_from_dense(G, null_value=10**9)
d = floyd_warshall(G)

ans = 0
for i in range(N):
  for j in range(N):
    if ans < d[i][j]:
      ans = d[i][j]
      
print(int(ans) + 1)

Verdicts: Wrong Answer

Accepted
Problem: Given is a connected undirected graph with N vertices and M edges. The vertices are numbered 1 to N, and the edges are described by a grid of characters S. If S_{i,j} is `1`, there is an edge connecting Vertex i and j; otherwise, there is no such edge.  Determine whether it is possible to divide the vertices into non-empty sets V_1, \dots, V_k such that the following condition is satisfied. If the answer is yes, find the maximum possible number of sets, k, in such a division.    * Every edge connects two vertices belonging to two "adjacent" sets. More formally, for every edge (i,j), there exists 1\leq t\leq k-1 such that i\in V_t,j\in V_{t+1} or i\in V_{t+1},j\in V_t holds.

Submission attempts (in order):
import sys
from scipy.sparse.csgraph import floyd_warshall
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

N = int(readline())
S = [list(map(int, list(i))) for i in read().split()]

print(S)
distance = floyd_warshall(S, directed=False)
distance = [list(map(int, i)) for i in distance]

if S == distance:
    print(-1)
else:
    print(max([max(i) for i in distance]) + 1)

import sys
from scipy.sparse.csgraph import floyd_warshall
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines

N = int(readline())
S = [list(map(int, list(i))) for i in read().split()]

distance = floyd_warshall(S, directed=False)
distance = [list(map(int, i)) for i in distance]

if S == distance:
    print(-1)
else:
    print(max([max(i) for i in distance]) + 1)

import sys
from scipy.sparse.csgraph import floyd_warshall
import numpy as np
from collections import deque

read = sys.stdin.read
readline = sys.stdin.readline

N = int(readline())
S = np.array([list(i) for i in read().split()], np.int64)
edges = np.where(S == 1)


graph = [[] for _ in range(N)]

for i, j in zip(edges[0].tolist(), edges[1].tolist()):
    graph[i].append(j)
    graph[j].append(i)


def judge(start):
    colors = [-1] * N
    colors[start] = 0
    queue = deque([(start, 0)])
    while queue:
        V, c = queue.popleft()
        c ^= 1
        for v in graph[V]:
            if colors[v] == -1:
                colors[v] = c
                queue.append((v, c))
            else:
                if colors[v] != c:
                    return False
    return True


start = edges[0][0]
if judge(start):
    d = floyd_warshall(S)
    print(int(np.max(d)) + 1)
else:
    print(-1)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Given are integers N and X. For each integer k between 0 and X (inclusive), find the answer to the following question, then compute the sum of all those answers, modulo 998244353.    * Let us repeat the following operation on the integer k. Operation: if the integer is currently odd, subtract 1 from it and divide it by 2; otherwise, divide it by 2 and add 2^{N-1} to it. How many operations need to be performed until k returns to its original value? (The answer is considered to be 0 if k never returns to its original value.)

Submission attempts (in order):
mod = 998244353
N = int(input())
X = input()

d = []
for n in range(1,N+1):
    if N%n==0 and (N//n)%2==1:
        d.append(n)

p_d = {}

for n in d:
    p_d[n] = 0
    S = []
    for i in range(N):
        j = i//n
        if X[i%n]=='0':
            if j%2==0:
                S.append('0')
            else:
                S.append('1')
        else:
            if j%2==0:
                S.append('1')
            else:
                S.append('0')

    S = ''.join(S)
    s = X[:n][::-1]
    print(S)
    print(X)
    for i in range(n):
        if s[i]=='1':
            p_d[n] += pow(2,i,mod)
    if S<=X:
        p_d[n] += 1


ans = 0
for i in range(len(d)):
    n = d[i]
    for j in range(i):
        m = d[j]
        if n%m==0:
            p_d[n] -= p_d[m]
    ans += p_d[n]*2*n
ans %= mod
print(ans)


mod = 998244353
N = int(input())
X = input()
X_ = []
for i in range(N):
    if X[i]=='0':
        X_.append('1')
    else:
        X_.append('0')
X_ = ''.join(X_)

d = []
for n in range(1,N+1):
    if N%n==0 and (N//n)%2==1:
        d.append(n)

p_d = {}

for n in d:
    p_d[n] = 0
    S = (X[:n]+X_[:n])*(N//n//2)+X[:n]
    p_d[n] += int(X[:n],2)%mod
    if S<=X:
        p_d[n] += 1

ans = 0
for i in range(len(d)):
    n = d[i]
    for j in range(i):
        m = d[j]
        if n%m==0:
            p_d[n] -= p_d[m]
    ans += p_d[n]*2*n
ans %= mod
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

N = int(input())

odd_count = (N//2+1)
print('{:.6f}'.format(odd_count/N))



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


n = len([1 for x in friends if x>=K])

print(n)

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

n = len([1 for x in friends if x>K])

print(n)

from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

N = int(input())

if N%2==0:
    odd_count = N//2
else:
    odd_count = N//2+1
print('{:.10f}'.format(odd_count/N))



Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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.

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

print("{:.10f}".format((a // 2 + 1) / a))

a = int(input())

print("{:.10f}".format(((a + 1) // 2 ) / a))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
nums = filter(lambda x: x % 2 != 0, range(1, N + 1))
print(len(nums) / float(N))


N = int(input())
odds = list(filter(lambda x: x % 2 != 0, range(1, N + 1)))
print("{:.10f}".format(len(odds) / float(N)))


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
if N % 2 == 0:
    print('{:.010f}'.format(N / 2))
else:
    print('{:.010f}'.format((N+1) / (2 * N)))

N = int(input())
if N % 2 == 0:
    print(N / 2)
else:
    print('{:.06f}'.format((N+1) / (2 * N)))

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

N = int(input())
if N % 2 == 0:
    print('{:.010f}'.format(1 / 2))
else:
    print('{:.010f}'.format((N+1) / (2 * N)))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

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

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


N = int(input())

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


N = int(input())
# N=100

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


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys
N = int(sys.stdin.readline())

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

import sys
N = int(sys.stdin.readline())

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

import sys

N = int(sys.stdin.readline())

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

print('%.10f' %a)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def main():
    N = int(input())
    if(N==1):
        print(1.0)
        return
    if(N%2==0):
        print(0.5)
    else:
        result = (N - round(N/2))/N
        print(result)

if __name__ == "__main__":
    main()

def main():
    N = int(input())
    if(N==1):
        print(1)
        return
    if(N%2==0):
        print(0.5)
    else:
        result = (N - round(N/2))/N
        print(result)

if __name__ == "__main__":
    main()

def main():
    N = int(input())
    if(N==1):
        print('{:.10g}'.format(1.0))
        return
    if(N%2==0):
        print('{:.10g}'.format(0.5))
    else:
        result = (N - round(N/2))/N
        print('{:.10g}'.format(result))

if __name__ == "__main__":
    main()

def main():
    N = int(input())
    if(N==1):
        print(1)
        return
    if(N%2==0):
        print(0.5)
        return
    else:
        result = (N - round(N/2))/N
        print(result)

if __name__ == "__main__":
    main()

def main():
    N = int(input())
    if(N==1):
        print('{:.10f}'.format(1.0))
        return
    if(N%2==0):
        print('{:.10f}'.format(0.5))
    else:
        result = (N - (N-1)/2)/N
        print('{:.10f}'.format(result))

if __name__ == "__main__":
    main()

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

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

res = (n-(n/2))/n

print(ress)

n = input()

res = (n-(n/2))/n

print(res)

n = int(input())

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


n = int(input())

if n == 1:
    print(1)
    exit

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

print(res)


import math
n = int(input())

if n == 1:
    print("{:.10f}".format(1))
    exit()

res = (n-math.floor(n/2))/n


print("{:.10f}".format(res))


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys

input = sys.stdin.readline
A, B = map(int, input().split())


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

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

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

    return arr


af = factorization(A)
bf = factorization(B)
ans = 1
for afi in af:
    if afi in bf:
        ans += 1
print(ans)


N = int(input())

if N % 2 == 0:
    print('0.5000000000')
else:
    print(round((int(N / 2) + 1) / N, 10))


Verdicts: Runtime Error

Accepted
Problem: 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.

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

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

n = int(input())

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

n = int(input())

if n%2 == 0:
	print(format(1, '.10f'))
else:
	print(format((n//2  + 1)/ n, '.10f'))

n = int(input())

if n%2 == 0:
	print(format(0.5, '.10f'))
else:
	print(format((n//2  + 1)/ n, '.10f'))

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
print((n / 2) / n)

n = int(input())
if n % 2 == 0:
    print('{:.10f}'.format((n / 2) / n))
else:
    print('{:.10f}'.format(((n + 1) / 2) / n))

Verdicts: Wrong Answer

Accepted
Problem: 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.

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

print((N // 2 + N % 2) / )N

N = int(input())

print("{0:.10f}".format((N // 2 + N % 2) / N))


Verdicts: Runtime Error

Accepted
Problem: 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.

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

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

N = float(input("N: "))

if (N % 2 == 0) :
    print('{:.10f}'.format(N/(2 * N)))
else :
    print('{:.10f}'.format((((N-1)/2)+1)/N))

N = int(input("N: "))

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

import math

N = float(input("N: "))

print('{:.10f}'.format(1-math.floor(N/2)/N))

import math

N = float(input())

print('{:.10f}'.format(1-math.floor(N/2)/N))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
MAX = 10**8+1
N, M = map(int, input().split())

X = [MAX]*(2**N)
X[0] = 0

for i in range(M):
    a, b = map(int, input().split())
    k = sum(1<<(c-1) for c in map(int, input().split()))

    for j, x in enumerate(X):
        if X[j|k] > x + a:
            X[j|k] = x + a

print(X[-1] if X[-1] < MAX else -1)


#  --*-coding:utf-8-*--

def main():
    N = int(input())

    print('{:.10f}'.format(((N+1)//2)/N))


if __name__ == '__main__':
    main()


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):

N = int(input())

kisu = 0
gusu = 0

for i in range(N):
  if i % 2 = 0:
    kisu += 1
  else:
    gusu += 1
    
kakuritsu = kisu // (gusu + kisu)

print(kakuritsu)

N = int(input())

kisu = 0
gusu = 0

for i in range(N):
  if i % 2 == 1:
    kisu += 1
  else:
    gusu += 1
    
kakuritsu = kisu / (gusu + kisu)

print(kakuritsu)



N = int(input())

kisu = 0
gusu = 0

for i in range(N):
  if i % 2 == 1:
    kisu += 1
  else:
    gusu += 1
    
kakuritsu = kisu / (gusu + kisu)

print('{:10f}'.format(kakuritsu))



N = int(input())

kisu = 0
gusu = 0

for i in range(1, N+1):
  if i % 2 == 1:
    kisu += 1
  else:
    gusu += 1
    
    
kakuritsu = kisu / (gusu + kisu)



N = int(input())

kisu = 0
gusu = 0

for i in range(N):
  if i % 2 == 1:
    kisu += 1
  else:
    gusu += 1
    
kakuritsu = kisu / (gusu + kisu)

print('{:f}'.format(kakuritsu))



N = int(input())

kisu = 0
gusu = 0

for i in range(1,N+1):
  if i % 2 == 1:
    kisu += 1
  else:
    gusu += 1
    
kakuritsu = kisu / (gusu + kisu)

print('{:.10f}'.format(kakuritsu))



Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())
if N%2==0:
  print('{:.06}'.format(N//2))
else:
  print('{:.06}'.format(N//2+1))

N=int(input())
if N%2==0:
  print('{:.010f}'.format((N//2)/N))
else:
  print('{:.010f}'.format((N//2+1)/N))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
if n%2 == 0:
    #print(format(n/(2*n), '.10f'))
    print(n/(2*n))
else:
    #print(format((n+1)/2*n, '.10f'))
    print((n+1)/2*n)

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

n = int(input())
if n%2 == 0:
    #print(format(n/(2*n), '.10f'))
    print(n/(2*n))
else:
    #print(format((n+1)/(2*n), '.10f'))
    print((n+1)/2*n)

n = int(input())
if n%2 == 0:
    print(format(n/(2*n), '.10f'))
    #print(n/(2*n))
else:
    print(format((n+1)/(2*n), '.10f'))
    #print((n+1)/(2*n))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
from collections import*
n,m,*t=map(int,open(0).read().split())
i,o,r=[0]*n,[[]for _ in'_'*n],[]
for a,b in zip(*[iter(t)]*2):
  o[a-1]+=b-1,
  i[b-1]+=1
q=deque(v for v in range(n)if i[v]<1)
while q:
  v=q.popleft()
  r+=v,
  for w in o[v]:
    i[w]-=1
    if i[w]==0:q+=w,
print(-(len(r)==n))
for j,k in enumerate(i):
  if i[j]>0: print(j+1)

n = int(input())
print('{:.10f}'.format((n//2 + n%2)/n))

Verdicts: Runtime Error

Accepted
Problem: 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.

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

x=float(input())
c=0
for i in range(1,int(x+1)):
    if (i%2!=0):
        c+=1
print('%.10f'%(c/x))


Verdicts: Wrong Answer

Accepted
Problem: 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.

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

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

n = int(input())

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

print('{:.10f}'.format(t))

n = int(input())

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

print('{:.10f}'.format(t))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
count = 0
for i in range(1, n+1):
    if i % 2 == 1:
        count += 1

print('{:.11g}'.format(n/count))

n = int(input())
count = 0
for i in range(1, n+1):
    if i % 2 == 1:
        count += 1

print(n/count)

n = int(input())
count = 0
for i in range(1, n+1):
    if i % 2 == 1:
        count += 1

print('{:.11f}'.format(n/count))


n = int(input())
count = 0
for i in range(1, n+1):
    if i % 2 == 1:
        count += 1

print('{:.10f}'.format(count/n))


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

n = int(input())
if n == 1:
    print('{:.10g}'.format(0.5000000000))
elif n%2 ==1:
    print('{:.10g}'.format(0.6000000000))
else:
    print('{:.10g}'.format(0.5000000000))

n = int(input())

k = n%2
if n == 1:
    print('{:.10f}'.format(1.0000000000))
elif k == 1:
    print('{:.10f}'.format((n//2 + 1)/n))
else:
    print('{:.10f}'.format(0.5000000000))


Verdicts: Wrong Answer

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
N,K=map(int,input().split())
h=list(map(int,input().split()))
h=sorted(h)
left=-1
right=len(h)
while left-right>1:
  mid=(right+left)//2
  if h[mid]>=K:
    right=mid
  else:
    left=mid
print(len(h)-left)

N,K=map(int,input().split())
h=list(map(int,input().split()))
h=sorted(h)
left=-1
right=len(h)
while right-left>1:
  mid=(right+left)//2
  if h[mid]>=K:
    right=mid
  else:
    left=mid
print(len(h)-left)

N,K=map(int,input().split())
h=list(map(int,input().split()))
h=sorted(h)
right=-1
left=len(h)
while left-right>1:
  mid=(right+left)//2
  if h[mid]>K:
    left=mid
  else:
    right=mid
print(len(h)-left)

N,K=map(int,input().split())
h=list(map(int,input().split()))
h=sorted(h)
left=-1
right=len(h)
while right-left>1:
  mid=(right+left)//2
  if h[mid]>=K:
    right=mid
  else:
    left=mid
print(len(h)-left-1)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
data = input().split()
N = int(data[0])
K = int(data[0])
h = map(int, input().split())

isGraterThanN = lambda n: lambda value: value >= n
isGraterThanK = isGraterThanN(K)

h_grater_then_k = filter(isGraterThanK, h)
h_grater_then_k = list(h_grater_then_k)

answer = len(h_grater_then_k)
print(answer)


data = input().split()
N = int(data[0])
K = int(data[1])
h = map(int, input().split())

isGraterThanN = lambda n: lambda value: value >= n
isGraterThanK = isGraterThanN(K)

h_grater_then_k = filter(isGraterThanK, h)
h_grater_then_k = list(h_grater_then_k)

answer = len(h_grater_then_k)
print(answer)


Verdicts: Wrong Answer

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
n,k=map(int,input().split())
c=0
l=list(map(int,input().split()))
for i in l:
    if i>k:
        c+=1
print(c)

n,k=map(int,input().split())
l=list(map(int,input().split()))
o=[x for x in l if x>=k]
print(len(o))

Verdicts: Wrong Answer

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
n, k = map(int, input().split())
h = [int(x) for x in input().split() if x>=k]
print(sum(h))

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

Verdicts: Runtime Error

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

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

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
# coding: utf-8
import numpy as np


def main():

    _, limit = map(int, input().split(' '))
    heights = np.array(list(map(int, input().split(' '))))

    print(heights >= limit)
    print(np.count_nonzero(heights >= limit))

    return 0
    
    
if __name__ == '__main__':
    main()


# coding: utf-8


def main():

    n, limit = map(int, input().split(' '))
    heights = list(map(int, input().split(' ')))
    heights = sorted(heights, reverse=True)

    nakama_count = 0
    for height in heights:
        if height >= limit:
            nakama_count += 1
        else:
            break

    print(nakama_count)

    return 0
    
    
if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
N,K = map(int,input().split())
h = list(map(int,input().split()))

h.sort()
a = 0

for i in range(N):
  if h[i] >= K:
    a += i
    break
print(N-a+1)

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

h.sort()
a = 0

for i in range(N):
  if h[i] >= K:
    a += i
  break
print(N-a+1)

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

h.sort()
a = 0

for i in range(N):
  if h[i] >= K:
    a += i
    break
  else:
    continue
if max(a) < K:
  a += N
print(N-a)

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

h.sort()
a = 0

for i in range(N):
  if h[i] >= K:
    a += i
    break
  else:
    continue
if max(h) < K:
  a += N
print(N-a)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
n,k = int(input())
h = list(map(int,input().split()))
cnt=0
for i in range(n):
	if k<=h[i]:
		cnt+=1
print(cnt)

N_K = list(map(int, input().split()))#N_K[0]=N , N_K[1]=K
h = list(map(int,input().split()))# h[N]
ans = 0
for i in range(N_K[0])
	if h[i] >= N_K[1]:
		ans+=1
print(ans)


n,k = map(int,input().split())
h = list(map(int,input().split()))
cnt=0
for i in range(n):
	if k<=h[i]:
		cnt+=1
print(cnt)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
x = input().split()
y = input().split()

cnt = 0

for i in y:
  if i >= int(x[1]):
    cnt += 1
    
print(cnt)

x = input().split()
y = input().split()

cnt = 0

for i in y:
  if int(i) >= int(x[1]):
    cnt += 1
    
print(cnt)

Verdicts: Runtime Error

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
n,k=input().split(" ") 
h=input().split(" ") 
c=0
for i in h:
  if int(i )>int(k):
    c+=1
print (c)

n,k=input().split(" ") 
h=input().split(" ") 
c=0
for i in h:
  if int(i)>=int(k):
    c+=1
print (c)

Verdicts: Wrong Answer

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
n, k=map(int,input())
h=list(map(int,input()))
cnt=0
for i in h:
  if i>=k:
    cnt+=1
print(cnt)

n, k=map(int,input().split())
h=list(map(int,input().split()))
cnt=0
for i in h:
  if i>=k:
    cnt+=1
print(cnt)


Verdicts: Runtime Error

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):

inputA =  list(map(int,input().split()))
inputB =  list(map(int,input().split()))

humancount = inputA[0]
talllimit = inputA[1]
count= 0

for count in range(0,humancount):
    if inputB(count) >= talllimit:
        count += 1


print(count)

ip= list(map(int, input().split()))

N = ip[0]
K = ip[1]

h = list(map(int, input().split()))
ans = 0
for tall in h:
    if tall >= K:
        ans +=1

print(ans)

Verdicts: Runtime Error

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

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

res=0

for i in h:
	if i>=k:
       res = res + 1
       
print(res)

n,k=map(int,input().split())
H=list(map(int,input().split()))
res=0
for h in H:
	if h>=k:
		res += 1
print(res)

Verdicts: Runtime Error

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

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

h = list(map(int, input().split()))

# n = int(input())


index = 0
h.sort()
print(h)
for i in range (0,n):
    if h[i] >= k:
        index = i
        break

print(n-index)


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

h = list(map(int, input().split()))

# n = int(input())


count = 0
for i in range (0,n):
    if h[i] < k:
        count+=1

print(n-count)


Verdicts: Wrong Answer

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
N, K = map(int, input().split(''))
friends = list(map(int, input().split('')))

n = len([1 for x in friends if x>K])

print(n)

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


n = len([1 for x in friends if x>=K])

print(n)

Verdicts: Runtime Error

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
N, K=map(int, input())
a=1
T=0
if a<=N:
	a+=1
	P=input()
    if P>=K:
		T+=1
print(T)

N, K=map(int, input())
A=list(map(int, input()))
a=0
for i in A:
	if i>=K:
		a+=1
print(a)

N, K=map(int, input().split())
A=list(map(int, input().split()))
a=0
for i in A:
	if i>=K:
		a+=1
print(a)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
def atc_142b(NK_input: str, hi_input: str) -> int:
    N, K = map(int, NK_input.split(" "))
    hi = [int(i) for i in hi_input.split(" ")]
    hi = sorted(hi)
    for i in range(0, len(hi)):
        if hi[i] >= K:
            return len(hi) - i
    return 0

NK_input_value = input()
hi_input_value = input()
pritn(atc_142b(NK_input_value, hi_input_value))


def atc_142b(NK_input: str, hi_input: str) -> int:
    N, K = map(int, NK_input.split(" "))
    hi = [int(i) for i in hi_input.split(" ")]
    hi = sorted(hi)
    for i in range(0, len(hi)):
        if hi[i] >= K:
            return len(hi) - i
    return 0


NK_input_value = input()
hi_input_value = input()
print(atc_142b(NK_input_value, hi_input_value))


Verdicts: Runtime Error

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
n, k, *h = map(int,open(0).read().split());
print(sum(h>=k for h_i in h))

n, k, *h = map(int,open(0).read().split())
print(sum(h>=k for h_i in h))

n,k,*h=map(int,open(0).read().split());print(sum(h>=k for h in h))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: N friends of Takahashi has come to a theme park.  To ride the most popular roller coaster in the park, you must be at least K centimeters tall.  The i-th friend is h_i centimeters tall.  How many of the Takahashi's friends can ride the roller coaster?

Submission attempts (in order):
n, k = map(int, input().split())
a=input().split()
sum=0
for i in a:
  sum+=int(a)>=k
print(sum)

n, k = map(int, input().split())
a=input().split()
sum=0
for i in a:
  sum+=int(int(i)>=k)
print(sum)

Verdicts: Runtime Error

Accepted