結果

問題 No.358 も~っと!門松列
ユーザー kuuso1kuuso1
提出日時 2016-08-17 00:54:03
言語 F#
(F# 4.0)
結果
AC  
実行時間 72 ms / 1,000 ms
コード長 575 bytes
コンパイル時間 5,990 ms
コンパイル使用メモリ 189,508 KB
実行使用メモリ 31,360 KB
最終ジャッジ日時 2024-04-25 08:13:10
合計ジャッジ時間 8,465 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
30,848 KB
testcase_01 AC 70 ms
30,976 KB
testcase_02 AC 72 ms
31,232 KB
testcase_03 AC 68 ms
30,580 KB
testcase_04 AC 68 ms
31,232 KB
testcase_05 AC 67 ms
31,232 KB
testcase_06 AC 65 ms
30,848 KB
testcase_07 AC 68 ms
30,976 KB
testcase_08 AC 64 ms
30,592 KB
testcase_09 AC 69 ms
31,360 KB
testcase_10 AC 65 ms
30,720 KB
testcase_11 AC 66 ms
30,976 KB
testcase_12 AC 65 ms
30,976 KB
testcase_13 AC 67 ms
31,060 KB
testcase_14 AC 66 ms
31,232 KB
testcase_15 AC 66 ms
31,232 KB
testcase_16 AC 67 ms
31,356 KB
testcase_17 AC 65 ms
30,976 KB
testcase_18 AC 65 ms
31,104 KB
testcase_19 AC 68 ms
31,104 KB
testcase_20 AC 67 ms
31,232 KB
testcase_21 AC 66 ms
31,104 KB
testcase_22 AC 67 ms
31,360 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (201 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/

ソースコード

diff #

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()
0