/ 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 424.0 KiB
#4 Accepted 10ms 428.0 KiB
#5 Accepted 1ms 332.0 KiB
#6 Accepted 50ms 432.0 KiB
#7 Time Exceeded ≥1054ms ≥284.0 KiB
#8 Time Exceeded ≥1086ms ≥412.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("%llu %llu",&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("%llu\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 16:40:44
Judged At
2024-11-11 03:41:13
Judged By
Score
50
Total Time
≥1086ms
Peak Memory
≥432.0 KiB