結果
| 問題 | 
                            No.183 たのしい排他的論理和(EASY)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             rana
                         | 
                    
| 提出日時 | 2021-09-10 23:40:27 | 
| 言語 | C++17(clang)  (17.0.6 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 504 bytes | 
| コンパイル時間 | 3,448 ms | 
| コンパイル使用メモリ | 130,088 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-06-12 05:16:18 | 
| 合計ジャッジ時間 | 7,369 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 2 WA * 15 RE * 1 | 
ソースコード
#include <algorithm>
#include <iostream>
#include <numeric>
#include <queue>
#include <vector>
using namespace std;
int main(void) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) cin >> a[i];
    vector<int> can(16385, 0);
    can[0] = 1;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < 16385; ++j) {
            if (!can[j]) continue;
            can[j | a[i]] |= can[j];
        }
    }
    cout << accumulate(can.begin(), can.end(), 0) << endl;
}
            
            
            
        
            
rana