結果

問題 No.110 しましまピラミッド
ユーザー mlihua09mlihua09
提出日時 2020-09-14 21:14:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 5,000 ms
コード長 856 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 71,512 KB
最終ジャッジ日時 2023-09-04 00:48:07
合計ジャッジ時間 4,218 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,180 KB
testcase_01 AC 76 ms
71,180 KB
testcase_02 AC 76 ms
71,292 KB
testcase_03 AC 76 ms
71,512 KB
testcase_04 AC 76 ms
71,192 KB
testcase_05 AC 77 ms
71,368 KB
testcase_06 AC 76 ms
71,400 KB
testcase_07 AC 77 ms
71,296 KB
testcase_08 AC 76 ms
71,448 KB
testcase_09 AC 75 ms
71,248 KB
testcase_10 AC 75 ms
71,300 KB
testcase_11 AC 77 ms
71,376 KB
testcase_12 AC 76 ms
71,424 KB
testcase_13 AC 73 ms
71,092 KB
testcase_14 AC 74 ms
71,460 KB
testcase_15 AC 76 ms
71,376 KB
testcase_16 AC 74 ms
71,332 KB
testcase_17 AC 76 ms
71,328 KB
testcase_18 AC 75 ms
71,192 KB
testcase_19 AC 76 ms
71,220 KB
testcase_20 AC 75 ms
71,300 KB
testcase_21 AC 73 ms
71,140 KB
testcase_22 AC 75 ms
71,296 KB
testcase_23 AC 75 ms
71,304 KB
testcase_24 AC 75 ms
71,092 KB
testcase_25 AC 75 ms
71,184 KB
testcase_26 AC 73 ms
71,168 KB
testcase_27 AC 76 ms
71,448 KB
testcase_28 AC 75 ms
71,044 KB
testcase_29 AC 76 ms
71,188 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Nw = int(input())

W = list(map(int, input().split()))
W.sort()

Nb = int(input())

B = list(map(int, input().split()))
B.sort()

from bisect import bisect_left
answ = 0
x = 1
y = 21
while True:
    if x:
        x = 0
        i = bisect_left(W, y)
        if i > 0:
            answ += 1
            y = W[i - 1]
        else:
            break
    else:
        x = 1
        i = bisect_left(B, y)
        if i > 0:
            answ += 1
            y = B[i - 1]
        else:
            break
ansb = 0
x = 0
y = 21
while True:
    if x:
        x = 0
        i = bisect_left(W, y)
        if i > 0:
            ansb += 1
            y = W[i - 1]
        else:
            break
    else:
        x = 1
        i = bisect_left(B, y)
        if i > 0:
            ansb += 1
            y = B[i - 1]
        else:
            break
print(max(ansb, answ))
0