結果

問題 No.206 数の積集合を求めるクエリ
ユーザー Kmcode1Kmcode1
提出日時 2015-05-08 23:17:33
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,034 bytes
コンパイル時間 975 ms
コンパイル使用メモリ 95,320 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-19 08:41:41
合計ジャッジ時間 59,642 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 4 ms
4,380 KB
testcase_07 AC 3 ms
4,376 KB
testcase_08 AC 5 ms
4,376 KB
testcase_09 AC 6 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 10 ms
4,376 KB
testcase_13 AC 8 ms
4,380 KB
testcase_14 AC 4 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 3 ms
4,376 KB
testcase_17 TLE -
testcase_18 AC 1,922 ms
4,380 KB
testcase_19 AC 6,177 ms
4,380 KB
testcase_20 AC 21 ms
4,376 KB
testcase_21 AC 1,445 ms
4,380 KB
testcase_22 AC 1,913 ms
4,376 KB
testcase_23 AC 6,537 ms
4,376 KB
testcase_24 TLE -
testcase_25 TLE -
testcase_26 AC 1,938 ms
4,376 KB
testcase_27 AC 2,294 ms
4,376 KB
testcase_28 AC 4,625 ms
4,384 KB
testcase_29 AC 4,223 ms
4,376 KB
testcase_30 AC 3,087 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<cctype>
#include<cstdlib>
#include<algorithm>
#include<bitset>
#include<vector>
#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<ctime>
#include<complex>
#include<functional>
#include<climits>
#include<cassert>
#include<iterator>
using namespace std;
int l, m, n;
#define MAX 100002
vector<int> a;
vector<int> b;
int ans[MAX];
int main(){
	scanf("%d%d%d", &l, &m, &n);
	a.resize(l);
	for (int i = 0; i < l; i++){
		scanf("%d", &a[i]);
	}
	b.resize(m);
	for (int j = 0; j < m; j++){
		scanf("%d", &b[j]);
	}
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	for (int i = 0; i < b.size(); i++){
		int ind = lower_bound(a.begin(), a.end(), b[i]) - a.begin();
		for (int j = ind; j < a.size(); j++){
			ans[abs(a[j] - b[i])]++;
		}
	}
	int q;
	scanf("%d", &q);
	for (int i = 0; i < q; i++){
		printf("%d\n", ans[i]);
	}
	return 0;
}
0