結果

問題 No.3035 2018
ユーザー kotatsugamekotatsugame
提出日時 2020-03-09 08:39:34
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 309 ms / 2,000 ms
コード長 427 bytes
コンパイル時間 515 ms
コンパイル使用メモリ 63,480 KB
実行使用メモリ 24,064 KB
最終ジャッジ日時 2024-04-25 10:13:46
合計ジャッジ時間 2,683 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
24,064 KB
testcase_01 AC 82 ms
24,064 KB
testcase_02 AC 78 ms
23,936 KB
testcase_03 AC 309 ms
24,064 KB
testcase_04 AC 305 ms
24,064 KB
testcase_05 AC 299 ms
23,936 KB
testcase_06 AC 188 ms
24,064 KB
testcase_07 AC 71 ms
24,064 KB
testcase_08 AC 69 ms
24,064 KB
testcase_09 AC 71 ms
23,936 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
int isp[5<<20];
main()
{
	for(int i=2;i<5<<20;i++)
	{
		if(!isp[i])
		{
			isp[i]=i;
			for(int j=i+i;j<5<<20;j+=i)
			{
				isp[j]=i;
			}
		}
	}
	int N;cin>>N;
	for(int i=2;;i++)
	{
		int t=i;
		int s=1;
		while(t>1)
		{
			int k=isp[t];
			int c=1;
			while(t%k==0)c++,t/=k;
			s*=c;
			if(s>4)break;
		}
		if(s==4)
		{
			if(!--N)
			{
				cout<<i<<endl;
				return 0;
			}
		}
	}
}
0