結果

問題 No.2517 Right Triangles on Circle
ユーザー yu_w(ゆ)yu_w(ゆ)
提出日時 2023-10-27 21:41:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 180 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 81,820 KB
実行使用メモリ 168,732 KB
最終ジャッジ日時 2023-10-27 21:41:32
合計ジャッジ時間 4,162 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
53,552 KB
testcase_01 AC 36 ms
53,552 KB
testcase_02 AC 35 ms
53,552 KB
testcase_03 AC 33 ms
53,552 KB
testcase_04 AC 37 ms
53,552 KB
testcase_05 AC 36 ms
53,552 KB
testcase_06 AC 36 ms
53,552 KB
testcase_07 AC 36 ms
53,552 KB
testcase_08 AC 35 ms
53,552 KB
testcase_09 AC 34 ms
53,552 KB
testcase_10 AC 33 ms
53,552 KB
testcase_11 AC 33 ms
53,552 KB
testcase_12 AC 32 ms
53,552 KB
testcase_13 AC 179 ms
159,032 KB
testcase_14 AC 142 ms
158,752 KB
testcase_15 AC 174 ms
168,732 KB
testcase_16 AC 180 ms
168,644 KB
testcase_17 AC 139 ms
117,188 KB
testcase_18 AC 129 ms
113,012 KB
testcase_19 AC 122 ms
137,980 KB
testcase_20 AC 125 ms
138,252 KB
testcase_21 AC 174 ms
163,260 KB
testcase_22 AC 73 ms
93,864 KB
testcase_23 AC 131 ms
136,064 KB
testcase_24 AC 81 ms
102,096 KB
testcase_25 AC 59 ms
88,124 KB
testcase_26 AC 151 ms
147,092 KB
testcase_27 AC 66 ms
90,880 KB
testcase_28 AC 56 ms
78,960 KB
testcase_29 AC 76 ms
99,840 KB
testcase_30 AC 62 ms
85,716 KB
testcase_31 AC 137 ms
136,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
A=list(map(int,input().split()))

d=dict()
for i in range(N):
    if A[i] in d.keys():
        d[A[i]]+=1
    else:
        d[A[i]]=1
    
if M%2!=0:
    print(0)
    exit()

ans=0
for i in d.keys():
    if i>=M//2+1:
        continue
    j=i+M//2
    if j in d.keys():
        ans+=d[i]*d[j]*(N-d[i]-d[j])
    
print(ans)
0