結果
問題 | No.853 河原の石 |
ユーザー |
![]() |
提出日時 | 2019-07-26 23:13:06 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 56 ms / 3,153 ms |
コード長 | 362 bytes |
コンパイル時間 | 317 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-07-02 09:22:30 |
合計ジャッジ時間 | 4,006 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 57 |
ソースコード
h,w=map(int,input().split())if h==0 or w==0:print(0)quit()w=abs(w)ans=ht=1l=1k=10**9+7while w>l:if w-l<t:ans+=t*(w-l)if w-l>k:ans-=w-l-kbreakif l+t>h:k=h-l+1ans+=(t*t-(l+t-1-h))*((w-l)//t)l+=((w-l)//t)*telse:ans+=t*tl+=tt+=1print(ans)