結果
| 問題 |
No.110 しましまピラミッド
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-20 10:13:24 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 40 ms / 5,000 ms |
| コード長 | 735 bytes |
| コンパイル時間 | 148 ms |
| コンパイル使用メモリ | 82,424 KB |
| 実行使用メモリ | 52,608 KB |
| 最終ジャッジ日時 | 2024-11-23 14:27:26 |
| 合計ジャッジ時間 | 2,308 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 |
ソースコード
nw = int(input())
W = list(map(int, input().split()))
nb = int(input())
B = list(map(int, input().split()))
W.sort(reverse = True)
B.sort(reverse = True)
ans = 0
wp = 0
bp = 0
bef = 1 << 40
while 1:
while wp != nw and W[wp] >= bef:
wp += 1
if wp == nw:
break
ans += 1
bef = W[wp]
while bp != nb and B[bp] >= bef:
bp += 1
if bp == nb:
break
ans += 1
bef = B[bp]
ans2 = 0
wp = 0
bp = 0
bef = 1 << 40
while 1:
while bp != nb and B[bp] >= bef:
bp += 1
if bp == nb:
break
ans2 += 1
bef = B[bp]
while wp != nw and W[wp] >= bef:
wp += 1
if wp == nw:
break
ans2 += 1
bef = W[wp]
print(max(ans, ans2))