USACO Bronze 2016 December - Block Game
Authors: Óscar Garries, tickox, Dong Liu
Appears In
C++
Implementation
#include <bits/stdc++.h>using namespace std;constexpr int nb_letter = 26;using arr = array<int, nb_letter>;void count_freq(const string &s, arr &freq) {for (char c: s) {freq[c - 'a']++;
Python
import syssys.stdin = open("blocks.in", "r")sys.stdout = open("blocks.out", "w")def countfreq(s):freqs = [0]*26for c in s:freqs[ord(c)-ord('a')] += 1return freqs
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!