直觉。

先走$1$走到$n$,然后从$n$走到$2$,然后从$2$走到$n-1$,然后从$n-1$走到$3$。一次花费为$0$,一次花费为$1$。

#include <cstdio>
#include <cmath>
#include <set>
#include <cstring>
#include <algorithm>
using namespace std; int n; int main()
{
scanf("%d",&n); int L=2,R = n;
int ans=0; while(1)
{
if(L>=R) break;
ans++;
L++; R--;
} printf("%d\n",ans); return 0;
}

最新文章

  1. cordova iOS blank iframe iphone iframe 白屏 ios iframe 白屏
  2. [PHP]使用PHPMailer发送带附件并支持HTML内容的邮件
  3. 【redis】redis 在 windows 下安装使用
  4. C# sql语句拼接时 like情况的防sql注入的用法
  5. 最大似然估计 (MLE) 最大后验概率(MAP)
  6. Shell实现跳板机,为什么用跳板机
  7. 编程之美 3.1 字符串移位包含问 复杂度(O(N*K)
  8. 新版的DEV RichEdit很强悍,兼容docx,排版更强
  9. 配置CAS错误No Certificate file specified or invalid file format
  10. Linux系列教程(四)——Linux文件和目录处理命令
  11. python基础----特性(property)、静态方法(staticmethod)、类方法(classmethod)、__str__的用法
  12. React native 中使用Fetch请求数据
  13. SQL脚本--总耗CPU最多的前个SQL --平均耗CPU最多的前个SQL
  14. Intellij IDEA超好用的快捷键
  15. CentOS系统找不到setup命令工具的解决方法
  16. 3 第一个Django应用 第2部分(管理站点)
  17. jeecg开源项目的IDEA的部署
  18. django+xadmin+echarts实现数据可视化
  19. 交叉验证(CrossValidation)方法思想简介[zz]
  20. 性能分析之– JAVA Thread Dump 分析

热门文章

  1. spring mvc入门配置
  2. 「LibreOJ β Round #4」游戏
  3. UVA 1647 Computer Transformation
  4. BZOJ2588:LCA+主席树来实现树上两点之间第K大点权查询
  5. atcoder #082 E 暴力 计算几何
  6. JavaScript arguments你不知道的秘密
  7. 【BZOJ】2120: 数颜色 带修改的莫队算法
  8. 【AtCoder】ARC086 E - Smuggling Marbles
  9. Windows.event
  10. JS设计模式——3.封装与信息隐藏