結果
| 問題 | No.517 壊れたアクセサリー |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-05-28 22:16:47 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 486 bytes |
| 記録 | |
| コンパイル時間 | 286 ms |
| コンパイル使用メモリ | 21,340 KB |
| 実行使用メモリ | 15,788 KB |
| 最終ジャッジ日時 | 2026-09-01 17:35:31 |
| 合計ジャッジ時間 | 5,871 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 9 TLE * 1 -- * 5 |
ソースコード
import itertools
def main():
N = int(input())
A = [input() for i in range(N)]
M = int(input())
B = [input() for i in range(M)]
cnt = 0
for a in itertools.permutations(A):
a_ = ''.join(a)
for b in itertools.permutations(B):
b_ = ''.join(b)
if a_ == b_:
ans = b_
cnt += 1
if cnt > 1:
break
if cnt > 1:
print(-1)
else:
print(ans)
main()