mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-23 23:48:48 +00:00
parent
90b2034295
commit
02872e62a0
50
LibreOJ/10170/10170.cpp
Normal file
50
LibreOJ/10170/10170.cpp
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
|
using std::cin;
|
||||||
|
using std::cout;
|
||||||
|
const char endl = '\n';
|
||||||
|
|
||||||
|
int n, k;
|
||||||
|
int cnt, r[2005], s[2005];
|
||||||
|
long long f[15][2005][105], ans;
|
||||||
|
|
||||||
|
void dfs(int x, int sum, int len) {
|
||||||
|
if (len >= n) {
|
||||||
|
r[++cnt] = x;
|
||||||
|
s[cnt] = sum;
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
dfs(x, sum, len + 1);
|
||||||
|
dfs(x + (1 << len), sum + 1, len + 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
std::ios::sync_with_stdio(false);
|
||||||
|
|
||||||
|
cin >> n >> k;
|
||||||
|
|
||||||
|
dfs(0, 0, 0);
|
||||||
|
|
||||||
|
for (int i = 1; i <= cnt; i++) f[1][i][s[i]] = 1;
|
||||||
|
|
||||||
|
for (int i = 2; i <= n; i++) {
|
||||||
|
for (int j = 1; j <= cnt; j++) {
|
||||||
|
for (int p = 1; p <= cnt; p++) {
|
||||||
|
if ((r[j] & r[p]) || ((r[j] << 1) & r[p]) || (r[j] & (r[p] << 1))) continue;
|
||||||
|
|
||||||
|
for (int l = k; l >= s[j]; l--) {
|
||||||
|
f[i][j][l] += f[i - 1][p][l - s[j]];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 1; i <= cnt; i++) ans += f[n][i][k];
|
||||||
|
|
||||||
|
cout << ans << endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
BIN
LibreOJ/10170/data/horse0.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse0.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse0.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse0.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse1.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse1.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse1.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse1.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse10.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse10.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse10.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse10.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse2.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse2.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse2.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse2.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse3.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse3.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse3.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse3.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse4.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse4.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse4.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse4.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse5.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse5.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse5.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse5.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse6.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse6.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse6.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse6.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse7.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse7.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse7.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse7.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse8.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse8.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse8.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse8.out
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse9.in
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse9.in
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
LibreOJ/10170/data/horse9.out
(Stored with Git LFS)
Normal file
BIN
LibreOJ/10170/data/horse9.out
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user