Time Exceeded
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