Time Exceeded
Code
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
long long int a,b;
cin>>a>>b;
int cnt=0;
for(int i=1;i<=a;i++)
for(int j=1;j<=b;j++)
{
int gcd=__gcd(i,j);
int lcm=(i*j)/gcd;
if(lcm!=gcd)
cnt++;
}
cout<<cnt<<endl;
}
}
Information
- Submit By
- Type
- Submission
- Problem
- P1075 GCD not equal LCM
- Contest
- Brain Booster #5
- Language
- C++20 (G++ 13.2.0)
- Submit At
- 2024-09-05 16:00:06
- Judged At
- 2024-10-03 13:09:33
- Judged By
- Score
- 10
- Total Time
- ≥1103ms
- Peak Memory
- ≥540.0 KiB