/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 0ms 320.0 KiB
#2 Accepted 36ms 460.0 KiB
#3 Time Exceeded ≥3081ms ≥324.0 KiB

Code

#include <stdio.h>

int main() {
    int t;
    scanf("%d",&t);
    while(t--){
        int n,m;
        scanf("%d %d",&n,&m);
        int lcd=-1;
        int i=2;
        while (i<=n && i<=m){
            if (n%i==0 && m%i==0){
                lcd=i;
                break;
            }
            i++;
        }
        
        printf("%d\n", lcd);
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1011 LCD
Contest
Brain booster - 1
Language
C11 (GCC 13.2.0)
Submit At
2023-12-31 16:22:37
Judged At
2024-11-11 03:45:12
Judged By
Score
50
Total Time
≥3081ms
Peak Memory
≥460.0 KiB