USACO Silver 2017 January - Hoof, Paper, Scissors

Author: Óscar Garries and Mrinall Umausdhan

Official Analysis

C++

C++ Implementation

1#include <bits/stdc++.h>
2
3using namespace std;
4
5int main () {
6 freopen("hps.in", "r", stdin);
7 freopen("hps.out", "w", stdout);
8
9 int n;
10 cin >> n;

Java

Java Implementation

1import java.io.*;
2import java.util.*;
3
4public class hps {
5 static class InputReader {
6 BufferedReader reader;
7 StringTokenizer tokenizer;
8
9 public InputReader(File stream) throws FileNotFoundException {
10 reader = new BufferedReader(new FileReader(stream), 32768);

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 2017 January - Hoof, Paper, Scissors!