/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 0ms 284.0 KiB
#2 Wrong Answer 0ms 548.0 KiB

Code

#include <stdio.h>
int main(){
    int t;
    scanf("%d",&t);
    
    while(t--){
        int a,b,yy,yy1;
        scanf("%d %d",&a,&b);
        
        if(a<b){
            yy = a;
        }
        else{
            yy = a;
        }
        
        for(int i = 2; i<yy; i++){
            if(a%i == 0 && b%i == 0){
                yy1 = i;
            }
        }
        if(yy1 > 1){
            printf("%d\n",yy1);
        }
        else {
            printf("-1\n");
        }
    }
}

Information

Submit By
Type
Submission
Problem
P1013 Divisible by 3
Contest
Brain booster - 1
Language
C99 (GCC 13.2.0)
Submit At
2023-12-31 16:35:09
Judged At
2024-11-11 03:45:05
Judged By
Score
0
Total Time
0ms
Peak Memory
548.0 KiB