题解:P17655 [IO 2025 #1] 丝绸阶梯
我通过的第 200 道橙题!!!
题目大意
有
思路解析
上图蓝色为路径。
仔细思考不难发现,上图的路径是最优的。
观察易得,
所以答案的公式是
代码展示
#include<bits/stdc++.h>
using namespace std;
long long n;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin>>n;
cout<<(n-1)*3+1;
return 0;
}
谢谢观看。