結果

問題 No.1456 Range Xor
ユーザー bluemeganebluemegane
提出日時 2021-05-20 16:22:57
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 878 bytes
コンパイル時間 1,078 ms
コンパイル使用メモリ 104,448 KB
実行使用メモリ 33,152 KB
最終ジャッジ日時 2024-04-18 14:05:11
合計ジャッジ時間 5,863 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
17,792 KB
testcase_01 AC 26 ms
18,048 KB
testcase_02 AC 27 ms
17,792 KB
testcase_03 AC 76 ms
33,024 KB
testcase_04 AC 76 ms
33,024 KB
testcase_05 AC 77 ms
33,024 KB
testcase_06 AC 77 ms
32,768 KB
testcase_07 AC 76 ms
33,024 KB
testcase_08 AC 78 ms
33,152 KB
testcase_09 AC 75 ms
33,024 KB
testcase_10 AC 70 ms
32,896 KB
testcase_11 AC 40 ms
20,864 KB
testcase_12 AC 34 ms
19,712 KB
testcase_13 AC 44 ms
22,144 KB
testcase_14 AC 43 ms
21,888 KB
testcase_15 AC 68 ms
30,976 KB
testcase_16 AC 65 ms
28,800 KB
testcase_17 AC 52 ms
24,320 KB
testcase_18 AC 43 ms
22,016 KB
testcase_19 AC 59 ms
26,368 KB
testcase_20 AC 64 ms
28,288 KB
testcase_21 AC 54 ms
26,240 KB
testcase_22 AC 55 ms
26,624 KB
testcase_23 AC 47 ms
22,912 KB
testcase_24 AC 37 ms
19,820 KB
testcase_25 AC 44 ms
21,760 KB
testcase_26 AC 55 ms
25,088 KB
testcase_27 AC 59 ms
27,648 KB
testcase_28 AC 43 ms
21,784 KB
testcase_29 AC 71 ms
32,000 KB
testcase_30 AC 72 ms
32,512 KB
testcase_31 AC 42 ms
21,248 KB
testcase_32 AC 46 ms
20,864 KB
testcase_33 AC 50 ms
24,192 KB
testcase_34 AC 66 ms
32,512 KB
testcase_35 AC 52 ms
25,088 KB
testcase_36 AC 74 ms
33,024 KB
testcase_37 AC 74 ms
31,232 KB
testcase_38 AC 35 ms
19,844 KB
testcase_39 AC 69 ms
28,032 KB
testcase_40 AC 66 ms
27,904 KB
testcase_41 AC 28 ms
18,944 KB
testcase_42 AC 35 ms
19,652 KB
testcase_43 WA -
testcase_44 AC 24 ms
18,176 KB
testcase_45 AC 23 ms
17,920 KB
testcase_46 AC 27 ms
17,792 KB
testcase_47 WA -
testcase_48 AC 28 ms
17,792 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System.Collections.Generic;
using System;

public class Hello
{
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        var n = int.Parse(line[0]);
        var k = int.Parse(line[1]);
        line = Console.ReadLine().Trim().Split(' ');
        var a = Array.ConvertAll(line, int.Parse);
        var d = new Dictionary<int, int>();
        var b = new int[n];
        b[0] = a[0];
        d[b[0]] = 0;
        for (int i = 1; i < n; i++)
        {
            b[i] = b[i - 1] ^ a[i];
            d[b[i]] = i;
        }
        getAns(n, k, b, d);

    }
    static void getAns(int n, int k, int[] b, Dictionary<int, int> d)
    {
        for (int i = 0; i < n; i++)
        {
            var w = b[i] ^ k;
            if (d.ContainsKey(w)) { Console.WriteLine("Yes"); return; }
        }
        Console.WriteLine("No");
    }
}
0