제출 #1192152

#제출 시각아이디문제언어결과실행 시간메모리
1192152SmuggingSpunTrol (COCI19_trol)C++20
50 / 50
1 ms328 KiB
#include<bits/stdc++.h> #define taskname "A" using namespace std; typedef long long ll; ll f(ll n){ return 45LL * (n / 9LL) + (((n % 9LL) * (n % 9LL + 1)) >> 1LL); } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); if(fopen(taskname".inp", "r")){ freopen(taskname".inp", "r", stdin); } int _t; cin >> _t; for(int _ = 0; _ < _t; _++){ ll l, r; cin >> l >> r; cout << f(r) - f(l - 1) << "\n"; } }

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

trol.cpp: In function 'int main()':
trol.cpp:11:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |                 freopen(taskname".inp", "r", stdin);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...