Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
160586 Kevin 百鸡问题 C++ Accepted 788 MS 268 KB 609 2026-09-24 15:00:02

Tests(1/1):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n; while(cin >> n) //多组输入 { // x最多100,y最多100,z=100-x-y >=0 for(int x = 0; x <= 100; x++) { for(int y = 0; y <= 100; y++) { int z = 100 - x - y; if(z < 0) continue; // 总花费 5x+3y + z/3 <= n if(5*x + 3*y + z/3.0 <= n) { cout << "x=" << x << ",y=" << y << ",z=" << z << endl; } } } } return 0; }