/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Accepted 3ms 532.0 KiB
#3 Time Exceeded ≥1086ms ≥2.488 MiB
#4 Time Exceeded ≥1111ms ≥185.621 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-10-03 13:27:57
Judged By
Score
40
Total Time
≥1111ms
Peak Memory
≥185.621 MiB