結果

問題 No.3035 2018
ユーザー toriaezuACtoriaezuAC
提出日時 2018-04-02 21:43:19
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 642 ms / 2,000 ms
コード長 412 bytes
コンパイル時間 843 ms
コンパイル使用メモリ 51,296 KB
実行使用メモリ 26,928 KB
最終ジャッジ日時 2023-09-08 13:38:52
合計ジャッジ時間 8,437 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 580 ms
26,796 KB
testcase_01 AC 596 ms
26,744 KB
testcase_02 AC 642 ms
26,712 KB
testcase_03 AC 628 ms
26,856 KB
testcase_04 AC 627 ms
26,852 KB
testcase_05 AC 619 ms
26,696 KB
testcase_06 AC 625 ms
26,928 KB
testcase_07 AC 610 ms
26,716 KB
testcase_08 AC 624 ms
26,860 KB
testcase_09 AC 632 ms
26,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
const int MAX = 6000000;
int K;

int factors[MAX + 1];

void Pre_calc() {
	for (int p = 1; p <= MAX; ++p) {
		for (int i = p; i <= MAX; i += p) {
			++factors[i];
		}
	}
}

int main() {
	Pre_calc();

	cin >> K;
	int cnt = 0;
	for (int i = 0; i < MAX; ++i) {
		if (factors[i] == 4) {
			++cnt;
			if (cnt == K) {
				cout << i << endl;
				break;
			}
		}
	}
	return 0;
}
0