USACO Bronze 2016 December - The Cow-Signal

Authors: Benjamin Qi, Jesse Choe


Official Analysis (Java)

C++

#include <bits/stdc++.h>
using namespace std;
void setIO(string name = ""){ // FastIO see General -> Fast Input and Output
ios_base::sync_with_stdio(0); cin.tie(0);
if(name.size()){
freopen((name+".in").c_str(), "r", stdin);
freopen((name+".out").c_str(), "w", stdout);
}
}

Python

import sys
sys.stdin = open("cowsignal.in","r")
sys.stdout = open("cowsignal.out","w")
M,N,K = map(int,input().split())
g = [input() for _ in range(M)]
for i in range(K*M):
for j in range(K*N):
print(g[i//K][j//K],end='')
print()

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!