結果
問題 | No.2061 XOR Sort |
ユーザー |
|
提出日時 | 2022-08-26 22:16:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 386 ms / 2,000 ms |
コード長 | 530 bytes |
コンパイル時間 | 1,022 ms |
コンパイル使用メモリ | 77,624 KB |
実行使用メモリ | 25,632 KB |
最終ジャッジ日時 | 2024-10-13 22:53:31 |
合計ジャッジ時間 | 6,450 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 41 |
コンパイルメッセージ
main.cpp:7:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 7 | main() | ^~~~
ソースコード
#include<iostream> #include<vector> #include<atcoder/modint> using namespace std; using mint=atcoder::modint998244353; int N; main() { cin>>N; vector<vector<int> >now,nxt; now.emplace_back(N); for(int i=0;i<N;i++)cin>>now[0][i]; mint ans=1; for(int k=30;k--;) { nxt.clear(); for(int i=0;i<now.size();i++) { vector<int>L[2]; for(int a:now[i])L[a>>k&1].push_back(a); for(int j=0;j<2;j++)if(!L[j].empty())nxt.push_back(L[j]); } if(now.size()<nxt.size())ans*=2; swap(now,nxt); } cout<<ans.val()<<endl; }