結果
問題 | No.29 パワーアップ |
ユーザー |
|
提出日時 | 2020-06-15 19:19:05 |
言語 | OCaml (5.2.1) |
結果 |
AC
|
実行時間 | 2 ms / 5,000 ms |
コード長 | 477 bytes |
コンパイル時間 | 330 ms |
コンパイル使用メモリ | 21,572 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 01:16:29 |
合計ジャッジ時間 | 1,086 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
ソースコード
Scanf.scanf "%d" (fun n -> let items = Array.make 10 0 in for i = 1 to n do Scanf.scanf " %d %d %d" (fun a b c -> items.(a - 1) <- items.(a - 1) + 1; items.(b - 1) <- items.(b - 1) + 1; items.(c - 1) <- items.(c - 1) + 1; ) done; let rec loop i r acc = if i = 10 then acc + r / 4 else loop (i + 1) (r + items.(i) mod 2) (acc + items.(i) / 2) in loop 0 0 0 |> Printf.printf "%d\n" )