結果
| 問題 |
No.110 しましまピラミッド
|
| コンテスト | |
| ユーザー |
👑 Kazun
|
| 提出日時 | 2020-12-19 04:31:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 40 ms / 5,000 ms |
| コード長 | 692 bytes |
| コンパイル時間 | 244 ms |
| コンパイル使用メモリ | 82,288 KB |
| 実行使用メモリ | 53,756 KB |
| 最終ジャッジ日時 | 2024-09-21 10:01:04 |
| 合計ジャッジ時間 | 2,629 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 |
ソースコード
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)))
Kazun