/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 324.0 KiB
#2 Accepted 1ms 320.0 KiB
#3 Accepted 5ms 524.0 KiB
#4 Accepted 8ms 320.0 KiB
#5 Accepted 4ms 324.0 KiB
#6 Accepted 31ms 320.0 KiB
#7 Time Exceeded ≥1090ms ≥324.0 KiB
#8 Time Exceeded ≥1097ms ≥532.0 KiB

Code

#include <iostream>
#include <cmath>
using namespace std;
int main() {
    
    //SAYED AL MAMUN_LU
    
    int t;
    cin >> t;

    while (t--) {
        long long int a, b, sum = 0;
        cin >> a >> b;

        while (a > 0 && b > 0) {
            if (a > b) {
                a = abs(a - b);
            } 
            else {
                b = abs(b - a);
            }
            sum++;
        }

        cout << sum << endl;
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1029 Make it zero
Contest
Brain booster #2
Language
C++17 (G++ 13.2.0)
Submit At
2024-03-06 16:39:11
Judged At
2024-11-11 03:41:16
Judged By
Score
50
Total Time
≥1097ms
Peak Memory
≥532.0 KiB