/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 356.0 KiB
#2 Accepted 1ms 328.0 KiB
#3 Accepted 5ms 428.0 KiB
#4 Accepted 11ms 424.0 KiB
#5 Accepted 1ms 284.0 KiB
#6 Accepted 52ms 424.0 KiB
#7 Time Exceeded ≥1016ms ≥512.0 KiB
#8 Time Exceeded ≥1019ms ≥328.0 KiB

Code

#include <stdio.h>

int main(){
    unsigned long long int a,b;
    int n;
    scanf("%d",&n);
    for (int i = 0; i < n; i++){
        scanf("%lld %lld",&a,&b);
        unsigned long long int count = 0;
        while (a != 0 && b != 0){
            if (a > b){
                a = a - b;
                count++;
            }
            else{
                b = b - a;
                count++;
            }
        }
        printf("%lld\n",count);
    }
    return 0;    
}

Information

Submit By
Type
Submission
Problem
P1029 Make it zero
Contest
Brain booster #2
Language
C11 (GCC 13.2.0)
Submit At
2024-03-06 15:54:58
Judged At
2024-11-11 03:41:30
Judged By
Score
50
Total Time
≥1019ms
Peak Memory
≥512.0 KiB