0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-09-19 16:25:25 +00:00

Compare commits

...

3 Commits

59 changed files with 287 additions and 0 deletions

6
AcWing/30/30.js Normal file
View File

@ -0,0 +1,6 @@
/**
* @param {string} s
* @param {string} p
* @return {boolean}
*/
const isMatch = (s, p) => new RegExp(`^${p}$`).test(s);

BIN
AcWing/30/data/16.ans (Stored with Git LFS) Normal file

Binary file not shown.

BIN
AcWing/30/data/16.in (Stored with Git LFS) Normal file

Binary file not shown.

31
S2OJ/1448/1448.cpp Normal file
View File

@ -0,0 +1,31 @@
#include <iostream>
#include <set>
using std::cin;
using std::cout;
const char endl = '\n';
int n, m;
std::set<int> set;
int main() {
cin >> n >> m;
set.insert(0);
set.insert(n);
while (m--) {
int k;
cin >> k;
set.insert(k);
int prev = *--set.lower_bound(k),
next = *set.upper_bound(k);
cout << (k - prev) * (next - k) << endl;
}
return 0;
}

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

Binary file not shown.

BIN
S2OJ/1448/data/sunflower1.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower1.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower10.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower10.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower11.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower11.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower12.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower12.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower13.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower13.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower14.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower14.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower15.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower15.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower16.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower16.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower17.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower17.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower18.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower18.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower19.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower19.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower2.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower2.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower20.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower20.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower3.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower3.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower4.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower4.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower5.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower5.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower6.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower6.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower7.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower7.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower8.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower8.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower9.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1448/data/sunflower9.out (Stored with Git LFS) Normal file

Binary file not shown.

82
S2OJ/1461/1461.cpp Normal file
View File

@ -0,0 +1,82 @@
#include <iostream>
#include <algorithm>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 45,
D = 1e5 + 5;
const int mod = 1e9 + 7;
int n, d, r[N], f[N][N][N * N], ans;
int fac[D], inv[D];
int binpow(int a, int b) {
int res = 1;
a %= mod;
while (b) {
if (b & 1) res = 1ll * res * a % mod;
a = 1ll * a * a % mod;
b >>= 1;
}
return res;
}
inline int C(int n, int m) {
return 1ll * fac[n] * inv[m] % mod * inv[n - m] % mod;
}
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
// factorial
fac[0] = 1;
for (int i = 1; i <= 100000; i++) {
fac[i] = 1ll * fac[i - 1] * i % mod;
}
// inverse
inv[100000] = binpow(fac[100000], mod - 2);
for (int i = 99999; i >= 0; i--)
inv[i] = 1ll * inv[i + 1] * (i + 1) % mod;
// main
cin >> n >> d;
for (int i = 1; i <= n; i++) {
cin >> r[i];
}
std::sort(r + 1, r + 1 + n);
f[0][0][0] = 1;
for (int i = 0; i <= n; i++) {
for (int j = 0; j <= i; j++) {
for (int k = 0; k <= 40 * 40; k++) {
int t = r[i + 1];
if (j >= 1) {
f[i + 1][j][k + t] = (f[i + 1][j][k + t] + 1ll * f[i][j][k] * 2 * j) % mod;
}
if (j >= 2) {
f[i + 1][j - 1][k + t * 2 - 1] = (f[i + 1][j - 1][k + t * 2 - 1] + 1ll * f[i][j][k] * j * (j - 1)) % mod;
}
f[i + 1][j + 1][k + 1] = (f[i + 1][j + 1][k + 1] + f[i][j][k]) % mod;
}
}
}
for (int i = 0; i <= std::min(d, 40 * 40); i++) {
ans = (ans + 1ll * C(d - i + n, n) * f[n][1][i] % mod) % mod;
}
cout << ans << endl;
return 0;
}

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

Binary file not shown.

BIN
S2OJ/1461/data/shooter1.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1461/data/shooter1.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1461/data/shooter2.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1461/data/shooter2.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1461/data/shooter3.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1461/data/shooter3.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1461/data/shooter4.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1461/data/shooter4.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1461/data/shooter5.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1461/data/shooter5.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1461/data/shooter6.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1461/data/shooter6.out (Stored with Git LFS) Normal file

Binary file not shown.