結果
| 問題 | No.2078 魔抜けなパープル |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-09-25 22:02:56 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 341 bytes |
| 記録 | |
| コンパイル時間 | 1,169 ms |
| コンパイル使用メモリ | 20,696 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-05-28 20:43:01 |
| 合計ジャッジ時間 | 8,641 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 1 WA * 6 |
ソースコード
T=int(input())
for tests in range(T):
X,A=map(int,input().split())
ANS=A*(1*1+X)
r=A//2
rest=A-r*2
ANS2=r*(2*2+X)+rest*(1*1+X)
ANS=min(ANS,ANS2)
for i in range(2,A+1):
r=A//i
rest=A-r*i
ANS2=(r-rest)*(i*i+X)+rest*((i+1)*(i+1)+X)
ANS=min(ANS,ANS2)
print(ANS)
titia