QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#134936#6641. XOR Dicenameless_story#WA 1ms3420kbC++20559b2023-08-05 10:09:192023-08-05 10:09:21

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-05 10:09:21]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3420kb
  • [2023-08-05 10:09:19]
  • 提交

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();
	}
}

详细

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