10pts求助,一个A,1个TLE,其他WA
查看原帖
10pts求助,一个A,1个TLE,其他WA
797229
inarticulate_stupid楼主2023/10/6 18:55
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const string str="12233344445555566666677777778888888899999999910101010101010101010";
string s;
ll t,l,r,h;
signed main(){
	cin>>t;
	for(int i=1;i<=15400;i++)
		s+=str;
	while(t--){
		cin>>l>>r;
		for(int i=l-1;i<r;i++)
			h+=s[i]-'0';
		cout<<h<<endl;
		h=0;
	}
	return 0;
}

悬关!

2023/10/6 18:55
加载中...