arrow_forward همه ارسال‌ها

جزئیات ارسال کد#677

verified
وضعیت داوری نهایی: محدودیت زمان تست 12
terminal
زبان برنامه‌نویسی: Python
schedule
ارسال‌کننده و زمان:
Amir Mohammad Baghche sara (۱ سال پیش)
descriptionsolution.py ۱۳ خط • ۲۳۸ بایت
1n=int(input())
2w = list(map(int, input().split()))
3c1=0
4c2=0
5for i in range(2*n):
6 if c1 == n:
7 break
8 for j in range(i+1,2*n):
9 if w[i] == w[j]:
10 d = j - i
11 c2 += d
12 c1 += 1
13print(c2)
کد ارسال‌شده برای داوری خودکار هاتکدز UTF-8