QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#499388 | #6731. Digit Product | ssmy | AC ✓ | 44ms | 3704kb | C++20 | 585b | 2024-07-31 13:41:43 | 2024-07-31 13:41:44 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
ll n;
cin>>n;
while(n--)
{
ll l,r;
ll flag=1;
cin>>l>>r;
if(r-l>=10)
flag=0;
else{
for(;l<=r;l++)
{
ll tt=l;
while(tt>1)
{
flag=flag*(tt%10);
flag%=1000000007;
tt/=10;
}
}
}
cout<<flag%1000000007<<endl;
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3704kb
input:
2 1 9 97 99
output:
362880 367416
result:
ok 2 number(s): "362880 367416"
Test #2:
score: 0
Accepted
time: 44ms
memory: 3632kb
input:
100000 657483518 657483518 296765674 296765675 500554849 500554849 392403 392411 962255578 962255578 35428433 35428436 362396272 362396273 284893570 974440644 115568436 806300808 751214641 751214647 646086592 646086598 437591523 437591526 263956058 263956059 558669721 558669723 655489691 655489692 2...
output:
806400 410944971 0 0 1512000 155233636 998375151 0 0 414306437 0 208997103 0 129273888 911603819 243342348 649464275 0 0 0 0 722813914 4320 11337408 653184 787649465 0 652380550 189496944 4608 0 26880 0 0 99347696 311040 0 208177374 0 16458092 489888 51840 0 888464445 0 933120 0 0 0 748384125 483840...
result:
ok 100000 numbers