QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#723901 | #9133. Function with Many Maximums | ucup-team3646 | AC ✓ | 105ms | 26900kb | Python3 | 563b | 2024-11-08 02:57:27 | 2024-11-08 02:57:28 |
Judging History
answer
"""
A を降順ソート
f(A[k]) = A[1] + A[2] + ... + A[k-1] + (k+1)*A[k] になる
k >= 10^5 の偶数で
f(A[k]) = f(A[k+2]) となるようにしたい
-> k*A[k]=A[k+1]+(k+3)*A[k+2] となるように適当に A[k+1], A[k+2] を決めればよさそう
"""
A = [10**12 - i for i in range(10**5)]
k = 10**5
for _ in range(10**5 + 10):
val = k * A[-1]
res2 = (val - (k + 5)) // (k + 4)
res1 = val - res2 * (k + 3)
assert A[-1] > res1 > res2
A.append(res1)
A.append(res2)
k += 2
print(len(A))
print(*A[::-1])
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 105ms
memory: 26884kb
input:
4
output:
300020 111097695843 111098074341 111099177058 111099668746 111100658303 111100962927 111102139577 111102556917 111103620881 111104150697 111105102215 111105444259 111106583578 111107037624 111108064971 111108630779 111109546394 111109923722 111111027846 111111516462 111112509328 111113108992 1111139...
result:
ok n=300020, max_a=1000000000000, max_num=100011 >= 4
Test #2:
score: 0
Accepted
time: 104ms
memory: 26900kb
input:
100000
output:
300020 111097695843 111098074341 111099177058 111099668746 111100658303 111100962927 111102139577 111102556917 111103620881 111104150697 111105102215 111105444259 111106583578 111107037624 111108064971 111108630779 111109546394 111109923722 111111027846 111111516462 111112509328 111113108992 1111139...
result:
ok n=300020, max_a=1000000000000, max_num=100011 >= 100000
Extra Test:
score: 0
Extra Test Passed