Advertisement
Guest User

Untitled

a guest
Oct 4th, 2015
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #include <iostream>
  2. #include <map>
  3. #include <vector>
  4. using namespace std;
  5.  
  6. struct npair
  7. {
  8.     int b;
  9.     int h;
  10.     npair(int nb,int nh)
  11.     {
  12.         b = nb;
  13.         h = nh;
  14.     }
  15. };
  16.  
  17. int main()
  18. {
  19.     map<int,vector<npair> > lennot();
  20.     int n,m;
  21.     cin >> n >> m;
  22.     for (int i = 0; i < m; i++ )
  23.     {
  24.         int a,b,h;
  25.         cin >> a >> b >> h;
  26.         npair tp(b,h);
  27.         lennot[a].push_back(tp);
  28.     }
  29.  
  30. l.cpp: In function ‘int main():
  31. l.cpp:42:11: warning: pointer to a function used in arithmetic [-Wpointer-arith]
  32.    lennot[a].push_back(tp);
  33.            ^
  34. 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> >()
  35.    lennot[a].push_back(tp);
  36.              ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement