結果

問題 No.8029 素因数
ユーザー e869120
提出日時 2017-03-31 23:18:00
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 881 bytes
コンパイル時間 679 ms
コンパイル使用メモリ 74,648 KB
実行使用メモリ 266,280 KB
最終ジャッジ日時 2024-07-07 05:26:19
合計ジャッジ時間 11,044 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7 WA * 1 TLE * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 <= 80000 * (M / 3)) {}
	for (int i = 0; i < 10000 * (1 << (M % 13)); 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;
}
0