제출 #974148

#제출 시각아이디문제언어결과실행 시간메모리
974148vjudge1Trol (COCI19_trol)C++17
50 / 50
1 ms452 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define pii pair<int, int> #define pll pair<ll, ll> #define fastio ios::sync_with_stdio(0), cin.tie(0), cout.tie(0); #define fi first #define se second ll q, l, r; int main() { fastio; cin >> q; while (q--) { cin >> l >> r; l--; cout << ((r/9)*45 + (r%9)*(r%9+1)/2) - ((l/9)*45 + (l%9)*(l%9+1)/2) << endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...