結果

問題 No.184 たのしい排他的論理和(HARD)
ユーザー りあんりあん
提出日時 2015-04-19 01:59:18
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 2,195 bytes
コンパイル時間 2,258 ms
コンパイル使用メモリ 107,196 KB
実行使用メモリ 61,316 KB
最終ジャッジ日時 2023-09-17 16:46:46
合計ジャッジ時間 22,081 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 67 ms
22,756 KB
testcase_01 AC 67 ms
24,756 KB
testcase_02 AC 67 ms
22,812 KB
testcase_03 AC 68 ms
22,736 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 68 ms
24,840 KB
testcase_19 AC 68 ms
22,864 KB
testcase_20 AC 101 ms
27,912 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 68 ms
22,808 KB
testcase_24 AC 68 ms
24,796 KB
testcase_25 AC 68 ms
24,884 KB
testcase_26 AC 67 ms
20,820 KB
testcase_27 AC 69 ms
22,816 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 < 70; ++t)
                set = loop(set);

            sw.WriteLine((long)1 << set.Count);
            sw.Flush();
        }
        public static HashSet<long> loop (HashSet<long> set)
        {
            var ret = new HashSet<long>();
            long pre = set.Last();
            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