結果

問題 No.723 2つの数の和
ユーザー firiexp
提出日時 2018-08-03 22:49:08
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 391 bytes
コンパイル時間 663 ms
コンパイル使用メモリ 75,932 KB
実行使用メモリ 14,880 KB
最終ジャッジ日時 2024-09-19 17:34:16
合計ジャッジ時間 4,891 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 TLE * 1 -- * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>

using ll = long long;
using namespace std;

int main() {
    int n, x, a, ans = 0;
    cin >> n >> x;
    multiset<int> v;
    for (int i = 0; i < n; ++i) {
        cin >> a;
        v.insert(a);
    }
    for (auto &k : v) {
        if(v.count(x-k)) ans+=v.count(x-k);
    }
    cout << ans << "\n";
    return 0;
}
0