来源:CF333A
水题一道,注意输入
代码:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef unsigned long long LL;
LL n;
int main(){
LL ans = 0;
scanf("%lld",&n);
while(n%3==0) n/=3;
ans = n/3+1;
printf("%lld\n",ans);
return 0;
}

本文介绍了一个简单的算法题目及其解决方案。该题目来源于CF333A竞赛,主要涉及整数运算与条件判断。通过一个简洁的C++代码示例展示了如何计算特定整数的处理结果。
1万+

被折叠的 条评论
为什么被折叠?



