Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
61560 李星熠 19灯的编号 C++ Accepted 1 MS 292 KB 412 2023-12-10 11:45:40

Tests(10/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int deng[5001] = {0}; int n,m; cin>> n >> m; for(int i = 1; i<= m; i++) { for(int j = 1; j <= n;j++){ if(j % i == 0){ deng[j]++; } } } int suo = 0; for(int j = 1; j <= n; j++){ if(deng[j]%2 == 1 && suo == 0){ cout << j; suo = 1; }else if(deng[j]%2 == 1 && suo == 1){ cout<<","<<j; } } return 0; }