USACO Bronze 2016 January - Promotion Counting

Authors: Danh Ta Chi Thanh, Lin Jiang, Neo Wang

Official Analysis (Java)

Video Solution

By Neo Wang

Video Solution Code

C++

Implementation

#include <cstdio>
#include <iostream>
using namespace std;
int main() {
// initialize file I/O
ios_base::sync_with_stdio(0);
cin.tie(0); // see Fast Input & Output
freopen("promote.in", "r", stdin);
freopen("promote.out", "w", stdout);

Python

import sys
sys.stdin = open("promote.in", "r")
sys.stdout = open("promote.out", "a")
bronze = [int(a) for a in input().split(" ")]
silver = [int(b) for b in input().split(" ")]
gold = [int(c) for c in input().split(" ")]
platinum = [int(d) for d in input().split(" ")]

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!