結果

問題 No.723 2つの数の和
ユーザー tanaka255
提出日時 2025-10-08 01:44:15
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 331 bytes
コンパイル時間 2,912 ms
コンパイル使用メモリ 274,612 KB
実行使用メモリ 7,716 KB
最終ジャッジ日時 2025-10-08 01:44:22
合計ジャッジ時間 6,302 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 7 WA * 3 RE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
int N, X, a[1 << 17];
long long ans = 0, cnt[1 << 17];
signed main() {
  cin.tie(0)->sync_with_stdio(0);
  cin >> N >> X;
  rep(i, N) {
    cin >> a[i];
    ++cnt[a[i]];
  }
  rep(i, N) ans += cnt[X - a[i]];
  cout << ans << endl;
}
0