結果

問題 No.723 2つの数の和
ユーザー kerotonokerotono
提出日時 2018-08-03 22:56:48
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 407 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 12,004 KB
実行使用メモリ 21,676 KB
最終ジャッジ日時 2023-10-19 21:35:22
合計ジャッジ時間 2,367 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
10,908 KB
testcase_01 AC 34 ms
10,908 KB
testcase_02 AC 34 ms
10,908 KB
testcase_03 AC 65 ms
17,676 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 73 ms
19,800 KB
testcase_07 AC 52 ms
14,176 KB
testcase_08 AC 57 ms
15,160 KB
testcase_09 AC 72 ms
21,048 KB
testcase_10 WA -
testcase_11 AC 42 ms
11,832 KB
testcase_12 AC 56 ms
16,028 KB
testcase_13 AC 69 ms
21,560 KB
testcase_14 AC 42 ms
13,268 KB
testcase_15 AC 48 ms
14,564 KB
testcase_16 AC 56 ms
16,968 KB
testcase_17 AC 63 ms
19,376 KB
testcase_18 AC 57 ms
11,912 KB
testcase_19 WA -
testcase_20 AC 33 ms
10,908 KB
testcase_21 AC 34 ms
10,908 KB
testcase_22 AC 33 ms
10,908 KB
testcase_23 AC 80 ms
21,640 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!python
# -*- coding: utf-8 -*-


MAX = 10**5 + 10


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

    b = [0 for i in range(MAX)]
    for i in range(N):
        b[A[i]] += 1

    ANS = 0
    for i in range(MAX):
        j = X - i
        if not 0 <= j <= MAX:
            break
        ANS += b[i] * b[j]

    print(ANS)


if __name__ == '__main__':
    main()
0