/ Vijos /

记录详情

Compile Error

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; }
                                                                                                                                                                                                                                                                                                                                                                                                                                      ^

信息

递交者
类型
递交
题目
P1976 求和
语言
C++
递交时间
2015-11-21 11:38:57
评测时间
2015-11-21 11:38:58
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes