USACO Silver 2017 January - Hoof, Paper, Scissors

Authors: Óscar Garries (C++), Owen Wang (Java)

Official Analysis

C++

Implementation

#include <bits/stdc++.h>
using namespace std;
int main () {
freopen("hps.in", "r", stdin);
freopen("hps.out", "w", stdout);
int n;
cin >> n;

Java

Implementation

import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;
public class hps {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(new File("hps.in"));
PrintWriter out = new PrintWriter("hps.out");
int N = sc.nextInt();

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!