結果

問題 No.3029 素因数
ユーザー e869120e869120
提出日時 2017-03-31 23:02:28
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 777 bytes
コンパイル時間 593 ms
コンパイル使用メモリ 68,684 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-21 11:16:13
合計ジャッジ時間 18,837 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
4,376 KB
testcase_01 AC 203 ms
4,376 KB
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
testcase_08 TLE -
testcase_09 TLE -
testcase_10 TLE -
testcase_11 TLE -
testcase_12 TLE -
testcase_13 TLE -
testcase_14 TLE -
testcase_15 AC 223 ms
4,376 KB
testcase_16 AC 162 ms
4,380 KB
testcase_17 TLE -
testcase_18 AC 62 ms
4,376 KB
testcase_19 TLE -
testcase_20 TLE -
testcase_21 AC 42 ms
4,380 KB
testcase_22 AC 143 ms
4,376 KB
testcase_23 TLE -
testcase_24 WA -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 TLE -
testcase_28 TLE -
testcase_29 TLE -
testcase_30 WA -
testcase_31 AC 243 ms
4,380 KB
testcase_32 TLE -
testcase_33 AC 22 ms
4,380 KB
testcase_34 AC 122 ms
4,376 KB
testcase_35 TLE -
testcase_36 TLE -
testcase_37 TLE -
testcase_38 TLE -
testcase_39 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<ctime>
using namespace std;
string U = "1309020564363155364990198847863210152708042104341971929";
int main() {
	int M; cin >> M;
	int t = clock();
	while(clock() - t <= 20000 * M) {}
	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