結果
問題 |
No.3016 ハチマキおじさん
|
ユーザー |
![]() |
提出日時 | 2025-06-12 18:12:06 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 738 bytes |
コンパイル時間 | 2,375 ms |
コンパイル使用メモリ | 81,080 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-06-12 18:13:43 |
合計ジャッジ時間 | 5,603 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 31 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n, m; cin >> n >> m; vector<long long> a(n); for (int i = 0; i < n; ++i) { cin >> a[i]; } sort(a.begin(), a.end()); vector<int> res; res.reserve(m); for (int i = 0; i < m; ++i) { long long b; cin >> b; auto lower = lower_bound(a.begin(), a.end(), b); auto upper = upper_bound(a.begin(), a.end(), b); res.push_back(upper - lower); } for (int i = 0; i < m; ++i) { if (i > 0) { cout << ' '; } cout << res[i]; } cout << '\n'; return 0; }