返回小组 开始 2025-05-21 00:00:00

bq

结束 2025-05-21 20:00:00
Contest is over.
当前 2025-06-06 09:29:37

#include <iostream> using namespace std; int main() { int n; cin >> n; int peaches = 1; // 第n天剩下的桃子数

include

using namespace std;

int main() {

int n;
cin >> n;

int peaches = 1;  // 第n天剩下的桃子数

// 从第n-1天倒推到第1天
for (int day = n; day >= 1; day--) {
    peaches = (peaches + 1) * 2;
}

cout << peaches << endl;
return 0;

}


wyz12345  •  15天前

比赛已结束。