結果

問題 No.110 しましまピラミッド
ユーザー titia
提出日時 2022-01-31 02:06:50
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-11 08:37:52
合計ジャッジ時間 2,002 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 3
other AC * 2 WA * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

a=int(input())
W=list(map(int,input().split()))
b=int(input())
B=list(map(int,input().split()))

W=[(w,0) for w in W]
B=[(b,1) for b in B]

A=W+B
A.sort()

ANS=0
now0=-10
now=0

for i in range(len(A)):
    if A[i][0]!=now0 and A[i][1]!=now:
        ANS+=1
        now^=1
        now0=A[i][0]

ANS2=0
now0=-10
now=1

for i in range(len(A)):
    if A[i][0]!=now0 and A[i][1]!=now:
        ANS2+=1
        now^=1
        now0=A[i][0]

print(min(ANS,ANS2))
0