Ural1349(費馬大定理)

題目鏈接:點擊打開鏈接


解題思路:

費馬大定理······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;
    }
}

更多精彩請訪問:點擊打開鏈接
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章