結果

問題 No.2517 Right Triangles on Circle
ユーザー Carpenters-Cat
提出日時 2023-10-27 22:11:23
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 467 ms / 2,000 ms
コード長 247 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 43,388 KB
最終ジャッジ日時 2024-09-25 14:15:30
合計ジャッジ時間 6,874 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
ans = 0
fl = 0
for a in A :
	while fl < N and A[fl] < a + (M // 2) :
		fl += 1
	if fl < N and A[fl] == a + (M // 2) :
		ans += 1
if M & 1 :
	ans = 0
print(ans * (N - 2))
0