結果

問題 No.32 貯金箱の憂鬱
ユーザー piconic_Xpiconic_X
提出日時 2015-11-09 14:13:46
言語 OCaml
(5.1.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 417 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 21,604 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 08:31:03
合計ジャッジ時間 796 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

let div x p =
  let x0 = x / p in
  x0, x- x0 * p

let trans n m l =
  let dl = div l 25 in
  let dm = div ((fst dl) + m) 4 in
  let dn = div ((fst dm) + n) 10 in
  (snd dl) + (snd dm) + (snd dn)

let () =
  let trans1 = Scanf.sscanf (read_line ()) "%d" trans in
  let trans2 = Scanf.sscanf (read_line ()) "%d" trans1 in
  let result = Scanf.sscanf (read_line ()) "%d" trans2 in
  print_int result;
  print_newline ()
0