USACO Gold 2018 February - Snow Boots
Author: Benjamin Qi
We can use a sorted set in place of the linked list mentioned in the official solution.
Implementation
Time Complexity:
C++
We can use a sorted set in place of the linked list mentioned in the official solution.
#include <bits/stdc++.h>using namespace std;struct Boot {int max_depth, max_steps, index;};int main() {freopen("snowboots.in", "r", stdin);
Java
We can use a sorted set in place of the linked list mentioned in the official solution.
import java.io.*;import java.util.*;public class SnowBoots {Code Snippet: Boot Class (Click to expand)public static void main(String[] args) throws IOException {Kattio io = new Kattio("snowboots");int tileNum = io.nextInt();
Python
from typing import NamedTupleclass Boot(NamedTuple):max_depth: intmax_steps: intindex: intclass Tile:
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!