USACO Silver 2017 December - Why Did the Cow Cross the Road III

Author: Óscar Garries

Official Analysis

C++

Implementation

#include <bits/stdc++.h>
using namespace std;
const int MX = 1e2;
bool vis[MX][MX];
int cows[MX][MX], di[4] = {1, -1, 0, 0}, dj[4] = {0, 0, 1, -1}, nCows, n, k, r;
set<tuple<int, int, int, int>> roads;

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!