foo.cc: In function 'int main()':
foo.cc:14:2: error: 'cin' was not declared in this scope
cin>>n>>k;
^~~
foo.cc:14:2: note: suggested alternative: 'main'
cin>>n>>k;
^~~
main
foo.cc:15:26: error: 'scanf' was not declared in this scope
for (int i=1;i<=10;i++) scanf("%d",&e[i]);
^~~~~
foo.cc:16:25: error: 'scanf' was not declared in this scope
for (int i=1;i<=n;i++) scanf("%d",&p[i].w),p[i].d=i;
^~~~~
foo.cc:17:2: error: 'sort' was not declared in this scope
sort(p+1,p+n+1,cmp);
^~~~
foo.cc:17:2: note: suggested alternative: 'short'
sort(p+1,p+n+1,cmp);
^~~~
short
foo.cc:20:25: error: 'printf' was not declared in this scope
for (int i=1;i<=k;i++) printf("%d ",p[i].d);
^~~~~~
foo.cc:20:25: note: suggested alternative: 'int'
for (int i=1;i<=k;i++) printf("%d ",p[i].d);
^~~~~~
int
[Hydro](https://hydro.ac)提供评测服务