USACO Silver 2015 December - Switching on the Lights

Author: Óscar Garries

Official Analysis

C++

C++ Implementation

1#include <bits/stdc++.h>
2
3using namespace std;
4
5const int MX = 1e2;
6
7int n, m;
8bool light[MX][MX], vis[MX][MX], turn[MX][MX];
9vector<vector<vector<pair<int, int>>>> change(MX, vector<vector<pair<int, int>>>(MX, vector<pair<int, int>>()));
10int sol = 1, di[4] = {0, 1, 0, -1}, dj[4] = {1, 0, -1, 0};

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 2015 December - Switching on the Lights!