結果
| 問題 |
No.183 たのしい排他的論理和(EASY)
|
| コンテスト | |
| ユーザー |
syake_ta
|
| 提出日時 | 2018-08-26 18:36:58 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,207 bytes |
| コンパイル時間 | 625 ms |
| コンパイル使用メモリ | 86,044 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-01 03:58:06 |
| 合計ジャッジ時間 | 4,043 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 2 |
| other | RE * 18 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:62:25: warning: iteration 5010 invokes undefined behavior [-Waggressive-loop-optimizations]
62 | if (dp[i]) {
| ~~~~^
main.cpp:61:26: note: within this loop
61 | for(int i = 0; i < (1 << 15); i++) {
| ~~^~~~~~~~~~~
main.cpp:54:33: warning: iteration 5010 invokes undefined behavior [-Waggressive-loop-optimizations]
54 | if (dp[j]) {
| ~~~~^
main.cpp:53:34: note: within this loop
53 | for(int j = 0; j < (1 << 15); j++) {
| ~~^~~~~~~~~~~
ソースコード
#include<iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<functional>
#include<iomanip>
#include<queue>
#include<cassert>
#include<tuple>
#include<set>
#include<map>
#include<list>
#include<bitset>
#include<utility>
#include<numeric>
#define PB push_back
#define all(a) (a).begin(),(a).end()
#define ALL(v) begin(v), end(v)
#define DWN(a) (a).begin(),(a).end(), greater<int>()
#define rep(i, m) for (int i = 0; i < m; i++)
#define REP(i, n, m) for (int i = n; i < m; i++)
#define V vector<int>
#define VV vector<V>
#define VVV vector<VV>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int dx[4] = { 1, 0, -1, 0 };
const int dy[4] = { 0, 1, 0, -1 };
const int inf = (int)1e9;
const ll INF = (ll)1e18;
const ll MOD{ (ll)1e9 + 7 };
const long double EPS = 1e-10;
bool dp[5010] = {};
int main() {
int n;
cin >> n;
dp[0] = true;
for(int i = 0; i < n; i++) {
int tmp;
cin >> tmp;
for(int j = 0; j < (1 << 15); j++) {
if (dp[j]) {
dp[tmp ^ j] = true;
}
}
}
int cnt = 0;
for(int i = 0; i < (1 << 15); i++) {
if (dp[i]) {
cnt++;
}
}
cout << cnt << endl;
return 0;
}
syake_ta