結果

問題 No.3205 Range Pairwise Xor Query
ユーザー amesyu
提出日時 2025-06-05 13:06:04
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 434 bytes
コンパイル時間 2,004 ms
コンパイル使用メモリ 195,420 KB
実行使用メモリ 16,072 KB
最終ジャッジ日時 2025-06-05 13:06:11
合計ジャッジ時間 6,874 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5 TLE * 1 -- * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int main() {
    int N, Q; cin >> N >> Q;
    vector<int> A(N);
    for(int i = 0; i < N; ++i) {
        cin >> A[i];
    }
    while(Q--) {
        int L, R; cin >> L >> R;
        long long ans = 0;
        for(int i = L - 1; i < R - 1; ++i) {
            for(int j = i + 1; j < R; ++j) {
                ans += A[i] ^ A[j];
            }
        }
        cout << ans << endl;
    }
}
0