QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#377725#2934. How Many Unicycles in a Broken WheelL_M_YWA 7ms3648kbC++141.1kb2024-04-05 17:02:342024-04-05 17:02:36

Judging History

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

  • [2024-04-05 17:02:36]
  • 评测
  • 测评结果:WA
  • 用时:7ms
  • 内存:3648kb
  • [2024-04-05 17:02:34]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 4e3 + 10;
const int MOD = 100007;
ll n, dp[N][2][2] = { 0 }, ans = 0;
void slove() {
	cin >> n;
	for (int i = 2; i <= n; i++)
	{
		if (i == n)
		{
			ans = (ans + 1) % MOD;
			break;
		}
		memset(dp[i], 0, sizeof dp[i]);
		dp[i][0][0] = dp[i][1][0] = 1;
		for (int j = i + 1; j <= n; j++)
		{
			memset(dp[j], 0, sizeof dp[j]);
			dp[j][0][1] = (dp[j][0][1] + dp[j - 1][0][1] + dp[j - 1][1][1] + dp[j - 1][1][0]) % MOD;
			dp[j][1][0] = (dp[j][1][0] + dp[j - 1][1][0]) % MOD;
			dp[j][1][1] = (dp[j][1][1] + dp[j - 1][0][1] + dp[j - 1][1][1]) % MOD;
		}
		for (int j = (n - i) / 2 + i; j <= n; j++)
		{
			ans = (ans + (dp[j][1][0] + dp[j][1][1]) * (dp[n - j + i][1][0] + dp[n - j + i][1][1])) % MOD;
			if (j != n)
				ans = (ans + (dp[j][1][0] + dp[j][1][1]) * (dp[n - j + i - 1][1][0] + dp[n - j + i - 1][1][1])) % MOD;
		}
	}
	cout << ans << "\n";
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	int T = 1;
	//cin >> T;
	while (T--)
		slove();
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3620kb

input:

5

output:

19

result:

ok single line: '19'

Test #2:

score: -100
Wrong Answer
time: 7ms
memory: 3648kb

input:

1234

output:

72078

result:

wrong answer 1st lines differ - expected: '50380', found: '72078'