結果

問題 No.200 カードファイト!
ユーザー kimiyuki
提出日時 2016-01-16 04:17:28
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 520 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-10-15 09:00:31
合計ジャッジ時間 1,949 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
n = int(input())
a = int(input())
b = list(map(int,input().split()))
c = int(input())
d = list(map(int,input().split()))
ans = 0
xs, ys = [], []
for _ in range(n):
    if not len(xs): xs = list(sorted(b))
    if not len(ys): ys = list(sorted(d))
    for x in xs:
        zs = list(filter(lambda y: y < x, ys))
        if len(zs):
            xs.remove(x)
            ys.remove(max(zs))
            ans += 1
            break
    else:
        xs.remove(xs[0])
        ys.remove(ys[-1])
print(ans)
0