/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 2ms 504.0 KiB
#2 Accepted 1ms 532.0 KiB
#3 Accepted 7ms 320.0 KiB
#4 Accepted 9ms 324.0 KiB
#5 Accepted 4ms 532.0 KiB
#6 Accepted 57ms 568.0 KiB
#7 Wrong Answer 60ms 556.0 KiB
#8 Time Exceeded ≥1087ms ≥324.0 KiB

Code

#include <iostream>
using namespace std;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	int t, a, b, maxd, count;

    cin >> t;
    while(t--){
        cin >> a >> b;
        count = 0;
        while(a!=0 && b!=0){
            maxd = max(a, b);
            if(maxd == a){
                a = abs(a-b);
            }else{
                b = abs(a-b);
            }
            count++;
        }

        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 15:45:36
Judged At
2024-11-11 03:41:33
Judged By
Score
50
Total Time
≥1087ms
Peak Memory
≥568.0 KiB