# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
198389 | grobar | Trol (COCI19_trol) | C++14 | 4 ms | 380 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
sum=(dif/9)*45;
for(long long int j=b; j>=(b-dif%9); j--)
{
if(j%9==0)
{
sum=sum+9;
}
sum=sum+(j%9);
}
cout<<sum<<endl;
t--;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |