How ABC E
  • 板块学术版
  • 楼主Slient_QwQ
  • 当前回复16
  • 已保存回复17
  • 发布时间2024/7/13 21:45
  • 上次更新2024/7/14 08:14:38
查看原帖
How ABC E
963247
Slient_QwQ楼主2024/7/13 21:45

WA * 14

/*Code By Manipula*/
#include <bits/stdc++.h>
#define endl '\n'
#define Inf 0x3f3f3f3f
#define fi first
#define sc second
#define lb lower_bound

#define YES printf("YES\n")
#define Yes printf("Yes\n")
#define NO printf("NO\n")
#define No printf("No\n")

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define BUG puts("BUG!")

#define int long long

typedef long long ll;
typedef __int128 _int;

template <typename T> void ckmax(T &x, T y) { x = x > y ? x : y; }
template <typename T> void ckmin(T &x, T y) { x = x < y ? x : y; }
template <typename T> void ckadd(T &x, T A, T p) { x = (x + A) % p; }
template <typename T> void ckmul(T &x, T A, T p) { x = (x * A) % p; }
template <typename T> T max(T x, T y) { return x > y ? x : y; }
template <typename T> T min(T x, T y) { return x < y ? x : y; }

const int N = 87;
const int Mod = 998244353;

int f[N][N], a[N], ans[N];
int n;

signed main() {
	// freopen(".in", "r", stdin);
	// freopen(".out", "w", stdout);
	
	scanf("%lld", &n);
	
	for (int i = 1; i <= n; i++)
		scanf("%lld", &a[i]);
	
	for (int i = 1; i <= n; i++)
		f[i][1] = 1;
	for (int i = 2; i <= n; i++)
		f[i][2] = i - 1;
	
	for (int L = 3; L <= n; L++)
		for (int i = L; i <= n; i++)
			for (int j = L - 1; j < i; j++)
				for (int k = L - 2; k < j; k++)
					if (a[i] - a[j] == a[j] - a[k])
						f[i][L] = (f[i][L] + f[k][L - 2]) % Mod;
	
	for (int i = 1; i <= n; i++)
		for (int j = i; j <= n; j++)
			ans[i] = (ans[i] + f[j][i]) % Mod;
	
	for (int i = 1; i <= n; i++)
		printf("%lld ", ans[i]);
	
	return 0;
}
2024/7/13 21:45
加载中...