結果

問題 No.110 しましまピラミッド
ユーザー roiti46
提出日時 2015-02-10 18:45:26
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 5,000 ms
コード長 417 bytes
コンパイル時間 66 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-31 11:06:15
合計ジャッジ時間 1,304 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

Nw = int(raw_input())
W = list(set(map(int,raw_input().split())))
Nb = int(raw_input())
B = list(set(map(int,raw_input().split())))
WB = sorted([[w,"w"] for w in W] + [[b,"b"] for b in B])[::-1]

ans = 0
for sp in range(2):
    bar,col = WB[sp]
    tmp = 1
    for i,wb in WB[sp+1:]:
        if wb != col and i < bar:
            tmp += 1
            col = wb
            bar = i
    ans = max(ans,tmp)
print ans
    
0