foo.cpp:1:20: warning: extra tokens at end of #include directive
#include "stdio.h" #include "iostream" using namespace std;
^
foo.cpp: In function 'int main()':
foo.cpp:7:76: error: 'cin' was not declared in this scope
int main(){ freopen("sum.in","r",stdin); freopen("sum.out","w",stdout); cin>>n>>m;int i,ans=0; for(i=1;i<=n;i++){ scanf("%d",&val[i]); val[i]%=10007; } for(i=1;i<=n;i++){ scanf("%d",&color[i]); sum[i%2][color[i]]+=val[i]; sum[i%2][color[i]]%=10007; d[i%2][color[i]]++; } for(i=1;i<=n;i++){ ans=(ans+i%10007*((sum[i%2][color[i]]+(d[i%2][color[i]]-2)%10007*val[i]+10007)%10007))%10007; } cout<<ans<<endl; return 0; }
^
foo.cpp:7:411: error: 'cout' was not declared in this scope
int main(){ freopen("sum.in","r",stdin); freopen("sum.out","w",stdout); cin>>n>>m;int i,ans=0; for(i=1;i<=n;i++){ scanf("%d",&val[i]); val[i]%=10007; } for(i=1;i<=n;i++){ scanf("%d",&color[i]); sum[i%2][color[i]]+=val[i]; sum[i%2][color[i]]%=10007; d[i%2][color[i]]++; } for(i=1;i<=n;i++){ ans=(ans+i%10007*((sum[i%2][color[i]]+(d[i%2][color[i]]-2)%10007*val[i]+10007)%10007))%10007; } cout<<ans<<endl; return 0; }
^
foo.cpp:7:422: error: 'endl' was not declared in this scope
int main(){ freopen("sum.in","r",stdin); freopen("sum.out","w",stdout); cin>>n>>m;int i,ans=0; for(i=1;i<=n;i++){ scanf("%d",&val[i]); val[i]%=10007; } for(i=1;i<=n;i++){ scanf("%d",&color[i]); sum[i%2][color[i]]+=val[i]; sum[i%2][color[i]]%=10007; d[i%2][color[i]]++; } for(i=1;i<=n;i++){ ans=(ans+i%10007*((sum[i%2][color[i]]+(d[i%2][color[i]]-2)%10007*val[i]+10007)%10007))%10007; } cout<<ans<<endl; return 0; }
^