Submission #198368

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

using namespace std;
string convert(int num)
{
    string ss="";
    int cifra;
    string c1="";
    while(num>0)
    {
        cifra=num%10;
        c1=cifra+'0';
        num=num/10;
        ss=ss+c1;
    }
    return ss;
}

int main()
{
    int t;
    cin>>t;
    int a,b;
    while(t>0)
    {
        int sum=0;
        cin>>a>>b;
        //string sss;
        for(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 376 KB Output is correct
2 Correct 3 ms 376 KB Output is correct
3 Incorrect 2 ms 376 KB Output isn't correct
4 Execution timed out 1071 ms 376 KB Time limit exceeded
5 Incorrect 2 ms 256 KB Output isn't correct