結果

問題 No.112 ややこしい鶴亀算
ユーザー hum_ophum_op
提出日時 2016-04-19 13:57:04
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 9,460 ms
コンパイル使用メモリ 184,924 KB
実行使用メモリ 36,692 KB
最終ジャッジ日時 2024-04-15 03:44:05
合計ジャッジ時間 15,492 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 308 ms
35,500 KB
testcase_01 AC 311 ms
36,136 KB
testcase_02 AC 309 ms
35,504 KB
testcase_03 AC 306 ms
36,060 KB
testcase_04 AC 311 ms
35,372 KB
testcase_05 WA -
testcase_06 AC 310 ms
35,492 KB
testcase_07 AC 312 ms
35,504 KB
testcase_08 WA -
testcase_09 AC 309 ms
36,160 KB
testcase_10 AC 311 ms
36,052 KB
testcase_11 AC 312 ms
36,188 KB
testcase_12 AC 306 ms
35,884 KB
testcase_13 WA -
testcase_14 AC 308 ms
35,116 KB
testcase_15 AC 310 ms
36,312 KB
testcase_16 AC 312 ms
36,060 KB
testcase_17 AC 312 ms
35,632 KB
testcase_18 AC 313 ms
36,056 KB
testcase_19 WA -
testcase_20 AC 308 ms
35,508 KB
testcase_21 AC 318 ms
36,180 KB
testcase_22 AC 309 ms
35,908 KB
testcase_23 AC 313 ms
36,060 KB
testcase_24 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (269 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 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