結果

問題 No.2024 Xer
ユーザー 👑 kakel-sankakel-san
提出日時 2023-10-24 21:52:26
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 196 ms / 2,000 ms
コード長 1,114 bytes
コンパイル時間 14,489 ms
コンパイル使用メモリ 158,616 KB
実行使用メモリ 178,212 KB
最終ジャッジ日時 2023-10-24 21:52:56
合計ジャッジ時間 22,717 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
32,476 KB
testcase_01 AC 72 ms
32,476 KB
testcase_02 AC 73 ms
32,484 KB
testcase_03 AC 73 ms
32,484 KB
testcase_04 AC 72 ms
32,476 KB
testcase_05 AC 73 ms
32,484 KB
testcase_06 AC 73 ms
32,476 KB
testcase_07 AC 196 ms
48,740 KB
testcase_08 AC 174 ms
50,752 KB
testcase_09 AC 190 ms
51,132 KB
testcase_10 AC 177 ms
50,916 KB
testcase_11 AC 114 ms
39,708 KB
testcase_12 AC 143 ms
49,296 KB
testcase_13 AC 144 ms
43,784 KB
testcase_14 AC 184 ms
50,236 KB
testcase_15 AC 133 ms
46,036 KB
testcase_16 AC 154 ms
45,368 KB
testcase_17 AC 123 ms
41,368 KB
testcase_18 AC 123 ms
41,040 KB
testcase_19 AC 185 ms
50,156 KB
testcase_20 AC 141 ms
43,376 KB
testcase_21 AC 189 ms
51,136 KB
testcase_22 AC 190 ms
51,132 KB
testcase_23 AC 191 ms
51,132 KB
testcase_24 AC 190 ms
51,132 KB
testcase_25 AC 76 ms
32,828 KB
testcase_26 AC 76 ms
33,132 KB
testcase_27 AC 75 ms
33,056 KB
testcase_28 AC 75 ms
32,804 KB
testcase_29 AC 74 ms
32,876 KB
testcase_30 AC 76 ms
33,092 KB
testcase_31 AC 78 ms
33,244 KB
testcase_32 AC 76 ms
33,244 KB
testcase_33 AC 76 ms
33,060 KB
testcase_34 AC 74 ms
32,820 KB
testcase_35 AC 78 ms
32,732 KB
testcase_36 AC 76 ms
33,036 KB
testcase_37 AC 76 ms
33,180 KB
testcase_38 AC 77 ms
33,556 KB
testcase_39 AC 74 ms
32,800 KB
testcase_40 AC 74 ms
32,788 KB
testcase_41 AC 75 ms
33,056 KB
testcase_42 AC 76 ms
33,092 KB
testcase_43 AC 75 ms
33,024 KB
testcase_44 AC 76 ms
33,120 KB
testcase_45 AC 144 ms
47,488 KB
testcase_46 AC 92 ms
36,960 KB
testcase_47 AC 131 ms
43,780 KB
testcase_48 AC 73 ms
32,552 KB
testcase_49 AC 73 ms
32,560 KB
testcase_50 AC 73 ms
178,212 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (94 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.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, x) = (c[0], c[1]);
        var a = NList;
        var list = new List<(int ai, int xi)>(n);
        foreach (var ai in a) list.Add((ai, ai & (((1 << 30) - 1) ^ x)));
        list.Sort((l, r)=> l.xi.CompareTo(r.xi));
        for (var i = 0; i + 1 < list.Count; ++i)
        {
            if (list[i].xi == list[i + 1].xi)
            {
                WriteLine("No");
                return;
            }
            if (list[i].ai >= (list[i + 1].ai ^ x) || (list[i].ai ^ x) >= list[i + 1].ai)
            {
                WriteLine("No");
                return;
            }
        }
        WriteLine("Yes");
    }
}
0