結果

問題 No.29 パワーアップ
ユーザー kuuso1kuuso1
提出日時 2016-08-19 01:27:04
言語 F#
(5.0)
結果
AC  
実行時間 82 ms / 5,000 ms
コード長 521 bytes
コンパイル時間 3,594 ms
使用メモリ 16,952 KB
最終ジャッジ日時 2022-12-14 02:46:26
合計ジャッジ時間 6,884 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 80 ms
16,788 KB
testcase_01 AC 81 ms
16,772 KB
testcase_02 AC 81 ms
16,952 KB
testcase_03 AC 81 ms
16,804 KB
testcase_04 AC 80 ms
16,712 KB
testcase_05 AC 81 ms
16,928 KB
testcase_06 AC 81 ms
16,716 KB
testcase_07 AC 81 ms
16,948 KB
testcase_08 AC 80 ms
16,820 KB
testcase_09 AC 80 ms
16,836 KB
testcase_10 AC 80 ms
16,780 KB
testcase_11 AC 81 ms
16,872 KB
testcase_12 AC 81 ms
16,796 KB
testcase_13 AC 81 ms
16,780 KB
testcase_14 AC 82 ms
16,740 KB
testcase_15 AC 81 ms
16,776 KB
testcase_16 AC 81 ms
16,796 KB
testcase_17 AC 81 ms
16,676 KB
testcase_18 AC 81 ms
16,784 KB
testcase_19 AC 81 ms
16,808 KB
testcase_20 AC 81 ms
16,844 KB
testcase_21 AC 80 ms
16,868 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

open System
type Sol() =
    member this.Solve() = 
        let N = stdin.ReadLine() |> int
        let sum = Array.zeroCreate<int> 11
        for i = 0 to (N-1) do
            let a = stdin.ReadLine().Split() |> Array.map int
            a |> Array.iter (fun x -> (sum.[x] <- sum.[x] + 1) )
        
        let powerUp2 = (Array.sumBy (fun e -> e/2 ) sum )
        let powerUp4 = (Array.sumBy (fun e -> e%2 ) sum ) / 4
        
        (powerUp2 + powerUp4) |> printfn "%d"
        
let mySol = new Sol()
mySol.Solve()
0