1 条题解

  • 1
    @ 2026-8-18 16:59:13

    #include <bits/stdc++.h> using namespace std;

    int main() { int n,m; cin >> n >> m;

    for(int x=0;x <= min(n/5+1,m);x++){
    	for(int y=0;y <= min(n/3+1,m-x);y++){
    		if(5*x+3*y+(m-x-y)/3.0 == n) cout << x << ' ' << y << ' ' << m-x-y << endl;
    	}
    }
    
    return 0;
    

    }

    信息

    ID
    30083
    时间
    1000ms
    内存
    256MiB
    难度
    6
    标签
    递交数
    82
    已通过
    24
    上传者