結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
21,436 KB
testcase_01 AC 61 ms
21,524 KB
testcase_02 AC 61 ms
21,320 KB
testcase_03 AC 61 ms
21,388 KB
testcase_04 AC 60 ms
23,424 KB
testcase_05 AC 61 ms
21,376 KB
testcase_06 AC 61 ms
21,416 KB
testcase_07 RE -
testcase_08 AC 315 ms
21,836 KB
testcase_09 AC 237 ms
21,888 KB
testcase_10 AC 273 ms
23,968 KB
testcase_11 AC 337 ms
19,844 KB
testcase_12 RE -
testcase_13 AC 61 ms
21,432 KB
testcase_14 AC 163 ms
23,840 KB
testcase_15 AC 347 ms
21,904 KB
testcase_16 AC 61 ms
21,520 KB
testcase_17 AC 132 ms
23,772 KB
testcase_18 RE -
testcase_19 AC 99 ms
19,496 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 = 16384;
    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