Run ID:77076

提交时间:2024-06-08 11:50:15

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