0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 18:08:47 +00:00

#1585. 【2022.9.21 NOIP 模拟赛】zzy 的金牌

https://sjzezoj.com/submission/57363
This commit is contained in:
Baoshuo Ren 2022-09-21 17:17:15 +08:00
parent ff6dda0aec
commit 4a421c5716
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
22 changed files with 110 additions and 0 deletions

47
S2OJ/1585/1585.cpp Normal file
View File

@ -0,0 +1,47 @@
#include <iostream>
#include <algorithm>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 305;
const int mod = 998244353;
int n, k, a[N], f[N][N][N], g[N][N][N];
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n >> k;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
std::sort(a + 1, a + 1 + n);
for (int i = 0; i <= k; i++) {
g[0][0][i] = 1;
}
for (int i = 1; i <= n; i++) {
for (int j = 0; j <= k; j++) {
for (int l = 0; l <= k; l++) {
int p = std::min(a[i] - a[i - 1] + l, k);
if (p < 0) continue;
if (l <= j) {
f[i][j][l] = (f[i][j][l] + g[i - 1][j - l][p]) % mod;
}
g[i][j][l] = (f[i][j][l] + (l ? g[i][j][l - 1] : 0)) % mod;
}
}
}
cout << g[n][k][k] << endl;
return 0;
}

BIN
S2OJ/1585/data/data1.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data1.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data10.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data10.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data2.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data2.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data3.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data3.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data4.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data4.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data5.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data5.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data6.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data6.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data7.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data7.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data8.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data8.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data9.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/data9.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1585/data/problem.conf (Stored with Git LFS) Normal file

Binary file not shown.