結果
| 問題 | No.1115 二つの数列 / Two Sequences |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-12 14:50:28 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 332 bytes |
| 記録 | |
| コンパイル時間 | 313 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 105,088 KB |
| 最終ジャッジ日時 | 2024-09-19 21:56:30 |
| 合計ジャッジ時間 | 6,814 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 5 |
| other | AC * 3 TLE * 1 -- * 31 |
ソースコード
def count_inversion(sequence):
return sum(sum(m<n for m in sequence[i+1:]) for i,n in enumerate(sequence))
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
l = []
for i in range(N):
for j in range(N):
if A[i] == B[j]:
l.append(j)
ans = count_inversion(l)
print(ans)