A. 2月29日 (Feb. 29th)

Description

Given a starting date and an ending date. Count how many Feb. 29th are between the given dates.

Solution

The easiest way, of course, the brute force, which is quite simple with Python using the `datetime` lib.

However, it's not an effective way for the …

100组数据。

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

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

A. Lever

`^`把字符串分割开。然后分别计算两边的重量即可。

```#Result: Dec 24, 2013 6:04:41 PM    Wizmann  A - Lever   Python 2   Accepted     312 ms  4200 KB
def calc(ss):
res = 0
p = 1
for item in ss:
if item != '=':
t = int(item)
res += t * p
p += 1
return res

s = raw_input …```