diff options
| author | omagdy7 <omar.professional8777@gmail.com> | 2022-11-01 11:51:53 +0200 |
|---|---|---|
| committer | omagdy7 <omar.professional8777@gmail.com> | 2022-11-01 11:51:53 +0200 |
| commit | 91ca20b8f78eeeb74fc4eea6eeecdca9fefa5656 (patch) | |
| tree | 0b8fa3a57f5e442c8134f089e64019aba89c5b19 /fastSearch/main.cpp | |
| parent | f2c878488b659cd19ccecc9880e042251585fdbb (diff) | |
| download | competitive-programming-91ca20b8f78eeeb74fc4eea6eeecdca9fefa5656.tar.xz competitive-programming-91ca20b8f78eeeb74fc4eea6eeecdca9fefa5656.zip | |
Added new problems
Diffstat (limited to 'fastSearch/main.cpp')
| -rw-r--r-- | fastSearch/main.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/fastSearch/main.cpp b/fastSearch/main.cpp new file mode 100644 index 0000000..64d97f9 --- /dev/null +++ b/fastSearch/main.cpp @@ -0,0 +1,25 @@ +#include<bits/stdc++.h> + +using namespace std; + +int main () { + ios_base::sync_with_stdio(false); + cin.tie(NULL); + int n; + cin >> n; + vector<int> a(n); + for(int &x : a) cin >> x; + int m; + cin >> m; + + int count = 0; + for(int i = 0; i < m; i++) { + int p1, p2; + cin >> p1 >> p2; + if(a[i] >= p1 && a[i] <= p2){ + count++; + } + } + cout << count << endl; + +} |
