Wrong Answer
Code
#include <iostream>
using namespace std;
typedef long long ll;
int musa(ll A, ll B)
{
int operations = 0;
while (A != 0 && B != 0)
{
if (A > B)
{
operations += A / B;
A %= B;
}
else
{
operations += B / A;
B %= A;
}
}
return operations;
}
int main()
{
int T;
cin >> T;
while (T--)
{
ll A, B;
cin >> A >> B;
cout << musa(A, B) << endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1029 Make it zero
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-01-03 12:52:30
- Judged At
- 2025-01-03 12:52:30
- Judged By
- Score
- 50
- Total Time
- 4ms
- Peak Memory
- 584.0 KiB