結果

問題 No.2442 線形写像
ユーザー 👑 kakel-sankakel-san
提出日時 2023-08-25 21:51:56
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 139 ms / 2,000 ms
コード長 947 bytes
コンパイル時間 1,984 ms
コンパイル使用メモリ 63,724 KB
実行使用メモリ 28,736 KB
最終ジャッジ日時 2023-08-26 12:17:53
合計ジャッジ時間 4,985 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
21,740 KB
testcase_01 AC 59 ms
19,708 KB
testcase_02 AC 60 ms
21,748 KB
testcase_03 AC 60 ms
19,912 KB
testcase_04 AC 60 ms
23,820 KB
testcase_05 AC 59 ms
21,872 KB
testcase_06 AC 59 ms
21,756 KB
testcase_07 AC 60 ms
23,908 KB
testcase_08 AC 60 ms
23,792 KB
testcase_09 AC 59 ms
21,836 KB
testcase_10 AC 61 ms
21,796 KB
testcase_11 AC 62 ms
23,912 KB
testcase_12 AC 61 ms
19,684 KB
testcase_13 AC 62 ms
21,896 KB
testcase_14 AC 61 ms
21,704 KB
testcase_15 AC 92 ms
25,948 KB
testcase_16 AC 91 ms
23,860 KB
testcase_17 AC 124 ms
26,716 KB
testcase_18 AC 139 ms
28,548 KB
testcase_19 AC 136 ms
28,580 KB
testcase_20 AC 136 ms
26,508 KB
testcase_21 AC 126 ms
28,736 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using static System.Console;
using System.Linq;
using System.Collections.Generic;
class Program
{
    static int NN => int.Parse(ReadLine());
    static long[] NList => ReadLine().Split().Select(long.Parse).ToArray();
    static ulong[] LList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ulong.Parse(ReadLine())).ToArray();
    public static void Main()
    {
        Solve();
    }
    static void Solve()
    {
        var n = NN;
        var m = 1 << n;
        var a = LList(m);
        var blist = new ulong[n];
        for (var i = 0; i < n; ++i) blist[i] = a[1 << i];
        for (var i = 0; i < m; ++i)
        {
            var sub = (ulong)0;
            for (var j = 0; j < n; ++j) if ((i & (1 << j)) != 0) sub ^= blist[j];
            if (sub != a[i])
            {
                WriteLine("No");
                return;
            }
        }
        WriteLine("Yes");
    }
}
0