第二个数据是错的

第二个数据(也就是测试数据#1)是错的!!!!!!!!!!!!!
include <cmath> include <cstdio> include <iostream> include <algorithm>
using namespace std;
long long n,i,temp1,temp2,flag1;
int main()
{
temp1=1;
temp2=1;
cin>>n;
flag1=trunc(sqrt(n));
for (i=2;i<=flag1;i++)
{
if (n%i==0)
{
temp1=i;
break;
}
}
for (i=2;i<=flag1;i++)
{
if (n%i==0)
{
temp2=i;
//break;
}
}
//我发现有break就可以AC,没有第二个数据就过不去 于是验证一下 第二个数据不合格
if( (temp1<temp2)&&(temp2<n/temp2)&&(n/temp2 < n/temp1) )
{cout<<n/temp1;}
else{cout<<temp1+28;} //这句是为了让别的9个数据WA
return 0;
}
编译成功
测试数据 #0: WrongAnswer, time = 0 ms, mem = 556 KiB, score = 0
测试数据 #1: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #2: WrongAnswer, time = 0 ms, mem = 564 KiB, score = 0
测试数据 #3: WrongAnswer, time = 0 ms, mem = 560 KiB, score = 0
测试数据 #4: WrongAnswer, time = 0 ms, mem = 560 KiB, score = 0
测试数据 #5: WrongAnswer, time = 0 ms, mem = 556 KiB, score = 0
测试数据 #6: WrongAnswer, time = 0 ms, mem = 560 KiB, score = 0
测试数据 #7: WrongAnswer, time = 0 ms, mem = 560 KiB, score = 0
测试数据 #8: WrongAnswer, time = 0 ms, mem = 556 KiB, score = 0
测试数据 #9: WrongAnswer, time = 0 ms, mem = 560 KiB, score = 0
WrongAnswer, time = 0 ms, mem = 564 KiB, score = 10
这就说明(temp1<temp2)&&(temp2<n/temp2)&&(n/temp2 < n/temp1) 为ture
也就是说这个数据至少有 4个因数!!!!
真特么坑比

0 条评论

目前还没有评论...

信息

ID
1773
难度
3
分类
(无)
标签
(无)
递交数
2133
已通过
1044
通过率
49%
被复制
4
上传者