Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <map>
- #include <vector>
- using namespace std;
- struct npair
- {
- int b;
- int h;
- npair(int nb,int nh)
- {
- b = nb;
- h = nh;
- }
- };
- int main()
- {
- map<int,vector<npair> > lennot();
- int n,m;
- cin >> n >> m;
- for (int i = 0; i < m; i++ )
- {
- int a,b,h;
- cin >> a >> b >> h;
- npair tp(b,h);
- lennot[a].push_back(tp);
- }
- l.cpp: In function ‘int main()’:
- l.cpp:42:11: warning: pointer to a function used in arithmetic [-Wpointer-arith]
- lennot[a].push_back(tp);
- ^
- l.cpp:42:13: error: request for member ‘push_back’ in ‘*(lennot + ((sizetype)a))’, which is of non-class type ‘std::map<int, std::vector<npair> >()’
- lennot[a].push_back(tp);
- ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement