結果
| 問題 | No.183 たのしい排他的論理和(EASY) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-13 15:44:07 |
| 言語 | D (dmd 2.111.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 405 bytes |
| 記録 | |
| コンパイル時間 | 2,699 ms |
| コンパイル使用メモリ | 200,536 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-01-13 15:44:18 |
| 合計ジャッジ時間 | 10,291 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 TLE * 1 -- * 12 |
ソースコード
module main;
// https://yukicoder.me/problems/no/183/editorial より
// ナップザック問題
import std;
void main()
{
// 入力
int N = readln.chomp.to!int;
auto A = readln.split.to!(int[]);
// 答えの計算
bool[int] dp;
dp[0] = true;
foreach (a; A) {
auto newDP = dp.dup;
foreach (k; dp.keys) {
newDP[a ^ k] = true;
}
dp = newDP;
}
// 答えの出力
writeln(dp.length);
}