USACO Silver 2018 January - Mootube

Authors: Óscar Garries (C++), Qi Wang (Java)

Official Analysis

C++

Implementation

#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
vector<pair<int, int>> g[5001];
vector<bool> visited(5001);
int k, v, sol;

Java

Java Implementation

import java.util.*;
import java.io.*;
public class mootube {
static int N, Q, K, S;
static boolean[] vist;
static List<Edge> adj[];
@SuppressWarnings("unchecked")
public static void main(String[] args) throws IOException {
Kattio io = new Kattio("mootube");

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!