Submission #198374

# Submission time Handle Problem Language Result Execution time Memory
198374 2020-01-25T17:41:54 Z grobar Trol (COCI19_trol) C++14
0 / 50
11 ms 376 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;
        long long int dif=b-a;
        int pm=a%9;
        sum=(dif/9)*45;
        int mod=b%9;
        if(mod==0)
        {
            mod=9;
        }
        for(int j=pm; j<=mod; j++)
        {

            if(j==0)
            {
                sum=sum+9;
            }
            sum=sum+j;
        }
        cout<<sum<<endl;
        t--;
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 376 KB Output isn't correct
2 Incorrect 3 ms 376 KB Output isn't correct
3 Incorrect 3 ms 256 KB Output isn't correct
4 Incorrect 3 ms 256 KB Output isn't correct
5 Incorrect 3 ms 256 KB Output isn't correct