結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー 抹茶アイス抹茶アイス
提出日時 2023-07-27 15:53:58
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 278 ms / 5,000 ms
コード長 659 bytes
コンパイル時間 7,120 ms
コンパイル使用メモリ 164,768 KB
実行使用メモリ 185,120 KB
最終ジャッジ日時 2024-04-15 03:16:29
合計ジャッジ時間 10,326 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
31,616 KB
testcase_01 AC 67 ms
31,360 KB
testcase_02 AC 66 ms
31,488 KB
testcase_03 AC 64 ms
31,616 KB
testcase_04 AC 64 ms
31,604 KB
testcase_05 AC 64 ms
31,612 KB
testcase_06 AC 63 ms
31,744 KB
testcase_07 AC 278 ms
31,872 KB
testcase_08 AC 214 ms
32,128 KB
testcase_09 AC 176 ms
31,872 KB
testcase_10 AC 195 ms
32,000 KB
testcase_11 AC 228 ms
32,256 KB
testcase_12 AC 64 ms
31,488 KB
testcase_13 AC 63 ms
31,616 KB
testcase_14 AC 65 ms
31,852 KB
testcase_15 AC 233 ms
32,256 KB
testcase_16 AC 64 ms
31,744 KB
testcase_17 AC 105 ms
31,872 KB
testcase_18 AC 245 ms
32,000 KB
testcase_19 AC 88 ms
185,120 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (90 ms)。
MSBuild のバージョン 17.9.6+a4ecab324 (.NET)
  main -> /home/judge/data/code/bin/Release/net8.0/main.dll
  main -> /home/judge/data/code/bin/Release/net8.0/publish/

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

namespace yukicoder
{
	public class Program
	{
		public static void Main()
		{
			var n = int.Parse(Console.ReadLine());
			var a = Console.ReadLine().Trim().Split(' ').Select(value => int.Parse(value)).Distinct().ToArray();
			var m = 16384 * 2;
			var b = new bool[m];
			b[0] = true;
			for(var i = 0; i < a.Length; i++)
            {
                for (var j = 0; j < m; j++)
                {
                    if (b[j])
                    {
						b[j ^ a[i]] = true;
                    }
                }
            }
			Console.WriteLine(b.Count(value => value));
		}
    }
}
0