QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#567372 | #9313. Make Max | zsy0701 | RE | 0ms | 0kb | Python3 | 749b | 2024-09-16 11:31:47 | 2024-09-16 11:31:47 |
Judging History
answer
import sys
def main():
import threading
def solve():
t = int(sys.stdin.readline())
for _ in range(t):
n = int(sys.stdin.readline())
a = list(map(int, sys.stdin.readline().split()))
max_val = a[-1]
ans = 0
len_seg = 1
i = n - 2
while len_seg < n:
if i < 0:
ans += 1
len_seg *= 2
continue
if a[i] == max_val:
len_seg += 1
i -=1
else:
ans +=1
len_seg *=2
print(ans)
threading.Thread(target=solve).start()
main()
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Dangerous Syscalls
input:
4 2 1 2 2 2 2 7 1 1 1 2 2 2 2 3 1 2 3