## 443A - Anton and Letters

Simple and easy, solved by two lines of python code.

```ls = filter(lambda y: y, map(lambda x: x.strip(), raw_input()[1:-1].split(",")))
print len(set(ls))
```

## 443B - Kolya and Tandem Repeat

Brute force. Just enumerate the beginning and the end of the substring, and …

## Background

This problem is from the book "Algorithm 4th edition" (Exersise 4.1.10)

There are N cities and M undirected roads between those cities. People can travel to any city along the roads.

One day, a war breaks out. Our cities are under attack! As we can't defend all …

## How to implement a queue with stack(s)?

This problem is from the book Algorithms, 4th Edition.

Queue with three stacks. Implement a queue with three stacks so that each queue operation takes a constant (worst-case) number of stack operations.

Warning : high degree of difficulty.

When I search the Internet to find a solution, I find varieties of …

## A. Squats

Trun `x => X` or `X => x` to make the number of 'x' is equal to the number of 'X'.

```n = int(raw_input())
hamsters = [c for c in raw_input()]

sits = hamsters.count('x')
stands = hamsters.count('X')

if sits == stands:
print 0
print ''.join(hamsters)
else:
if sits > stands …```

## Overview

It has been months that I didn't participate in the contest on CF, now I'm back. :)

This round of contest makes me confused that the problem B and C is a little bit too twisted, if you can't catch the vital point, you will get a lot of WAs …

## A. Sereja and Dima

```n = int(raw_input())
pokers = map(int, raw_input().split())

v = [0, 0]
p = 0

for i in xrange(n):
if pokers[0] > pokers[-1]:
v[p] += pokers[0]
del pokers[0]
else:
v[p] += pokers[-1 …```