結果
問題 |
No.8029 素因数
|
ユーザー |
![]() |
提出日時 | 2017-03-31 23:26:40 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 881 bytes |
コンパイル時間 | 695 ms |
コンパイル使用メモリ | 74,500 KB |
実行使用メモリ | 13,088 KB |
最終ジャッジ日時 | 2024-07-07 05:55:20 |
合計ジャッジ時間 | 5,646 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 33 WA * 7 |
ソースコード
#include<iostream> #include<string> #include<ctime> #include<vector> using namespace std; string U = "1309020564363155364990198847863210152708042104341971929"; vector<int>Z; int main() { int M; cin >> M; int t = clock(); while (clock() - t <= 70000 * (M / 11)) {} for (int i = 0; i < 2000 * (1 << (M % 11)); i++)Z.push_back(0); while (true) { if (U.size() <= 7) { U = to_string(stoi(U) % M); break; } long double T = 0, T2 = 1; for (int j = U.size() - 1; j >= 0; j--) { T += T2*((U[j] - '0')); T2 *= 10; } T /= M; while (T >= 10)T /= 10; int E = T; int EE = E*M; int J = stoi(U.substr(0, 3)); while (J > EE * 10)EE *= 10; J -= EE; U = to_string(J) + U.substr(3, U.size() - 3); while (U[0] == '0')U = U.substr(1, U.size() - 1); //cout << U << endl; } if (U[U.size() - 1] % 2 == 0)cout << "even" << endl; else cout << "odd" << endl; return 0; }