/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 532.0 KiB
#2 Time Exceeded ≥1078ms ≥540.0 KiB
#3 Time Exceeded ≥1081ms ≥532.0 KiB
#4 Time Exceeded ≥1094ms ≥316.0 KiB
#5 Time Exceeded ≥1092ms ≥324.0 KiB
#6 Time Exceeded ≥1103ms ≥532.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-10-03 13:09:33
Judged By
Score
10
Total Time
≥1103ms
Peak Memory
≥540.0 KiB