結果

問題 No.723 2つの数の和
ユーザー kept1994kept1994
提出日時 2021-09-02 23:27:59
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 2,644 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 92,404 KB
最終ジャッジ日時 2023-08-20 12:52:03
合計ジャッジ時間 4,068 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
72,140 KB
testcase_01 AC 71 ms
72,388 KB
testcase_02 AC 73 ms
72,216 KB
testcase_03 WA -
testcase_04 RE -
testcase_05 RE -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 RE -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 72 ms
71,424 KB
testcase_14 AC 72 ms
71,352 KB
testcase_15 AC 71 ms
71,412 KB
testcase_16 AC 71 ms
71,132 KB
testcase_17 AC 70 ms
71,336 KB
testcase_18 AC 90 ms
89,388 KB
testcase_19 AC 94 ms
90,824 KB
testcase_20 AC 73 ms
72,236 KB
testcase_21 AC 72 ms
72,192 KB
testcase_22 AC 74 ms
72,092 KB
testcase_23 AC 93 ms
90,616 KB
testcase_24 RE -
権限があれば一括ダウンロードができます

ソースコード

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:
        ans += num[X - aa]
    print(ans)
    return

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