結果

問題 No.2517 Right Triangles on Circle
ユーザー ShirotsumeShirotsume
提出日時 2023-08-29 22:21:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 278 ms / 2,000 ms
コード長 415 bytes
コンパイル時間 352 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 177,828 KB
最終ジャッジ日時 2023-08-29 22:21:59
合計ジャッジ時間 8,352 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 109 ms
74,552 KB
testcase_01 AC 108 ms
74,840 KB
testcase_02 AC 115 ms
74,868 KB
testcase_03 AC 113 ms
74,548 KB
testcase_04 AC 113 ms
74,536 KB
testcase_05 AC 112 ms
74,660 KB
testcase_06 AC 110 ms
74,808 KB
testcase_07 AC 113 ms
74,844 KB
testcase_08 AC 113 ms
74,652 KB
testcase_09 AC 112 ms
74,656 KB
testcase_10 AC 110 ms
74,532 KB
testcase_11 AC 115 ms
74,536 KB
testcase_12 AC 114 ms
74,920 KB
testcase_13 AC 278 ms
172,752 KB
testcase_14 AC 179 ms
123,324 KB
testcase_15 AC 274 ms
177,828 KB
testcase_16 AC 270 ms
177,356 KB
testcase_17 AC 253 ms
152,468 KB
testcase_18 AC 240 ms
143,496 KB
testcase_19 AC 225 ms
135,316 KB
testcase_20 AC 219 ms
135,032 KB
testcase_21 AC 268 ms
174,616 KB
testcase_22 AC 131 ms
91,772 KB
testcase_23 AC 231 ms
146,276 KB
testcase_24 AC 167 ms
96,476 KB
testcase_25 AC 127 ms
88,724 KB
testcase_26 AC 250 ms
156,404 KB
testcase_27 AC 126 ms
90,260 KB
testcase_28 AC 140 ms
90,448 KB
testcase_29 AC 158 ms
96,336 KB
testcase_30 AC 148 ms
99,084 KB
testcase_31 AC 230 ms
146,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

n, m = mi()

a = li()

if m % 2:
    print(0)
    exit()
C = Counter(a)
ans = 0
for i in range(n):
    ans += C[(a[i] - m // 2 - 1) % m + 1] * (n - 2)

print(ans // 2)
0