diff --git a/S2OJ/1585/1585.cpp b/S2OJ/1585/1585.cpp new file mode 100644 index 00000000..629c1527 --- /dev/null +++ b/S2OJ/1585/1585.cpp @@ -0,0 +1,47 @@ +#include +#include + +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; +} diff --git a/S2OJ/1585/data/data1.in b/S2OJ/1585/data/data1.in new file mode 100644 index 00000000..01095ed9 --- /dev/null +++ b/S2OJ/1585/data/data1.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:435f2b88cb38f5366f0b1c81e75428eeae82072bb6abbe7043edc8cdd9df8145 +size 19 diff --git a/S2OJ/1585/data/data1.out b/S2OJ/1585/data/data1.out new file mode 100644 index 00000000..30456cdf --- /dev/null +++ b/S2OJ/1585/data/data1.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1769867b0abc7068f5cb7dd41574a420b3cfa4553856f459857ff8e5a525b13 +size 3 diff --git a/S2OJ/1585/data/data10.in b/S2OJ/1585/data/data10.in new file mode 100644 index 00000000..8b5cdff7 --- /dev/null +++ b/S2OJ/1585/data/data10.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dc465246544abc339bf4b15a60f210ee56d3ecf2b86423852a63ddbdb699ce96 +size 1595 diff --git a/S2OJ/1585/data/data10.out b/S2OJ/1585/data/data10.out new file mode 100644 index 00000000..0bae7f7d --- /dev/null +++ b/S2OJ/1585/data/data10.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:295e2d5607aa21a1cfe2cf68a0a2679a109bf69839f02e56602a8bcc28032130 +size 10 diff --git a/S2OJ/1585/data/data2.in b/S2OJ/1585/data/data2.in new file mode 100644 index 00000000..6f326485 --- /dev/null +++ b/S2OJ/1585/data/data2.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0deb345860b48319cbcded00f8a50652a2ba7fbb2ea043999a493836acddbd3 +size 45 diff --git a/S2OJ/1585/data/data2.out b/S2OJ/1585/data/data2.out new file mode 100644 index 00000000..dd94245f --- /dev/null +++ b/S2OJ/1585/data/data2.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab54ca4108eecf106d9dd469e07ed94b9d7c41bff073c17cd00414d77df198e5 +size 5 diff --git a/S2OJ/1585/data/data3.in b/S2OJ/1585/data/data3.in new file mode 100644 index 00000000..6e3140e7 --- /dev/null +++ b/S2OJ/1585/data/data3.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39664a75a3bfcd432d4f00d478491169bc68dbcf04e9648a161707d2fabe9711 +size 29 diff --git a/S2OJ/1585/data/data3.out b/S2OJ/1585/data/data3.out new file mode 100644 index 00000000..205ebff4 --- /dev/null +++ b/S2OJ/1585/data/data3.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6e27db66275c9c2a2779d4e9ad561dc33b22b0d9ad68c882acf50314e9b9716 +size 4 diff --git a/S2OJ/1585/data/data4.in b/S2OJ/1585/data/data4.in new file mode 100644 index 00000000..58f6a583 --- /dev/null +++ b/S2OJ/1585/data/data4.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a744098f9f00e5572118fdb9f5ea78de423bfb2a5657eae898c8c1d1fffc145 +size 248 diff --git a/S2OJ/1585/data/data4.out b/S2OJ/1585/data/data4.out new file mode 100644 index 00000000..582ade25 --- /dev/null +++ b/S2OJ/1585/data/data4.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70279c0dfe9b818d7c5d258cf0d6d63036f934260c38e8f875fde330603b83ac +size 9 diff --git a/S2OJ/1585/data/data5.in b/S2OJ/1585/data/data5.in new file mode 100644 index 00000000..e872c3d7 --- /dev/null +++ b/S2OJ/1585/data/data5.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2acae534682832776cd264f16ebc406c1d3742242448154ae18c5af985ea174a +size 208 diff --git a/S2OJ/1585/data/data5.out b/S2OJ/1585/data/data5.out new file mode 100644 index 00000000..ca5000c5 --- /dev/null +++ b/S2OJ/1585/data/data5.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:466b443e13427e2dae22637440ff3ee9497977e7a30c78cc43adfb3f04f3b542 +size 10 diff --git a/S2OJ/1585/data/data6.in b/S2OJ/1585/data/data6.in new file mode 100644 index 00000000..148c60ed --- /dev/null +++ b/S2OJ/1585/data/data6.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:808c4a16e820a7c030d0bcc498fe0eeee5579633a8464fe7593e29f778a3b575 +size 221 diff --git a/S2OJ/1585/data/data6.out b/S2OJ/1585/data/data6.out new file mode 100644 index 00000000..3303a84f --- /dev/null +++ b/S2OJ/1585/data/data6.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97f47793a41e12c395b2a58b8ddeac950fa3cb556be5edacdef959a0d678f0ae +size 10 diff --git a/S2OJ/1585/data/data7.in b/S2OJ/1585/data/data7.in new file mode 100644 index 00000000..e0bd8211 --- /dev/null +++ b/S2OJ/1585/data/data7.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73f3f4a8429470ea20ddc5ebff9a88e468245faba2a6dbf384476094c313ce8f +size 1387 diff --git a/S2OJ/1585/data/data7.out b/S2OJ/1585/data/data7.out new file mode 100644 index 00000000..7259c0af --- /dev/null +++ b/S2OJ/1585/data/data7.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64cf2f419bae22576cbdafcd8ec577001fe3b99a85c2134e1a0ebc819bf23a3f +size 10 diff --git a/S2OJ/1585/data/data8.in b/S2OJ/1585/data/data8.in new file mode 100644 index 00000000..fac88380 --- /dev/null +++ b/S2OJ/1585/data/data8.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92f03b6f610c58471a72ae6cf1c85dd5c13a796ffb1b1b8b6b44307366d9cfa4 +size 1538 diff --git a/S2OJ/1585/data/data8.out b/S2OJ/1585/data/data8.out new file mode 100644 index 00000000..4639aacf --- /dev/null +++ b/S2OJ/1585/data/data8.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:588838c76b2f2dff197eed02daf8de0ab4ce09e78c490fe4c40419b95343dc74 +size 10 diff --git a/S2OJ/1585/data/data9.in b/S2OJ/1585/data/data9.in new file mode 100644 index 00000000..3ab1f048 --- /dev/null +++ b/S2OJ/1585/data/data9.in @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87fdbbc8700cd3a2be9411a2291e35ae46cbc1d85f3457aec7b47a64c18748c4 +size 1459 diff --git a/S2OJ/1585/data/data9.out b/S2OJ/1585/data/data9.out new file mode 100644 index 00000000..bbf4ee8c --- /dev/null +++ b/S2OJ/1585/data/data9.out @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:37674cd24e048fbb3f104e12c0a927b14508c09e53dfd242316038f6ad039a65 +size 10 diff --git a/S2OJ/1585/data/problem.conf b/S2OJ/1585/data/problem.conf new file mode 100644 index 00000000..a4437d8d --- /dev/null +++ b/S2OJ/1585/data/problem.conf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0458533fbe97cec961fae262e102593b4c42da4dacf65b924fe6d61a97c2cd91 +size 193