結果

問題 No.842 初詣
ユーザー kou_kkk
提出日時 2025-09-10 01:27:45
言語 F#
(F# 4.0)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 264 bytes
コンパイル時間 21,708 ms
コンパイル使用メモリ 194,340 KB
実行使用メモリ 30,720 KB
最終ジャッジ日時 2025-09-10 01:28:18
合計ジャッジ時間 10,496 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (885 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

let arr =
    stdin.ReadLine().Split()
    |> Array.map int

let coin = [| 500; 100; 50; 10; 5; 1 |]
let calc n m x = x - (min (x / m) n) * m
let mutable v = arr.[6]

for i = 0 to 5 do
    v <- calc arr.[i] coin.[i] v

if v = 0 then "YES"
else "NO"
|> printfn "%s"
0