結果
問題 | No.3016 ハチマキおじさん |
ユーザー |
![]() |
提出日時 | 2025-03-31 17:34:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 591 bytes |
コンパイル時間 | 786 ms |
コンパイル使用メモリ | 78,896 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-31 17:35:45 |
合計ジャッジ時間 | 5,757 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 31 |
ソースコード
#include <iostream>#include <vector>#include <algorithm>using namespace std;int main() {ios::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());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);cout << (upper - lower) << (i == M - 1 ? "\n" : " ");}return 0;}