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