結果

問題 No.3029 素因数
ユーザー e869120e869120
提出日時 2017-03-31 23:04:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 776 bytes
コンパイル時間 555 ms
コンパイル使用メモリ 69,064 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-21 11:18:16
合計ジャッジ時間 6,290 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
4,380 KB
testcase_01 AC 52 ms
4,376 KB
testcase_02 AC 82 ms
4,376 KB
testcase_03 AC 103 ms
4,380 KB
testcase_04 AC 133 ms
4,376 KB
testcase_05 AC 157 ms
4,380 KB
testcase_06 AC 182 ms
4,380 KB
testcase_07 AC 203 ms
4,376 KB
testcase_08 AC 92 ms
4,376 KB
testcase_09 AC 112 ms
4,376 KB
testcase_10 WA -
testcase_11 AC 148 ms
4,380 KB
testcase_12 AC 153 ms
4,376 KB
testcase_13 AC 194 ms
4,376 KB
testcase_14 AC 168 ms
4,380 KB
testcase_15 AC 57 ms
4,376 KB
testcase_16 AC 42 ms
4,376 KB
testcase_17 AC 188 ms
4,380 KB
testcase_18 AC 17 ms
4,376 KB
testcase_19 WA -
testcase_20 AC 197 ms
4,380 KB
testcase_21 AC 12 ms
4,376 KB
testcase_22 AC 36 ms
4,376 KB
testcase_23 AC 107 ms
4,376 KB
testcase_24 WA -
testcase_25 AC 162 ms
4,376 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 67 ms
4,380 KB
testcase_29 AC 123 ms
4,380 KB
testcase_30 WA -
testcase_31 AC 62 ms
4,376 KB
testcase_32 AC 127 ms
4,376 KB
testcase_33 AC 7 ms
4,376 KB
testcase_34 AC 31 ms
4,380 KB
testcase_35 AC 142 ms
4,380 KB
testcase_36 AC 72 ms
4,380 KB
testcase_37 AC 97 ms
4,376 KB
testcase_38 WA -
testcase_39 AC 174 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

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 <= 5000 * 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