# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
480029 | rainboy | Trol (COCI19_trol) | C11 | 1 ms | 204 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 <stdio.h>
long long sum(long long n) {
return (n / 9) * 45 + (n % 9) * (n % 9 + 1) / 2;
}
int main() {
int q;
scanf("%d", &q);
while (q--) {
long long l, r;
scanf("%lld%lld", &l, &r);
printf("%lld\n", sum(r) - sum(l - 1));
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |