# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1253451 | terracottalite | Trol (COCI19_trol) | C++20 | 0 ms | 328 KiB |
#include <stdio.h>
long long f(long long a) {
return (a/9)*45 + ((a%9)*(a%9+1))/2;
}
int main()
{
int q;
scanf("%d", &q);
while (q--) {
long long l, r;
scanf("%lld %lld", &l, &r);
printf("%lld\n", f(r) - f(l-1));
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |