Run ID:61561

提交时间:2023-12-10 11:46:11

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