Time Exceeded
Code
def min_operations(a, b):
count = 0
while a != 0 and b != 0:
a, b = abs(a - b), min(a, b)
count += 1
return count
if __name__ == "__main__":
T = int(input())
for _ in range(T):
A, B = map(int, input().split())
result = min_operations(A, B)
print(result)
Information
- Submit By
- Type
- Submission
- Problem
- P1029 Make it zero
- Contest
- Brain booster #2
- Language
- Python 3 (Python 3.12.3)
- Submit At
- 2024-03-06 16:59:31
- Judged At
- 2024-11-11 03:41:06
- Judged By
- Score
- 10
- Total Time
- ≥1087ms
- Peak Memory
- ≥3.148 MiB