結果
| 問題 |
No.200 カードファイト!
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-15 22:38:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 654 bytes |
| コンパイル時間 | 210 ms |
| コンパイル使用メモリ | 81,588 KB |
| 実行使用メモリ | 91,800 KB |
| 最終ジャッジ日時 | 2025-04-15 22:40:01 |
| 合計ジャッジ時間 | 6,633 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 25 |
ソースコード
import itertools
n = int(input())
a = int(input())
b = list(map(int, input().split()))
c = int(input())
d = list(map(int, input().split()))
# Compute count[x][y]
count = [[0 for _ in range(c)] for _ in range(a)]
for i in range(n):
x = i % a
y = i % c
count[x][y] += 1
max_win = 0
# Generate all permutations of B and D
for b_perm in itertools.permutations(b):
for d_perm in itertools.permutations(d):
current = 0
for i in range(n):
x = i % a
y = i % c
if b_perm[x] > d_perm[y]:
current += 1
if current > max_win:
max_win = current
print(max_win)
lam6er