ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#213035 | #3823. 艾特扣德 | shiruiheng | 0 | 562ms | 12404kb | C++11 | 681b | 2024-11-03 12:53:56 | 2024-11-03 13:02:44 |
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
//using LL = __int128
#define pi pair<ll, ll>
#define fi first
#define se second
//#define fi(x) (x->first)
//#define se(x) (x->second)
#define N 1111111
#define mod 998244353ll
ll n, a[N], m, t, fac[N] = {1};
int main(){
for(int i = 1 ; i < N ; i++)
fac[i] = fac[i - 1] * i % mod;
scanf("%lld", &t);
while(t--){
scanf("%lld%lld", &n, &m);
for(int i = 1 ; i <= m ; i++){
scanf("%lld", &a[i]);
}
if(*min_element(a + 1, a + 1 + m) == 0){
printf("%lld\n", fac[n]);
continue;
}
}
return 0;
}
/*
freopen(".in", "r", stdin);
freopen(".out", "w", stdout);
*/
详细
小提示:点击横条可展开更详细的信息
Test #1:
score: 0
Wrong Answer
time: 9ms
memory: 9880kb
input:
100 4 4 3 0 1 2 3 1 0 5 2 1 3 5 3 1 4 2 5 3 0 4 2 3 1 0 5 1 3 3 3 1 2 0 3 1 0 4 3 0 2 3 4 2 0 2 5 1 ...
output:
24 6 120 6 6 6 24 24 6 24 24 24 24 1 1 24 24 2 120 1 2 120 120 2 120 24 24 6 120 24 24 120 120 120 6...
result:
wrong answer 1st lines differ - expected: '1', found: '24'
Test #2:
score: 0
Wrong Answer
time: 235ms
memory: 9876kb
input:
1000000 420929 1 239064 93187 1 85123 171379 1 110159 658643 1 0 303046 1 95912 800861 1 781035 9893...
output:
191686493 848462395 11183653 747676450 3498651 238321619 226042748 519281476 547005304 368128003 360...
result:
wrong answer 1st lines differ - expected: '598226497', found: '191686493'
Test #3:
score: 0
Wrong Answer
time: 116ms
memory: 12404kb
input:
38765 832568 1 0 992725 6 548209 466528 628957 748938 0 578853 943934 15 863133 363066 513728 634152...
output:
485766967 650452957 80598155 394133913 706883813 797465818 611475769 360710993 208822924 918807036 7...
result:
wrong answer 2nd lines differ - expected: '626192578', found: '650452957'
Test #4:
score: 0
Wrong Answer
time: 105ms
memory: 12356kb
input:
38573 988634 10 800634 876452 811249 495916 842656 695203 0 914758 757887 237251 948749 6 282623 267...
output:
703578748 782388262 852814394 253664529 230425221 738592545 789165389 612191618 884301777 331912650 ...
result:
wrong answer 1st lines differ - expected: '184333188', found: '703578748'
Test #5:
score: 0
Wrong Answer
time: 97ms
memory: 12044kb
input:
38561 996249 6 150367 424546 851150 536915 420708 392670 956743 7 858128 296060 304111 814957 936254...
output:
750642593 739764470 815916691 297950755 421373237 65966695 297717335 451414142 784059611 578902406 7...
result:
wrong answer 1st lines differ - expected: '204801326', found: '750642593'