結果

問題 No.723 2つの数の和
ユーザー 👑 tamatotamato
提出日時 2020-02-28 02:41:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 353 bytes
コンパイル時間 604 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 98,608 KB
最終ジャッジ日時 2024-04-21 17:23:28
合計ジャッジ時間 3,331 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
60,592 KB
testcase_01 AC 43 ms
59,608 KB
testcase_02 AC 44 ms
59,088 KB
testcase_03 AC 79 ms
86,676 KB
testcase_04 AC 93 ms
94,464 KB
testcase_05 AC 86 ms
92,024 KB
testcase_06 AC 87 ms
92,416 KB
testcase_07 AC 66 ms
75,820 KB
testcase_08 AC 69 ms
77,568 KB
testcase_09 AC 95 ms
94,208 KB
testcase_10 AC 66 ms
75,064 KB
testcase_11 AC 54 ms
64,896 KB
testcase_12 AC 74 ms
80,768 KB
testcase_13 AC 87 ms
93,696 KB
testcase_14 AC 58 ms
70,100 KB
testcase_15 AC 66 ms
76,288 KB
testcase_16 AC 76 ms
83,840 KB
testcase_17 AC 81 ms
89,932 KB
testcase_18 AC 65 ms
81,024 KB
testcase_19 AC 70 ms
83,200 KB
testcase_20 AC 47 ms
60,828 KB
testcase_21 AC 45 ms
60,316 KB
testcase_22 AC 44 ms
58,960 KB
testcase_23 AC 83 ms
98,608 KB
testcase_24 AC 62 ms
72,404 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    import sys
    from collections import Counter
    input = sys.stdin.readline

    N, x = map(int, input().split())
    A = list(map(int, input().split()))

    C = Counter(A)
    ans = 0
    for i in range(10**5+1):
        if i in C and x-i in C:
            ans += C[i] * C[x-i]
    print(ans)


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