/in/foo.cc: In function 'int main()':
/in/foo.cc:5:10: error: 'std::ios' has not been declared
std::ios::sync_with_stdio(false);
^~~
/in/foo.cc:6:5: error: 'cin' was not declared in this scope
cin>>n;
^~~
/in/foo.cc:11:42: error: 'INT_MAX' was not declared in this scope
for(int i=1;i<=1000000;i++) d[i]=INT_MAX;
^~~~~~~
/in/foo.cc:16:46: error: 'min' was not declared in this scope
d[i]=min(d[i],d[i-v[j]]+1);
^
/in/foo.cc:18:19: error: 'sort' was not declared in this scope
sort(v,v+n);
^
/in/foo.cc:24:18: error: 'INT_MAX' was not declared in this scope
if(d[S]==INT_MAX)
^~~~~~~
/in/foo.cc:25:13: error: 'cout' was not declared in this scope
cout<<-1<<endl;
^~~~
/in/foo.cc:25:23: error: 'endl' was not declared in this scope
cout<<-1<<endl;
^~~~
/in/foo.cc:27:13: error: 'cout' was not declared in this scope
cout<<tmp<<endl;
^~~~
/in/foo.cc:27:24: error: 'endl' was not declared in this scope
cout<<tmp<<endl;
^~~~