Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
156456 刘杨国卿 19灯的编号 C++ Accepted 1 MS 276 KB 393 2026-06-28 12:53:13

Tests(10/10):


Code:

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