From 26178121de9d6bd9fb359ba2a482603d91f793eb Mon Sep 17 00:00:00 2001 From: Jihoon Lee Date: Thu, 25 Jul 2024 22:42:31 +0900 Subject: [PATCH] Add 12185.cpp --- 12xxx/12185.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 12xxx/12185.cpp diff --git a/12xxx/12185.cpp b/12xxx/12185.cpp new file mode 100644 index 00000000..990589a9 --- /dev/null +++ b/12xxx/12185.cpp @@ -0,0 +1,30 @@ +#include +#include +using namespace std; + +void solve(int idx) { + int n; cin >> n; + vector 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; +} \ No newline at end of file