首页 > 其他 > 详细

Ural1349(费马大定理)

时间:2015-03-07 21:19:49      阅读:179      评论:0      收藏:0      [点我收藏+]

题目链接:点击打开链接


解题思路:

费马大定理······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;
    }
}

更多精彩请访问:点击打开链接

Ural1349(费马大定理)

原文:http://blog.csdn.net/u013447865/article/details/44119855

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!