結果

問題 No.3035 2018
ユーザー ty70ty70
提出日時 2018-04-03 16:26:26
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 377 ms / 2,000 ms
コード長 630 bytes
コンパイル時間 1,159 ms
コンパイル使用メモリ 143,596 KB
実行使用メモリ 27,376 KB
最終ジャッジ日時 2023-09-08 15:27:28
合計ジャッジ時間 5,928 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 377 ms
27,336 KB
testcase_01 AC 353 ms
27,292 KB
testcase_02 AC 348 ms
27,284 KB
testcase_03 AC 345 ms
27,212 KB
testcase_04 AC 352 ms
27,300 KB
testcase_05 AC 349 ms
27,204 KB
testcase_06 AC 352 ms
27,376 KB
testcase_07 AC 333 ms
27,264 KB
testcase_08 AC 345 ms
27,376 KB
testcase_09 AC 354 ms
27,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

const int L = 5111443;
int d[L + 1];
const int N = (int)1e6 + 6;
int a[N];

int main()
{
	memset(d, 0, sizeof(d));
	memset(a, 0, sizeof(a));
	for (int i = 1; i <= L; ++i){
		for (int j = i; j <= L; j += i){
			++d[j];
		} // end for
	} // end for

	int i = 1;
	for (int j = 1; j <= L; ++j){
		if (d[j] == 4){
			a[i] = j;
			++i;
		} // end if
	} // end for

	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;

	cout << a[n] << endl;
	
	return 0;
}
0