제출 #976819

#제출 시각아이디문제언어결과실행 시간메모리
976819vjudge1Trol (COCI19_trol)C++17
30 / 50
1089 ms456 KiB
#include<bits/stdc++.h>
using namespace std;
#define bismillah ios_base::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
#define int long long

signed main(){
	bismillah
	int q;
	cin >> q;
	int l, r;
	for(int i=0; i<q; i++){
		cin >> l >> r;
		int ans=0;
		for(int j=l; j<=r; j++){
			if(j%9==0){
				ans+=9;
				continue;
			}
			ans += j%9;
			
		}
		cout << ans << endl;
	}
	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...