結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー eSeFeSeF
提出日時 2020-06-08 00:53:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 66 ms / 5,000 ms
コード長 564 bytes
コンパイル時間 2,789 ms
コンパイル使用メモリ 101,708 KB
実行使用メモリ 23,984 KB
最終ジャッジ日時 2023-08-25 14:32:23
合計ジャッジ時間 4,291 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
23,592 KB
testcase_01 AC 56 ms
21,608 KB
testcase_02 AC 53 ms
19,552 KB
testcase_03 AC 52 ms
21,408 KB
testcase_04 AC 52 ms
21,628 KB
testcase_05 AC 52 ms
19,528 KB
testcase_06 AC 55 ms
21,472 KB
testcase_07 AC 64 ms
22,048 KB
testcase_08 AC 66 ms
23,956 KB
testcase_09 AC 66 ms
21,832 KB
testcase_10 AC 65 ms
22,020 KB
testcase_11 AC 66 ms
23,984 KB
testcase_12 AC 55 ms
21,468 KB
testcase_13 AC 59 ms
21,572 KB
testcase_14 AC 66 ms
23,924 KB
testcase_15 AC 62 ms
22,024 KB
testcase_16 AC 57 ms
21,556 KB
testcase_17 AC 62 ms
21,852 KB
testcase_18 AC 62 ms
19,912 KB
testcase_19 AC 60 ms
21,856 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Linq;
using System.Collections.Generic;
class Solution
{
    static void Main(string[] args)
    {
        int N = int.Parse(Console.ReadLine());
        var A = Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
        var bases = new List<long>();
        for(var i = 0; i < N; i++)
        {
            long v = A[i];
            foreach(var e in bases)
            {
                v = Math.Min(v, v ^ e);
            }
            if (v != 0) bases.Add(v);
        }
        Console.WriteLine(1L << bases.Count());
    }
}
0