結果
問題 | No.358 も~っと!門松列 |
ユーザー |
![]() |
提出日時 | 2016-08-17 00:54:03 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 80 ms / 1,000 ms |
コード長 | 575 bytes |
コンパイル時間 | 7,001 ms |
コンパイル使用メモリ | 188,784 KB |
実行使用メモリ | 31,616 KB |
最終ジャッジ日時 | 2024-11-07 18:37:18 |
合計ジャッジ時間 | 9,936 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (230 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
open System type Sol() = member this.Solve() = let (A1,A2,A3) = stdin.ReadLine().Split() |> Array.map int |> fun ss -> (ss.[0],ss.[1],ss.[2]) let isKadomatsu a b c = a <> b && b <> c && c <> a && ( (a<b && b>c) || (a>b && b<c) ) let max = A1::A2::A3::[] |> Seq.max let mutable sum = 0 for i in 1..max do sum <- sum + (if (isKadomatsu (A1%i) (A2%i) (A3%i)) then 1 else 0) let ans = if (isKadomatsu A1 A2 A3) then "INF" else (string sum) printfn "%s" ans let mySol = new Sol() mySol.Solve()