Skip to content

Commit

Permalink
Add 12185.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiyabye committed Jul 25, 2024
1 parent 58feefa commit 2617812
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions 12xxx/12185.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <iostream>
#include <vector>
using namespace std;

void solve(int idx) {
int n; cin >> n;
vector<int> v(5001, 0);
while (n--) {
int a, b; cin >> a >> b;
for (int i=a; i<=b; i++) v[i]++;
}

cout << "Case #" << idx << ": ";

int p; cin >> p;
while (p--) {
int c; cin >> c;
cout << v[c] << " ";
}
cout << "\n";
}

int main(void) {
ios::sync_with_stdio(false);
cin.tie(nullptr);

int t; cin >> t;
for (int i=1; i<=t; i++) solve(i);
return 0;
}

0 comments on commit 2617812

Please sign in to comment.