USACO Silver 2016 December - Moocast
Authors: Óscar Garries, Dong Liu
C++
C++ Implementation
1#include <bits/stdc++.h>23using namespace std;45vector<vector<bool>> isConnected(201, vector<bool>(201));6vector<int> g[201];7vector<bool> visited(201);8int n;910int dfs (int v) {
Python
1import sys23sys.stdin = open("moocast.in", 'r')4sys.stdout = open("moocast.out", 'w')56def dfs(v):7 visited[v] = True8 count = 19 for u in range(n):10 if visited[u] or not canReach[v][u]:
Join the USACO Forum!
Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!