結果
問題 |
No.8016 unordered_mapなるたけ落とすマン
|
ユーザー |
![]() |
提出日時 | 2016-05-22 01:36:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 59 ms / 1,000 ms |
コード長 | 431 bytes |
コンパイル時間 | 1,656 ms |
コンパイル使用メモリ | 168,972 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 05:05:03 |
合計ジャッジ時間 | 6,901 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 48 |
ソースコード
#include<bits/stdc++.h> //using namespace std;int main(){long n,a;map<long,int>r;for(cin>>n>>a;cin>>a;--n<0?cout<<r[a]<<' ',0:++r[a]);} using namespace std; long a[100010]; int main() { int n, m; scanf("%d%d", &n, &m); for(int i=0; i<n; ++i) scanf("%ld", a+i); sort(a, a+n); for(int i=0; i<m; ++i) { long b; scanf("%ld", &b); printf("%d ", upper_bound(a, a+n, b)-lower_bound(a, a+n, b)); } }