結果
| 問題 |
No.8016 unordered_mapなるたけ落とすマン
|
| ユーザー |
Lay_ec
|
| 提出日時 | 2016-05-22 00:37:52 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 1,000 ms |
| コード長 | 900 bytes |
| コンパイル時間 | 1,002 ms |
| コンパイル使用メモリ | 91,316 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-07 05:36:35 |
| 合計ジャッジ時間 | 5,399 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 48 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:41:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
41 | scanf("%lld",&a[i]);
| ~~~~~^~~~~~~~~~~~~~
main.cpp:47:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
47 | scanf("%lld",&b);
| ~~~~~^~~~~~~~~~~
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <cctype>
#include <stack>
#include <queue>
#include <cstring>
#include <map>
#include <unordered_map>
using namespace std;
const long long INF=1LL<<50LL;
const double PI=3.14159265358979323846264;
hash<long long> h_ll;
class myHash {
public:
size_t operator()(const int &x) const {
const long long mod=1e9+7;
return h_ll(x)^h_ll((x+1145141919)%mod);
}
};
int main(){
int n,m;
cin>>n>>m;
vector<long long> a(n);
for(int i=0;i<n;i++){
scanf("%lld",&a[i]);
}
sort(a.begin(),a.end());
long long b;
for(int i=0;i<m;i++){
scanf("%lld",&b);
cout<<upper_bound(a.begin(),a.end(),b)-lower_bound(a.begin(),a.end(),b)<<" ";
}
cout<<endl;
return 0;
}
Lay_ec