結果
| 問題 | No.723 2つの数の和 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-09 00:08:47 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 91 ms / 2,000 ms |
| コード長 | 258 bytes |
| 記録 | |
| コンパイル時間 | 592 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 99,712 KB |
| 最終ジャッジ日時 | 2026-05-21 13:55:25 |
| 合計ジャッジ時間 | 4,619 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 |
ソースコード
from collections import Counter
n, x = map(int,input().split())
A = list(map(int,input().split()))
cnt = Counter(A)
ans = 0
for k, v in cnt.items():
if k == x-k:
ans += v*v
continue
if cnt[x-k]:
ans += v*cnt[x-k]
print(ans)