結果
問題 |
No.200 カードファイト!
|
ユーザー |
![]() |
提出日時 | 2025-04-15 22:41:57 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 729 bytes |
コンパイル時間 | 203 ms |
コンパイル使用メモリ | 81,784 KB |
実行使用メモリ | 53,936 KB |
最終ジャッジ日時 | 2025-04-15 22:43:15 |
合計ジャッジ時間 | 2,222 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 WA * 12 |
ソースコード
import bisect 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() # Calculate the number of wins per full cycle of C's cards wins_per_cycle = 0 for num in d: idx = bisect.bisect_right(b, num) if idx < len(b): wins_per_cycle += 1 # Calculate the number of full cycles and remaining matches full_cycles = n // len(d) remaining_matches = n % len(d) # Calculate wins from remaining matches remaining_wins = 0 for i in range(remaining_matches): num = d[i] idx = bisect.bisect_right(b, num) if idx < len(b): remaining_wins += 1 total_wins = full_cycles * wins_per_cycle + remaining_wins print(total_wins)