/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 764.0 KiB
#2 Accepted 126ms 552.0 KiB
#3 Time Exceeded ≥3085ms ≥536.0 KiB

Code

#include<iostream>
#include<bits/stdc++.h>
using namespace std;
#define ll long long int


void solve(){
    ll n, m;
    cin>>n>>m;



    for(ll i=2;i<=min(n, m);i++){
        if(n%i==0 && m%i==0){
            cout<<i<<endl;
            return;
        }
    }

    cout<<-1<<endl;
}

int main(){

    ll t;
    cin>>t;
    while(t--){
        solve();
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1011 LCD
Contest
Brain booster - 1
Language
C++17 (G++ 13.2.0)
Submit At
2023-12-31 15:14:21
Judged At
2024-11-11 03:45:52
Judged By
Score
50
Total Time
≥3085ms
Peak Memory
≥764.0 KiB