QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#580660 | #9308. World Cup | gaosihan | RE | 0ms | 0kb | Python3 | 881b | 2024-09-21 22:58:14 | 2024-09-21 22:58:15 |
answer
def read():
n = 0
f = 1
ch = input()
# Read until a number is found (or a '-' sign for negative)
while not ch.isdigit():
if ch == '-':
f = -1
ch = input()
# Accumulate digits
while ch.isdigit():
n = n * 10 + int(ch)
ch = input()
return n * f
def main():
t = read()
for _ in range(t):
a = [0] * 33
for i in range(1, 33):
a[i] = read()
sl = sum(1 for i in range(1, 33) if a[i] > a[1])
if sl == 0:
print("1")
elif sl <= 4:
print("2")
elif sl <= 18:
print("4")
elif sl <= 25:
print("8")
elif sl <= 29:
print("16")
else:
print("32")
if __name__ == "__main__":
main()
详细
Test #1:
score: 0
Dangerous Syscalls
input:
1 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1