結果

問題 No.110 しましまピラミッド
ユーザー MitI_7
提出日時 2015-12-26 16:02:37
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 34 ms / 5,000 ms
コード長 627 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-12-31 11:13:18
合計ジャッジ時間 2,227 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect


def func(a_list, b_list):
    ans = 0
    prev = 0
    while True:
        i = bisect.bisect_right(a_list, prev)
        if i == len(a_list):
            break
        prev = a_list[i]
        ans += 1

        i = bisect.bisect_right(b_list, prev)
        if i == len(b_list):
            break
        prev = b_list[i]
        ans += 1

    return ans


def main():
    nw = input()
    w_list = list(sorted(map(int, input().split())))
    nb = input()
    b_list = list(sorted(map(int, input().split())))

    print(max(func(w_list, b_list), func(b_list, w_list)))
    
if __name__ == '__main__':
    main()
0