結果

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

ソースコード

diff #

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

using ll = long long;
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    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) {
        ans+=v.count(x-k);
    }
    cout << ans << "\n";
    return 0;
}
0