QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#789860 | #9621. 连方 | zxk# | WA | 1ms | 3540kb | C++20 | 924b | 2024-11-27 22:18:56 | 2024-11-27 22:18:57 |
Judging History
answer
#include <iostream>
#define int long long
using namespace std;
const int mod=998244353;
int a[15];
int quick_pow(int base,int index)
{
int ans=1,tmp=base;
while(index){
if(index&1){
ans*=tmp;
ans%=mod;
}
tmp*=tmp;
tmp%=mod;
index>>=1;
}
return ans;
}
int get_inv(int x)
{
return quick_pow(x,mod-2);
}
void solve()
{
int ans=1;
for(int i=1;i<=9;i++){
cin>>a[i];
}
a[10]=0;
while(a[1] && a[2])
{
a[1]--,a[2]--;
a[3]++;
}
while(a[1]>=3)
{
a[1]-=3;
a[3]++;
}
if(a[1]==2) a[1]=0,a[2]++;
int mini=11;
for(int i=3;i<=10;i++){
if(a[i]) mini=min(mini,i);
}
if(a[1]==1)
{
a[1]=0,a[mini]--,a[mini+1]++;
}
for(int i=2;i<=10;i++){
ans*=quick_pow(i,a[i]);
ans%=mod;
}
cout<<ans<<'\n';
return;
}
signed main()
{
int t;
cin>>t;
while(t--){
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3540kb
input:
5 4 #..# .##. 5 ##.#. .#.## 6 ###### .####. 27 .######.######.####.#.##### .####...####..#.......##### 10 ########## ##########
output:
4 4 4 4 4
result:
wrong answer Testcase 1: output is 4, but jury's answer is YES.