QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#879599 | #9690. Iron Warrior | ucup-team987 | WA | 13ms | 9344kb | Python3 | 481b | 2025-02-02 07:21:52 | 2025-02-02 07:21:52 |
Judging History
answer
def f(n):
d,r,b=0,5,0
if n%2==1:d=b=10
n//=2
A=2*d+2*b+2*b*n+53*n+2*r*n*n+2*r*n+11*n*n
B=-6-2*b+15*n-2*r*n+10*n*n
C=-15*n-21
D=5
def g(x):
return (A+B*x+C*x*x+D*x*x*x)//2
ans=max(g(0),g(n))
#g'=3*D*x*x+2*C*x+B=0 <=> x=-C-sqrt(C*C-3*D*B)
m=round((-C-(C*C-3*D*B)**0.5)/(3*D))
sz=10
L=max(m-sz,0)
R=min(m+sz,n)
for x in range(L,R+1):
ans=max(ans,g(x))
return ans
print(f(int(input())))
詳細信息
Test #1:
score: 100
Accepted
time: 10ms
memory: 9088kb
input:
1
output:
20
result:
ok answer is '20'
Test #2:
score: 0
Accepted
time: 9ms
memory: 9216kb
input:
3
output:
72
result:
ok answer is '72'
Test #3:
score: 0
Accepted
time: 8ms
memory: 9088kb
input:
4
output:
105
result:
ok answer is '105'
Test #4:
score: 0
Accepted
time: 11ms
memory: 8960kb
input:
5
output:
145
result:
ok answer is '145'
Test #5:
score: 0
Accepted
time: 12ms
memory: 9088kb
input:
6
output:
208
result:
ok answer is '208'
Test #6:
score: 0
Accepted
time: 7ms
memory: 9088kb
input:
7
output:
248
result:
ok answer is '248'
Test #7:
score: 0
Accepted
time: 8ms
memory: 9088kb
input:
8
output:
343
result:
ok answer is '343'
Test #8:
score: 0
Accepted
time: 9ms
memory: 9216kb
input:
486036
output:
13810882446441423
result:
ok answer is '13810882446441423'
Test #9:
score: 0
Accepted
time: 12ms
memory: 9088kb
input:
857503
output:
75842693981321486
result:
ok answer is '75842693981321486'
Test #10:
score: 0
Accepted
time: 12ms
memory: 9216kb
input:
459087
output:
11638561802272893
result:
ok answer is '11638561802272893'
Test #11:
score: 0
Accepted
time: 10ms
memory: 9216kb
input:
326354
output:
4181111331905669
result:
ok answer is '4181111331905669'
Test #12:
score: 0
Accepted
time: 10ms
memory: 9344kb
input:
755041
output:
51774938180590304
result:
ok answer is '51774938180590304'
Test #13:
score: 0
Accepted
time: 9ms
memory: 9216kb
input:
1000000
output:
120283726342420340
result:
ok answer is '120283726342420340'
Test #14:
score: 0
Accepted
time: 9ms
memory: 9344kb
input:
562451495
output:
21401951468280078633294014
result:
ok answer is '21401951468280078633294014'
Test #15:
score: 0
Accepted
time: 9ms
memory: 9216kb
input:
100214615
output:
121057415160393160185480
result:
ok answer is '121057415160393160185480'
Test #16:
score: 0
Accepted
time: 10ms
memory: 9216kb
input:
726997959
output:
46216571009844858875968944
result:
ok answer is '46216571009844858875968944'
Test #17:
score: 0
Accepted
time: 12ms
memory: 9216kb
input:
883477562
output:
82943950684199531529718356
result:
ok answer is '82943950684199531529718356'
Test #18:
score: 0
Accepted
time: 10ms
memory: 9216kb
input:
456878752
output:
11470993586298146794567272
result:
ok answer is '11470993586298146794567272'
Test #19:
score: 0
Accepted
time: 13ms
memory: 9216kb
input:
1000000000
output:
120281308501417045326995605
result:
ok answer is '120281308501417045326995605'
Test #20:
score: 0
Accepted
time: 8ms
memory: 9344kb
input:
151798318021627311
output:
420725672820572820226091469784149314525410684999074
result:
ok answer is '420725672820572820226091469784149314525410684999074'
Test #21:
score: -100
Wrong Answer
time: 11ms
memory: 9216kb
input:
466154514052238226
output:
12183941850211915347991952173009513930850219473085071
result:
wrong answer expected '12183941850211915347991952173009567537536253846445099', found '12183941850211915347991952173009513930850219473085071'