QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#292633 | #4904. 圆滚滚的算术占卜 | _yjh | 0 | 2177ms | 3592kb | C++14 | 772b | 2023-12-28 09:55:33 | 2023-12-28 09:55:34 |
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;
int 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;
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;
cout<<calc(l)<<'\n';
}
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3372kb
input:
10 9653 62002 91160 95589 4602 60141 54240 79592 69170 95623 46733 68190 25361 84435 23506 99583 62553 65996 22099 81703
output:
170399186 121694627 977236162 79409748 321853849 910748500 145527957 190986768 710288498 286050968
result:
wrong answer 1st numbers differ - expected: '103592019', found: '170399186'
Subtask #2:
score: 0
Time Limit Exceeded
Test #4:
score: 10
Accepted
time: 679ms
memory: 3388kb
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: 1138ms
memory: 3388kb
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: 1511ms
memory: 3592kb
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: 0
Accepted
time: 2177ms
memory: 3304kb
input:
5 632445684 632445684 734428390 734428390 713862928 713862928 749060122 749060122 542269196 542269196
output:
651099756 192673041 504124590 272521896 299385724
result:
ok 5 number(s): "651099756 192673041 504124590 272521896 299385724"
Test #8:
score: 0
Accepted
time: 902ms
memory: 3384kb
input:
5 292694554 292694554 122280051 122280051 174892392 174892392 9910543 9910543 784522094 784522094
output:
419465926 714229591 283421374 481713044 109145296
result:
ok 5 number(s): "419465926 714229591 283421374 481713044 109145296"
Test #9:
score: 0
Accepted
time: 1723ms
memory: 3436kb
input:
5 615497298 615497298 564113448 564113448 753391603 753391603 551814992 551814992 174017428 174017428
output:
22576684 137456470 513923958 668473835 317575304
result:
ok 5 number(s): "22576684 137456470 513923958 668473835 317575304"
Test #10:
score: -10
Time Limit Exceeded
input:
5 1000000000 1000000000 999999999 999999999 999999998 999999998 999999997 999999997 999999996 999999996
output:
222450657 694100606 163329444 630802635 100031473
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%