結果

問題 No.723 2つの数の和
ユーザー PUNTE5963PUNTE5963
提出日時 2018-09-04 13:32:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 313 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 20,724 KB
最終ジャッジ日時 2024-04-21 09:37:57
合計ジャッジ時間 2,627 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
11,264 KB
testcase_01 AC 30 ms
11,392 KB
testcase_02 AC 30 ms
11,392 KB
testcase_03 AC 65 ms
17,164 KB
testcase_04 AC 79 ms
19,856 KB
testcase_05 AC 73 ms
18,952 KB
testcase_06 AC 76 ms
18,844 KB
testcase_07 AC 52 ms
15,080 KB
testcase_08 AC 54 ms
15,472 KB
testcase_09 AC 77 ms
20,216 KB
testcase_10 AC 52 ms
15,016 KB
testcase_11 AC 35 ms
12,416 KB
testcase_12 AC 56 ms
15,732 KB
testcase_13 AC 79 ms
20,536 KB
testcase_14 AC 42 ms
13,692 KB
testcase_15 AC 50 ms
15,184 KB
testcase_16 AC 63 ms
16,668 KB
testcase_17 AC 70 ms
18,644 KB
testcase_18 AC 67 ms
12,520 KB
testcase_19 AC 91 ms
20,724 KB
testcase_20 AC 30 ms
11,264 KB
testcase_21 AC 32 ms
11,392 KB
testcase_22 AC 31 ms
11,264 KB
testcase_23 AC 83 ms
20,524 KB
testcase_24 AC 43 ms
13,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def calc(X, A):
    B = [0] * 101010
    for ia in A:
        B[ia] += 1
    c = 0
    for i1 in A:
        if X - i1 >= 0 and X - i1 <= 100000:
            c += B[X - i1]
    return c


if __name__ == '__main__':
    N, X = map(int, input().split())
    a = list(map(int, input().split()))
    print(calc(X, a))
0