n = int(input()) buy = 0 eat = 0 temp = 0 while eat < n: buy += 1 eat += 1 temp +=1 if temp == 3: temp -= 2 eat += 1 print(buy)
感觉这么解也对 好伤心 严重超时了,不会二分法,求助