/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 536.0 KiB
#2 Accepted 4ms 548.0 KiB
#3 Time Exceeded ≥1066ms ≥2.492 MiB
#4 Time Exceeded ≥1099ms ≥180.207 MiB

Code



#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main()
{
    int t;
    cin >> t;
    while(t--){
        ll n;
        cin >> n;
        
        map<ll, int>mp;
        for(int i = 1; i < n; i++){
            mp[i]++;
        }
        int cnt = 0;
        for(int i = 1; i < n; i++){
            ll req = n - i;
            
            if(i < req and mp.find(req) != mp.end()){
                cnt++;
            }
        }
        cout << cnt << '\n';
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1073 Pair Sum
Contest
Bangladesh 2.0
Language
C++20 (G++ 13.2.0)
Submit At
2024-08-16 16:14:39
Judged At
2024-11-11 03:15:26
Judged By
Score
40
Total Time
≥1099ms
Peak Memory
≥180.207 MiB