結果

問題 No.723 2つの数の和
ユーザー _polarbear08_polarbear08
提出日時 2018-08-03 23:02:20
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 114 ms / 2,000 ms
コード長 171 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 11,728 KB
実行使用メモリ 24,236 KB
最終ジャッジ日時 2023-10-19 21:37:25
合計ジャッジ時間 2,784 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,092 KB
testcase_01 AC 29 ms
10,092 KB
testcase_02 AC 29 ms
10,092 KB
testcase_03 AC 89 ms
18,608 KB
testcase_04 AC 108 ms
20,868 KB
testcase_05 AC 104 ms
19,576 KB
testcase_06 AC 109 ms
19,776 KB
testcase_07 AC 61 ms
14,996 KB
testcase_08 AC 67 ms
15,780 KB
testcase_09 AC 114 ms
21,020 KB
testcase_10 AC 60 ms
14,740 KB
testcase_11 AC 36 ms
11,440 KB
testcase_12 AC 73 ms
16,528 KB
testcase_13 AC 112 ms
21,536 KB
testcase_14 AC 48 ms
13,432 KB
testcase_15 AC 62 ms
15,192 KB
testcase_16 AC 82 ms
18,572 KB
testcase_17 AC 100 ms
19,580 KB
testcase_18 AC 75 ms
11,892 KB
testcase_19 AC 95 ms
21,616 KB
testcase_20 AC 29 ms
10,092 KB
testcase_21 AC 28 ms
10,092 KB
testcase_22 AC 29 ms
10,092 KB
testcase_23 AC 95 ms
24,236 KB
testcase_24 AC 53 ms
14,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

N,X = map(int, input().split())
A = list(map(int, input().split()))

cnt = Counter(A)

ans = 0
for a in A:
    ans += cnt[X-a]

print(ans)
0