結果

問題 No.723 2つの数の和
ユーザー hiragnhiragn
提出日時 2022-12-02 09:44:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 25,472 KB
最終ジャッジ日時 2024-04-17 18:46:40
合計ジャッジ時間 2,463 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,624 KB
testcase_01 AC 29 ms
10,624 KB
testcase_02 AC 31 ms
10,624 KB
testcase_03 AC 91 ms
19,448 KB
testcase_04 AC 99 ms
19,976 KB
testcase_05 AC 93 ms
21,112 KB
testcase_06 AC 94 ms
20,916 KB
testcase_07 AC 56 ms
16,300 KB
testcase_08 AC 60 ms
17,000 KB
testcase_09 AC 96 ms
20,340 KB
testcase_10 AC 52 ms
16,072 KB
testcase_11 AC 33 ms
12,160 KB
testcase_12 AC 63 ms
16,596 KB
testcase_13 AC 100 ms
20,644 KB
testcase_14 AC 43 ms
13,816 KB
testcase_15 AC 56 ms
16,456 KB
testcase_16 AC 72 ms
19,452 KB
testcase_17 AC 88 ms
20,836 KB
testcase_18 AC 62 ms
12,608 KB
testcase_19 AC 83 ms
20,840 KB
testcase_20 AC 26 ms
10,624 KB
testcase_21 AC 28 ms
10,624 KB
testcase_22 AC 27 ms
10,624 KB
testcase_23 AC 79 ms
25,472 KB
testcase_24 AC 47 ms
15,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter


def main():
    n, x = map(int, input().split())
    arr = list(map(int, input().split()))
    c = Counter(arr)

    ans = sum([c[x - a] for a in arr])
    print(ans)


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