結果
| 問題 | No.2061 XOR Sort |
| コンテスト | |
| ユーザー |
👑 Nachia
|
| 提出日時 | 2024-04-22 22:49:05 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 88 ms / 2,000 ms |
| コード長 | 763 bytes |
| 記録 | |
| コンパイル時間 | 710 ms |
| コンパイル使用メモリ | 105,228 KB |
| 実行使用メモリ | 15,872 KB |
| 最終ジャッジ日時 | 2026-07-04 15:22:26 |
| 合計ジャッジ時間 | 3,824 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 41 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <atcoder/modint>
using namespace std;
using u64 = unsigned long long;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
using modint = atcoder::static_modint<998244353>;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N; cin >> N;
vector<u64> A(N); rep(i,N) cin >> A[i];
set<u64> S(A.begin(), A.end());
A = vector<u64>(S.begin(), S.end());
modint ans = 1;
rep(d,30){
u64 D = 1ull << d;
for(u64 a : A){
u64 l = (a^D)&~(D-1);
u64 r = l+D;
if(S.lower_bound(l) != S.lower_bound(r)){ ans *= 2; break; }
}
}
cout << ans.val() << '\n';
return 0;
}
Nachia