QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#292630 | #4904. 圆滚滚的算术占卜 | _yjh | 0 | 2315ms | 3652kb | C++14 | 816b | 2023-12-28 09:53:21 | 2023-12-28 09:53:22 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef double db;
inline ll read() {
ll x=0,f=1;char ch=getchar();
while(!isdigit(ch)) {if(ch=='-')f=-1;ch=getchar();}
while(isdigit(ch)) {x=(x<<1)+(x<<3)+(ch^48);ch=getchar();}
return x*f;
}
const ll p=998244353;
ll T,l,r,fnl;
ll calc(ll n) {
ll ans=n;
while(n>=10) {
int tmp=n,sum=0;
while(tmp) {
sum+=tmp%10;
tmp/=10;
}
n-=sum;tmp=n;
while(tmp) {
ans*=10;ans%=p;
tmp/=10;
}
(ans+=n)%=p;
}
return ans;
}
int main() {
// freopen(".in","r",stdin);
// freopen(".out","w",stdout);
T=read();
while(T--) {
l=read(),r=read(),fnl=0;
for(ll i=l;i<=r;i++) (fnl+=calc(i))%=p;
cout<<fnl<<'\n';
}
return 0;
}
详细
Subtask #1:
score: 0
Time Limit Exceeded
Test #1:
score: 0
Time Limit Exceeded
input:
10 9653 62002 91160 95589 4602 60141 54240 79592 69170 95623 46733 68190 25361 84435 23506 99583 62553 65996 22099 81703
output:
result:
Subtask #2:
score: 0
Time Limit Exceeded
Test #4:
score: 10
Accepted
time: 1033ms
memory: 3552kb
input:
5 14151615 14151615 50959220 50959220 177962208 177962208 173507309 173507309 608527742 608527742
output:
574888399 728657674 419976531 502012045 456375259
result:
ok 5 number(s): "574888399 728657674 419976531 502012045 456375259"
Test #5:
score: 0
Accepted
time: 1743ms
memory: 3528kb
input:
5 441384319 441384319 606726578 606726578 100872719 100872719 290542038 290542038 290435521 290435521
output:
304014472 49910017 871510667 927387471 830052470
result:
ok 5 number(s): "304014472 49910017 871510667 927387471 830052470"
Test #6:
score: 0
Accepted
time: 2315ms
memory: 3652kb
input:
5 686934834 686934834 217972715 217972715 91760217 91760217 478910665 478910665 871116356 871116356
output:
95543981 675033334 382398698 617891543 7219851
result:
ok 5 number(s): "95543981 675033334 382398698 617891543 7219851"
Test #7:
score: -10
Time Limit Exceeded
input:
5 632445684 632445684 734428390 734428390 713862928 713862928 749060122 749060122 542269196 542269196
output:
result:
Subtask #3:
score: 0
Skipped
Dependency #2:
0%
Subtask #4:
score: 0
Skipped
Dependency #3:
0%
Subtask #5:
score: 0
Skipped
Dependency #1:
0%
Subtask #6:
score: 0
Skipped
Dependency #5:
0%