結果

問題 No.112 ややこしい鶴亀算
ユーザー regeregeregerege
提出日時 2016-04-17 19:34:05
言語 F#
(F# 4.0)
結果
AC  
実行時間 337 ms / 5,000 ms
コード長 365 bytes
コンパイル時間 6,093 ms
コンパイル使用メモリ 191,508 KB
実行使用メモリ 35,864 KB
最終ジャッジ日時 2024-04-15 02:17:11
合計ジャッジ時間 15,651 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 337 ms
35,240 KB
testcase_01 AC 328 ms
34,940 KB
testcase_02 AC 333 ms
34,852 KB
testcase_03 AC 331 ms
34,852 KB
testcase_04 AC 331 ms
34,936 KB
testcase_05 AC 332 ms
35,028 KB
testcase_06 AC 326 ms
35,620 KB
testcase_07 AC 329 ms
35,240 KB
testcase_08 AC 327 ms
35,580 KB
testcase_09 AC 328 ms
35,052 KB
testcase_10 AC 328 ms
34,980 KB
testcase_11 AC 331 ms
35,864 KB
testcase_12 AC 327 ms
34,976 KB
testcase_13 AC 325 ms
35,840 KB
testcase_14 AC 330 ms
34,804 KB
testcase_15 AC 329 ms
35,636 KB
testcase_16 AC 329 ms
35,728 KB
testcase_17 AC 332 ms
35,228 KB
testcase_18 AC 326 ms
35,224 KB
testcase_19 AC 325 ms
35,060 KB
testcase_20 AC 324 ms
35,180 KB
testcase_21 AC 330 ms
34,976 KB
testcase_22 AC 326 ms
35,616 KB
testcase_23 AC 324 ms
35,864 KB
testcase_24 AC 323 ms
34,804 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (208 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 #

let a = stdin.ReadLine() |> int
let l =
    stdin.ReadLine().Split(' ')
    |> Seq.map int
    |> Seq.groupBy id
    |> Seq.sortBy fst
    |> Seq.map (fun (a,b) -> a,Seq.length b)
    |> Seq.toList
let l2 = List.map snd l
let x,y =
    if l.Length = 2 then l2.[1],l2.[0]
    else
        let s = fst l.[0]
        if (s+2)/2=a then a,0 else 0,a
printfn "%d %d" x y
0