結果
問題 |
No.1115 二つの数列 / Two Sequences
|
ユーザー |
![]() |
提出日時 | 2020-11-24 17:12:57 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 311 bytes |
コンパイル時間 | 489 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 29,088 KB |
最終ジャッジ日時 | 2024-07-23 18:41:48 |
合計ジャッジ時間 | 9,014 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 5 |
other | AC * 2 TLE * 2 -- * 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))