結果

問題 No.723 2つの数の和
ユーザー convexineqconvexineq
提出日時 2021-02-26 02:18:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 188 bytes
コンパイル時間 168 ms
コンパイル使用メモリ 82,468 KB
実行使用メモリ 103,608 KB
最終ジャッジ日時 2024-04-09 18:26:53
合計ジャッジ時間 3,258 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
55,188 KB
testcase_01 AC 41 ms
55,388 KB
testcase_02 AC 40 ms
55,064 KB
testcase_03 AC 79 ms
89,872 KB
testcase_04 AC 93 ms
97,540 KB
testcase_05 AC 86 ms
95,152 KB
testcase_06 AC 92 ms
96,492 KB
testcase_07 AC 66 ms
77,800 KB
testcase_08 AC 67 ms
79,256 KB
testcase_09 AC 91 ms
98,188 KB
testcase_10 AC 64 ms
78,004 KB
testcase_11 AC 51 ms
65,492 KB
testcase_12 AC 71 ms
83,252 KB
testcase_13 AC 88 ms
98,068 KB
testcase_14 AC 56 ms
71,832 KB
testcase_15 AC 63 ms
77,404 KB
testcase_16 AC 72 ms
86,260 KB
testcase_17 AC 80 ms
93,808 KB
testcase_18 AC 71 ms
86,216 KB
testcase_19 AC 74 ms
89,348 KB
testcase_20 AC 41 ms
54,152 KB
testcase_21 AC 41 ms
54,292 KB
testcase_22 AC 40 ms
53,364 KB
testcase_23 AC 88 ms
103,608 KB
testcase_24 AC 59 ms
73,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,x = map(int,input().split())
*a, = map(int,input().split())
from collections import Counter
d = Counter(a)
ans = 0
for ai in a:
    v = x-ai
    if v in d:
        ans += d[v]
print(ans)
0