Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
82115 sh25_chenyj 开关灯 C++ 通过 0 MS 256 KB 585 2026-01-10 12:38:44

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int main() { int n,m; cin>>n>>m; int ls[n]; // cout << fixed << setprecision(10) << ce(a); for(int i = 0; i < n; i++){ ls[i] = 1; } for(int j = 0; j < m; j++){ for(int k = 0; k < n; k++){ if((k + 1) % (j + 1) == 0){ ls[k] += 1; } } } int ls2[m][2]; int cnt = 0; for(int l = 0; l < n; l++){ if(ls[l] % 2 == 0){ ls2[cnt][0] = ls[l]; ls2[cnt][1] = l; cnt ++; } } for(int o = 0; o < cnt; o++){ cout<<ls2[o][1] + 1; if(o < cnt - 1){ cout<<","; } } return 0; }


测评信息: