結果

問題 No.723 2つの数の和
ユーザー 👑 CleyL
提出日時 2020-02-10 18:57:00
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 297 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 64,960 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-01 06:28:40
合計ジャッジ時間 3,521 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 RE * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
long long nya[100001];
int main(){
    int n,x;cin>>n>>x;
    for(int i = 0; n > i; i++){
        int z;cin>>z;
        nya[z]++;
    }
    long long ans = 0;
    for(int i = 0; x >= i; i++){
        ans += nya[i]*nya[x-i];
    }
    cout << ans << endl;
}
0