Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
109129 陈铎文 19灯的编号 C++ Accepted 1 MS 288 KB 308 2025-02-02 11:12:08

Tests(10/10):


Code:

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