結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー mochidanmochidan
提出日時 2020-06-29 15:21:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 303 ms / 2,000 ms
コード長 1,069 bytes
コンパイル時間 1,575 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 121,644 KB
最終ジャッジ日時 2023-09-25 16:51:19
合計ジャッジ時間 9,637 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 251 ms
91,596 KB
testcase_01 AC 251 ms
91,700 KB
testcase_02 AC 290 ms
110,980 KB
testcase_03 AC 266 ms
93,296 KB
testcase_04 AC 293 ms
114,320 KB
testcase_05 AC 269 ms
92,864 KB
testcase_06 AC 303 ms
118,480 KB
testcase_07 AC 278 ms
104,516 KB
testcase_08 AC 300 ms
121,644 KB
testcase_09 AC 277 ms
105,420 KB
testcase_10 AC 287 ms
109,808 KB
testcase_11 AC 301 ms
119,616 KB
testcase_12 AC 285 ms
106,460 KB
testcase_13 AC 282 ms
106,748 KB
testcase_14 AC 299 ms
117,896 KB
testcase_15 AC 296 ms
112,504 KB
testcase_16 AC 274 ms
99,212 KB
testcase_17 AC 260 ms
93,264 KB
testcase_18 AC 274 ms
100,304 KB
testcase_19 AC 277 ms
103,852 KB
testcase_20 AC 275 ms
101,888 KB
testcase_21 AC 280 ms
107,468 KB
testcase_22 AC 247 ms
91,636 KB
testcase_23 AC 250 ms
91,700 KB
testcase_24 AC 301 ms
120,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import itertools
import random
from decimal import *

input = sys.stdin.readline

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
def inputStr(): return input()[:-1]

inf = float('inf')
mod = 1000000007

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

def main():
	N,D = inputMap()
	A = inputList()

	moto = [0]
	for i,val in enumerate(A):
		tmp = moto[i] + val
		moto.append(tmp)

	ans = [0]
	for i in range(N):
		if i == 0:
			continue
		tmp = moto[i] - ans[i-1]
		if tmp >= D:
			ans.append(moto[i])
		else:
			aaa = D - tmp
			ans.append(moto[i]+aaa)

	print(*ans)

#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
#-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
if __name__ == "__main__":
	main()
0