【发布时间】:2021-10-14 01:31:02
【问题描述】:
这是我用 PyCharm 编写的程序。它在 PyCharm IDE 中运行良好,但在 Codechef 的编译器中显示 EOF 错误。请提及错误的原因以及什么是 EOF 错误。谢谢!!
try:
T = int(input())
S = []
N = []
K = []
c = ''
for i in range(T):
x, y = input().split()
N.append(int(x))
K.append(int(y))
ele = input()
ele = ele.split()
for j in range(len(ele)):
ele[j] = int(ele[j])
S = ele
S.sort()
S.reverse()
count = 0
for l in range(N[I]):
if S[l] >= S[K[i]-1]:
count += 1
c += str(count) + " "
print(c)
except EOFError as e:
print(e)
【问题讨论】:
标签: python runtime-error eof