QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#580660#9308. World CupgaosihanRE 0ms0kbPython3881b2024-09-21 22:58:142024-09-21 22:58:15

Judging History

你现在查看的是最新测评结果

  • [2024-09-21 22:58:15]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:0kb
  • [2024-09-21 22:58:14]
  • 提交

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()

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

output:


result: