結果

問題 No.1468 Colourful Pastel
ユーザー bluemeganebluemegane
提出日時 2021-04-09 22:52:18
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 151 ms / 1,000 ms
コード長 906 bytes
コンパイル時間 1,142 ms
コンパイル使用メモリ 61,256 KB
実行使用メモリ 37,884 KB
最終ジャッジ日時 2023-09-07 12:30:30
合計ジャッジ時間 5,230 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 151 ms
35,916 KB
testcase_01 AC 151 ms
37,884 KB
testcase_02 AC 61 ms
20,680 KB
testcase_03 AC 61 ms
22,676 KB
testcase_04 AC 61 ms
22,692 KB
testcase_05 AC 62 ms
20,592 KB
testcase_06 AC 62 ms
20,596 KB
testcase_07 AC 63 ms
22,696 KB
testcase_08 AC 61 ms
20,616 KB
testcase_09 AC 62 ms
20,712 KB
testcase_10 AC 61 ms
20,704 KB
testcase_11 AC 62 ms
22,744 KB
testcase_12 AC 61 ms
20,716 KB
testcase_13 AC 62 ms
22,644 KB
testcase_14 AC 61 ms
20,684 KB
testcase_15 AC 61 ms
20,628 KB
testcase_16 AC 63 ms
24,688 KB
testcase_17 AC 62 ms
20,636 KB
testcase_18 AC 61 ms
20,600 KB
testcase_19 AC 62 ms
20,712 KB
testcase_20 AC 62 ms
20,536 KB
testcase_21 AC 62 ms
20,556 KB
testcase_22 AC 61 ms
22,748 KB
testcase_23 AC 61 ms
20,708 KB
testcase_24 AC 59 ms
20,704 KB
testcase_25 AC 61 ms
22,700 KB
testcase_26 AC 62 ms
20,656 KB
testcase_27 AC 145 ms
36,776 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System.Collections.Generic;
using System;

public class Hello
{
    static void Main()
    {
        var n = long.Parse(Console.ReadLine().Trim());
        string[] line = Console.ReadLine().Trim().Split(' ');
        var d1 = getD(line);
        line = Console.ReadLine().Trim().Split(' ');
        var d2 = getD(line);
        getAns(d1, d2);
    }
    static void getAns(Dictionary<string, int> d1, Dictionary<string, int> d2)
    {
        foreach (var x in d1)
        {
            if (!d2.ContainsKey(x.Key)) { Console.WriteLine(x.Key); return; }
            else if (x.Value != d2[x.Key]) { Console.WriteLine(x.Key); return; }
        }
    }
    static Dictionary<string, int> getD(string[] s)
    {
        var d = new Dictionary<string, int>();
        foreach (var x in s)
        {
            if (d.ContainsKey(x)) d[x]++;
            else d[x] = 1;
        }
        return d;
    }
}
0