結果
| 問題 | No.628 Tagの勢い |
| コンテスト | |
| ユーザー |
tak
|
| 提出日時 | 2018-03-20 00:27:29 |
| 言語 | F# (F# 10.0) |
| 結果 |
AC
|
| 実行時間 | 216 ms / 2,000 ms |
| コード長 | 734 bytes |
| 記録 | |
| コンパイル時間 | 9,206 ms |
| コンパイル使用メモリ | 200,008 KB |
| 実行使用メモリ | 39,688 KB |
| 最終ジャッジ日時 | 2026-04-24 08:50:51 |
| 合計ジャッジ時間 | 10,625 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (187 ミリ秒)。 main -> /home/judge/data/code/bin/Release/net10.0/main.dll main -> /home/judge/data/code/bin/Release/net10.0/publish/
ソースコード
open System
open System.Collections.Generic
open System.Linq
let read() = Console.ReadLine()
let Int () = read() |> int
let Ints() = read().Split()
|> Array.map(int)
let Int2() =
let t = Ints()
t.[0],t.[1]
let dict = Dictionary<string,int>()
let N = Int()
for i in 1..N do
let No = Int()
let M,S = Int2()
let tags = read().Split()
for t in tags do
if not <| dict.ContainsKey t then
dict.[t] <- S
else
dict.[t] <- dict.[t] + S
dict.OrderByDescending(fun kp -> kp.Value).ThenBy(fun kp -> kp.Key).Take(10)
|> Seq.iter (fun kp -> printfn "%s %i" kp.Key kp.Value)
tak