2010-10-25から1日間の記事一覧

Codeforces Beta Round #37 C. Old Berland Language

Old Berland Language短い順に単語を割り当てていく。例えば長さが、3, 3, 3, 5, 5ならば、 000 001 010 01100 01101多倍長整数を使うと楽。 N = input() l = map(int,raw_input().split()) ans = [""]*N c = 0 d = 0 while True: p = -1 for i in range(N):…

Codeforces Beta Round #37 B. Computer Game

Computer Gameそのときに詠唱可能な最も強い呪文を唱える。NOとなるのは、ボスのHPが減らないかつ新たに唱える呪文が無い場合。ボスのHPが減らないだけだと↓の入力にNOを返してしまう。 3 100 29 100 10 100 10 100 10import itertools N,max,reg = map(int,…

Codeforces Beta Round #37 A. Towers

Towers input() l = map(int,raw_input().split()) print max([l.count(x) for x in l]), len(set(l))

Codeforces Beta Round #37

久しぶりに参加。 A 480 B System Test Failed C 1098 結果 160位 1672 → 1681