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