#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using lint = long long;
const int MAX_N = 1e5 + 5, MAX_K = 1e2 + 5;
int n, k;
lint val[MAX_N];
vector<int> adj[MAX_N], adj_ind[MAX_N]; // adj_ind[u][i] = ind of adj list u is for adj[u][i]
void init() {
for (int i = 1; i <= n; i++) {
adj[i].push_back(0);
adj_ind[i].push_back(0);
}
}
// vector<lint> dp[MAX_N][MAX_K];
lint dp2[MAX_N][MAX_K];
int main() {
// freopen("chase.in", "r", stdin);
cin.sync_with_stdio(false);
cin.tie(0);
cin >> n >> k;
init();
for (int i = 1; i <= n; i++) cin >> val[i];
for (int i = 1; i < n; i++) {
int u, v; cin >> u >> v;
adj[u].push_back(v);
adj[v].push_back(u);
int u_ind = adj[u].size() - 1, v_ind = adj[v].size() - 1;
adj_ind[u].push_back(v_ind);
adj_ind[v].push_back(u_ind);
}
for (int c = 1; c <= k; c++)
for (int i = 1; i <= n; i++) {
// dp[i][c].resize(adj[i].size() + 2);
dp2[i][c] = 1;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
7000 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
7000 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
112 ms |
96316 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
7000 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |