You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#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;
|
|
}
|