답안 #974148

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
974148 2024-05-03T01:44:39 Z vjudge1 Trol (COCI19_trol) C++17
50 / 50
1 ms 452 KB
#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;
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 452 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct