君はまるで砂漠に咲く、一輪の花。

僕はその花に引き寄せられる蝶。

Codeforces Round #250 (Div. 2)

はい。
http://codeforces.com/contest/437

A. The Child and Homework

ざっくりと大意

・'_'を含む文字列長で他の全ての文字列長の1/2以下か2倍以上であればそれのA,B,C,Dを出力。条件を満たすものがなければCを出力。

方針のようなもの

・2重ループで比較する。

l=[]
ans=[1]*4
for i in range(4):
    s=raw_input()
    chk=len(s)-2
    l.append(chk)
a=max(l)
i=min(l)
for x in range(4):
    if l[x]!=a and l[x]!=i:
        ans[x]=0
    else:
        for y in range(4):
            if x==y:
                pass
            elif l[x]==a and l[y]*2>a:
                ans[x]=0
            elif l[x]==i and l[y]<i*2:
                ans[x]=0
print 'C' if ans.count(1)!=1 else chr(ans.index(1)+65)