제출 #1253451

#제출 시각아이디문제언어결과실행 시간메모리
1253451terracottaliteTrol (COCI19_trol)C++20
50 / 50
0 ms328 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) 메시지

trol.cpp: In function 'int main()':
trol.cpp:10:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   10 |     scanf("%d", &q);
      |     ~~~~~^~~~~~~~~~
trol.cpp:14:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |         scanf("%lld %lld", &l, &r);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...