結果

問題 No.723 2つの数の和
ユーザー U-Ar
提出日時 2018-11-23 18:03:04
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 402 bytes
コンパイル時間 527 ms
コンパイル使用メモリ 58,200 KB
実行使用メモリ 17,480 KB
最終ジャッジ日時 2024-12-24 18:46:03
合計ジャッジ時間 43,427 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10 TLE * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>

using namespace std;

int main() {
    long n, x;
    

    cin >> n;
    cin >> x;

    vector<long> a(n);

    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    
    long res = 0;

    for (int i = 0; i < n; i++){
        for (int j = 0; j < n; j++){
            if ((a[i] + a[j]) == x)
                res++;
        }
    }
    cout << res  << "\n";
}
0