結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー りあんりあん
提出日時 2015-04-19 01:10:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 432 ms / 5,000 ms
コード長 2,198 bytes
コンパイル時間 3,291 ms
コンパイル使用メモリ 105,612 KB
実行使用メモリ 55,088 KB
最終ジャッジ日時 2023-09-17 16:14:12
合計ジャッジ時間 13,249 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
23,420 KB
testcase_01 AC 68 ms
23,300 KB
testcase_02 AC 68 ms
23,132 KB
testcase_03 AC 70 ms
25,348 KB
testcase_04 AC 69 ms
23,192 KB
testcase_05 AC 70 ms
25,284 KB
testcase_06 AC 67 ms
23,248 KB
testcase_07 AC 69 ms
23,196 KB
testcase_08 AC 327 ms
51,192 KB
testcase_09 AC 124 ms
31,196 KB
testcase_10 AC 261 ms
46,556 KB
testcase_11 AC 199 ms
40,308 KB
testcase_12 AC 351 ms
45,364 KB
testcase_13 AC 373 ms
51,036 KB
testcase_14 AC 256 ms
46,172 KB
testcase_15 AC 418 ms
52,424 KB
testcase_16 AC 353 ms
49,036 KB
testcase_17 AC 367 ms
48,596 KB
testcase_18 AC 70 ms
23,304 KB
testcase_19 AC 67 ms
23,344 KB
testcase_20 AC 98 ms
26,324 KB
testcase_21 AC 432 ms
53,028 KB
testcase_22 AC 431 ms
52,972 KB
testcase_23 AC 71 ms
23,260 KB
testcase_24 AC 71 ms
23,300 KB
testcase_25 AC 71 ms
23,324 KB
testcase_26 AC 70 ms
25,252 KB
testcase_27 AC 70 ms
23,412 KB
testcase_28 AC 283 ms
47,980 KB
testcase_29 AC 346 ms
45,804 KB
testcase_30 AC 312 ms
43,372 KB
testcase_31 AC 274 ms
46,456 KB
testcase_32 AC 321 ms
42,704 KB
testcase_33 AC 415 ms
54,516 KB
testcase_34 AC 416 ms
54,448 KB
testcase_35 AC 423 ms
55,088 KB
testcase_36 AC 420 ms
52,960 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.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;

namespace Solver
{
    class Program
    {
        const int M = 1000000007;
        static void Main()
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Scan sc = new Scan();
            int n = sc.Int();
            long[] a = sc.LongArray();
            var set = new SortedSet<long>();
            foreach (long i in a)
                set.Add(i);

            for (int t = 0; t < 70; ++t)
            {
                long pre = 0;
                var l = new List<long>();
                foreach (long i in set)
                {
                    l.Add(Math.Min(i, pre ^ i));
                    pre = i;
                }
                set.Clear();
                foreach (long i in l)
                    set.Add(i);
            }

            sw.WriteLine((long)1 << set.Count);
            sw.Flush();
        }
    }

    class Scan
    {
        public int Int()
        {
            return int.Parse(Console.ReadLine().Trim());
        }
        public long Long()
        {
            return long.Parse(Console.ReadLine().Trim());
        }
        public string Str()
        {
            return Console.ReadLine().Trim();
        }

        public int[] IntArray()
        {
            return Console.ReadLine().Trim().Split().Select(int.Parse).ToArray();
        }
        public void IntTwi(out int a, out int b)
        {
            int[] arr = IntArray();
            a = arr[0];
            b = arr[1];
        }
        public void LongTwi(out long a, out long b)
        {
            long[] arr = LongArray();
            a = arr[0];
            b = arr[1];
        }
        public void StrTwi(out string a, out string b)
        {
            string[] arr = StrArray();
            a = arr[0];
            b = arr[1];
        }

        public long[] LongArray()
        {
            return Console.ReadLine().Trim().Split().Select(long.Parse).ToArray();
        }
        public string[] StrArray()
        {
            return Console.ReadLine().Trim().Split();
        }
    }
}
0