結果

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

ソースコード

diff #

def solve(w, h, xs, ys):
    if not xs:
        return h
    if xs[0] <= w:
        return solve(w, h, xs[1:], ys)
    else:
        return solve(xs[0], h + 1, ys, xs[1:])

_ = input()
W = sorted(map(int, raw_input().strip().split()))
_ = input()
B = sorted(map(int, raw_input().strip().split()))
print(max(solve(0, 0, W, B), solve(0, 0, B, W)))
0