Skip to content

Commit

Permalink
Create example.test.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
adamant-pwn authored Feb 10, 2024
1 parent d4e7b9e commit 55fc800
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions examples/example.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#define PROBLEM "https://onlinejudge.u-aizu.ac.jp/courses/lesson/1/ALDS1/4/ALDS1_4_B"
#include <algorithm>
#include <iostream>
#include <vector>
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define ALL(x) std::begin(x), std::end(x)
using namespace std;

int main() {
int n; cin >> n;
vector<int> s(n);
REP (i, n) {
cin >> s[i];
}
int q; cin >> q;
int cnt = 0;
while (q --) {
int t_i; cin >> t_i;
cnt += binary_search(ALL(s), t_i);
}
cout << cnt << endl;
return 0;
}

0 comments on commit 55fc800

Please sign in to comment.