結果

問題 No.29 パワーアップ
コンテスト
ユーザー kuuso1
提出日時 2016-08-19 01:27:04
言語 F#
(F# 10.0)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
AC  
実行時間 207 ms / 5,000 ms
+ 642µs
コード長 521 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 11,364 ms
コンパイル使用メモリ 211,124 KB
実行使用メモリ 36,784 KB
最終ジャッジ日時 2026-07-15 21:44:36
合計ジャッジ時間 11,236 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (177 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

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