Description

Input

一行两个整数n; k。

Output

一行一个整数,表示n 个函数第k 层最少能由多少段组成。

Sample Input

1 1

Sample Output

1

HINT

对于100% 的数据满足1 ≤ k ≤ n ≤ 100。

正解:数学

解题报告:

  网上都没有题解,那我也不写了吧。

 //It is made by jump~
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <ctime>
#include <vector>
#include <queue>
#include <map>
#include <set>
using namespace std;
typedef long long LL;
int n,k,ans; inline int getint()
{
int w=,q=; char c=getchar();
while((c<'' || c>'') && c!='-') c=getchar(); if(c=='-') q=,c=getchar();
while (c>='' && c<='') w=w*+c-'', c=getchar(); return q ? -w : w;
} inline void work(){
n=getint(); k=getint(); if(n==) ans=; else ans=min(k,n-k+)*;
printf("%d",ans);
} int main()
{
work();
return ;
}

BZOJ1432 [ZJOI2009]Function的更多相关文章

  1. bzoj千题计划138:bzoj1432: [ZJOI2009]Function

    http://www.lydsy.com/JudgeOnline/problem.php?id=1432 http://blog.sina.com.cn/s/blog_86942b1401014bd2 ...

  2. 【构造】Bzoj1432[ZJOI2009]Function

    Description Input 一行两个整数n; k. Output 一行一个整数,表示n 个函数第k 层最少能由多少段组成. Sample Input 1 1 Sample Output 1   ...

  3. BZOJ1432: [ZJOI2009]Function(找规律)

    Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 1523  Solved: 1128[Submit][Status][Discuss] Descriptio ...

  4. 【BZOJ1432】[ZJOI2009]Function(找规律)

    [BZOJ1432][ZJOI2009]Function(找规律) 题面 BZOJ 洛谷 题解 这...找找规律吧. #include<iostream> using namespace ...

  5. bzoj 1432 [ZJOI2009]Function 思想

    [bzoj1432][ZJOI2009]Function Description Input 一行两个整数n; k. Output 一行一个整数,表示n 个函数第k 层最少能由多少段组成. Sampl ...

  6. BZOJ 1432: [ZJOI2009]Function

    1432: [ZJOI2009]Function Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 1046  Solved: 765[Submit][Sta ...

  7. 1432: [ZJOI2009]Function

    1432: [ZJOI2009]Function Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 710  Solved: 528[Submit][Stat ...

  8. BZOJ 1432: [ZJOI2009]Function(新生必做的水题)

    1432: [ZJOI2009]Function Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 1205  Solved: 895[Submit][Sta ...

  9. bzoj 1432 [ZJOI2009]Function(找规律)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1432 [思路] 找(cha)规(ti)律(jie) 分析戳这儿 click here ...

随机推荐

  1. Bluestacks 使用

    Bluestack介绍 一款能够在PC模拟Android的好用模拟器 官网:http://www.bluestacks.cn/ 早在2012年就使用上它了,但一直未发现他的许多优点,在使用过其它的两款 ...

  2. ArcGis实现添加MultiLayerMarkerSymbol(多个符号叠加生成新的符号)

    , , );             pMarkerSymbol.Angle = ;             pMarkerSymbol.XOffset = ;;;;, , );            ...

  3. 在Centos5下安装GraphicsMagick

    安装GraphicsMagick的流水账: 安装参照的http://www.graphicsmagick.org/INSTALL-unix.html 解压 /home/milton/GraphicsM ...

  4. 动态调用webservice,不需要添加Web References

    using System; using System.Collections.Generic; using System.Web; using System.Net; using System.IO; ...

  5. SQL 数据结构操作语句

    修改字段 exec sp_rename '表名.[字段名]','新字段名','column' alter table tab_info rename column createname to this ...

  6. OSGEARTH三维地形开源项目

    第一章   OSGEarth介绍 第二章   OSGEarth编译环境配置 OSGEarth的编译环境配置随着版本的不同.运行平台的不同,也有很大的差异.本章主要以Windows XP SP3(x86 ...

  7. react-native 的微信SDK辅助包,支持微信登录、微信分享、微信支付

    微信SDK集成示例,现已完成微信授权登录,之后将陆续包装分享等其他功能. ReactNative高级交流群 127482131 或访问  http://blog.1ygowu.com ReactNat ...

  8. Linux第二次学习笔记

    #Linux第二次实验(第三周) 学习目标 熟悉Linux系统下的开发环境 熟悉vi的基本操作 熟悉gcc编译器的基本原理 熟练使用gcc编译器的常用选项 熟练使用gdb调试技术 熟悉makefile ...

  9. 开发一个简单实用的android紧急求助软件

    之前女朋友一个人住,不怎么放心,想找一个紧急求助的软件,万一有什么突发情况,可以立即知道.用金山手机卫士的手机定位功能可以知道对方的位置状态,但不能主动发送求助信息,在网上了很多的APK,都是鸡肋功能 ...

  10. 5.HBase In Action 第一章-HBase简介(1.1.3 HBase的兴起)

    Pretend that you're working on an open source project for searching the web by crawling websites and ...