Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
58718 | teacher_wang | 百鸡问题 | C++ | Accepted | 0 MS | 240 KB | 375 | 2024-12-14 20:12:53 |
#include<bits/stdc++.h> using namespace std; int main() { int x,y,z,n,m,cnt=0; cin>>x>>y>>z>>n>>m; for(int a = 0; a <= m; a ++) { for(int b = 0; b <= m -a; b ++) { int c = m - a - b; if(c >= 0 && c%z == 0 && x*a+y*b+c/z == n) cnt ++; } } cout<<cnt; return 0; }