BZOJ1432 [ZJOI2009]Function
Description

Input
Output
Sample Input
Sample Output
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的更多相关文章
- bzoj千题计划138:bzoj1432: [ZJOI2009]Function
http://www.lydsy.com/JudgeOnline/problem.php?id=1432 http://blog.sina.com.cn/s/blog_86942b1401014bd2 ...
- 【构造】Bzoj1432[ZJOI2009]Function
Description Input 一行两个整数n; k. Output 一行一个整数,表示n 个函数第k 层最少能由多少段组成. Sample Input 1 1 Sample Output 1 ...
- BZOJ1432: [ZJOI2009]Function(找规律)
Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 1523 Solved: 1128[Submit][Status][Discuss] Descriptio ...
- 【BZOJ1432】[ZJOI2009]Function(找规律)
[BZOJ1432][ZJOI2009]Function(找规律) 题面 BZOJ 洛谷 题解 这...找找规律吧. #include<iostream> using namespace ...
- bzoj 1432 [ZJOI2009]Function 思想
[bzoj1432][ZJOI2009]Function Description Input 一行两个整数n; k. Output 一行一个整数,表示n 个函数第k 层最少能由多少段组成. Sampl ...
- BZOJ 1432: [ZJOI2009]Function
1432: [ZJOI2009]Function Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 1046 Solved: 765[Submit][Sta ...
- 1432: [ZJOI2009]Function
1432: [ZJOI2009]Function Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 710 Solved: 528[Submit][Stat ...
- BZOJ 1432: [ZJOI2009]Function(新生必做的水题)
1432: [ZJOI2009]Function Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 1205 Solved: 895[Submit][Sta ...
- bzoj 1432 [ZJOI2009]Function(找规律)
[题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=1432 [思路] 找(cha)规(ti)律(jie) 分析戳这儿 click here ...
随机推荐
- DragRigidbody2D
组件源码 using UnityEngine; using System.Collections; //This script allows to drag rigidbody2D elements ...
- IEnumerable和IEnumerator 详解 (转)
原文链接:http://blog.csdn.net/byondocean/article/details/6871881 参考链接:http://www.cnblogs.com/hsapphire/a ...
- Android的Drawable缓存机制源码分析
Android获取Drawable的方式一般是Resources.getDrawable(int),Framework会返回给你一个顶层抽象的Drawable对象.而在Framework中,系统使用了 ...
- Java中的IO流系统详解(转载)
摘要: Java 流在处理上分为字符流和字节流.字符流处理的单元为 2 个字节的 Unicode 字符,分别操作字符.字符数组或字符串,而字节流处理单元为 1 个字节,操作字节和字节数组. Java ...
- no.1
#import requests import urllib import bs4 try: html=urllib.urlopen('http://anyun.org') except HTTPer ...
- Unity小知识
这些是我在开发时遇到的一些问题: 2D的碰撞器和3D的碰撞器是没有任何物理反应的,必须是2D对2D,3D对3D 碰撞器Collision包含触发物体的速度等信息,触发器没有
- ES5基础01:正则表达式
1.功能 匹配特定模式:比如匹配手机号码,匹配身份证号码等 替换文本:比如将input中的空格全部去掉 提取字符串:将特定的字符串提取出来 2.语法
- sqlalchemy 的 raw sql 方式使用示例
#获取数据库 from sqlalchemy import create_engine db = create_engine("sqlite:///:memory:", echo= ...
- JS之apply,call,bind区别
为了加深对基础知识的理解,今天再复习下js中的apply,call,bind的区别和用法.整理笔记的过程也是一个再次学习的过程. apply和call js中的调用apply和call方法可以改变某个 ...
- 三种实例化委托的方式(C# 编程指南)
1.定义的委托和方法 delegate void TestDelegate(string s); static void M(string s) { Console.WriteLine(s); } 2 ...