結果

問題 No.723 2つの数の和
ユーザー nohakai3nohakai3
提出日時 2022-11-04 20:43:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 94,396 KB
最終ジャッジ日時 2023-09-25 22:51:57
合計ジャッジ時間 5,181 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
71,696 KB
testcase_01 AC 97 ms
71,528 KB
testcase_02 AC 97 ms
71,420 KB
testcase_03 AC 131 ms
86,424 KB
testcase_04 AC 139 ms
90,380 KB
testcase_05 AC 134 ms
88,308 KB
testcase_06 AC 138 ms
88,172 KB
testcase_07 AC 120 ms
82,472 KB
testcase_08 AC 123 ms
83,520 KB
testcase_09 AC 141 ms
90,500 KB
testcase_10 AC 115 ms
81,980 KB
testcase_11 AC 104 ms
77,976 KB
testcase_12 AC 118 ms
84,260 KB
testcase_13 AC 136 ms
90,352 KB
testcase_14 AC 110 ms
80,148 KB
testcase_15 AC 118 ms
81,936 KB
testcase_16 AC 123 ms
85,880 KB
testcase_17 AC 132 ms
88,276 KB
testcase_18 AC 119 ms
88,880 KB
testcase_19 AC 124 ms
90,788 KB
testcase_20 AC 92 ms
71,692 KB
testcase_21 AC 92 ms
71,752 KB
testcase_22 AC 92 ms
71,556 KB
testcase_23 AC 137 ms
94,396 KB
testcase_24 AC 115 ms
80,384 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
l=list(map(int,input().split()))
from collections import Counter
c=Counter(l)
ans=0
for x in l:
    if m-x==x:
        ans+=c[x]
    else:
        ans+=c[m-x]
print(ans)
0