| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160615 | 罗钰帆 | 19灯的编号 | C++ | Accepted | 1 MS | 292 KB | 617 | 2026-09-24 19:25:48 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int a[5000]={0},m=0,n=0; cin>>n>>m; for(int i=2;i<=m;i++){ for(int j=i;j<=n;j+=i){ if(a[j]==0) a[j]=1; else if(a[j]==1) a[j]=0; } } cout<<1; for(int i=2;i<=n;i++){ if(a[i]==0){ cout<<","<<i; } } return 0; }