Time Exceeded
Code
#include <stdio.h>
int main(){
unsigned long long int a,b;
int n;
scanf("%d",&n);
for (int i = 0; i < n; i++){
scanf("%lld %lld",&a,&b);
unsigned long long int count = 0;
while (a != 0 && b != 0){
if (a > b){
a = a - b;
count++;
}
else{
b = b - a;
count++;
}
}
printf("%lld\n",count);
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1029 Make it zero
- Contest
- Brain booster #2
- Language
- C11 (GCC 13.2.0)
- Submit At
- 2024-03-06 15:54:58
- Judged At
- 2024-11-11 03:41:30
- Judged By
- Score
- 50
- Total Time
- ≥1019ms
- Peak Memory
- ≥512.0 KiB