Time Exceeded
Code
#include <bits/stdc++.h>
using namespace std;
/// complete sliding window and two pointer
///A. Codeforces Checking
int main()
{
long long t;
cin >> t;
while(t--){
long long int n;
int cnt=0;
cin >> n;
for(int i=0; i<n; i++){
for(int j=1; j<n; j++){
if(i<j && j<n && i+j==n){
cnt++;
}
}
}
cout << cnt << endl;
}
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:12:31
- Judged At
- 2024-10-03 13:28:11
- Judged By
- Score
- 40
- Total Time
- ≥1089ms
- Peak Memory
- ≥536.0 KiB