Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
84110 sh25_linzx 开关灯 C++ 解答错误 0 MS 260 KB 533 2026-02-08 16:56:27

Tests(0/1):


#include<iostream> using namespace std; int ss[10000]; int main(){ int a,b,s=0; cin>>a>>b; bool bb[a]={true}; for(int i=1;i<=b;++i){ for(int j=0;j<a;++j){ if((j+1)%i==0){ if(bb[j]==true) bb[j]=false; else bb[j]=true; } } } for(int j=0;j<a;++j){ if(bb[j]==false){ ss[s]=j; ++s; } } for(int k=0;k<s-1;++k) cout<<ss[k]<<","; cout<<ss[s-1]; return 0; }


测评信息: