結果
問題 | No.8016 unordered_mapなるたけ落とすマン |
ユーザー |
![]() |
提出日時 | 2016-05-22 00:35:49 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 85 ms / 1,000 ms |
コード長 | 823 bytes |
コンパイル時間 | 1,079 ms |
コンパイル使用メモリ | 91,612 KB |
実行使用メモリ | 9,856 KB |
最終ジャッジ日時 | 2024-10-07 05:35:23 |
合計ジャッジ時間 | 6,331 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 48 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:42:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 42 | scanf("%lld",&a); | ~~~~~^~~~~~~~~~~ main.cpp:47:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 47 | scanf("%lld",&a); | ~~~~~^~~~~~~~~~~
ソースコード
#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; map<long long,int> cnt; long long a; for(int i=0;i<n;i++){ scanf("%lld",&a); cnt[a]++; } for(int i=0;i<m;i++){ scanf("%lld",&a); cout<<cnt[a]<<" "; } cout<<endl; return 0; }