Time Exceeded
Code
#include <stdio.h>
int main(){
long long int a, b;
long long int t;
scanf("%lld", &t);
long long int i = 1;
while(i <= t){
scanf("%lld %lld", &a, &b);
long long int count = 0;
while(a != 0){
a = abs(a);
b = abs(b);
if (a >= b){
a = a-b;
//printf("%d\n", a);
count++;
}
else{
b = b-a;
//printf("%d\n", b);
count++;
if (b == 0){
break;
}
}
}
printf("%lld\n", count);
i++;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1029 Make it zero
- Contest
- Brain booster #2
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2024-03-06 15:44:53
- Judged At
- 2024-11-11 03:41:34
- Judged By
- Score
- 50
- Total Time
- ≥1095ms
- Peak Memory
- ≥428.0 KiB