結果

問題 No.723 2つの数の和
ユーザー masumasumath1masumasumath1
提出日時 2020-01-08 21:04:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 256 bytes
コンパイル時間 100 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 20,728 KB
最終ジャッジ日時 2024-05-02 13:03:21
合計ジャッジ時間 3,109 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 31 ms
10,752 KB
testcase_03 AC 98 ms
17,176 KB
testcase_04 RE -
testcase_05 AC 122 ms
19,092 KB
testcase_06 AC 118 ms
19,104 KB
testcase_07 AC 68 ms
15,092 KB
testcase_08 AC 75 ms
15,864 KB
testcase_09 AC 111 ms
20,228 KB
testcase_10 RE -
testcase_11 AC 43 ms
12,288 KB
testcase_12 AC 78 ms
15,780 KB
testcase_13 AC 125 ms
20,544 KB
testcase_14 AC 55 ms
13,568 KB
testcase_15 AC 72 ms
15,316 KB
testcase_16 AC 90 ms
16,676 KB
testcase_17 AC 108 ms
18,704 KB
testcase_18 AC 113 ms
12,500 KB
testcase_19 AC 145 ms
20,728 KB
testcase_20 AC 31 ms
10,752 KB
testcase_21 AC 31 ms
10,624 KB
testcase_22 AC 30 ms
10,624 KB
testcase_23 AC 139 ms
20,536 KB
testcase_24 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N, X = map(int,input().split())
A = list(map(int,input().split()))
cnt = [0 for _ in range(max(A)+1)]
Y = [0 for _ in range(N)]
ans = 0
for i in range(N):
    cnt[A[i]] += 1
for a in A:
    if X-a >= 0 and X-a <=len(cnt):
        ans += cnt[X-a]
print(ans)
0