結果

問題 No.3029 素因数
ユーザー e869120e869120
提出日時 2017-03-31 23:27:36
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 880 bytes
コンパイル時間 726 ms
コンパイル使用メモリ 73,640 KB
実行使用メモリ 13,084 KB
最終ジャッジ日時 2023-09-21 12:05:40
合計ジャッジ時間 6,866 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,384 KB
testcase_01 AC 53 ms
4,380 KB
testcase_02 AC 102 ms
4,376 KB
testcase_03 AC 104 ms
4,376 KB
testcase_04 AC 153 ms
4,380 KB
testcase_05 AC 162 ms
13,056 KB
testcase_06 AC 204 ms
4,380 KB
testcase_07 TLE -
testcase_08 AC 103 ms
4,376 KB
testcase_09 AC 107 ms
8,396 KB
testcase_10 WA -
testcase_11 AC 155 ms
5,456 KB
testcase_12 AC 157 ms
7,512 KB
testcase_13 AC 208 ms
7,500 KB
testcase_14 AC 203 ms
4,380 KB
testcase_15 AC 53 ms
4,376 KB
testcase_16 AC 51 ms
4,376 KB
testcase_17 AC 206 ms
5,284 KB
testcase_18 AC 3 ms
4,380 KB
testcase_19 WA -
testcase_20 AC 212 ms
12,800 KB
testcase_21 AC 2 ms
4,376 KB
testcase_22 AC 12 ms
12,924 KB
testcase_23 AC 106 ms
5,164 KB
testcase_24 WA -
testcase_25 AC 202 ms
4,380 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 54 ms
5,420 KB
testcase_29 AC 153 ms
4,380 KB
testcase_30 WA -
testcase_31 AC 53 ms
4,376 KB
testcase_32 AC 153 ms
4,380 KB
testcase_33 AC 2 ms
4,380 KB
testcase_34 AC 6 ms
7,716 KB
testcase_35 AC 154 ms
4,380 KB
testcase_36 AC 57 ms
8,276 KB
testcase_37 AC 103 ms
4,380 KB
testcase_38 WA -
testcase_39 AC 203 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

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