您的位置:首页 > 其它

Ural1349(费马大定理)

2015-03-07 20:50 274 查看
题目链接:点击打开链接

解题思路:

费马大定理······Orz!!!膜拜神学。当n== 1时,输出1 、2、 3;当n==2时,输出3 、4 、5;当n >= 3时,无解。

完整代码:

#include <algorithm>
#include <iostream>
#include <cstring>
#include <climits>
#include <cstdio>
#include <string>
#include <cmath>
#include <map>
#include <queue>
using namespace std;
typedef long long LL;
const int MOD = int(1e9)+7;
const int INF = 0x3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1.0); //M_PI;

int main()
{
    #ifdef DoubleQ
    freopen("in.txt","r",stdin);
    #endif
    int n;
    while(cin >> n)
    {
        if(n == 1)
            cout << "1 2 3" << endl;
        else if(n == 2)
            cout << "3 4 5" << endl;
        else
            cout << "-1" << endl;
    }
}


更多精彩请访问:点击打开链接
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: