結果
問題 | No.326 あみだますたー |
ユーザー | lloyz |
提出日時 | 2023-10-16 00:05:24 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 484 bytes |
コンパイル時間 | 363 ms |
コンパイル使用メモリ | 87,112 KB |
実行使用メモリ | 78,368 KB |
最終ジャッジ日時 | 2023-10-16 00:05:33 |
合計ジャッジ時間 | 7,629 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | MLE | - |
testcase_01 | MLE | - |
testcase_02 | MLE | - |
testcase_03 | MLE | - |
testcase_04 | MLE | - |
testcase_05 | MLE | - |
testcase_06 | MLE | - |
testcase_07 | MLE | - |
testcase_08 | MLE | - |
testcase_09 | MLE | - |
testcase_10 | MLE | - |
testcase_11 | MLE | - |
testcase_12 | MLE | - |
testcase_13 | MLE | - |
testcase_14 | MLE | - |
testcase_15 | MLE | - |
testcase_16 | MLE | - |
testcase_17 | MLE | - |
testcase_18 | MLE | - |
testcase_19 | MLE | - |
testcase_20 | MLE | - |
testcase_21 | MLE | - |
testcase_22 | MLE | - |
testcase_23 | MLE | - |
testcase_24 | MLE | - |
testcase_25 | MLE | - |
testcase_26 | MLE | - |
testcase_27 | MLE | - |
ソースコード
n = int(input()) A = [i + 1 for i in range(n)] m = int(input()) for _ in range(m): a, b = map(int, input().split()) a -= 1 b -= 1 A[a], A[b] = A[b], A[a] B = list(map(int, input().split())) ANS = [] for i in range(n): b = B[i] for j in range(i, n): a = A[j] if a == b: for k in range(j, i, -1): ANS.append((k, k + 1)) A[k - 1], A[k] = A[k], A[k - 1] print(len(ANS)) for a, b in ANS: print(a, b)