結果

問題 No.723 2つの数の和
ユーザー GB
提出日時 2018-09-02 21:03:41
言語 C++17(clang)
(17.0.6 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 679 ms
コンパイル使用メモリ 119,272 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-30 12:39:39
合計ジャッジ時間 12,219 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>

using namespace std;

int main() {

	int n, x;
	int *array;
	
	cin >> n >> x;
	array = new int[n];
	for (int i = 0;i < n;i++) {
		cin >> array[i];
	}
	int count = 0;
	for (int i = 0;i < n;i++) {
		if (array[i] > x)continue;
		for (int j = 0;j < n;j++) {
			if (array[i] + array[j] == x)count++;
		}
	}

	cout << count;

	delete[] array;

	return 0;
}
0