全MLE,为什么,求调
查看原帖
全MLE,为什么,求调
778070
tall_buildin楼主2024/7/24 17:31
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
ll n;
int mi(ll m){
    int i=0,t=1;
    while (t*2<=m){
        t*=2;
        i++;
    }
    if (i==0) cout<<"2(0)";
    if (i==1) cout<<"2";
    if (i==2) cout<<"2(2)";
    if (i>2){
    	cout<<"2"<<"(";
		mi(i); 
		cout<<")";
    }
    if (m-t>0) {
        cout<<"+";
        mi(m-t);
    }
}

int main(){
    cin>>n;
    mi(n);
    return 0;
}
2024/7/24 17:31
加载中...