제출 #1303068

#제출 시각아이디문제언어결과실행 시간메모리
1303068uranhishigTrol (COCI19_trol)C++20
50 / 50
1 ms572 KiB
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { int n; cin >> n; for (int i = 0; i < n; i++) { int a, b; cin >> a >> b; int ans = (b - a)/9 * 45; for (int i = a + (b - a)/9 * 9; i <= b; i++) { ans += (i%9 == 0 ? 9 : i%9); } cout << ans << "\n"; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...