Codeforces Round #387 (Div. 2) A

来源:互联网 发布:淘宝联盟 高佣金 编辑:程序博客网 时间:2024/06/02 02:33

这个题思路没错,但是要似乎出bug了

我在cf上交过了,在vj上交错了 

看了数据,一带是对的,不知哪里出错了。。

还是用sqrt写吧

代码如下

#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>#include<cmath>using namespace std;int main(){int n;scanf("%d",&n);int p=sqrt(n);for( ;p>=1;p--){if(n%p==0) break;}printf("%d %d\n",p,n/p); } 


原创粉丝点击