結果
| 問題 | No.1115 二つの数列 / Two Sequences |
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2020-11-24 17:13:22 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 311 bytes |
| 記録 | |
| コンパイル時間 | 758 ms |
| コンパイル使用メモリ | 85,280 KB |
| 実行使用メモリ | 82,092 KB |
| 最終ジャッジ日時 | 2026-04-03 15:48:19 |
| 合計ジャッジ時間 | 4,635 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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))
timi