O(logn) 可以二分优化为O(loglogn)
#include<bits/stdc++.h> using namespace std; int main(){ int n, i = 0; cin >> n; for(long long q = 1; n > q; q += pow(3, ++i)); cout << i + 1; return 0; }