結果

問題 No.628 Tagの勢い
ユーザー taktak
提出日時 2018-03-20 00:25:32
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 736 bytes
コンパイル時間 14,552 ms
コンパイル使用メモリ 185,564 KB
実行使用メモリ 36,584 KB
最終ジャッジ日時 2024-04-16 20:10:09
合計ジャッジ時間 21,741 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 343 ms
35,328 KB
testcase_04 AC 344 ms
35,868 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 345 ms
35,424 KB
testcase_11 WA -
testcase_12 AC 345 ms
36,164 KB
testcase_13 AC 345 ms
36,580 KB
testcase_14 AC 343 ms
36,584 KB
testcase_15 AC 347 ms
35,776 KB
testcase_16 AC 345 ms
35,792 KB
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (472 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/

ソースコード

diff #

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.Value).Take(10)
|> Seq.iter (fun kp -> printfn "%s %i" kp.Key kp.Value)

  
             
                                                  
0