1 条题解

  • 1
    @ 2024-11-24 11:26:33
    #include<iostream>
    using namespace std;
    int main(){
    	int n;
    	cin >> n;
    	int sum , z;
    	bool a = true;
    	for(int i = 0 ; i <= n ; i ++){
    		for(int j = 0 ; j <= n ; j ++){
    			for(int x = 0 ; x <= n ; x ++){
    				sum = i * 5 + j * 3 + x / 3;
    				z = i + j + x;
    				if(sum == n && z == n && x % 3 == 0){
    					cout << i << " " << j << " " << x << endl;
    					a = false;
    				}	
    			}
    		}	
    	}
    	if(a){
    		cout << "No Answer.";
    	}
    	return 0;
    }
    

    信息

    ID
    59
    时间
    1000ms
    内存
    256MiB
    难度
    6
    标签
    递交数
    136
    已通过
    44
    上传者