結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー nebukuro09
提出日時 2016-11-01 11:28:31
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 552 ms / 5,000 ms
コード長 443 bytes
コンパイル時間 922 ms
コンパイル使用メモリ 100,608 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-12 04:51:13
合計ジャッジ時間 4,771 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio;
import std.array;
import std.string;
import std.conv;
import std.algorithm;
import std.typecons;
import std.range;

void main() {
  int N = readln().chomp.to!int;
  int[] A= readln().split.map!(to!int).array;

  bool[2^^15] dp;
  dp[0] = true;

  foreach (a; A) 
    foreach (i; iota(2^^15))
      if (dp[i])
        dp[i^a] = true;

  int ans = 0;
  foreach (i; iota(2^^15))
    if (dp[i])
      ans += 1;
  writeln(ans);
}
0