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:28
- Judged At
- 2024-11-11 03:41:34
- Judged By
- Score
- 50
- Total Time
- ≥1089ms
- Peak Memory
- ≥572.0 KiB