結果

問題 No.723 2つの数の和
ユーザー ああいいああいい
提出日時 2021-12-04 19:32:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 232 bytes
コンパイル時間 270 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 19,612 KB
最終ジャッジ日時 2023-09-21 07:48:32
合計ジャッジ時間 2,761 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
8,896 KB
testcase_01 AC 28 ms
8,684 KB
testcase_02 AC 29 ms
8,752 KB
testcase_03 AC 70 ms
15,660 KB
testcase_04 AC 82 ms
19,424 KB
testcase_05 AC 74 ms
17,876 KB
testcase_06 AC 77 ms
17,680 KB
testcase_07 AC 53 ms
13,080 KB
testcase_08 AC 58 ms
13,436 KB
testcase_09 AC 71 ms
19,516 KB
testcase_10 AC 64 ms
12,872 KB
testcase_11 AC 45 ms
9,776 KB
testcase_12 AC 58 ms
13,952 KB
testcase_13 AC 70 ms
19,512 KB
testcase_14 AC 40 ms
11,464 KB
testcase_15 AC 47 ms
13,372 KB
testcase_16 AC 55 ms
15,000 KB
testcase_17 AC 62 ms
17,324 KB
testcase_18 AC 55 ms
9,800 KB
testcase_19 AC 71 ms
19,512 KB
testcase_20 AC 28 ms
8,800 KB
testcase_21 AC 29 ms
8,796 KB
testcase_22 AC 28 ms
8,660 KB
testcase_23 AC 93 ms
19,612 KB
testcase_24 AC 44 ms
11,820 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X = list(map(int,input().split()))
a = list(map(int,input().split()))
C = 10 ** 5
dat = [0] * (C+1)
for i in a:
    dat[i] += 1
count = 0
for i in range(C+1):
    if 0 <= X - i <= C:
        count += dat[i] * dat[X-i]
print(count)
0