結果

問題 No.723 2つの数の和
ユーザー matsukin1111matsukin1111
提出日時 2018-12-12 22:31:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 307 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 11,788 KB
実行使用メモリ 23,896 KB
最終ジャッジ日時 2023-10-25 08:35:55
合計ジャッジ時間 3,060 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,108 KB
testcase_01 AC 30 ms
10,108 KB
testcase_02 AC 29 ms
10,108 KB
testcase_03 AC 91 ms
18,572 KB
testcase_04 AC 116 ms
21,448 KB
testcase_05 AC 99 ms
19,656 KB
testcase_06 AC 104 ms
19,792 KB
testcase_07 AC 61 ms
15,004 KB
testcase_08 AC 65 ms
15,972 KB
testcase_09 AC 106 ms
21,728 KB
testcase_10 AC 59 ms
14,996 KB
testcase_11 AC 36 ms
11,352 KB
testcase_12 AC 70 ms
16,524 KB
testcase_13 AC 105 ms
21,544 KB
testcase_14 AC 46 ms
13,528 KB
testcase_15 AC 61 ms
15,184 KB
testcase_16 AC 78 ms
18,556 KB
testcase_17 AC 94 ms
20,440 KB
testcase_18 AC 69 ms
11,904 KB
testcase_19 AC 89 ms
21,624 KB
testcase_20 AC 29 ms
10,108 KB
testcase_21 AC 30 ms
10,108 KB
testcase_22 AC 30 ms
10,108 KB
testcase_23 AC 132 ms
23,896 KB
testcase_24 AC 52 ms
14,964 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

s = list(map(int,input().split()))
ss = list(map(int,input().split()))
sss = {}
ans = 0
for i in ss:
        if i not in sss:
                sss[i] = 1
        else:
                sss[i] += 1

for a,b in sss.items():
        if s[1] - a in sss:
                ans += b * sss[s[1]-a]

print(ans)
        
0