結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー りあんりあん
提出日時 2015-04-19 01:19:24
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 476 ms / 5,000 ms
コード長 2,194 bytes
コンパイル時間 2,793 ms
コンパイル使用メモリ 105,732 KB
実行使用メモリ 56,920 KB
最終ジャッジ日時 2023-09-17 16:15:03
合計ジャッジ時間 12,481 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
23,244 KB
testcase_01 AC 69 ms
23,284 KB
testcase_02 AC 70 ms
25,220 KB
testcase_03 AC 69 ms
25,340 KB
testcase_04 AC 69 ms
23,364 KB
testcase_05 AC 69 ms
21,100 KB
testcase_06 AC 71 ms
27,296 KB
testcase_07 AC 68 ms
23,200 KB
testcase_08 AC 330 ms
54,660 KB
testcase_09 AC 126 ms
33,240 KB
testcase_10 AC 263 ms
47,164 KB
testcase_11 AC 198 ms
39,620 KB
testcase_12 AC 378 ms
52,328 KB
testcase_13 AC 399 ms
55,276 KB
testcase_14 AC 256 ms
46,936 KB
testcase_15 AC 436 ms
51,832 KB
testcase_16 AC 380 ms
54,216 KB
testcase_17 AC 399 ms
53,072 KB
testcase_18 AC 69 ms
25,128 KB
testcase_19 AC 68 ms
23,304 KB
testcase_20 AC 100 ms
26,396 KB
testcase_21 AC 436 ms
54,164 KB
testcase_22 AC 476 ms
56,304 KB
testcase_23 AC 69 ms
23,180 KB
testcase_24 AC 68 ms
23,232 KB
testcase_25 AC 68 ms
23,176 KB
testcase_26 AC 69 ms
23,336 KB
testcase_27 AC 69 ms
25,304 KB
testcase_28 AC 280 ms
43,676 KB
testcase_29 AC 382 ms
56,920 KB
testcase_30 AC 332 ms
53,744 KB
testcase_31 AC 279 ms
46,140 KB
testcase_32 AC 338 ms
50,368 KB
testcase_33 AC 436 ms
55,912 KB
testcase_34 AC 438 ms
51,852 KB
testcase_35 AC 441 ms
56,096 KB
testcase_36 AC 433 ms
53,984 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)
                set = loop(set);

            sw.WriteLine((long)1 << set.Count);
            sw.Flush();
        }
        public static SortedSet<long> loop (SortedSet<long> set)
        {
            var ret = new SortedSet<long>();
            long pre = 0;
            foreach (long i in set)
            {
                ret.Add(Math.Min(i, pre ^ i));
                pre = i;
            }
            return ret;
        }
    }

    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