제출 #485822

#제출 시각아이디문제언어결과실행 시간메모리
485822groupATSUTrol (COCI19_trol)C++14
0 / 50
1 ms316 KiB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf=1e9;
const int maxn=100;
const ll mod=998244353;
int dp[maxn][maxn];
void solve(){
	int l,r;
	cin>>l>>r;
	l--;
	int c=r%9;
	int c1=l%9;
	int x1=(r/9)+(c*(c+1))/2;
	int x2=(l/9)+(c1*(c1+1))/2;
	cout<<x1-x2;
	
}

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
   	cin>>t;
    while(t--){
        solve();
        cout<<'\n';
    }


}
#Verdict Execution timeMemoryGrader output
Fetching results...