結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー maimai8maimai8
提出日時 2020-08-05 19:06:43
言語 OCaml
(5.1.0)
結果
WA  
実行時間 -
コード長 351 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 21,576 KB
実行使用メモリ 9,728 KB
最終ジャッジ日時 2024-04-17 09:09:00
合計ジャッジ時間 2,196 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 36 ms
8,320 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 5 ms
5,376 KB
testcase_06 WA -
testcase_07 AC 23 ms
7,424 KB
testcase_08 WA -
testcase_09 AC 21 ms
6,656 KB
testcase_10 AC 30 ms
8,064 KB
testcase_11 WA -
testcase_12 AC 26 ms
7,680 KB
testcase_13 WA -
testcase_14 AC 43 ms
9,088 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 3 ms
5,376 KB
testcase_18 WA -
testcase_19 AC 22 ms
7,424 KB
testcase_20 AC 18 ms
6,400 KB
testcase_21 AC 25 ms
7,808 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 WA -
testcase_24 AC 46 ms
9,728 KB
権限があれば一括ダウンロードができます

ソースコード

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