unsigned long long int - Counting the number of Common Divisors between two numbers -
well point coded on common divisors between 2 numbers found more interesting
#include<stdio.h> int main() { long long int t; scanf("%lld",&t); long long int i; while(t--){ long long int a,b; scanf("%lld %lld",&a,&b); long long int k=0; for(i=1;i<=b;i++) if((a%i)==0 && (b%i)==0) k++; printf("%lld\n",k); } }
but can't estimate why code's timing out when input 8 bit number kindly let me know what's problem !!
Comments
Post a Comment