Submission #1105206

# Submission time Handle Problem Language Result Execution time Memory
1105206 2024-10-25T17:37:39 Z jadai007 Tropical Garden (IOI11_garden) C++17
0 / 100
242 ms 262144 KB
#include "garden.h"
#include "gardenlib.h"
#include <bits/stdc++.h>

using namespace std;

int ans = 0;
vector<int> vc[200200];

void dfs(int u, int k, int P){
    if(u == P && k == 0){
        ans++;
        return;
    }
    for(auto v:vc[u]) dfs(v, k - 1, P);
}

void count_routes(int N, int M, int P, int R[][2], int Q, int G[]){
    for(int i = 0; i < M; ++i) vc[R[i][0]].push_back(R[i][1]), vc[R[i][1]].push_back(R[i][0]);
    for(int i = 0; i < N; ++i) dfs(i, G[0], P);
    answer(ans);
}


# Verdict Execution time Memory Grader output
1 Runtime error 242 ms 262144 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 242 ms 262144 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 242 ms 262144 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -