Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: anonymous

Problemset: J.Nine Khanaphat

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-20 12:27:24

#include <bits/stdc++.h>
using namespace std;

int h[109];

int main(){
    long long a,b; cin >> a >> b;
    long long cnt = 0;
    long long cnt2 = 0;

    for(long long i=1; i<a; i*=10)
    {
        long long suf = (a-1)/(i*10);
        long long curr = ((a-1)/i)%10;
        long long pre = (a-1)%i;

        if(curr < 9) cnt += suf*i;
        else cnt += suf*i+pre+1;
    }

    for(long long i = 1;i <= b;i*=10){
        long long suf = b/(i*10);
        long long curr = (b/i)%10;
        long long pre = b%i;

        if(curr < 9) cnt2 += suf*i;
        else cnt2 += suf*i+pre+1;
    }


    cout << cnt2-cnt;
}