求条
查看原帖
求条
1415261
tianyun4188awa楼主2024/12/3 21:21
#include <bits/stdc++.h>
using namespace std; 

bool isqrt(int tmp)
{
	double temp = sqrt(tmp);
	if (temp * temp == tmp) return true;
	return false;
}

int main()
{
	int s, t;
	cin >> s >> t;
	while (t--)
	{
		int x;
		cin >> x;
		if (x >= s && isqrt(x)) cout << "lucky" << endl;
		else if (x < s) cout << s << endl;
		else
		{
			while (x % s != 0) x++;
			cout << x << endl;
		}
	 } 
	return 0;
}


两个WA两个黑
2024/12/3 21:21
加载中...