結果

問題 No.723 2つの数の和
ユーザー B9syDOfYhHFXecuB9syDOfYhHFXecu
提出日時 2018-10-31 10:30:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 544 ms
コンパイル使用メモリ 86,772 KB
実行使用メモリ 93,584 KB
最終ジャッジ日時 2023-08-12 11:18:56
合計ジャッジ時間 4,166 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 63 ms
71,152 KB
testcase_01 AC 63 ms
71,000 KB
testcase_02 AC 61 ms
71,228 KB
testcase_03 AC 88 ms
85,504 KB
testcase_04 AC 94 ms
88,292 KB
testcase_05 AC 89 ms
87,712 KB
testcase_06 AC 94 ms
87,976 KB
testcase_07 AC 82 ms
81,320 KB
testcase_08 AC 81 ms
82,316 KB
testcase_09 AC 90 ms
88,224 KB
testcase_10 AC 76 ms
80,748 KB
testcase_11 AC 74 ms
76,516 KB
testcase_12 AC 83 ms
83,004 KB
testcase_13 AC 94 ms
88,352 KB
testcase_14 AC 73 ms
79,024 KB
testcase_15 AC 78 ms
81,440 KB
testcase_16 AC 87 ms
85,152 KB
testcase_17 AC 84 ms
86,864 KB
testcase_18 AC 77 ms
77,916 KB
testcase_19 AC 74 ms
79,344 KB
testcase_20 AC 61 ms
71,384 KB
testcase_21 AC 62 ms
71,176 KB
testcase_22 AC 63 ms
71,036 KB
testcase_23 AC 93 ms
93,584 KB
testcase_24 AC 77 ms
79,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, X = [int(x) for x in input().split(' ')]
numbers = [int(x) for x in input().split(' ')]
numbers_count = {}
count = 0

for num in numbers:
    if num in numbers_count:
        numbers_count[num] += 1

    else:
        numbers_count[num] = 1

for i in numbers_count:
    if (X - i) in numbers_count:
        count += numbers_count[i] * numbers_count[X - i]

print(count)
0