結果
問題 |
No.358 も~っと!門松列
|
ユーザー |
![]() |
提出日時 | 2018-05-31 17:39:26 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 65 ms / 1,000 ms |
コード長 | 412 bytes |
コンパイル時間 | 6,661 ms |
コンパイル使用メモリ | 187,232 KB |
実行使用メモリ | 30,080 KB |
最終ジャッジ日時 | 2024-06-30 08:33:47 |
合計ジャッジ時間 | 9,051 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (231 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/
ソースコード
let f a b c = (b>a && b>c && a<>c) || (b<a && b<c && a<>c) let g a b c = a=b || b=c || c=a let h a b c = seq { for i in 2..max a c -> if (f (a%i) (b%i) (c%i)) then 1 else 0 } |> Seq.sum let a = (stdin.ReadLine >> fun s -> s.Split ' ') () |> Array.map int match (f a.[0] a.[1] a.[2], g a.[0] a.[1] a.[2]) with | (true,_) -> "INF" | (_,true) -> "0" | (_,_) -> (h a.[0] a.[1] a.[2]).ToString () |> stdout.WriteLine