結果

問題 No.29 パワーアップ
ユーザー regeregeregerege
提出日時 2016-01-10 18:16:54
言語 F#
(F# 4.0)
結果
AC  
実行時間 144 ms / 5,000 ms
コード長 395 bytes
コンパイル時間 6,408 ms
コンパイル使用メモリ 186,660 KB
実行使用メモリ 34,260 KB
最終ジャッジ日時 2023-10-19 19:49:35
合計ジャッジ時間 10,491 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 137 ms
34,220 KB
testcase_01 AC 137 ms
34,216 KB
testcase_02 AC 137 ms
34,220 KB
testcase_03 AC 137 ms
34,220 KB
testcase_04 AC 138 ms
34,224 KB
testcase_05 AC 136 ms
34,248 KB
testcase_06 AC 135 ms
34,244 KB
testcase_07 AC 136 ms
34,232 KB
testcase_08 AC 136 ms
34,232 KB
testcase_09 AC 136 ms
34,220 KB
testcase_10 AC 139 ms
34,256 KB
testcase_11 AC 138 ms
34,260 KB
testcase_12 AC 138 ms
34,224 KB
testcase_13 AC 138 ms
34,232 KB
testcase_14 AC 138 ms
34,252 KB
testcase_15 AC 138 ms
34,248 KB
testcase_16 AC 144 ms
34,240 KB
testcase_17 AC 142 ms
34,228 KB
testcase_18 AC 139 ms
34,236 KB
testcase_19 AC 139 ms
34,232 KB
testcase_20 AC 141 ms
34,224 KB
testcase_21 AC 138 ms
34,224 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (231 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

let ``No.29 パワーアップ`` () =
    let N = int <| stdin.ReadLine()
    Seq.initInfinite (fun _ -> stdin.ReadLine().Split(' '))
    |> Seq.take N
    |> Seq.collect id
    |> Seq.groupBy id
    |> Seq.map (fun (_,s) -> let n = Seq.length s in n/2,n&&&1)
    |> Seq.fold(fun (s1,s2) (n,a) -> s1+n,s2+a) (0,0)
    |> fun (a,b) -> a + (b/4)
    |> printfn "%A"
``No.29 パワーアップ`` ()
0