Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- gcj2012qC.c (revision 23)
- +++ gcj2012qC.c (working copy)
- @@ -4,12 +4,12 @@
- scanf("%d%d",&a,&b);
- for(n=a,l=10;n/10;n/=10)l*=10;
- for(n=a,r=0;n<=b;n++){
- - for(p=q=0,L=10;L<l;L*=10){
- + for(p=q=0,L=1;L<l;L*=10){
- m=(n%L)*(l/L)+n/L;
- if(n==m)p++;
- if(n<m&&m<=b)q++;
- }
- - if(q)r+=q-p;
- + r+=q/p;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment