結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー りあんりあん
提出日時 2015-04-19 02:37:00
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 665 ms / 5,000 ms
コード長 2,283 bytes
コンパイル時間 2,372 ms
コンパイル使用メモリ 106,960 KB
実行使用メモリ 57,568 KB
最終ジャッジ日時 2023-09-17 16:48:45
合計ジャッジ時間 15,996 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
22,844 KB
testcase_01 AC 67 ms
24,852 KB
testcase_02 AC 68 ms
22,692 KB
testcase_03 AC 68 ms
22,704 KB
testcase_04 AC 70 ms
22,904 KB
testcase_05 AC 69 ms
22,860 KB
testcase_06 AC 67 ms
22,752 KB
testcase_07 AC 69 ms
22,880 KB
testcase_08 AC 441 ms
52,460 KB
testcase_09 AC 156 ms
42,140 KB
testcase_10 AC 364 ms
51,612 KB
testcase_11 AC 302 ms
44,464 KB
testcase_12 AC 578 ms
50,080 KB
testcase_13 AC 610 ms
56,804 KB
testcase_14 AC 348 ms
46,996 KB
testcase_15 AC 646 ms
53,952 KB
testcase_16 AC 564 ms
54,384 KB
testcase_17 AC 596 ms
57,180 KB
testcase_18 AC 69 ms
22,856 KB
testcase_19 AC 67 ms
22,696 KB
testcase_20 AC 100 ms
27,892 KB
testcase_21 AC 665 ms
55,320 KB
testcase_22 AC 653 ms
57,568 KB
testcase_23 AC 69 ms
22,796 KB
testcase_24 AC 68 ms
22,780 KB
testcase_25 AC 69 ms
22,836 KB
testcase_26 AC 68 ms
22,680 KB
testcase_27 AC 68 ms
22,804 KB
testcase_28 AC 382 ms
48,528 KB
testcase_29 AC 565 ms
54,752 KB
testcase_30 AC 438 ms
50,004 KB
testcase_31 AC 386 ms
47,484 KB
testcase_32 AC 531 ms
57,472 KB
testcase_33 AC 643 ms
53,284 KB
testcase_34 AC 639 ms
55,244 KB
testcase_35 AC 648 ms
55,372 KB
testcase_36 AC 648 ms
55,220 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 HashSet<long>();
            foreach (long i in a)
                set.Add(i);

            for (int t = 0; t < 150; ++t)
                set = loop(set, t);

            sw.WriteLine((long)1 << set.Count);
            sw.Flush();
        }
        public static HashSet<long> loop (HashSet<long> set, int t)
        {
            var ret = new HashSet<long>();
            long p = set.ElementAt(t % set.Count());

            foreach (long i in set)
            {
                if (i == p)
                    ret.Add(i);
                else
                    ret.Add(Math.Min(i, p ^ 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