Files
python/TangDou/XiTi/1218.cpp

25 lines
381 B
C++
Raw Normal View History

2025-08-30 18:35:01 +08:00
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n; //树的高度
int hour = 0;
int finish = 0;
//hour=1--->3
//hour=2--->3-1
//hour=3--->3-1+3
while (finish < n) {
hour++;
if (hour % 2 > 0) finish += 3;
else finish -= 1;
}
cout << hour << endl;
return 0;
}