已ac

Y  •  3天前


include

using namespace std; int main(){

int n;
cin >> n;
int cnt = 0;
int ans = 0;
while(n){
    cnt++;
    if(!ans && n%3 == 1) ans = cnt;
    n = n - (n+2)/3;
}
cout << cnt <<" " << ans;
return 0;

}


评论:

请先登录,才能进行评论