結果
問題 | No.2759 Take Pictures, Elements? |
ユーザー |
![]() |
提出日時 | 2024-05-17 22:05:56 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 290 bytes |
コンパイル時間 | 172 ms |
コンパイル使用メモリ | 82,372 KB |
実行使用メモリ | 62,276 KB |
最終ジャッジ日時 | 2024-12-20 13:57:08 |
合計ジャッジ時間 | 2,272 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 WA * 12 |
ソースコード
from collections import defaultdict as ddN,Q = map(int, input().split())A = list(map(int, input().split()))B = list(map(int, input().split()))idx = dd(int)for i in range(N):idx[A[i]] = ians = abs(idx[B[0]]-0)for i in range(Q-1):ans += abs(idx[B[i]]-idx[B[i+1]])print(ans)