結果

問題 No.1456 Range Xor
ユーザー 👑 kakel-sankakel-san
提出日時 2024-05-26 21:07:58
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 88 ms / 2,000 ms
コード長 867 bytes
コンパイル時間 7,961 ms
コンパイル使用メモリ 166,572 KB
実行使用メモリ 186,668 KB
最終ジャッジ日時 2024-05-26 21:08:17
合計ジャッジ時間 14,618 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
30,336 KB
testcase_01 AC 58 ms
30,336 KB
testcase_02 AC 58 ms
30,336 KB
testcase_03 AC 79 ms
43,496 KB
testcase_04 AC 81 ms
44,160 KB
testcase_05 AC 84 ms
45,312 KB
testcase_06 AC 81 ms
43,648 KB
testcase_07 AC 86 ms
45,824 KB
testcase_08 AC 84 ms
45,184 KB
testcase_09 AC 81 ms
43,648 KB
testcase_10 AC 83 ms
44,008 KB
testcase_11 AC 66 ms
33,792 KB
testcase_12 AC 60 ms
31,616 KB
testcase_13 AC 69 ms
36,096 KB
testcase_14 AC 69 ms
35,960 KB
testcase_15 AC 79 ms
41,856 KB
testcase_16 AC 78 ms
41,968 KB
testcase_17 AC 73 ms
38,272 KB
testcase_18 AC 68 ms
34,928 KB
testcase_19 AC 80 ms
41,472 KB
testcase_20 AC 84 ms
42,624 KB
testcase_21 AC 75 ms
39,908 KB
testcase_22 AC 75 ms
39,936 KB
testcase_23 AC 73 ms
36,736 KB
testcase_24 AC 65 ms
32,896 KB
testcase_25 AC 70 ms
35,840 KB
testcase_26 AC 74 ms
38,908 KB
testcase_27 AC 77 ms
41,216 KB
testcase_28 AC 68 ms
34,432 KB
testcase_29 AC 88 ms
45,928 KB
testcase_30 AC 83 ms
44,416 KB
testcase_31 AC 68 ms
34,304 KB
testcase_32 AC 66 ms
33,912 KB
testcase_33 AC 72 ms
37,236 KB
testcase_34 AC 86 ms
44,540 KB
testcase_35 AC 73 ms
38,144 KB
testcase_36 AC 83 ms
45,056 KB
testcase_37 AC 85 ms
45,568 KB
testcase_38 AC 65 ms
33,408 KB
testcase_39 AC 78 ms
41,592 KB
testcase_40 AC 83 ms
42,624 KB
testcase_41 AC 59 ms
30,704 KB
testcase_42 AC 62 ms
32,376 KB
testcase_43 AC 57 ms
30,336 KB
testcase_44 AC 56 ms
30,336 KB
testcase_45 AC 57 ms
30,208 KB
testcase_46 AC 58 ms
30,208 KB
testcase_47 AC 58 ms
30,336 KB
testcase_48 AC 57 ms
186,668 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (102 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 #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NArr(long n) => Enumerable.Repeat(0, (int)n).Select(_ => NList).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var c = NList;
        var (n, k) = (c[0], c[1]);
        var a = NList;
        var set = new HashSet<int>{ 0 };
        var cxor = 0;
        for (var i = 0; i < a.Length; ++i)
        {
            cxor ^= a[i];
            if (set.Contains(k ^ cxor))
            {
                WriteLine("Yes");
                return;
            }
            set.Add(cxor);
        }
        WriteLine("No");
    }
}
0