結果

問題 No.200 カードファイト!
ユーザー gew1fw
提出日時 2025-06-12 21:45:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 840 ms
コンパイル使用メモリ 82,192 KB
実行使用メモリ 54,188 KB
最終ジャッジ日時 2025-06-12 21:49:39
合計ジャッジ時間 2,916 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = int(input())
a_cards = list(map(int, input().split()))
c = int(input())
c_cards = list(map(int, input().split()))

a_max = max(a_cards)
c_min = min(c_cards)

if a_max <= c_min:
    print(0)
else:
    k = sum(1 for c_val in c_cards if c_val < a_max)
    m = len(c_cards)
    full_cycles = n // m
    remaining = n % m
    total_wins = k * full_cycles + min(remaining, k)
    print(total_wins)
0