結果

問題 No.723 2つの数の和
ユーザー realDivineJKrealDivineJK
提出日時 2020-05-21 22:35:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 125 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 25,308 KB
最終ジャッジ日時 2024-04-10 06:57:59
合計ジャッジ時間 3,133 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,496 KB
testcase_01 AC 28 ms
10,624 KB
testcase_02 AC 26 ms
10,624 KB
testcase_03 AC 82 ms
19,444 KB
testcase_04 AC 105 ms
20,756 KB
testcase_05 AC 91 ms
21,116 KB
testcase_06 AC 97 ms
20,828 KB
testcase_07 AC 60 ms
16,164 KB
testcase_08 AC 61 ms
17,000 KB
testcase_09 AC 100 ms
20,200 KB
testcase_10 AC 58 ms
15,940 KB
testcase_11 AC 34 ms
11,904 KB
testcase_12 AC 65 ms
16,580 KB
testcase_13 AC 100 ms
20,528 KB
testcase_14 AC 42 ms
13,820 KB
testcase_15 AC 57 ms
16,452 KB
testcase_16 AC 72 ms
19,336 KB
testcase_17 AC 90 ms
20,832 KB
testcase_18 AC 94 ms
12,516 KB
testcase_19 AC 125 ms
20,836 KB
testcase_20 AC 28 ms
10,496 KB
testcase_21 AC 27 ms
10,624 KB
testcase_22 AC 27 ms
10,624 KB
testcase_23 AC 119 ms
25,308 KB
testcase_24 AC 45 ms
15,284 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X = map(int, input().split())
A = list(map(int, input().split()))
D = {}
for i in A:
    if i in D:
        D[i] += 1
    else:
        D[i] = 1
S = 0
for i in A:
    if X - i in D:
        S += D[X-i]
print(S)
0