結果
| 問題 |
No.206 数の積集合を求めるクエリ
|
| コンテスト | |
| ユーザー |
agatan
|
| 提出日時 | 2015-05-08 23:33:22 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 633 bytes |
| コンパイル時間 | 627 ms |
| コンパイル使用メモリ | 75,772 KB |
| 実行使用メモリ | 332,800 KB |
| 最終ジャッジ日時 | 2024-07-05 20:41:34 |
| 合計ジャッジ時間 | 23,421 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 TLE * 1 -- * 18 |
ソースコード
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <unordered_set>
#include <set>
#define REP(i, n) for(int i=0;i<(n);i++)
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int L, M, N;
cin >> L >> M >> N;
vector<int> A(L);
REP(i, L) {
cin >> A[i];
}
vector<int> B(M);
REP(i, M) {
cin >> B[i];
}
int Q;
cin >> Q;
multiset<int> C;
for (int a: A) {
for (int b: B) {
C.insert(a - b);
}
}
REP(i, Q) {
cout << C.count(i) << endl;
}
return 0;
}
agatan