QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#859173#9717. Defuse the BombszhenghanyunTL 10ms8960kbPython3227b2025-01-17 16:07:412025-01-17 16:07:42

Judging History

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

  • [2025-01-17 16:07:42]
  • 评测
  • 测评结果:TL
  • 用时:10ms
  • 内存:8960kb
  • [2025-01-17 16:07:41]
  • 提交

answer

T = int(input())
for i in range(T):
	input();a=list(map(int,input().split()));l=1;r=int(9e9)
	while l<=r:
		s=0;m=l+r>>1
		for x in a:
			s+=max(0,m-x)
		if s<=m:
			l=m+1
		else:
			r=m-1
	print(f"Case #{i+1}: {l}")

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 10ms
memory: 8960kb

input:

2
2
1 1
3
1 2 3

output:

Case #1: 3
Case #2: 4

result:

ok 2 lines

Test #2:

score: -100
Time Limit Exceeded

input:

3
100000
968870229 246637522 23867348 170512761 317727561 135784257 788061221 6692201 96102115 164513402 826612817 675345177 690177641 969959105 957765211 678805726 936166573 281739681 760822473 521447491 619742216 102531432 633299481 698320991 55968513 399427883 808303141 53228160 432641457 7250014...

output:

Case #1: 2
Case #2: 2

result: