# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1253004 | fahriegegokaydin | Trol (COCI19_trol) | C++20 | 0 ms | 328 KiB |
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
int Q;
cin >>Q;
while(Q--){
ll l,r,d;
cin>>l>>r;
d=(r-l+1)/9;
l+=d*9;
d*=45;
for(;l<=r;l++){
if(l%9==0) d+=9;
else d+=l%9;
}
cout<<d<<"\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |