# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
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));
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |