結果
| 問題 | 
                            No.200 カードファイト!
                             | 
                    
| コンテスト | |
| ユーザー | 
                             qwewe
                         | 
                    
| 提出日時 | 2025-04-24 12:30:54 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 594 bytes | 
| コンパイル時間 | 303 ms | 
| コンパイル使用メモリ | 81,856 KB | 
| 実行使用メモリ | 54,248 KB | 
| 最終ジャッジ日時 | 2025-04-24 12:32:18 | 
| 合計ジャッジ時間 | 2,366 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 2 WA * 24 | 
ソースコード
n = int(input())
a = int(input())
b = list(map(int, input().split()))
c = int(input())
d = list(map(int, input().split()))
# Sort A's cards in descending order
a_sorted = sorted(b, reverse=True)
# Sort C's cards in descending order and move the maximum to the end
if not d:
    c_sorted = []
else:
    c_sorted = sorted(d, reverse=True)
    max_c = c_sorted[0]
    c_sorted.remove(max_c)
    c_sorted.append(max_c)
a_len = len(a_sorted)
c_len = len(c_sorted)
count = 0
for k in range(n):
    i = k % a_len
    j = k % c_len
    if a_sorted[i] > c_sorted[j]:
        count += 1
print(count)
            
            
            
        
            
qwewe