結果
問題 |
No.1115 二つの数列 / Two Sequences
|
ユーザー |
![]() |
提出日時 | 2020-11-24 17:13:22 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 311 bytes |
コンパイル時間 | 278 ms |
コンパイル使用メモリ | 82,688 KB |
実行使用メモリ | 209,128 KB |
最終ジャッジ日時 | 2024-07-23 18:41:54 |
合計ジャッジ時間 | 5,566 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 5 |
other | AC * 3 TLE * 1 -- * 31 |
ソースコード
N=int(input()) A=list(map(int, input().split())) B=list(map(int, input().split())) AA=[0]*N C=[0]*N for i in range(N): AA[A[i]-1]=i+1 for i in range(N): C[i]=AA[B[i]-1] def count_inversion(sequence): return sum(sum(m<n for m in sequence[i+1:]) for i,n in enumerate(sequence)) print(count_inversion(C))