2 条题解

  • 2
    @ 2024-6-2 10:40:06

    #include<bits/stdc++.h> using namespace std; int a[10400]; int main(){ int n,k; cin>>n>>k; for(int d=1;d<=n;d++){ a[d]=2; } for(int i=2;i<=k;i++){ for(int d=1;d<=n;d++){ if(d%i0){ a[d]++; } } } for(int m=1;m<=n;m++){ if(a[m]%20){ cout<<m<<" "; } } return 0; }

    • 1
      @ 2024-5-30 9:02:29
      #include<bits/stdc++.h>
      using namespace std;
      int a[1001];
      int main(){
      	int n,k;
      	cin>>n>>k;
      	for(int i=2;i<=k;i++)
      	{
      		for(int j=1;j<=n;j++)
      		{
      			if(j%i==0)  a[j]=!a[j];
      		}
      	}
      	for(int i=1; i<=n; i++)
      	{
      		if(a[i]==0) cout<<i<<" ";
      	}
      	return 0;
      } 
      
      • 1

      信息

      ID
      2196
      时间
      1000ms
      内存
      256MiB
      难度
      3
      标签
      递交数
      82
      已通过
      50
      上传者