AC 250, tried atcoder virtual contest, wasn't even half bad
This commit is contained in:
36
atcoder/beginner_contests/250/e.cpp
Normal file
36
atcoder/beginner_contests/250/e.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(){
|
||||
ios::sync_with_stdio(0);
|
||||
cin.tie(0);
|
||||
|
||||
int n, q;
|
||||
cin >> n;
|
||||
|
||||
vector<int> a(n), b(n);
|
||||
|
||||
for(int i = 0; i < n; ++i){
|
||||
cin >> a[i];
|
||||
}
|
||||
for(int i = 0; i < n; ++i){
|
||||
cin >> b[i];
|
||||
}
|
||||
|
||||
cin >> q;
|
||||
for(int j = 0; j < q; ++j){
|
||||
int x, y;
|
||||
cin >> x >> y;
|
||||
|
||||
set<int> a_set(a.begin(), a.begin() + x);
|
||||
set<int> b_set(b.begin(), b.begin() + y);
|
||||
|
||||
cout << (a_set == b_set ? "Yes" : "No") << '\n';
|
||||
}
|
||||
|
||||
cout << flush;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user