結果
| 問題 | 
                            No.200 カードファイト!
                             | 
                    
| コンテスト | |
| ユーザー | 
                             gew1fw
                         | 
                    
| 提出日時 | 2025-06-12 17:04:26 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 412 bytes | 
| コンパイル時間 | 225 ms | 
| コンパイル使用メモリ | 81,920 KB | 
| 実行使用メモリ | 52,224 KB | 
| 最終ジャッジ日時 | 2025-06-12 17:04:45 | 
| 合計ジャッジ時間 | 2,318 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 14 WA * 12 | 
ソースコード
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)
            
            
            
        
            
gew1fw