# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
205145 | mraron | Trol (COCI19_trol) | C++14 | 6 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;
typedef long long ll;
int main() {
int T;
cin>>T;
while(T--) {
ll l,r;
cin>>l>>r;
ll ans=0;
//0 1 2 3 4 5 6 7 8
while(l<=r && l%9!=0) {
ans+=(l%9==0?9:l%9);
l++;
}
while(l<=r && r%9!=8) {
ans+=(r%9==0?9:r%9);
r--;
}
ans+=(r-l+1)*5;
cout<<ans<<"\n";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |