prog.cpp:5:1: error: 'map' does not name a type
map<pair<int, int>, int> dp;
^
prog.cpp: In function 'int Solve(int, int)':
prog.cpp:13:6: error: 'mp' was not declared in this scope
if(mp.find(pr) != mp.end()) return mp[pr];
^
prog.cpp:17:18: error: 'Q' was not declared in this scope
for(int i=0; i<Q; i++) {
^
prog.cpp:23:3: error: 'mp' was not declared in this scope
mp[pr]=r;
^
prog.cpp: In function 'int main()':
prog.cpp:29:2: error: 'ans' was not declared in this scope
ans = solve(0,p-1);
^
prog.cpp:29:19: error: 'solve' was not declared in this scope
ans = solve(0,p-1);
^