/ SeriousOJ /

Record Detail

Wrong Answer


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

Code

/*CODED BY mahmudulsakib2019
  DATE:-12/03/2024;TIME:-16:10 pm
  BANGALDESH , SYLHET*/

#include <iostream>
#include <cmath>     ///mathematics
#include<cstdlib>    ///for std::exit(EXIT_SUCCESS)
#include <vector>    ///array
#include <regex>     ///searching_prefix_suffix
#include <algorithm> ///finding_max_min_from_array
#include <string>    ///string_manipulation
#include <numeric>   ///findin total sum of an array
#include<bits/stdc++.h>
using namespace std;

int main() {
    int T;
    std::cin >> T;
    while(T--) {
        long long A, B;
        std::cin >> A >> B;
        int count = 0;
        while(A != 0 && B != 0) {
            if(A > B) {
                count += A / B;
                A %= B;
            } else {
                count += B / A;
                B %= A;
            }
        }
        std::cout << count << std::endl;
    }
    return 0;
}

Information

Submit By
Type
Submission
Problem
P1029 Make it zero
Language
C++20 (G++ 13.2.0)
Submit At
2024-03-12 10:11:19
Judged At
2024-11-11 03:41:01
Judged By
Score
50
Total Time
4ms
Peak Memory
548.0 KiB