結果

問題 No.112 ややこしい鶴亀算
ユーザー hum_ophum_op
提出日時 2016-04-19 14:00:33
言語 F#
(F# 4.0)
結果
AC  
実行時間 314 ms / 5,000 ms
コード長 380 bytes
コンパイル時間 6,101 ms
コンパイル使用メモリ 186,248 KB
実行使用メモリ 36,436 KB
最終ジャッジ日時 2024-04-15 03:44:23
合計ジャッジ時間 14,916 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 309 ms
36,028 KB
testcase_01 AC 305 ms
36,152 KB
testcase_02 AC 307 ms
35,932 KB
testcase_03 AC 310 ms
36,056 KB
testcase_04 AC 305 ms
36,312 KB
testcase_05 AC 308 ms
36,060 KB
testcase_06 AC 308 ms
36,184 KB
testcase_07 AC 307 ms
36,056 KB
testcase_08 AC 306 ms
36,056 KB
testcase_09 AC 309 ms
36,308 KB
testcase_10 AC 308 ms
36,436 KB
testcase_11 AC 308 ms
36,288 KB
testcase_12 AC 308 ms
36,300 KB
testcase_13 AC 314 ms
36,184 KB
testcase_14 AC 309 ms
36,060 KB
testcase_15 AC 309 ms
36,060 KB
testcase_16 AC 312 ms
36,068 KB
testcase_17 AC 307 ms
35,756 KB
testcase_18 AC 305 ms
36,192 KB
testcase_19 AC 310 ms
36,172 KB
testcase_20 AC 308 ms
36,060 KB
testcase_21 AC 303 ms
36,188 KB
testcase_22 AC 314 ms
36,188 KB
testcase_23 AC 306 ms
35,632 KB
testcase_24 AC 307 ms
36,172 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (202 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
 
let No112 () =
    let N = int <| Console.ReadLine()
    let A = Console.ReadLine().Split(' ') |> Array.map Int32.Parse |> Array.sort
    let t n s = (4 * n - s) / 2
 
    let a = (fun a b ->
        if a = b && a <> 0 then a + 1
        elif a > b then a
        else b) (t (N - 1) A.[0]) (t (N - 1) A.[A.Length - 1])
    printfn "%d %d" a (N - a)
    ()
 
No112 ()
0