Submission #23500424


Source Code Expand

#include<bits/stdc++.h>

#define ll long long 

using namespace std;

int read()
{
	int a=0,f=1,c=getchar();
	while(!isdigit(c))
	{
		if(c=='-')f=-1;
		c=getchar();
	}
	while(isdigit(c))
	{
		a=a*10+c-'0';
		c=getchar();
	}
	return a*f;
}

int main()
{
//	freopen("1.in","r",stdin);
	
	int n=read()-3;
	vector<int> ans;
	
	ans.push_back(2*3);
	ans.push_back(2*5);
	ans.push_back(3*5);
	
	for(int i=1;i<=10000 && n>0;++i)if(i!=2*3 && i!=2*5 && i!=3*5)
	{
		int cnt=0;
		if(i%2==0)++cnt;
		if(i%3==0)++cnt;
		if(i%5==0)++cnt;
		if(cnt>=2)
		{
			ans.push_back(i);
			--n;
		}
	}
	
	for(int i=0;i<(int)ans.size();++i)printf("%d ",ans[i]);
	puts("");
	
	return 0;
}

Submission Info

Submission Time
Task C - Coprime Set
User WhereIsDodoco
Language C++ (GCC 9.2.1)
Score 500
Code Size 711 Byte
Status AC
Exec Time 10 ms
Memory 3660 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 1
AC × 14
Set Name Test Cases
Sample 01_sample_01.txt
All 01_sample_01.txt, 02_small_01.txt, 02_small_02.txt, 02_small_03.txt, 02_small_04.txt, 02_small_05.txt, 02_small_06.txt, 02_small_07.txt, 03_rand_01.txt, 03_rand_02.txt, 03_rand_03.txt, 03_rand_04.txt, 03_rand_05.txt, 04_max_01.txt
Case Name Status Exec Time Memory
01_sample_01.txt AC 8 ms 3596 KiB
02_small_01.txt AC 2 ms 3636 KiB
02_small_02.txt AC 2 ms 3512 KiB
02_small_03.txt AC 2 ms 3576 KiB
02_small_04.txt AC 2 ms 3652 KiB
02_small_05.txt AC 1 ms 3660 KiB
02_small_06.txt AC 2 ms 3632 KiB
02_small_07.txt AC 4 ms 3636 KiB
03_rand_01.txt AC 2 ms 3608 KiB
03_rand_02.txt AC 7 ms 3516 KiB
03_rand_03.txt AC 10 ms 3628 KiB
03_rand_04.txt AC 10 ms 3560 KiB
03_rand_05.txt AC 5 ms 3604 KiB
04_max_01.txt AC 7 ms 3532 KiB