답안 #596471

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
596471 2022-07-14T19:08:22 Z Hussein3600 Trol (COCI19_trol) C++14
10 / 50
1000 ms 300 KB
#include<bits/stdc++.h>

using namespace std ;

#define mid (r+l)/2

#define fr(i,n) for(int i=0;i<n;i++)

typedef long long ll ;

ll ans=0 ;

int main()
{
    int t ;

    cin >> t ;

    while(t--)
    {
        ll r , l ;
        cin >> l >> r ;
        for(int i=l;i<=r;i++)
        {
            ll x=i ;
            while(x>0)
            {
                ans+=x%10;
                x/=10 ;
            }
        }
        cout<<ans<<endl;
        ans=0 ;
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 1 ms 300 KB Output isn't correct
3 Execution timed out 1085 ms 212 KB Time limit exceeded
4 Execution timed out 1086 ms 280 KB Time limit exceeded
5 Execution timed out 1060 ms 212 KB Time limit exceeded