結果
| 問題 | No.206 数の積集合を求めるクエリ |
| コンテスト | |
| ユーザー |
latte0119
|
| 提出日時 | 2016-02-27 18:11:50 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 894 ms / 7,000 ms |
| コード長 | 897 bytes |
| 記録 | |
| コンパイル時間 | 1,417 ms |
| コンパイル使用メモリ | 160,304 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-24 11:43:13 |
| 合計ジャッジ時間 | 9,727 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:38:18: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘std::size_t’ {aka ‘long unsigned int’} [-Wformat=]
38 | printf("%d\n",(A&B).count());
| ~^ ~~~~~~~~~~~~~
| | |
| int std::size_t {aka long unsigned int}
| %ld
main.cpp:36:16: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
36 | int Q;scanf("%d",&Q);
| ~~~~~^~~~~~~~~
ソースコード
#include<bits/stdc++.h>
using namespace std;
//#define int long long
typedef long long ll;
typedef pair<int,int>pint;
typedef vector<int>vint;
typedef vector<pint>vpint;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
template<class T,class U>inline void chmin(T &t,U f){if(t>f)t=f;}
template<class T,class U>inline void chmax(T &t,U f){if(t<f)t=f;}
typedef bitset<100000>bs;
signed main(){
int L,M,N;
cin>>L>>M>>N;
bs A,B;
rep(i,L){
int a;cin>>a;A.set(--a);
}
rep(i,M){
int b;cin>>b;B.set(--b);
}
int Q;scanf("%d",&Q);
rep(i,Q){
printf("%d\n",(A&B).count());
B<<=1;
}
return 0;
}
latte0119