Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
44196 | 承诺 | 开关灯 | C++ | Accepted | 0 MS | 248 KB | 327 | 2024-03-29 15:19:15 |
#include<bits/stdc++.h> using namespace std; int main(){ bool a[5009]={}; int M,N,l; cin>>N>>M; for(int i=1;i<=N;i++) for(int j=1;j<=M;j++) if(i%j==0) a[i]=!(a[i]); for(int i=1;i<=N;i++) if(a[i]){ l=i; break; } cout<<l; for(int i=l+1;i<=N;i++) if(a[i]) cout<<","<<i; return 0; }