# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
480029 | 2021-10-14T11:49:43 Z | rainboy | Trol (COCI19_trol) | C | 1 ms | 204 KB |
#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
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 0 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 204 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 0 ms | 204 KB | Output is correct |