## A. Fox And Snake

Implementation

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

res = []

for i in xrange(n):
if i % 2 == 0:
res.append('#' * m)
elif (i / 2) % 2 == 0:
res.append('.' * (m - 1) + '#')
else:
res.append('#' + '.' * (m - 1))

for line in res:
print line
```

DFS …

## A. Maximum in Table

Simulation.

```n = int(raw_input())
g = [[1 for i in xrange(n)] for j in xrange(n)]

for i in xrange(1, n):
for j in xrange(1, n):
g[i][j] = g[i - 1][j] + g[i][j - 1]

print g[n - 1][n - 1]
```

## A. Pasha and Pixels

Brute force.

There are multiple ways to form a 2*2 square at one single step.

So at every step, we have to check the neighbours of pixel that is colored black.

```#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>

using namespace std;

#define …```

## 热身题 - 24Game

### 题意

S = [1, 2, 3, 4, 5]

1 <= n <= 100000

## 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 …

## 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 …```

## 啥？

Tic-tac-toe是我很久之前在CF上做的一道题。非常考细心的模拟题。

## show me the CODE

```class State {
public:
State …```