# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
976724 | vjudge1 | Trol (COCI19_trol) | C++17 | 1 ms | 348 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;
#define debug cout << "here\n";
int main()
{
int q; cin >> q;
while(q--){
long long ans = 0;
long long l,r; cin >> l >> r;
while(l%9 != 1 && l <= r) {
if(l%9 == 0) {
ans += 9;
}else
ans += l%9;
l++;
}
while(r%9 != 0 && r > l) {
ans += r%9;
r--;
}
ans += 45 * ((r-l+1)/9);
cout << ans << '\n';
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |