結果

問題 No.110 しましまピラミッド
コンテスト
ユーザー 👑 Kazun
提出日時 2020-12-19 04:31:40
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 56 ms / 5,000 ms
+ 673µs
コード長 692 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 229 ms
コンパイル使用メモリ 96,332 KB
実行使用メモリ 78,936 KB
最終ジャッジ日時 2026-09-01 14:01:08
合計ジャッジ時間 3,790 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

def F(B,W):
    X=float("inf")
    K=0
    Mode=0

    A=[B,W]
    Index=[0,0]

    Flag=True
    while True:
        while True:
            if Index[Mode]==len(A[Mode]):
                Flag=False
                break
            if A[Mode][Index[Mode]]>=X:
                Index[Mode]+=1
            else:
                X=A[Mode][Index[Mode]]
                Index[Mode]+=1
                break

        if not Flag:
            break
        K+=1;Mode^=1

    return K
#================================================
N=int(input())
W=list(map(int,input().split()))

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

W.sort(reverse=True);B.sort(reverse=True)
print(max(F(W,B),F(B,W)))
0