Time Exceeded
Code
#include <stdio.h>
int main(){
int a, b, t;
scanf("%d", &t);
int i = 1;
while(i <= t){
scanf("%d %d", &a, &b);
int count = 0;
while(a != 0){
if (a >= b){
a = abs(a-b);
//printf("%d\n", a);
count++;
}
else{
b = abs(b-a);
//printf("%d\n", b);
count++;
}
}
printf("%d\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 14:36:27
- Judged At
- 2024-11-11 03:41:51
- Judged By
- Score
- 50
- Total Time
- ≥1100ms
- Peak Memory
- ≥428.0 KiB