/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 540.0 KiB
#2 Accepted 2ms 328.0 KiB
#3 Accepted 2ms 328.0 KiB
#4 Accepted 3ms 332.0 KiB
#5 Accepted 3ms 328.0 KiB
#6 Accepted 5ms 540.0 KiB
#7 Accepted 5ms 540.0 KiB
#8 Accepted 8ms 572.0 KiB
#9 Accepted 32ms 816.0 KiB
#10 Accepted 74ms 792.0 KiB
#11 Accepted 81ms 576.0 KiB
#12 Accepted 71ms 540.0 KiB
#13 Time Exceeded ≥2000ms ≥1.527 MiB
#14 Time Exceeded ≥2100ms ≥1.789 MiB

Code

#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
using ll = long long;

void bruteForce() {
    int n;
    cin >> n;
    vector<int> v(n);
    for(auto &i: v) cin >> i;
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        for(int j = i + 1; j <= n; j++) {
            if((v[i - 1] ^ i) < ((v[j - 1] ^ i) ^ j)) ++ans;
        }
    }
    cout << ans << endl;
    return;
}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    int tc = 1;
    cin >> tc;
    for (int t = 1; t <= tc; t++) {
        // cout << "Case " << t << ": ";
        bruteForce();
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1198 E. Good Signal Pairs
Language
C++17 (G++ 13.2.0)
Submit At
2025-05-22 11:19:33
Judged At
2025-05-22 11:19:33
Judged By
Score
12
Total Time
≥2100ms
Peak Memory
≥1.789 MiB