| 记录编号 | 575223 | 评测结果 | AAAAAAATTT | ||
|---|---|---|---|---|---|
| 题目名称 | 3717.小凯的数字 | 最终得分 | 70 | ||
| 用户昵称 | 是否通过 | 未通过 | |||
| 代码语言 | C++ | 运行时间 | 3.000 s | ||
| 提交时间 | 2022-09-07 20:49:21 | 内存使用 | 1.72 MiB | ||
#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
ull l,r,q;
ull asd[10];
int main()
{
freopen("xiaokai.in","r",stdin);
freopen("xiaokai.out","w",stdout);
cin>>q;
while(q!=0)
{
q--;
cin>>l>>r;
ull t=l;
for(int i=1;i<=9&&t<=r;++i)
{
asd[i]=(asd[i-1]+t%9)%9;
t++;
}
cout<<asd[(r-l)%9+1]<<endl;
}
return 0;
}