結果
問題 |
No.200 カードファイト!
|
ユーザー |
![]() |
提出日時 | 2025-04-16 15:59:39 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 729 bytes |
コンパイル時間 | 236 ms |
コンパイル使用メモリ | 81,744 KB |
実行使用メモリ | 53,984 KB |
最終ジャッジ日時 | 2025-04-16 16:02:04 |
合計ジャッジ時間 | 2,272 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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)