QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#213304 | #6731. Digit Product | yujie3# | WA | 26ms | 3716kb | C++20 | 567b | 2023-10-14 13:41:15 | 2023-10-14 13:41:15 |
Judging History
answer
#include<bits/stdc++.h>
#define endl '\n'
#define fast() ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define _ int _T; cin >> _T; while(_T --)
#define int long long
using namespace std;
const int mod = 1e9 + 10;
void solve(){
int l,r; cin >> l >> r;
int ans = 1;
for(int i = l;i <= r;i ++){
int x = i;
while(x){
int cnt = x % 10;
x /= 10;
if(!cnt){
cout << 0 << endl;
return;
} ans = ans * cnt % mod;
}
} cout << ans << endl;
}
signed main(){
fast();
_
solve();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3592kb
input:
2 1 9 97 99
output:
362880 367416
result:
ok 2 number(s): "362880 367416"
Test #2:
score: -100
Wrong Answer
time: 26ms
memory: 3716kb
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 410890530 0 0 1512000 134219670 998375034 0 0 377446320 0 298589340 0 689819980 911571170 612256294 649463378 0 0 0 0 722813020 4320 11337408 653184 386424950 0 652356580 189493920 4608 0 26880 0 0 141925400 311040 0 208165620 0 16292360 489888 51840 0 168294770 0 933120 0 0 0 139651530 48384...
result:
wrong answer 2nd numbers differ - expected: '410944971', found: '410890530'