Language: C

/*
 * Author:  chlxyd
 * Created Time:  2013-9-14 12:44:02
 * File Name: 1007.cpp
 */
#include<iostream>
#include<sstream>
#include<fstream>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cctype>
#include<cmath>
#include<ctime>
using namespace std;
const double eps(1e-8);
typedef long long lint;
#define clr(x) memset( x , 0 , sizeof(x) )
#define sz(v) ((int)(v).size())
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repf(i, a, b) for (int i = (a); i <= (b); ++i)
#define repd(i, a, b) for (int i = (a); i >= (b); --i)
#define clrs( x , y ) memset( x , y , sizeof(x) )

const int maxMark = 2000 + 10;

struct node {
    int num, res, ty;
    node (int num = 0, int res = 0, int ty = 0) : num(num), res(res), ty(ty) {
    }
};

int lim[20];
int aa[20], bb[20];
int lenA, lenB;
int a, b, top[4];
int ans;
int dp[4][maxMark][3];
int ten[20], dit[20], n, m;

int F(int w, int len) {
    int res = 0;
    repd (i, len - 1, 0) {
        res = res * 2 + w / ten[i];
        w %= ten[i];
    }
    return res;
}

void init() { //int64
    lenA = 0;
    lenB = 0;
    int na = a, nb = b; 
    clr(aa);
    clr(bb);
    while (na != 0) {
        aa[lenA++] = na % 10;
        na /= 10;
    }
    if (lenA == 0)
        aa[lenA++] = 0;
    while (nb != 0) {
        bb[lenB++] = nb % 10;
        nb /= 10;
    }
    if (lenB == 0)
        bb[lenB++] = 0;
    
    ten[0] = 1;
    repf (i, 1, 13)
        ten[i] = ten[i - 1] * 10;
    
    dit[0] = bb[0];
    repf (i, 1, 13)
        dit[i] = dit[i - 1] * 10 + bb[i];
}

int getF(int *aa, int r, int l) {
    int res = 0;
    repd (i, r, l)
        res = res * 2 + aa[i];
    return res;
} 

int getD(int *aa, int r, int l) {
    int res = 0;
    repd (i, r, l)
       res = res * 10 + aa[i];
    return res; 
}

int getRes(int len, int ty) {
    if (len == -1) return 1;
    if (ty == 0) {
        return ten[len + 1];
    }
    else return dit[len];
}

int main(){
    int T, ca = 1;
    scanf("%d", &T);
    while (T--) {
        scanf("%d%d", &n, &m);
        a = n, b = m;
        init();        
        ans = 0;
        int st = 0;
        clr(dp[st]);
        dp[st][0][1] = 1; 
       
        //printf("%d\n", lenA);
        //repd (i, lenA, 0)
           //printf("%d", aa[i]); 
        //printf("\n");
        
        repd (i, max(lenB, lenA) - 1, 0) {
            clr(dp[!st]);
            int ha = getF(aa, i + 3, i);
            int hb = getD(bb, i + 3, i);
            repf (z, 0, 1) repf (k, 0, 999) {
                int x = k;
                int y = dp[st][x][z]; 
                if (y == 0) continue;
                int now = F(x, 3) * 2;
                rep (j, 10) {
                    int nx = x * 10 + j;
                    if (z && nx > hb) break;
                    int nnow = now + j; 
                    if (nnow < ha) {
                        //printf("%d\n", ans);
                        if (nx == hb && z)
                            ans += getRes(i - 1, 1); 
                        else ans += getRes(i - 1, 0);
                        //printf("%d\n======\n", ans);
                    }
                    else if (nnow == ha) {
                        int nz = 0;
                        if (nx == hb && z)
                            nz = 1;        
                        dp[!st][(x % 100) * 10 + j][nz] += y;
                    }
                }
            }
            st = !st;
        } 
        repf (k, 0, 999)
            repf (ty, 0, 1)
                ans += dp[st][k][ty];
        printf("Case #%d: ", ca++);
        printf("%d\n", ans);
    }
    return 0;
}

Compiler output:
main.c:6:9: fatal error: iostream: No such file or directory
    6 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.