Submission #623418

# Submission time Handle Problem Language Result Execution time Memory
623418 2022-08-05T14:45:51 Z Vladth11 Chase (CEOI17_chase) C++14
0 / 100
37 ms 9468 KB
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << x << "\n"
#define debugs(x) cerr << #x << " " << x << " "

using namespace std;
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <long double, pii> muchie;

const int NMAX = 100001;
const ll VMAX = 101;
const ll INF = (1LL << 60);
const ll MOD = 998244353;
const ll BLOCK = 447;
const ll base = 117;
const int nr_of_bits = 18;

int n, V;
int p[NMAX];
vector <int> v[NMAX];
int dp[NMAX][VMAX];

void DFS(int node, int p){
    for(auto x : v[node]){
        if(x == p) continue;
        DFS(x, node);
    }
    return;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int i;
    cin >> n >> V;
    for(i = 1; i <= n; i++) cin >> p[i];
    for(i = 1; i < n; i++){
        int a, b;
        cin >> a >> b;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    DFS(1, 0);
    return 0;
}

# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2644 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2644 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 37 ms 9468 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 2644 KB Output isn't correct
2 Halted 0 ms 0 KB -