Search found 2 matches

by raihan004
Thu Oct 25, 2012 2:06 am
Forum: Volume 118 (11800-11899)
Topic: 11827 - Maximum GCD
Replies: 22
Views: 3925

11827 - Maximum GCD Getting Wrong Ans Need Help

hi am (11827 - Maximum GCD) Getting Wrong Ans Need Help. I dont know where is my fault. pls me help me to find my fault. here is my code #include<stdio.h> int main() { int s,t; scanf("%d",&t); for(s=0;s<t;s++) { long long max=0,a[1000000],n,p,q; int i,j,m; char c; m=0; do { scanf("%lld%c",&a[m],&c);...
by raihan004
Fri Oct 12, 2012 12:35 pm
Forum: Volume 100 (10000-10099)
Topic: 10014 - Simple calculations
Replies: 34
Views: 8518

10014 got time limit error

here is my code face time limt error how solve this problem using this logic? #include<stdio.h> int rec(long n) { if(n%10>0) return n%10; else if(n==0) return 0; else rec(n/10); } int main() { long p,q; long sum=0; long i; while(scanf("%ld%ld",&p,&q)!=0) { if(p<0&&q<0) break; else { for(i=p;i<=q;i++...

Go to advanced search