/ 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 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 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: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 364.0 KiB
#10 Accepted 20ms 1.367 MiB

信息

递交者
类型
递交
题目
P1732 能量采集
语言
C++
递交时间
2021-11-26 05:03:56
评测时间
2021-11-26 05:03:56
评测机
分数
100
总耗时
29ms
峰值内存
1.367 MiB