- 开关灯
为什么样例过了,测试点没过
- 2023-11-1 17:57:05 @
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a[35243],n,m,Max=0;
cin>>n>>m;
for(int i=0;i<35243;i++)a[i]=-1;
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)if((j+1)%(i+1)==0)a[j]*=-1;
}
for(int i=0;i<m;i++)
{
if(a[i]==1)
{
if(Max<=i)Max=i;
}
}
for(int i=0;i<m;i++)
{
if(a[i]==1)
{
printf("%d",i+1);
if(i<Max)
{
cout<<',';
}
}
}
return 0;
}
0 comments
No comments so far...
Information
- ID
- 594
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 6
- Tags
- (None)
- # Submissions
- 129
- Accepted
- 41
- Uploaded By