Hey everyone,
I’m wondering why I’m getting an error when I copy-paste the code on the USACO guide chapter for pairs and tuples.
Could someone help me out?
Hey everyone,
I’m wondering why I’m getting an error when I copy-paste the code on the USACO guide chapter for pairs and tuples.
Could someone help me out?
I think in most IDEs, if you put your cursor over the red line, it tells you what the problem is. So many try that, then make a post here?
You need to put the pair class inside the Main class.
It should look like this:
public class Main {
static class Pair<K, V> {
}
public static void main(String[] args) {
}
}
You can put it outside the main class, you just have to remove the static
modifier.