2010-11-07から1日間の記事一覧

PKU 1051 P,MTHBGWB

1051 -- P,MTHBGWBモールス信号。 #include <iostream> #include <string> #include <map> #include <algorithm> using namespace std; inline void maketable(map<char, string>& enc, map<string, char>& dec){ const char *abc[] = { ".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-", ".-..","--","</string,></char,></algorithm></map></string></iostream>…

PKU 1068 Parencodings

1068 -- Parencodings #include <cstdio> #include <string> using namespace std; int main() { int t; scanf("%d\n", &t); for(int i = 0; i < t; i++){ int n; scanf("%d\n", &n); string s; for(int j = 0,lm = 0, m; j < n; j++){ scanf("%d", &m); s += string(m - lm,</string></cstdio>…