結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー maimai8
提出日時 2020-08-05 19:06:43
言語 OCaml
(5.2.1)
結果
WA  
実行時間 -
コード長 351 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 21,636 KB
実行使用メモリ 9,728 KB
最終ジャッジ日時 2024-10-09 01:57:09
合計ジャッジ時間 2,374 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 13 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

let () =
  Scanf.scanf "%d %d\n" @@ fun n d ->
  let arr = Array.of_list
      (0 :: (Array.to_list (Array.init (n-1) @@ fun _ -> Scanf.scanf "%d " @@ fun d -> d))) in
  for i = 0 to n - 2 do
    if arr.(i+1) - arr.(i) >= d then ()
    else arr.(i+1) <- arr.(i) + d
  done;
  Array.iter (fun x -> print_int x; print_string " ") arr;
  print_newline ()
0