結果

問題 No.110 しましまピラミッド
ユーザー gorugo30gorugo30
提出日時 2021-02-26 21:01:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 462 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 82,532 KB
実行使用メモリ 53,420 KB
最終ジャッジ日時 2024-04-10 11:27:10
合計ジャッジ時間 2,398 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,108 KB
testcase_01 AC 38 ms
52,920 KB
testcase_02 AC 39 ms
53,224 KB
testcase_03 AC 37 ms
52,332 KB
testcase_04 AC 37 ms
52,536 KB
testcase_05 AC 37 ms
52,884 KB
testcase_06 AC 37 ms
52,280 KB
testcase_07 AC 37 ms
53,312 KB
testcase_08 AC 37 ms
53,012 KB
testcase_09 AC 37 ms
52,904 KB
testcase_10 AC 37 ms
52,888 KB
testcase_11 AC 38 ms
52,688 KB
testcase_12 AC 38 ms
52,940 KB
testcase_13 AC 38 ms
52,860 KB
testcase_14 AC 38 ms
52,408 KB
testcase_15 AC 37 ms
52,596 KB
testcase_16 AC 37 ms
52,948 KB
testcase_17 AC 37 ms
53,120 KB
testcase_18 AC 37 ms
52,984 KB
testcase_19 AC 37 ms
53,420 KB
testcase_20 AC 37 ms
52,348 KB
testcase_21 AC 37 ms
52,216 KB
testcase_22 AC 37 ms
52,956 KB
testcase_23 AC 37 ms
52,072 KB
testcase_24 AC 37 ms
52,632 KB
testcase_25 AC 38 ms
52,636 KB
testcase_26 AC 37 ms
52,780 KB
testcase_27 AC 38 ms
52,660 KB
testcase_28 AC 37 ms
52,728 KB
testcase_29 AC 37 ms
52,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Nw = int(input())
W = list(map(int, input().split()))
Nb = int(input())
B = list(map(int, input().split()))
Bl = [(W[i], 0) for i in range(Nw)] + [(B[i], 1) for i in range(Nb)]
Bl.sort(reverse = True)

ans = 0
N = Nw + Nb
for bottom in range(2):
    nexc = bottom
    minw = 100
    h = 0
    for i in range(N):
        w, c = Bl[i]
        if c == nexc and w < minw:
            minw = w
            nexc ^= 1
            h += 1
    ans = max(ans, h)
print(ans)
0