結果
| 問題 | No.110 しましまピラミッド |
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2024-01-27 13:33:59 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 24 ms / 5,000 ms |
| コード長 | 680 bytes |
| 記録 | |
| コンパイル時間 | 161 ms |
| コンパイル使用メモリ | 85,576 KB |
| 実行使用メモリ | 53,944 KB |
| 最終ジャッジ日時 | 2026-04-15 01:29:33 |
| 合計ジャッジ時間 | 2,075 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()
B.sort()
WB = [W+[0],B+[0]]
NWB = [NW,NB]
def solve(x):
tmp = []
wb = [0,0]
turn = x
now = 0
b = 0
cnt = 0
while wb[turn] < NWB[turn]:
while wb[turn] < NWB[turn] and now >= WB[turn][wb[turn]]:
wb[turn] += 1
if WB[turn][wb[turn]] == 0:
#print(tmp,cnt)
return cnt
now = WB[turn][wb[turn]]
tmp.append((turn,now))
wb[turn] += 1
cnt += 1
turn ^= 1
#print(tmp,cnt)
return cnt
ans = 0
for i in range(2):
ans = max(ans,solve(i))
print(ans)
ntuda