/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Time Exceeded ≥1087ms ≥536.0 KiB
#3 Time Exceeded ≥1086ms ≥320.0 KiB

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-11-11 03:02:07
Judged By
Score
10
Total Time
≥1087ms
Peak Memory
≥536.0 KiB