/ Vijos /

记录详情

Accepted

/in/foo.cc: In function 'int main()':
/in/foo.cc:7:15: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long unsigned int*' [-Wformat=]
  scanf("%d",&n);for(int i=1;i<=n;i++){scanf("%d",&a[i]);sum+=a[i];}k=sum/n;
               ^
/in/foo.cc:7:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  scanf("%d",&n);for(int i=1;i<=n;i++){scanf("%d",&a[i]);sum+=a[i];}k=sum/n;
                             ~^~~
/in/foo.cc:7:55: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long unsigned int*' [-Wformat=]
  scanf("%d",&n);for(int i=1;i<=n;i++){scanf("%d",&a[i]);sum+=a[i];}k=sum/n;
                                                       ^
/in/foo.cc:8:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1;i<=n;i++){if(a[i]<k){a[i+1]-=k-a[i];ans+=1;}if(a[i]>k){a[i+1]+=a[i]-k;ans+=1;} }
              ~^~~
/in/foo.cc:9:17: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long unsigned int' [-Wformat=]
  printf("%d",ans);
                 ^
# 状态 耗时 内存占用
#1 Accepted 1ms 256.0 KiB
#2 Accepted 1ms 256.0 KiB
#3 Accepted 3ms 348.0 KiB
#4 Accepted 3ms 328.0 KiB
#5 Accepted 2ms 376.0 KiB

信息

递交者
类型
递交
题目
P1123 均分纸牌
语言
C++
递交时间
2017-04-23 19:44:53
评测时间
2017-04-23 19:44:53
评测机
分数
50
总耗时
12ms
峰值内存
376.0 KiB