結果
| 問題 | No.200 カードファイト! |
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 21:44:48 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 1,074 bytes |
| コンパイル時間 | 213 ms |
| コンパイル使用メモリ | 81,996 KB |
| 実行使用メモリ | 848,364 KB |
| 最終ジャッジ日時 | 2025-06-12 21:49:22 |
| 合計ジャッジ時間 | 7,375 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | MLE * 1 -- * 25 |
ソースコード
import itertools
def main():
import sys
input = sys.stdin.read().split()
ptr = 0
N = int(input[ptr])
ptr +=1
A = int(input[ptr])
ptr +=1
B = list(map(int, input[ptr:ptr+A]))
ptr +=A
C = int(input[ptr])
ptr +=1
D = list(map(int, input[ptr:ptr+C]))
ptr +=C
max_victory = 0
# 生成所有可能的A的排列顺序
A_perms = list(itertools.permutations(B))
# 生成所有可能的C的排列顺序
C_perms = list(itertools.permutations(D))
for a_order in A_perms:
for c_order in C_perms:
i = 0
j = 0
victory = 0
for _ in range(N):
a = a_order[i % A]
c = c_order[j % C]
if a > c:
victory +=1
i +=1
j +=1
if victory > max_victory:
max_victory = victory
if max_victory == N:
break
if max_victory == N:
break
print(max_victory)
if __name__ == "__main__":
main()
gew1fw