prog.cpp:3:21: error: ‘vector’ has not been declared
int minSubarray(vector<int>& a, int p) {
^~~~~~
prog.cpp:3:27: error: expected ‘,’ or ‘...’ before ‘<’ token
int minSubarray(vector<int>& a, int p) {
^
prog.cpp: In member function ‘int Solution::minSubarray(int)’:
prog.cpp:5:18: error: ‘a’ was not declared in this scope
int i,n=a.size();
^
prog.cpp:7:9: error: ‘vector’ was not declared in this scope
vector<int>front(n,0),back(n,0);
^~~~~~
prog.cpp:7:16: error: expected primary-expression before ‘int’
vector<int>front(n,0),back(n,0);
^~~
prog.cpp:10:9: error: ‘front’ was not declared in this scope
front[0]=a[0]%p;
^~~~~
prog.cpp:10:9: note: suggested alternative: ‘float’
front[0]=a[0]%p;
^~~~~
float
prog.cpp:10:23: error: ‘p’ was not declared in this scope
front[0]=a[0]%p;
^
prog.cpp:11:9: error: ‘back’ was not declared in this scope
back[n-1]=a[n-1]%p;
^~~~
prog.cpp:23:9: error: ‘unordered_map’ was not declared in this scope
unordered_map<int,set<int>>mm;
^~~~~~~~~~~~~
prog.cpp:23:23: error: expected primary-expression before ‘int’
unordered_map<int,set<int>>mm;
^~~
prog.cpp:28:13: error: ‘mm’ was not declared in this scope
mm[back[i]].insert(i);
^~
prog.cpp:43:16: error: ‘min’ was not declared in this scope
ans=min(ans,n-i-1);
^~~
prog.cpp:46:17: error: ‘min’ was not declared in this scope
ans=min(ans,i);
^~~
prog.cpp:50:16: error: ‘mm’ was not declared in this scope
if(mm[rem2].size()!=0)
^~
prog.cpp:55:23: error: ‘min’ was not declared in this scope
ans=min(ans,*it-i-1);
^~~