結果

問題 No.136 Yet Another GCD Problem
ユーザー taktak
提出日時 2018-03-22 23:51:55
言語 F#
(F# 4.0)
結果
AC  
実行時間 123 ms / 5,000 ms
コード長 254 bytes
コンパイル時間 4,499 ms
コンパイル使用メモリ 165,492 KB
実行使用メモリ 34,968 KB
最終ジャッジ日時 2023-09-07 01:56:05
合計ジャッジ時間 10,768 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
22,932 KB
testcase_01 AC 86 ms
23,012 KB
testcase_02 AC 86 ms
25,080 KB
testcase_03 AC 102 ms
26,764 KB
testcase_04 AC 116 ms
30,368 KB
testcase_05 AC 92 ms
25,672 KB
testcase_06 AC 91 ms
23,720 KB
testcase_07 AC 91 ms
23,604 KB
testcase_08 AC 98 ms
26,700 KB
testcase_09 AC 88 ms
23,108 KB
testcase_10 AC 98 ms
26,592 KB
testcase_11 AC 112 ms
33,364 KB
testcase_12 AC 87 ms
23,008 KB
testcase_13 AC 98 ms
28,488 KB
testcase_14 AC 123 ms
34,968 KB
testcase_15 AC 120 ms
32,592 KB
testcase_16 AC 113 ms
33,756 KB
testcase_17 AC 111 ms
32,940 KB
testcase_18 AC 89 ms
23,072 KB
testcase_19 AC 110 ms
29,300 KB
testcase_20 AC 100 ms
26,912 KB
testcase_21 AC 87 ms
25,012 KB
testcase_22 AC 86 ms
22,988 KB
testcase_23 AC 86 ms
22,932 KB
testcase_24 AC 85 ms
23,072 KB
testcase_25 AC 87 ms
22,976 KB
testcase_26 AC 88 ms
23,032 KB
testcase_27 AC 110 ms
31,364 KB
testcase_28 AC 101 ms
26,796 KB
testcase_29 AC 88 ms
22,896 KB
testcase_30 AC 87 ms
21,016 KB
testcase_31 AC 87 ms
23,080 KB
testcase_32 AC 86 ms
22,932 KB
testcase_33 AC 86 ms
25,112 KB
testcase_34 AC 95 ms
24,032 KB
testcase_35 AC 99 ms
26,660 KB
testcase_36 AC 91 ms
23,552 KB
testcase_37 AC 114 ms
33,924 KB
testcase_38 AC 86 ms
22,932 KB
testcase_39 AC 87 ms
22,980 KB
testcase_40 AC 87 ms
23,064 KB
testcase_41 AC 88 ms
25,088 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System

let rec gcd a b =
    match b with 
    | 0 -> a
    | _ -> gcd b (a%b)

let N,K = 
    let t = Console.ReadLine().Split()
            |> Array.map(int)
    t.[0],t.[1]

[1..N-1]
|> List.map (fun x -> gcd x (N-x))
|> List.max
|> printfn "%i"
0