結果

問題 No.1032 数数え
ユーザー ixTL255ixTL255
提出日時 2020-12-03 23:29:53
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 684 ms / 2,000 ms
コード長 612 bytes
コンパイル時間 2,686 ms
コンパイル使用メモリ 106,808 KB
実行使用メモリ 53,272 KB
最終ジャッジ日時 2023-10-12 09:54:28
合計ジャッジ時間 6,274 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
23,904 KB
testcase_01 AC 70 ms
23,896 KB
testcase_02 AC 69 ms
23,832 KB
testcase_03 AC 69 ms
21,928 KB
testcase_04 AC 68 ms
19,896 KB
testcase_05 AC 67 ms
19,888 KB
testcase_06 AC 69 ms
21,788 KB
testcase_07 AC 684 ms
53,272 KB
testcase_08 AC 70 ms
23,952 KB
testcase_09 AC 100 ms
24,112 KB
testcase_10 AC 76 ms
22,060 KB
testcase_11 AC 66 ms
23,972 KB
testcase_12 AC 649 ms
40,072 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

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));
		}
	}
}
0