結果
問題 |
No.1032 数数え
|
ユーザー |
![]() |
提出日時 | 2020-12-03 23:29:53 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
AC
|
実行時間 | 652 ms / 2,000 ms |
コード長 | 612 bytes |
コンパイル時間 | 1,951 ms |
コンパイル使用メモリ | 111,220 KB |
実行使用メモリ | 50,060 KB |
最終ジャッジ日時 | 2024-09-14 08:48:53 |
合計ジャッジ時間 | 4,807 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Linq; public class Yuki1032 { public static void Main() { var nm = Console.ReadLine().Split().Select(x => long.Parse(x)).ToList(); var l = Console.ReadLine().Split().Select(x => long.Parse(x)).ToList(); var d = new Dictionary<long,long>(); for(var i = 0; i < nm[0]; ++i) { var x = l[i]; if(d.ContainsKey(x)) d[x] += 1; else d.Add(x,1); } for(var i = 1; i <= nm[1]; ++i) { if(d.ContainsKey(i)) Console.WriteLine(string.Format("{0} {1}", i, d[i])); else Console.WriteLine(string.Format("{0} {1}", i, 0)); } } }