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

Author: Óscar Garries

Official Analysis

C++

C++ Implementation

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

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!

Give Us Feedback on USACO Silver 2017 December - Why Did the Cow Cross the Road III!