USACO Gold 2015 Open - Palindromic Paths

Author: Maggie Liu


Official Analysis (Java)

Implementation

Time Complexity: O(N3)\mathcal{O}(N^3)

C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
const int MAX_N = 500;
int main() {
freopen("palpath.in", "r", stdin);

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!