結果

問題 No.723 2つの数の和
ユーザー sggkshio
提出日時 2018-12-26 00:31:02
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 723 bytes
コンパイル時間 944 ms
コンパイル使用メモリ 83,312 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-10-01 14:38:44
合計ジャッジ時間 3,686 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 13 RE * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include <sstream>
#include<iomanip>
#include <ctype.h>
using namespace std;

//#include<bits/stdc++.h>
long long int d[100005];
int main() {
	
	long long int n, m;
	cin >> n >> m;

	for (int i = 0; i < n; i++) {

		int x;
		cin >> x;
		if(x<=100000)d[x]++;

	}
	long long int b = 0;
	for (int i = 0; i <= 100000; i++) {
		if (i > m)break;
		if(d[i])b += d[m - i]*d[i];
//		cout << i << " " << b << endl;
	}
	cout << b << endl;



	return 0;
}
0