/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 1ms 320.0 KiB
#3 Accepted 4ms 320.0 KiB
#4 Accepted 4ms 324.0 KiB
#5 Accepted 4ms 508.0 KiB
#6 Accepted 4ms 532.0 KiB
#7 Wrong Answer 4ms 552.0 KiB
#8 Wrong Answer 4ms 532.0 KiB

Code

/*CODED BY mahmudulsakib2019
  DATE:-4/3/2024;TIME:-23:05 pm
  BANGALDESH , SYLHET*/

#include <iostream>
using namespace std;

int main() {
    int T;
    cin >> T;
    while (T--) {
        unsigned long long a, b;
        cin >> a >> b;
        int count = 0;
        while (a != 0 && b != 0) {
            if (a > b) {
                unsigned long long temp = a;
                a = a % b;
                count += temp / b;
            } else {
                unsigned long long temp = b;
                b = b % a;
                count += temp / a;
            }
        }
        cout << count << endl;
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1029 Make it zero
Contest
Brain booster #2
Language
C++20 (G++ 13.2.0)
Submit At
2024-03-06 16:33:13
Judged At
2024-11-11 03:41:18
Judged By
Score
50
Total Time
4ms
Peak Memory
552.0 KiB