結果
| 問題 | No.2757 Pin Game |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-05-17 21:38:14 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 85 ms / 2,000 ms |
| コード長 | 506 bytes |
| 記録 | |
| コンパイル時間 | 158 ms |
| コンパイル使用メモリ | 85,432 KB |
| 実行使用メモリ | 127,192 KB |
| 最終ジャッジ日時 | 2026-05-27 13:26:13 |
| 合計ジャッジ時間 | 1,480 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 10 |
ソースコード
from collections import deque
def main():
n,k=map(int,input().split())
x=list(map(int,input().split()))
l=deque()
for i in range(len(x)-1):
l.append(x[i+1]-x[i])
cnt=0
while len(l)!=0:
tmp=l.popleft()
if tmp<k:
if len(l)!=0:
l[0]+=tmp
else:
pass
# cnt+=1
cnt+=1
else:
pass
print(n-cnt)
if __name__ == "__main__":
main()