結果

問題 No.358 も~っと!門松列
ユーザー nobigomunobigomu
提出日時 2018-05-31 17:39:26
言語 F#
(F# 4.0)
結果
AC  
実行時間 66 ms / 1,000 ms
コード長 412 bytes
コンパイル時間 3,956 ms
コンパイル使用メモリ 154,632 KB
実行使用メモリ 26,432 KB
最終ジャッジ日時 2023-09-12 20:59:59
合計ジャッジ時間 6,031 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
24,412 KB
testcase_01 AC 63 ms
22,492 KB
testcase_02 AC 66 ms
22,352 KB
testcase_03 AC 62 ms
22,416 KB
testcase_04 AC 65 ms
22,576 KB
testcase_05 AC 66 ms
26,432 KB
testcase_06 AC 63 ms
22,420 KB
testcase_07 AC 66 ms
22,404 KB
testcase_08 AC 64 ms
24,484 KB
testcase_09 AC 66 ms
22,416 KB
testcase_10 AC 61 ms
22,316 KB
testcase_11 AC 65 ms
22,464 KB
testcase_12 AC 65 ms
22,568 KB
testcase_13 AC 63 ms
22,352 KB
testcase_14 AC 66 ms
22,412 KB
testcase_15 AC 64 ms
22,452 KB
testcase_16 AC 62 ms
24,444 KB
testcase_17 AC 63 ms
22,408 KB
testcase_18 AC 63 ms
22,396 KB
testcase_19 AC 63 ms
22,396 KB
testcase_20 AC 66 ms
22,396 KB
testcase_21 AC 63 ms
22,420 KB
testcase_22 AC 65 ms
24,448 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

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
0