2. Andrii Soldatenko
• Contributor in OpenAPI, Golang,
Pyhelm, python-sendgrid, tutorial of
aiohttp, ansible, requests, etc.
• Speaker at many PyCons,
committee member of PyCon
Belarus and PyCon Russia and
open source contributor
• blogger at https://asoldatenko.com
@a_soldatenko
8. @a_soldatenko
Anatomy of a Programming
Contest Problem
• Background story / Summary
• Input and Output description
• Sample Input/Output
• Hints/Pictures
44. 195 - Anagram
Given the word “abc”, your
program should — by exploring
all different combination of the
three letters — output the
words “abc”, “acb”, “bac”,
“bca”, “cab” and “cba”.
https://uva.onlinejudge.org/external/1/195.pdf
45. int main()
{
string s = "aba";
sort(s.begin(), s.end());
do {
cout << s << 'n';
} while(next_permutation(s.begin(),
s.end()));
}
// aab
// aba
// baa
@a_soldatenko
46. from itertools import permutations
def main():
for perm in permutations('aba'):
print(''.join(perm))
47. # aab
# aab
# aba
# aba
# baa
# baa
from itertools import permutations
def main():
for perm in permutations('aba'):
print(''.join(perm))