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 DoubleQfreopen("in.txt","r",stdin);#endifint n;while(cin >> n){if(n == 1)cout << "1 2 3" << endl;else if(n == 2)cout << "3 4 5" << endl;elsecout << "-1" << endl;}}更多精彩请访问:点击打开链接

每一发奋美文努力的背后,必有加倍的赏赐。

Ural1349(费马大定理)

相关文章:

你感兴趣的文章:

标签云: