結果

問題 No.723 2つの数の和
ユーザー YamadaYamada
提出日時 2019-01-13 03:20:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 303 bytes
コンパイル時間 306 ms
コンパイル使用メモリ 10,964 KB
実行使用メモリ 23,560 KB
最終ジャッジ日時 2023-08-25 15:32:38
合計ジャッジ時間 3,241 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
18,704 KB
testcase_01 AC 32 ms
18,400 KB
testcase_02 AC 31 ms
18,464 KB
testcase_03 AC 95 ms
22,140 KB
testcase_04 AC 118 ms
23,560 KB
testcase_05 AC 104 ms
23,452 KB
testcase_06 AC 110 ms
22,828 KB
testcase_07 AC 67 ms
20,396 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 80 ms
20,312 KB
testcase_11 AC 53 ms
18,792 KB
testcase_12 AC 75 ms
20,960 KB
testcase_13 AC 100 ms
22,892 KB
testcase_14 AC 44 ms
19,860 KB
testcase_15 AC 57 ms
20,360 KB
testcase_16 AC 71 ms
21,712 KB
testcase_17 AC 84 ms
22,928 KB
testcase_18 WA -
testcase_19 AC 80 ms
23,468 KB
testcase_20 WA -
testcase_21 AC 31 ms
18,568 KB
testcase_22 AC 31 ms
18,576 KB
testcase_23 AC 113 ms
23,424 KB
testcase_24 AC 53 ms
19,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X =map(int,input().split())
l =[int(i) for i in input().split()]
d ={i:0 for i in range(10**5+1)}
n = 0
for i in l:
    d[i] += 1
if X > max(l)*2:
    n = 0
elif X > 10**5:
    for i in range(X-10**5,10**5+1):
        n += d[i] * d[X-i]
else:
    for i in range(X):
        n += d[i] * d[X-i]
print(n)
0