# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
974693 | 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;
int main() {
int q;
unsigned long long l, r, res = 0;
cin >> q;
while (q--) {
cin >> l >> r;
unsigned long long quo, rem, tmp;
quo = (r-l+1)/9;
rem = (r-l+1)%9;
tmp = (l-1)%9+1;
res = 45*quo;
while (rem--) {
res += tmp;
tmp = (tmp+1)%9;
}
cout << res << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |