QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#580671 | #9308. World Cup | gaosihan | RE | 0ms | 0kb | Python3 | 1.0kb | 2024-09-21 23:01:19 | 2024-09-21 23:01:19 |
answer
def solve():
a = [0] * 40 # 创建一个大小为40的列表
for i in range(1, 33): # 读取32个整数
a[i] = int(input())
cnt = 0
for i in range(2, 33): # 统计小于a[1]的元素数量
if a[i] < a[1]:
cnt += 1
# 根据cnt的值输出不同的结果
if cnt < 2:
print(32)
elif cnt < 6:
print(16)
elif cnt < 13:
print(8)
elif cnt < 27:
print(4)
elif cnt < 31:
print(2)
else:
print(1)
# 主函数
def main():
import sys
input = sys.stdin.read # 使用read()在批量输入时更有效率
data = input().split() # 读取所有输入
ins = int(data[0]) # 获取测试用例的数量
index = 1
for _ in range(ins):
# 将32个整数从输入中提取并进行处理
for i in range(1, 33):
a[i] = int(data[index])
index += 1
solve()
if __name__ == "__main__":
main()
Details
Tip: Click on the bar to expand more detailed information
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