結果

問題 No.723 2つの数の和
ユーザー yomo3yomo3
提出日時 2020-03-07 02:42:34
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 188 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 10,624 KB
実行使用メモリ 23,684 KB
最終ジャッジ日時 2023-08-04 14:07:19
合計ジャッジ時間 2,800 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,528 KB
testcase_01 AC 19 ms
8,440 KB
testcase_02 AC 20 ms
8,540 KB
testcase_03 AC 80 ms
18,100 KB
testcase_04 AC 119 ms
19,236 KB
testcase_05 AC 114 ms
19,172 KB
testcase_06 AC 99 ms
18,816 KB
testcase_07 AC 48 ms
14,412 KB
testcase_08 AC 54 ms
14,268 KB
testcase_09 AC 90 ms
19,832 KB
testcase_10 AC 57 ms
14,360 KB
testcase_11 AC 25 ms
9,960 KB
testcase_12 AC 57 ms
15,004 KB
testcase_13 AC 133 ms
20,016 KB
testcase_14 AC 41 ms
11,976 KB
testcase_15 AC 60 ms
14,580 KB
testcase_16 AC 86 ms
17,056 KB
testcase_17 AC 109 ms
18,720 KB
testcase_18 AC 72 ms
10,300 KB
testcase_19 AC 89 ms
19,980 KB
testcase_20 AC 18 ms
8,552 KB
testcase_21 AC 18 ms
8,560 KB
testcase_22 AC 18 ms
8,544 KB
testcase_23 AC 89 ms
23,684 KB
testcase_24 AC 48 ms
13,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

N, X = map(int, input().split())
A = sorted(map(int, input().split()))
c = Counter(A)

ans = 0
for a in A:
    if a > X: break
    ans += c[X-a]
print(ans)
0