結果

問題 No.723 2つの数の和
ユーザー YamadaYamada
提出日時 2019-01-18 20:29:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 253 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 16,640 KB
最終ジャッジ日時 2023-09-20 19:10:26
合計ジャッジ時間 2,904 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,668 KB
testcase_01 AC 17 ms
8,824 KB
testcase_02 AC 17 ms
8,672 KB
testcase_03 AC 65 ms
14,196 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 77 ms
15,656 KB
testcase_07 AC 47 ms
11,820 KB
testcase_08 WA -
testcase_09 AC 73 ms
16,200 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 53 ms
13,052 KB
testcase_13 AC 68 ms
16,148 KB
testcase_14 AC 29 ms
10,440 KB
testcase_15 AC 38 ms
11,960 KB
testcase_16 AC 50 ms
13,836 KB
testcase_17 AC 59 ms
14,980 KB
testcase_18 AC 53 ms
10,036 KB
testcase_19 AC 65 ms
16,640 KB
testcase_20 AC 17 ms
8,724 KB
testcase_21 AC 17 ms
8,832 KB
testcase_22 AC 17 ms
8,816 KB
testcase_23 AC 90 ms
16,424 KB
testcase_24 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,X =map(int,input().split())
l =[0]*(10**5+1)
for i in input().split():
    s = int(i)
    l[s] += 1
ans = 0
if X < N:
    for i in range(X+1):
        ans += l[i]*l[X-i]
elif X <= 2*N:
    for i in range(X-N,N+1):
        ans += l[i]*l[X-i]
print(ans)
0