結果

問題 No.3715 Tomorrow is MONDAY!!!!!!
コンテスト
ユーザー kazuppa
提出日時 2026-09-21 12:49:31
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 497 ms / 2,000 ms
+ 337µs
コード長 303 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 319 ms
コンパイル使用メモリ 15,104 KB
実行使用メモリ 32,596 KB
最終ジャッジ日時 2026-09-21 12:49:45
合計ジャッジ時間 7,905 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

k,n=map(int, input().split())
d=list(map(int, input().split()))
s,l=0,0
for i in range(k):s+=d[i]
for i in range(k):
 ans=1<<60
 if(i and i<=(l-1)//n*n):ans=min(ans,l%n+n*(l%n==0))
 if(i!=k-1 and k-i<=s-(l+d[i]+n-1)//n*n):ans=min(ans,n-(l+d[i]-1)%n)
 if(ans==(1<<60)):print(-1)
 else:print(ans)
 l+=d[i]
0