为什么只得5分???
查看原帖
为什么只得5分???
1379298
陈小希2013楼主2025/1/18 16:56
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
using namespace std;

int main()
{
	long long n, s, m;
	cin >> n >> s >> m;
	double num = 10000000 / n;
	for (int i = 0; i <= n - m; i++)
	{
		for (int j = 0; j <= m; j++)
		{
			long long sum = num * (n - m) + i + num * j / 2;
			if (sum == s)
			{
				cout << "p" << n - m << "(+" << i << ") f" << j << " l" << m - j;
				return 0;
			}
		}
	}
	return 0;
}
2025/1/18 16:56
加载中...