Skip to content

Commit e5c051e

Browse files
authored
Create example.test.cpp
1 parent 84bfa9e commit e5c051e

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

‎example.test.cpp‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/lesson/1/ALDS1/4/ALDS1_4_B"
2+
#include <algorithm>
3+
#include <iostream>
4+
#include <vector>
5+
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
6+
#define ALL(x) std::begin(x), std::end(x)
7+
using namespace std;
8+
9+
int main() {
10+
int n; cin >> n;
11+
vector<int> s(n);
12+
REP (i, n) {
13+
cin >> s[i];
14+
}
15+
int q; cin >> q;
16+
int cnt = 0;
17+
while (q --) {
18+
int t_i; cin >> t_i;
19+
cnt += binary_search(ALL(s), t_i);
20+
}
21+
cout << cnt << endl;
22+
return 0;
23+
}

0 commit comments

Comments
 (0)