USACO Gold 2016 December - Cow Checklist

Author: Maggie Liu

Official Analysis

Time Complexity: O(HG)\mathcal{O}(H \cdot G)

C++

#include <iostream>
#include <cstdio>
using namespace std;
int energy(pair<int, int> a, pair<int, int> b)
{
int dx = a.first - b.first, dy = a.second - b.second;
return dx * dx + dy * dy;
}

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!