結果
| 問題 | No.3456 Common Difference is D |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-02-28 14:55:51 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 665 bytes |
| 記録 | |
| コンパイル時間 | 689 ms |
| コンパイル使用メモリ | 77,860 KB |
| 実行使用メモリ | 82,408 KB |
| 最終ジャッジ日時 | 2026-02-28 14:55:56 |
| 合計ジャッジ時間 | 5,251 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 TLE * 1 -- * 14 |
ソースコード
# import bisect
# import heapq
## deque, defaultdict, Counter
# from collections import
## SortedList, SortedDict, SortedSet
# from sortedcontainers import
## itertools, combinations, permutations
# from itertools import
# from atcoder import
def solve():
n,d = map(int, input().split())
a = list(map(int, input().split()))
ans = 0
for i in range(n):
ai = a[i]
for j in range(i+1, n):
if a[j] - ai != d:
continue
aj = a[j]
for k in range(j+1, n):
if a[k] - aj == d:
ans += 1
print(ans)
if __name__ == "__main__":
solve()