結果
問題 | No.326 あみだますたー |
ユーザー |
![]() |
提出日時 | 2015-12-19 00:16:23 |
言語 | Python2 (2.7.18) |
結果 |
WA
|
実行時間 | - |
コード長 | 419 bytes |
コンパイル時間 | 222 ms |
コンパイル使用メモリ | 7,040 KB |
実行使用メモリ | 7,168 KB |
最終ジャッジ日時 | 2024-09-16 08:46:17 |
合計ジャッジ時間 | 4,001 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge6 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 12 ms
6,812 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 13 ms
6,940 KB |
testcase_06 | AC | 26 ms
6,944 KB |
testcase_07 | AC | 17 ms
6,944 KB |
testcase_08 | AC | 21 ms
7,040 KB |
testcase_09 | AC | 35 ms
7,040 KB |
testcase_10 | AC | 32 ms
7,168 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
ソースコード
n = input() k = input() inputs = lambda:map(int, raw_input().split()) st = range(1,n+1) for i in xrange(k): x, y = inputs() y-=2 st[x], st[y] = st[y], st[x] a = inputs() b = [a.index(e) for e in st] ans = [] for i in xrange(n): for j in xrange(n-1): if b[j]>b[j+1]: b[j],b[j+1]=b[j+1],b[j] ans.append((j+1, j+2)) print len(ans) print "\n".join("%d %d" % e for e in ans)