| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 1146622 | mnbvcxz123 | Trol (COCI19_trol) | C++20 | 0 ms | 328 KiB | 
#include <bits/stdc++.h>
using namespace std;
#define int long long
int t;
main()
{
    cin>>t;
    while(t--){
        int l,r;
        cin>>l>>r;
        int res=(r-l+1);
        int tmp=res%9;
        res=((res/9)*45);
        int x=0;
        while(l>9){
            while(l){
                x+=(l%10);
                l/=10;
            }
            l=x;
            x=0;
        }
        x=l;
        while(tmp){
            tmp--;
            res+=x;
            x++;
            if(x>9)x=1;
        }
        cout<<res<<"\n";
    }
    return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
