結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー magmag
提出日時 2020-06-26 06:27:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 955 bytes
コンパイル時間 1,414 ms
コンパイル使用メモリ 163,668 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-16 23:26:48
合計ジャッジ時間 3,253 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 8 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 9 ms
4,380 KB
testcase_10 AC 11 ms
4,380 KB
testcase_11 WA -
testcase_12 AC 9 ms
4,376 KB
testcase_13 WA -
testcase_14 AC 14 ms
4,376 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 2 ms
4,380 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 7 ms
4,380 KB
testcase_21 WA -
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 17 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*
2$BHVL\$N?M$+$i=g$K(Bi$BHVL\$N?M$O(Bi$B!](B1$BHVL\$N?M$H$N5wN%$,(BD$BL$K~$N>l9g!"(B
D$B$K$J$k$^$G@5$NJ}8~$K0\F0$7$^$9!#(B 
$B$3$N0\F0$G(B i + 1 $BHVL\$N?M$H0LCV$,5UE>$7$?>l9g!"Ii$N5wN%$H$7$F07$$$^$9!#(B

$B$D$^$j!">r7o$rK~$?$9$?$a$K$O:G=*E*$KI,$:(B i $BHVL\$h$j(B i + 1 $BHVL\$N?M$N$[$&$,Bg$-$$:BI8$K$$$^$9!#(B

5 2
1 2 3 1000

0 2 4 6 1006

10 90
1 2 3 4 5 6 7 8 9

0 90 180 270 360 450 540 630 720 810
*/
#include<bits/stdc++.h>

using namespace std;
using ll=long long;
#define rep2(i, a, n) for(int i = (a); i < (n); i++)
#define rep(i, n) rep2(i,0,n)

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  int n,d,shake;cin>>n>>d;
  int hoge[n];
  hoge[0]=0;
  rep2(i,1,n)cin>>hoge[i];
  if(n>1){
    shake=hoge[1];
    rep2(i,2,n){
      shake+=hoge[i];
      hoge[i]=shake;
    }
    rep2(i,1,n){
      if(hoge[i]<i*d)hoge[i]=i*d;
    }
  }
  rep(i,n){
    i!=n-1?cout<<hoge[i]<<" ":cout<<hoge[i]<<endl;
  }
}
0