Submission #960918

# Submission time Handle Problem Language Result Execution time Memory
960918 2024-04-11T08:43:25 Z Ghetto Chase (CEOI17_chase) C++17
0 / 100
511 ms 524288 KB
#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;
        }
            
    

    
}
# Verdict Execution time Memory Grader output
1 Incorrect 160 ms 253500 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 160 ms 253500 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 511 ms 524288 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 160 ms 253500 KB Output isn't correct
2 Halted 0 ms 0 KB -