| 记录编号 | 583975 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 3927.[CSP 2023J]小苹果 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.000 s | ||
| 提交时间 | 2023-10-25 20:03:28 | 内存使用 | 0.00 MiB | ||
#include <bits/stdc++.h>
using namespace std;
int n,s,ans;
bool f;
int main(){
freopen("apple.in","r",stdin);
freopen("apple.out","w",stdout);
scanf("%d",&n);
while(n){
int l = (n-1)/3;
if(!f && 3*l+1 == n){
ans = s+1;
f = 1;
}
n = n-l-1;
s++;
}
printf("%d %d\n",s,ans);
return 0;
}