結果
| 問題 | No.1115 二つの数列 / Two Sequences |
| コンテスト | |
| ユーザー |
rei60
|
| 提出日時 | 2020-08-29 12:00:31 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 277 bytes |
| 記録 | |
| コンパイル時間 | 279 ms |
| コンパイル使用メモリ | 84,992 KB |
| 実行使用メモリ | 115,200 KB |
| 最終ジャッジ日時 | 2026-05-09 18:12:06 |
| 合計ジャッジ時間 | 5,553 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 5 |
| other | AC * 3 TLE * 1 -- * 31 |
ソースコード
N = int(input())
A = {int(x):i for i,x in enumerate(input().split())}
B = list(map(int, input().split()))
exch = 0
for i in range(len(B)-1, 0, -1):
for j in range(i):
if A[B[j]] > A[B[j+1]]:
B[j], B[j+1] = B[j+1], B[j]
exch += 1
print(exch)
rei60