Time Exceeded
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