結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー りあんりあん
提出日時 2015-04-17 23:17:04
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 1,945 bytes
コンパイル時間 2,275 ms
コンパイル使用メモリ 108,532 KB
実行使用メモリ 27,532 KB
最終ジャッジ日時 2023-09-17 22:08:28
合計ジャッジ時間 4,891 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
22,796 KB
testcase_01 AC 68 ms
24,836 KB
testcase_02 AC 68 ms
22,840 KB
testcase_03 AC 69 ms
20,780 KB
testcase_04 AC 69 ms
22,836 KB
testcase_05 AC 68 ms
22,892 KB
testcase_06 AC 68 ms
22,876 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 68 ms
22,864 KB
testcase_13 AC 66 ms
22,772 KB
testcase_14 AC 76 ms
23,140 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 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();
            var set = new HashSet<long>();
            int n = sc.Int();
            long[] a = sc.LongArray();
            set.Add(0);
            long p = 0;
            long ans = 2;
            foreach (long i in a)
            {
                if (set.Add(i) && set.Add(p = p ^ i))
                    ans *= 2;
                }
            sw.WriteLine(ans);
            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