QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#134936 | #6641. XOR Dice | nameless_story# | WA | 1ms | 3420kb | C++20 | 559b | 2023-08-05 10:09:19 | 2023-08-05 10:09:21 |
Judging History
answer
#include"bits/stdc++.h"
using namespace std;
#define all(x) (x).begin(),(x).end()
const int mod=1e9+7;
void init(int n)
{ }
void upd(int &x,int y) { x=(x+y)%mod; }
int f[100][100];
void solve()
{
int n,c; cin>>n>>c;
f[0][0]=1;
for (int i=0; i<n*2; ++i)
{
for (int j=0; j<=i; ++j)
{
if (j>0) upd(f[i+1][j-1],f[i][j]);
else upd(f[i+1][j+1],f[i][j]*(j==0?c:c-1));
}
}
cout<<f[n*2][0]<<'\n';
}
int main()
{
ios::sync_with_stdio(0); cin.tie(0);
int T=0; cin>>T;
init(1000'0000);
while (T--)
{
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3420kb
input:
3 2
output:
0 0 0
result:
wrong output format Unexpected end of file - int32 expected