結果
| 問題 | No.723 2つの数の和 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-06-09 00:08:47 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 54 ms / 2,000 ms |
| + 753µs | |
| コード長 | 258 bytes |
| 記録 | |
| コンパイル時間 | 69 ms |
| コンパイル使用メモリ | 82,584 KB |
| 実行使用メモリ | 103,772 KB |
| 最終ジャッジ日時 | 2026-09-30 17:24:24 |
| 合計ジャッジ時間 | 3,996 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge3_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)