結果
問題 |
No.184 たのしい排他的論理和(HARD)
|
ユーザー |
|
提出日時 | 2020-08-09 15:46:00 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 31 ms / 5,000 ms |
コード長 | 418 bytes |
コンパイル時間 | 2,245 ms |
コンパイル使用メモリ | 194,756 KB |
最終ジャッジ日時 | 2025-01-12 19:22:00 |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:17:21: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | int n; scanf("%d",&n); | ~~~~~^~~~~~~~~ main.cpp:19:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 19 | rep(i,n) scanf("%llu",&a[i]); | ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(n);i++) using namespace std; auto basis(const vector<unsigned long long>& a){ vector<unsigned long long> B; for(auto v:a){ for(auto b:B) v=min(v,v^b); if(v!=0) B.emplace_back(v); } return B; } int main(){ int n; scanf("%d",&n); vector<unsigned long long> a(n); rep(i,n) scanf("%llu",&a[i]); printf("%lld\n",1LL<<basis(a).size()); return 0; }