結果

問題 No.723 2つの数の和
ユーザー GBGB
提出日時 2018-09-02 21:03:41
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 599 ms
コンパイル使用メモリ 120,320 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-07 17:50:44
合計ジャッジ時間 12,239 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 313 ms
5,376 KB
testcase_04 AC 1,102 ms
5,376 KB
testcase_05 AC 920 ms
5,376 KB
testcase_06 AC 564 ms
5,376 KB
testcase_07 AC 77 ms
5,376 KB
testcase_08 AC 129 ms
5,376 KB
testcase_09 AC 321 ms
5,376 KB
testcase_10 AC 179 ms
5,376 KB
testcase_11 AC 7 ms
5,376 KB
testcase_12 AC 118 ms
5,376 KB
testcase_13 AC 1,253 ms
5,376 KB
testcase_14 AC 83 ms
5,376 KB
testcase_15 AC 224 ms
5,376 KB
testcase_16 AC 507 ms
5,376 KB
testcase_17 AC 863 ms
5,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
5,376 KB
testcase_21 AC 1 ms
5,376 KB
testcase_22 AC 1 ms
5,376 KB
testcase_23 AC 1,263 ms
5,376 KB
testcase_24 AC 112 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

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