/ Vijos /

记录详情

Accepted

foo.cc: In function 'int main()':
foo.cc:5:23: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long unsigned int*' [-Wformat=]
     scanf("%d%d",&x,&y);if (x<y) n=x;else n=y;for (i=2;i<=n;i++) t[i]=(x/i)*(y/i);k=n/2;ans=x*y;
                  ~~   ^
foo.cc:5:23: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long unsigned int*' [-Wformat=]
foo.cc:7:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
     for (i=1;i<=p[0];i++) p[i]=0;for (i=2;i<=p[0];i++) if (p[i]==0) {a[0]++;a[a[0]]=i;j=i+i;while (j<=p[0]) {p[j]=1;j+=i;}}
     ^~~
foo.cc:7:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
     for (i=1;i<=p[0];i++) p[i]=0;for (i=2;i<=p[0];i++) if (p[i]==0) {a[0]++;a[a[0]]=i;j=i+i;while (j<=p[0]) {p[j]=1;j+=i;}}
                                  ^~~
foo.cc:9:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
     for (j=1;j<=a[0];j++) if (x%a[j]==0){y++;x/=a[j];if (x%a[j]==0) {y=-1;break;}}if (y!=-1) if (x>1) y++;
     ^~~
foo.cc:9:83: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
     for (j=1;j<=a[0];j++) if (x%a[j]==0){y++;x/=a[j];if (x%a[j]==0) {y=-1;break;}}if (y!=-1) if (x>1) y++;
                                                                                   ^~
foo.cc:9:88: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (j=1;j<=a[0];j++) if (x%a[j]==0){y++;x/=a[j];if (x%a[j]==0) {y=-1;break;}}if (y!=-1) if (x>1) y++;
                                                                                       ~^~~~
foo.cc:10:10: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (y==-1) f[i]=0;else if (y%2==1) f[i]=-1;else f[i]=1;}
         ~^~~~
foo.cc:5:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d",&x,&y);if (x<y) n=x;else n=y;for (i=2;i<=n;i++) t[i]=(x/i)*(y/i);k=n/2;ans=x*y;
     ~~~~~^~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Accepted 0ms 256.0 KiB
#2 Accepted 0ms 256.0 KiB
#3 Accepted 0ms 256.0 KiB
#4 Accepted 0ms 256.0 KiB
#5 Accepted 0ms 256.0 KiB
#6 Accepted 0ms 256.0 KiB
#7 Accepted 0ms 256.0 KiB
#8 Accepted 0ms 256.0 KiB
#9 Accepted 1ms 384.0 KiB
#10 Accepted 18ms 1.688 MiB

信息

递交者
类型
递交
题目
P1732 能量采集
语言
C++
递交时间
2021-11-26 04:37:59
评测时间
2021-11-26 04:37:59
评测机
分数
100
总耗时
27ms
峰值内存
1.688 MiB