結果
問題 |
No.723 2つの数の和
|
ユーザー |
![]() |
提出日時 | 2018-09-30 14:52:50 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 358 bytes |
コンパイル時間 | 214 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 27,584 KB |
最終ジャッジ日時 | 2024-10-12 09:07:27 |
合計ジャッジ時間 | 5,553 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 1 TLE * 1 -- * 20 |
ソースコード
n, x = map(int, input().split()) a = list(map(int, input().split())) count = {} for i in a: if i in count: count[i] += 1 else: count[i] = 1 l = [] for key in count: if x-key in count and not key in l and not x-key in l: l.append(key) ans = 0 for i in l: ans += count[i]*count[x-i]*(2 if i != x-i else 1) print(ans)