QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#123100#6731. Digit ProductlhzawaAC ✓31ms3724kbC++14766b2023-07-11 18:58:442023-07-11 18:58:48

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-11 18:58:48]
  • 评测
  • 测评结果:AC
  • 用时:31ms
  • 内存:3724kb
  • [2023-07-11 18:58:44]
  • 提交

answer

// Problem: L. Digit Product
// Contest: QOJ - The 2019 ICPC China Shaanxi Provincial Programming Contest
// URL: https://qoj.ac/contest/1285/problem/6731
// Memory Limit: 256 MB
// Time Limit: 1000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include<bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
	function<void ()> solve = []() -> void {
		int l, r;
		scanf("%d%d",&l, &r);
		long long val = 1;
		for (int i = l; i <= r; i++) {
			for (int zxx = i; zxx; zxx /= 10) {
				val = 1ll * val * (zxx % 10) % mod;
				if (! val) {
					printf("0\n");
					return ;
				} 
			}
		}
		printf("%lld\n", val);
		return ;
	};
	int _;
	scanf("%d", &_);
	for (; _; _--) {
		solve();
	}
	return 0; 
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3724kb

input:

2
1 9
97 99

output:

362880
367416

result:

ok 2 number(s): "362880 367416"

Test #2:

score: 0
Accepted
time: 31ms
memory: 3640kb

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