/ SeriousOJ /

Record Detail

Time Exceeded


  
# Status Time Cost Memory Cost
#1 Accepted 1ms 320.0 KiB
#2 Accepted 1ms 324.0 KiB
#3 Accepted 7ms 564.0 KiB
#4 Accepted 9ms 572.0 KiB
#5 Accepted 3ms 324.0 KiB
#6 Accepted 55ms 560.0 KiB
#7 Wrong Answer 59ms 560.0 KiB
#8 Time Exceeded ≥1089ms ≥320.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:28
Judged At
2024-11-11 03:41:34
Judged By
Score
50
Total Time
≥1089ms
Peak Memory
≥572.0 KiB