View Compilation Error
2_32239_2624440_10184.cpp:2:7: error: expected nested-name-specifier before 'namespaece'
using namespaece std;
^
2_32239_2624440_10184.cpp:11:1: error: 'map' does not name a type
map<int,Node>mp;
^
2_32239_2624440_10184.cpp: In function 'int main()':
2_32239_2624440_10184.cpp:40:7: error: 'mp' was not declared in this scope
if(mp.find(find(i)) == mp.end()){
^
2_32239_2624440_10184.cpp:44:4: error: 'mp' was not declared in this scope
mp[pre[i]].x += e[i].x;
^
2_32239_2624440_10184.cpp:47:7: error: 'map' was not declared in this scope
for(map<int,Node>::iterator it = mp.begin() ; it != mp.end() ; it++){
^
2_32239_2624440_10184.cpp:47:7: note: suggested alternative:
In file included from 4.9.2/x86_64-w64-mingw32/include/c++/map:61:0,
from 4.9.2/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/bits/stdc++.h:80,
from 2_32239_2624440_10184.cpp:1:
4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_map.h:96:11: note: 'std::map'
class map
^
2_32239_2624440_10184.cpp:47:11: error: expected primary-expression before 'int'
for(map<int,Node>::iterator it = mp.begin() ; it != mp.end() ; it++){
^
2_32239_2624440_10184.cpp:47:49: error: 'it' was not declared in this scope
for(map<int,Node>::iterator it = mp.begin() ; it != mp.end() ; it++){
^
2_32239_2624440_10184.cpp:47:55: error: 'mp' was not declared in this scope
for(map<int,Node>::iterator it = mp.begin() ; it != mp.end() ; it++){
^
2_32239_2624440_10184.cpp:49:16: error: 'w' was not declared in this scope
for(int i = w ; i >= now.x ; i -- ){
^
2_32239_2624440_10184.cpp:50:5: error: 'dp' was not declared in this scope
dp[i] = max(dp[i], dp[i-now.x] + now.w)
^
2_32239_2624440_10184.cpp:50:43: error: 'max' was not declared in this scope
dp[i] = max(dp[i], dp[i-now.x] + now.w)
^
2_32239_2624440_10184.cpp:50:43: note: suggested alternative:
In file included from 4.9.2/x86_64-w64-mingw32/include/c++/algorithm:62:0,
from 4.9.2/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/bits/stdc++.h:64,
from 2_32239_2624440_10184.cpp:1:
4.9.2/x86_64-w64-mingw32/include/c++/bits/stl_algo.h:3454:5: note: 'std::max'
max(initializer_list<_Tp> __l, _Compare __comp)
^
2_32239_2624440_10184.cpp:52:4: error: 'cout' was not declared in this scope
cout<< dp[w] <<endl;
^
2_32239_2624440_10184.cpp:52:4: note: suggested alternative:
In file included from 4.9.2/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/bits/stdc++.h:74:0,
from 2_32239_2624440_10184.cpp:1:
4.9.2/x86_64-w64-mingw32/include/c++/iostream:61:18: note: 'std::cout'
extern ostream cout; /// Linked to standard output
^
2_32239_2624440_10184.cpp:52:11: error: 'dp' was not declared in this scope
cout<< dp[w] <<endl;
^
2_32239_2624440_10184.cpp:52:14: error: 'w' was not declared in this scope
cout<< dp[w] <<endl;
^
2_32239_2624440_10184.cpp:52:19: error: 'endl' was not declared in this scope
cout<< dp[w] <<endl;
^
2_32239_2624440_10184.cpp:52:19: note: suggested alternative:
In file included from 4.9.2/x86_64-w64-mingw32/include/c++/istream:39:0,
from 4.9.2/x86_64-w64-mingw32/include/c++/sstream:38,
from 4.9.2/x86_64-w64-mingw32/include/c++/complex:45,
from 4.9.2/x86_64-w64-mingw32/include/c++/ccomplex:38,
from 4.9.2/x86_64-w64-mingw32/include/c++/x86_64-w64-mingw32/bits/stdc++.h:52,
from 2_32239_2624440_10184.cpp:1:
4.9.2/x86_64-w64-mingw32/include/c++/ostream:564:5: note: 'std::endl'
endl(basic_ostream<_CharT, _Traits>& __os)
^