- 质因数
- 2016-02-10 21:35:48 @
代码
#include <cmath>
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
long long n,i,temp,flag1;
int main()
{
temp=1;
cin>>n;
flag1=trunc(sqrt(n));
for (i=2;i<=flag1;i++)
{
if (n%i==0)
{
temp=i;
//break; //这里特别注意这个break 我注释掉了 如果有break vijos上也能过 说明vijos上的数据至少有4个因数
}
}
cout<<n/temp;
}
这是TYVJ上的结果
评测结果
#0: Accepted (0ms, 528KiB)
#1: Accepted (0ms, 528KiB)
#2: Accepted (15ms, 528KiB)
#3: Accepted (15ms, 528KiB)
#4: Accepted (0ms, 528KiB)
#5: Accepted (0ms, 524KiB)
#6: Accepted (0ms, 528KiB)
#7: Accepted (0ms, 528KiB)
#8: Accepted (0ms, 528KiB)
#9: Accepted (15ms, 528KiB)
这是VIJOS上的结果
编译成功
测试数据 #0: Accepted, time = 0 ms, mem = 556 KiB, score = 10
测试数据 #1: WrongAnswer, time = 0 ms, mem = 560 KiB, score = 0
测试数据 #2: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #3: Accepted, time = 0 ms, mem = 556 KiB, score = 10
测试数据 #4: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #5: Accepted, time = 0 ms, mem = 560 KiB, score = 10
测试数据 #6: Accepted, time = 0 ms, mem = 556 KiB, score = 10
测试数据 #7: Accepted, time = 15 ms, mem = 560 KiB, score = 10
测试数据 #8: Accepted, time = 15 ms, mem = 556 KiB, score = 10
测试数据 #9: Accepted, time = 15 ms, mem = 556 KiB, score = 10
WrongAnswer, time = 45 ms, mem = 560 KiB, score = 90
2 条评论
-
5661lhr LV 8 @ 2016-02-12 21:30:25
辛苦了。 新年快乐
-
2016-02-11 12:22:15@
修好辣!
- 1
信息
- ID
- 1773
- 难度
- 3
- 分类
- (无)
- 标签
- (无)
- 递交数
- 2133
- 已通过
- 1044
- 通过率
- 49%
- 被复制
- 4
- 上传者