Submission #198370

# Submission time Handle Problem Language Result Execution time Memory
198370 2020-01-25T17:22:29 Z grobar Trol (COCI19_trol) C++14
30 / 50
1000 ms 452 KB
#include<bits/stdc++.h>

using namespace std;

int main()
{
    int t;
    cin>>t;
    long long int a,b;
    while(t>0)
    {
        long long int sum=0;
        cin>>a>>b;
        //string sss;
        for(long long int i=a;i<=b;i++)
        {
            if(i%9==0)
            {
                sum=sum+9;
            }else
            {
                sum=sum+(i%9);
            }
            //cout<<sum<<endl;
        }
        cout<<sum<<endl;
        t--;
    }
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 380 KB Output is correct
2 Correct 3 ms 256 KB Output is correct
3 Correct 3 ms 256 KB Output is correct
4 Execution timed out 1044 ms 452 KB Time limit exceeded
5 Execution timed out 1080 ms 256 KB Time limit exceeded