結果
| 問題 | No.110 しましまピラミッド |
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2022-10-18 11:16:40 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
AC
|
| 実行時間 | 98 ms / 5,000 ms |
| コード長 | 524 bytes |
| 記録 | |
| コンパイル時間 | 417 ms |
| コンパイル使用メモリ | 20,572 KB |
| 実行使用メモリ | 15,232 KB |
| 最終ジャッジ日時 | 2026-03-17 22:44:03 |
| 合計ジャッジ時間 | 4,365 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 |
ソースコード
import sys
readline=sys.stdin.readline
N=int(readline())
W=list(map(int,readline().split()))
M=int(readline())
B=list(map(int,readline().split()))
W.sort()
B.sort()
ans=0
for i in range(2):
lst=[]
WB=[[w for w in W],[b for b in B]]
for j in range(100):
ij=(i+j)%2
while WB[ij] and lst and WB[ij][-1]>=lst[-1]:
WB[ij].pop()
if WB[ij] and (not lst or WB[ij][-1]<lst[-1]):
lst.append(WB[ij].pop())
else:
break
ans=max(ans,len(lst))
print(ans)
vwxyz