結果

問題 No.723 2つの数の和
ユーザー bluebery1001bluebery1001
提出日時 2024-02-20 13:06:27
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 187 ms / 2,000 ms
コード長 342 bytes
コンパイル時間 4,073 ms
コンパイル使用メモリ 278,096 KB
実行使用メモリ 21,616 KB
最終ジャッジ日時 2024-02-20 13:08:37
合計ジャッジ時間 5,995 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 AC 55 ms
7,808 KB
testcase_04 AC 187 ms
15,216 KB
testcase_05 AC 171 ms
19,464 KB
testcase_06 AC 61 ms
8,264 KB
testcase_07 AC 44 ms
6,676 KB
testcase_08 AC 48 ms
7,752 KB
testcase_09 AC 42 ms
6,676 KB
testcase_10 AC 98 ms
13,800 KB
testcase_11 AC 41 ms
8,116 KB
testcase_12 AC 37 ms
6,676 KB
testcase_13 AC 2 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 AC 14 ms
6,676 KB
testcase_19 AC 184 ms
21,616 KB
testcase_20 AC 1 ms
6,676 KB
testcase_21 AC 2 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 101 ms
12,576 KB
testcase_24 AC 173 ms
20,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#include<atcoder/convolution>
using namespace atcoder;
typedef long long ll;
int main(){
	ll n,x;cin >> n >> x;
	if(x>1000000){
		cout<<0<<endl;
		return 0;
	}
	vector<ll>cnt(x+1);
	for(;n--;){
		ll a;cin >> a;
		if(a<=x)cnt[a]++;
	}
	auto ret = convolution_ll(cnt,cnt);
	cout << ret[x] << endl;
}
0