Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
73164 sh25_wangsj 开关灯 C++ 通过 0 MS 248 KB 740 2025-11-07 14:37:47

Tests(1/1):


#include <iostream> #include <cstring> using namespace std; int main() { int N, M,x; cin >> N >> M; bool lt[666]; for(int i=1;i<=N;i++){ lt[i]=false; } for(int j=1;j<=M;j++){ x=1; while(x<=N){ if(x%j==0){ if(lt[x]==false){ lt[x]=true; }else{ lt[x]=false; } } x=x+1; } } for(int y=1;y<=N;y++){ if(lt[y]==true){ if(y!=1){ cout<<","<<y; }else{ cout<<y; } } } return 0; }


测评信息: