結果

問題 No.723 2つの数の和
ユーザー kept1994kept1994
提出日時 2021-09-02 23:31:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 432 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 91,000 KB
最終ジャッジ日時 2023-08-20 12:55:39
合計ジャッジ時間 4,210 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
71,876 KB
testcase_01 AC 85 ms
71,816 KB
testcase_02 AC 85 ms
71,900 KB
testcase_03 AC 109 ms
85,668 KB
testcase_04 AC 112 ms
90,292 KB
testcase_05 AC 110 ms
88,836 KB
testcase_06 AC 112 ms
89,088 KB
testcase_07 AC 101 ms
80,868 KB
testcase_08 AC 101 ms
81,484 KB
testcase_09 AC 116 ms
90,432 KB
testcase_10 AC 101 ms
80,936 KB
testcase_11 AC 93 ms
76,920 KB
testcase_12 AC 103 ms
83,500 KB
testcase_13 AC 89 ms
71,280 KB
testcase_14 AC 89 ms
71,068 KB
testcase_15 AC 85 ms
71,092 KB
testcase_16 AC 88 ms
71,356 KB
testcase_17 AC 86 ms
71,224 KB
testcase_18 AC 109 ms
89,540 KB
testcase_19 AC 113 ms
91,000 KB
testcase_20 AC 89 ms
71,876 KB
testcase_21 AC 88 ms
71,852 KB
testcase_22 AC 86 ms
71,816 KB
testcase_23 AC 113 ms
90,464 KB
testcase_24 AC 98 ms
79,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
import sys

def main():
    N, X = map(int, input().split())
    if X > 2 * 10 ** 5:
        print(0)
        return
    A = list(map(int, input().split()))
    num = [0] * (10 ** 5 + 1)
    ans = 0
    for aa in A:
        num[aa] += 1
    for aa in A:
        if X - aa < 0 or X - aa > 10 ** 5:
            continue
        ans += num[X - aa]
    print(ans)
    return

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