Time Exceeded
Code
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int res =0;
for(int i =1; i<=n; i++)
{
for(int j =1; j<=i; j++)
{
if((abs(j-i) ==1 || abs(j-i) ==0) && j*i <=n)
{
res++;
}
}
}
cout<<res<<endl;
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1191 A. Balanced Product
- Contest
- Brain Booster #10
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-06-13 16:13:28
- Judged At
- 2025-06-13 16:13:28
- Judged By
- Score
- 40
- Total Time
- ≥1101ms
- Peak Memory
- ≥556.0 KiB