蒟蒻95分求助大佬
查看原帖
蒟蒻95分求助大佬
1356959
zn1412楼主2024/7/28 17:42
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int x,y,z,n,m,c = 0;
    cin>>x>>y>>z>>n>>m;
    for(int i = 0;i <= m;i++){
    	for(int j = 0;j <= m;j++){
    		if(x*i + j*y + (m-i-j) / z == n && i+j+(m-i-j) == m&& (m-i-j) % z == 0)
    			c++;
		}
	}
	cout<<c;
    return 0;
}

输入 1 1 1 100 100 输出 10201 不知道哪错了?

2024/7/28 17:42
加载中...