結果

問題 No.2517 Right Triangles on Circle
ユーザー flygonflygon
提出日時 2023-10-27 21:35:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 2,000 ms
コード長 479 bytes
コンパイル時間 606 ms
コンパイル使用メモリ 81,860 KB
実行使用メモリ 170,060 KB
最終ジャッジ日時 2023-10-27 21:35:41
合計ジャッジ時間 4,608 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
55,680 KB
testcase_01 AC 37 ms
55,680 KB
testcase_02 AC 36 ms
55,680 KB
testcase_03 AC 35 ms
55,680 KB
testcase_04 AC 36 ms
55,680 KB
testcase_05 AC 36 ms
55,680 KB
testcase_06 AC 35 ms
55,680 KB
testcase_07 AC 35 ms
55,680 KB
testcase_08 AC 35 ms
55,680 KB
testcase_09 AC 34 ms
55,680 KB
testcase_10 AC 42 ms
55,680 KB
testcase_11 AC 35 ms
55,680 KB
testcase_12 AC 35 ms
55,680 KB
testcase_13 AC 154 ms
163,836 KB
testcase_14 AC 157 ms
163,656 KB
testcase_15 AC 163 ms
170,060 KB
testcase_16 AC 158 ms
169,964 KB
testcase_17 AC 141 ms
142,568 KB
testcase_18 AC 136 ms
135,648 KB
testcase_19 AC 117 ms
110,636 KB
testcase_20 AC 120 ms
110,756 KB
testcase_21 AC 161 ms
164,656 KB
testcase_22 AC 75 ms
97,164 KB
testcase_23 AC 130 ms
135,956 KB
testcase_24 AC 88 ms
101,244 KB
testcase_25 AC 67 ms
91,664 KB
testcase_26 AC 140 ms
149,336 KB
testcase_27 AC 71 ms
94,316 KB
testcase_28 AC 56 ms
78,244 KB
testcase_29 AC 80 ms
100,732 KB
testcase_30 AC 65 ms
87,020 KB
testcase_31 AC 134 ms
139,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

n,m = map(int,input().split())
a = list(map(int,input().split()))

for i in range(n):
    if a[i] == m:
        a[i] = 0
s = set()
ans = 0
for i in range(n):
    op = (a[i]+(m//2)) % m
    if op in s:
        ans += n-2
    s.add(a[i])
print(ans*(m%2==0))
0