結果

問題 No.200 カードファイト!
ユーザー lam6er
提出日時 2025-04-09 21:03:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 525 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 82,360 KB
実行使用メモリ 54,236 KB
最終ジャッジ日時 2025-04-09 21:05:50
合計ジャッジ時間 2,279 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = int(input())
b = list(map(int, input().split()))
c = int(input())
d = list(map(int, input().split()))

b.sort()
d.sort()

i = 0
j = 0
max_wins = 0

# Compute the maximum wins using two-pointer technique
while i < a and j < c:
    if b[i] > d[j]:
        max_wins += 1
        i += 1
        j += 1
    else:
        i += 1

# The total number of wins is the maximum number of times the optimal pairs can be repeated within N matches
total = (n // max_wins) * max_wins if max_wins != 0 else 0
print(total)
0