結果
問題 | No.29 パワーアップ |
ユーザー |
![]() |
提出日時 | 2016-08-19 01:27:04 |
言語 | F# (F# 4.0) |
結果 |
AC
|
実行時間 | 340 ms / 5,000 ms |
コード長 | 521 bytes |
コンパイル時間 | 6,705 ms |
コンパイル使用メモリ | 187,928 KB |
実行使用メモリ | 34,760 KB |
最終ジャッジ日時 | 2024-11-07 19:39:27 |
合計ジャッジ時間 | 15,459 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 22 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (239 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/
ソースコード
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()