結果
| 問題 | No.206 数の積集合を求めるクエリ |
| コンテスト | |
| ユーザー |
IL_msta
|
| 提出日時 | 2015-07-24 18:25:22 |
| 言語 | C++11(廃止可能性あり) (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,107 bytes |
| 記録 | |
| コンパイル時間 | 959 ms |
| コンパイル使用メモリ | 90,168 KB |
| 実行使用メモリ | 10,112 KB |
| 最終ジャッジ日時 | 2024-07-08 12:59:40 |
| 合計ジャッジ時間 | 10,137 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 TLE * 1 -- * 6 |
ソースコード
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
//#include <array>
#include <list>
#include <queue>
#include <vector>
#include <complex>
#include <set>
#include <map>
/////////
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define P(p) cout<<(p)<<endl;
#define PII pair<int,int>
/////////
typedef long long LL;
typedef long double LD;
/////////
using namespace::std;
/////////
const int nmax = 100000;
vector<int> A;
vector<int> B;
vector<int> v;
int main(void){
std::cin.tie(0);
std::ios::sync_with_stdio(false);
std::cout << std::fixed;//
//cout << setprecision(16);//
int L,M,N;
cin>>L>>M>>N;
A.resize(L);
rep(i,L){
cin>>A[i];
}
B.resize(M);
rep(i,M){
cin>>B[i];
}
v.resize(L+M);
sort(A.begin(),A.end());
sort(B.begin(),B.end());
vector<int>::iterator it;
int Q;
cin>>Q;
rep(i,Q){
it = set_intersection( A.begin(), A.end(),
B.begin(), B.end(),
v.begin() );
cout << it - v.begin() << '\n';
rep(i,M){
++B[i];
}
}
return 0;
}
IL_msta