# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
456155 | Jasiekstrz | Trol (COCI19_trol) | C++17 | 1 ms | 316 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>
#define fi first
#define se second
using namespace std;
long long f(long long x)
{
long long d=x/9,r=x%9;
return d*45+r*(r+1)/2;
}
void solve()
{
long long l,r;
cin>>l>>r;
cout<<f(r)-f(l-1)<<"\n";
return;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int qq;
cin>>qq;
while(qq--)
solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |