結果

問題 No.2061 XOR Sort
ユーザー 👑 NachiaNachia
提出日時 2022-08-26 21:34:10
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 963 bytes
コンパイル時間 2,771 ms
コンパイル使用メモリ 122,424 KB
最終ジャッジ日時 2025-01-31 04:22:07
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 34 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <atcoder/modint>

using namespace std;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
#define rep(i,n) for(int i=0; i<(int)(n); i++)


const i64 INF = 1001001001001001001;
using modint = atcoder::static_modint<998244353>;



int main(){
    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)>>1);
            u64 r = l+D;
            if(S.lower_bound(l) != S.lower_bound(r)){ ans *= 2; break; }
        }
    }
    cout << ans.val() << '\n';
    return 0;
}


struct ios_do_not_sync{
    ios_do_not_sync(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(nullptr);
    }
} ios_do_not_sync_instance;


0