제출 #288342

#제출 시각아이디문제언어결과실행 시간메모리
288342LawlietTrol (COCI19_trol)C++17
50 / 50
1 ms288 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int lli; lli getValue(lli k) { if( k%9 != 0 ) return k%9; return 9; } int main() { int n; scanf("%d",&n); while( n-- ) { lli L, R; scanf("%lld %lld",&L,&R); lli ans = 0; while( L%9 != 1 && L <= R ) ans += getValue( L++ ); while( R%9 != 0 && L <= R ) ans += getValue( R-- ); lli sz = (R - L + 1)/9; ans += sz*45; printf("%lld\n",ans); } }

컴파일 시 표준 에러 (stderr) 메시지

trol.cpp: In function 'int main()':
trol.cpp:15:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   15 |  scanf("%d",&n);
      |  ~~~~~^~~~~~~~~
trol.cpp:20:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   20 |   scanf("%lld %lld",&L,&R);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...