CF1214B

解法:

暴力枚举,时间复杂度 $ O(n) $

CODE:

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath> using namespace std; #define LL long long
#define N 100010 int r,b,n,ans; int main() {
scanf("%d%d%d",&b,&r,&n);
for(int i = 0 ; i <= n ; i++) {
int j = n - i;
if(i > b) continue;
if(j > r) continue;
ans++;
}
printf("%d \n",ans);
//system("p
return 0;
}

CF1214B的更多相关文章

随机推荐

  1. 十、es6之扩展运算符 三个点(...)

    对象的扩展运算符 对象中的扩展运算符(...)用于取出参数对象中的所有可遍历属性,拷贝到当前对象之中 let bar = { a: 1, b: 2 }; let baz = { ...bar }; / ...

  2. springboot启动流程(七)ioc容器refresh过程(上篇)

    所有文章 https://www.cnblogs.com/lay2017/p/11478237.html 正文 在前面的几篇文章中,我们看到Environment创建.application配置文件的 ...

  3. React实现顶部固定滑动式导航栏(导航条下拉一定像素时显示原导航栏样式)

    摘要 基于react的框架开发一个顶部固定滑动式的酷炫导航栏,当导航栏置顶时,导航栏沉浸在背景图片里:当鼠标滑动滚轮时,导航栏固定滑动并展示下拉样式. JS部分 相关技术栈:react.antd.re ...

  4. Java 之 IDEA 的 Debug 追踪

    使用 IDEA 的断点调试功能,查看程序的运行过程. 1.在有效代码行,点击行号右边的空白区域,设置断点,程序执行到断点将停止,我们可以手动来运行程序 2.点击 Debug 运行模式 3.程序停止在断 ...

  5. No valid host was found. There are not enough hosts available-----openstack建虚拟机直接报错

    目录 No valid host was found. There are not enough hosts available-----openstack建虚拟机直接报错 一.问题现象: 二.解决思 ...

  6. PAT Advanced 1071 Speech Patterns (25 分)

    People often have a preference among synonyms of the same word. For example, some may prefer "t ...

  7. iis深入学习资源

    iis站点:https://www.iis.net/overview/reliability/richdiagnostictools 感兴趣可以深入学习下iis

  8. linux 终端命令学习

    Linux 的版本不同,其终端下命令也有所差异的. cal -y / -d  /-m  查看日历的 free  -m /df -m 查剩余空间的 passwd  -l / -u  用户名 -锁定,解锁 ...

  9. Python自动化测试PO模式

    页面元素定位信息 页面元素定位信息文件 [leadscloud_login] input_user_name = xpath>//*[@id='main']/div/div[2]/div[2]/ ...

  10. [原创]VSCode debug jest的配置

    重拾JS的路从修改JS源码开始,修改JS源码从源码自带的test code开始.源码的test code使用了jtest框架,从test code刚好可以看到要修改部分的 多种传值方式,以及函数输出结 ...