結果

問題 No.723 2つの数の和
ユーザー kyabaria
提出日時 2018-09-09 13:09:57
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 415 bytes
コンパイル時間 1,992 ms
コンパイル使用メモリ 159,060 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-23 06:16:50
合計ジャッジ時間 2,680 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
typedef unsigned long long ll;
#define INF 1000000000
using namespace std;
#define N 100000
int main(void){
    int n,x;
    cin>>n>>x;
    int cnt[N+5]={0};
    vector<int>a(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
        cnt[a[i]]++;
    }
    int ans=0;
    for(int i=0;i<n;i++){
        if(x-a[i]<0|x-a[i]>100000)continue;
        ans+=cnt[x-a[i]];
    }
    cout<<ans<<endl;
}
0