結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー mbanmban
提出日時 2017-01-12 13:22:34
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 1,806 bytes
コンパイル時間 2,219 ms
コンパイル使用メモリ 108,572 KB
実行使用メモリ 23,932 KB
最終ジャッジ日時 2023-08-23 08:44:23
合計ジャッジ時間 6,082 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 58 ms
21,428 KB
testcase_01 AC 59 ms
23,600 KB
testcase_02 AC 60 ms
21,524 KB
testcase_03 AC 59 ms
21,500 KB
testcase_04 AC 59 ms
19,472 KB
testcase_05 AC 59 ms
21,444 KB
testcase_06 AC 59 ms
21,628 KB
testcase_07 RE -
testcase_08 AC 310 ms
21,892 KB
testcase_09 AC 235 ms
23,880 KB
testcase_10 AC 271 ms
22,004 KB
testcase_11 AC 334 ms
22,132 KB
testcase_12 RE -
testcase_13 AC 59 ms
21,548 KB
testcase_14 AC 160 ms
21,952 KB
testcase_15 AC 346 ms
23,932 KB
testcase_16 AC 59 ms
21,452 KB
testcase_17 AC 127 ms
21,872 KB
testcase_18 RE -
testcase_19 AC 95 ms
21,676 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;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Text;
using System.Text.RegularExpressions;
using System.Linq;
using System.IO;

class Program
{
    static private Magatro M = new Magatro();
    static private void Main(string[]args)
    {
        M.Scan();
        M.Solve();
    }
}

public class Scanner
{
    private string[] S;
    private int Index;
    private char Separator;

    public Scanner(char separator = ' ')
    {
        Index = 0;
        Separator = separator;
    }

    private string[] Line()
    {
        return Console.ReadLine().Split(Separator);
    }

    public string Next()
    {
        string result;
        if (S == null || Index >= S.Length)
        {
            S = Line();
            Index = 0;
        }
        result = S[Index];
        Index++;
        return result;
    }
    public int NextInt()
    {
        return int.Parse(Next());
    }
    public double NextDouble()
    {
        return double.Parse(Next());
    }
    public long NextLong()
    {
        return long.Parse(Next());
    }
}

public class Magatro
{
    private int N;
    private int[] A;
    private const int Max = 1<<14;
    public void Scan()
    {
        Scanner sc = new Scanner();
        N = sc.NextInt();
        A = new int[N];
        for(int i = 0; i < N; i++)
        {
            A[i] = sc.NextInt();
        }
    }
    public void Solve()
    {
        bool[] dp = new bool[Max + 1];
        dp[0] = true;
        for(int i = 0; i < N; i++)
        {
            for(int j = 0; j <= Max; j++)
            {
                if (dp[j])
                {
                    dp[j ^ A[i]] = true;
                }
            }
        }
        Console.WriteLine(dp.Count(ss =>ss));
    }
}
0