1 条题解

  • 0
    @ 2025-11-23 15:13:04

    GOOD\LARGE GOOD

    #define writen by Neo
    #include <bits/stdc++.h>
    using namespace std;
    void d(int x){
    	bool flag = false;
    	while (x != 0){
    		int t = int(log2(x));
    		if (flag) cout << "+";
    		if (t == 1) cout << "2";
    		else if (t == 0) cout << "2(0)"; 
    		else
    		{
    			cout << "2(";
    			d(t);
    			cout << ")";
    		}
    		x -= pow(2,t); 
    		flag = true;
    	}
    }
    int main(){
    	int a;
    	cin>>a;
    	d(a);
    	return 0;
    }
    

    信息

    ID
    10
    时间
    1000ms
    内存
    125MiB
    难度
    3
    标签
    递交数
    2
    已通过
    2
    上传者