http://codeforces.com/problemset/problem/334/C
求不能凑整n,和最小,数量最多的数量。
#include<iostream> #include<cstring> #include<cstdio> #include<algorithm> using namespace std; int main() { long long n; scanf("%I64d",&n); while(n%3 == 0) { n /= 3; } printf("%I64d\n",n/3+1); return 0; }
时间: 2024-10-09 09:48:38