結果

問題 No.29 パワーアップ
ユーザー chike_pluschike_plus
提出日時 2019-03-26 16:26:46
言語 F#
(.NET 7)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 382 bytes
コンパイル時間 3,030 ms
コンパイル使用メモリ 154,592 KB
実行使用メモリ 24,404 KB
最終ジャッジ日時 2023-08-01 09:27:12
合計ジャッジ時間 5,384 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
22,308 KB
testcase_01 AC 59 ms
22,224 KB
testcase_02 AC 59 ms
22,212 KB
testcase_03 AC 60 ms
22,384 KB
testcase_04 AC 59 ms
24,360 KB
testcase_05 AC 60 ms
22,408 KB
testcase_06 AC 60 ms
22,420 KB
testcase_07 AC 60 ms
22,348 KB
testcase_08 AC 59 ms
22,340 KB
testcase_09 AC 59 ms
22,236 KB
testcase_10 AC 60 ms
22,376 KB
testcase_11 AC 60 ms
22,388 KB
testcase_12 AC 59 ms
22,472 KB
testcase_13 AC 59 ms
24,400 KB
testcase_14 AC 59 ms
22,304 KB
testcase_15 AC 59 ms
22,436 KB
testcase_16 AC 59 ms
22,256 KB
testcase_17 AC 60 ms
24,404 KB
testcase_18 AC 60 ms
22,360 KB
testcase_19 AC 60 ms
22,268 KB
testcase_20 AC 60 ms
22,272 KB
testcase_21 AC 59 ms
20,268 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let ``No.29 パワーアップ``() =

  let sum = Array.zeroCreate<int> 11
  [1.. (stdin.ReadLine() |> int) ]
  |> List.iter (fun i ->

    stdin.ReadLine().Split(' ')
    |> Array.map int
    |> Array.iter (fun x -> sum.[x] <- sum.[x] + 1)
  )

  (sum |> Array.sumBy (fun e -> e/2 )) + (sum |> Array.sumBy (fun e -> e%2 )) / 4
  |> stdout.WriteLine


``No.29 パワーアップ``()
0