| 记录编号 | 124950 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 1461.[SPOJ 1739] Pell方程 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.002 s | ||
| 提交时间 | 2014-10-07 06:12:34 | 内存使用 | 0.31 MiB | ||
#include<iostream>
#include<cstdio>
using namespace std;
int f(int x,int y,int n)
{
return x*x-n*y*y;
}
int main()
{
freopen("pell.in","r",stdin);
freopen("pell.out","w",stdout);
int n;
cin>>n;
for(int i=1;i<=300;i++)
for(int j=1;j<=300;j++)
if(f(i,j,n)==1)
{
cout<<i<<" "<<j;
return 0;
}
return 0;
}