結果

問題 No.206 数の積集合を求めるクエリ
ユーザー snteasntea
提出日時 2015-11-09 23:28:01
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 817 bytes
コンパイル時間 1,131 ms
コンパイル使用メモリ 143,312 KB
実行使用メモリ 8,704 KB
最終ジャッジ日時 2023-10-11 15:28:24
合計ジャッジ時間 17,283 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#include <cmath>
#include <climits>
#include <cstdio>

using namespace std;

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define DEBUG(x) cout<<#x<<": "<<x<<endl

typedef pair<int,int> P;
typedef long long int LL;
typedef pair<LL,LL> LP;

bool A[100000+5];
int B[100000];
int q[100000];

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int N,L,M;
	int Q;
	cin >> L >> M >> N;
	REP(i,L){
		int a;
		cin >> a;
		A[a] = true;
	}
	REP(i,M){
		cin >> B[i];
		FOR(j,B[i],N+1){
			if(A[j]){
				q[j-B[i]]++;
			}
		}
	}
	cin >> Q;
	REP(i,Q){
		cout << q[i] << endl;
	}
	return 0;
}
0