二分!!!

AC代码例如以下:

#include<iostream>
#include<cstring>
#include<cstdio>
#define ll long long
using namespace std; ll n,m,k; ll work(ll a)
{
ll i,j;
ll ans=0;
for(i=1;i<=n;i++)
{
j=a/i;
if(j>m)
j=m;
ans+=j;
}
return ans;
} int main()
{
scanf("%I64d%I64d%I64d",&n,&m,&k);
ll l,r,mid;
l=1;
r=n*m+1;
while(l<r)
{
mid=(l+r)/2;
//cout<<mid<<"!!!!!!!!!!!!!!!!!!!!!!"<<work(mid)<<endl;
if(work(mid)<k) l=mid+1;
else r=mid;
}
cout<<r<<endl;
return 0;
}

CF Codeforces Round #256 (Div. 2) D (448D) Multiplication Table的更多相关文章

  1. 水题 Codeforces Round #308 (Div. 2) A. Vanya and Table

    题目传送门 /* 水题:读懂题目就能做 */ #include <cstdio> #include <iostream> #include <algorithm> ...

  2. Codeforces Round #256 (Div. 2) D. Multiplication Table(二进制搜索)

    转载请注明出处:viewmode=contents" target="_blank">http://blog.csdn.net/u012860063?viewmod ...

  3. Codeforces Round #256 (Div. 2) 题解

    Problem A: A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standar ...

  4. Codeforces Round #256 (Div. 2) D. Multiplication Table 二分法

     D. Multiplication Table time limit per test 1 second memory limit per test 256 megabytes input st ...

  5. Codeforces Round #256 (Div. 2) D. Multiplication Table 很有想法的一个二分

    D. Multiplication Table time limit per test 1 second memory limit per test 256 megabytes input stand ...

  6. CF Codeforces Round #231 (Div. 2)

    http://codeforces.com/contest/394 话说这次CF做的超级不爽,A题一开始交过了,我就没再管,B题还没看完呢,就死困死困的,后来觉得B题枚举一下估计能行,当时是觉得可以从 ...

  7. Codeforces Round #256 (Div. 2) B. Suffix Structures(模拟)

    题目链接:http://codeforces.com/contest/448/problem/B --------------------------------------------------- ...

  8. [cf]Codeforces Round #784(Div 4)

    由于一次比赛被虐得太惨,,生发开始写blog的想法,于是便有了这篇随笔(找了个近期的cf比赛练练手(bushi))第一次写blog,多多包涵. 第二场cf比赛,第一场打的Div2,被虐太惨,所以第二场 ...

  9. Codeforces Round #256 (Div. 2/B)/Codeforces448B_Suffix Structures(字符串处理)

    解题报告 四种情况相应以下四组数据. 给两字符串,推断第一个字符串是怎么变到第二个字符串. automaton 去掉随意字符后成功转换 array 改变随意两字符后成功转换 再者是两个都有和两个都没有 ...

随机推荐

  1. [P1580] yyy loves Easter_Egg I

    Link: P1580 传送门 Solution: 拿来练练字符串的读入: 1.$gets()$相当于$c++$中的$getline()$,但返回值为指针!(无数据时为NULL) (都读入换行符,并将 ...

  2. POJ 2112 Optimal Milking(二分图匹配)

    [题目链接] http://poj.org/problem?id=2112 [题目大意] 给出一些挤奶器,每台只能供给M头牛用,牛和挤奶器之间有一定的距离 现在要让每头牛都挤奶,同时最小化牛到挤奶器的 ...

  3. 【计算几何】【状压dp】Codeforces Round #226 (Div. 2) D. Bear and Floodlight

    读懂题意发现是傻逼状压. 只要会向量旋转,以及直线求交点坐标就行了.(验证了我这俩板子都没毛病) 细节蛮多. #include<cstdio> #include<algorithm& ...

  4. 【模拟】bzoj2760 [JLOI2011]小A的烦恼

    注意细节和初始化. #include<cstdio> #include<string> #include<algorithm> #include<iostre ...

  5. AngularJS的$resource

    $http $http服务是基于$q服务的,提供了promise封装,它接受一个配置对象参数,并返回一个promise对象.同时,它还提供了2个方法用来定义Promise回调:success 和 er ...

  6. 高性能mysql读后感

    1. 事务里的写操作,四种隔离级别,都会加排他锁. 2. 事务里的读操作,前三种隔离级别,不会加锁,最后一种隔离级别,会加共享锁. 3. 上面的写.读操作,都是隐式加的锁.  可以自己显示对读操作进行 ...

  7. jvm-监控指令-jstat

    格式: jstat -<option> <vmid> [<interval> [<count>]] 作用: 查看虚拟机各种运行状态信息.         ...

  8. NDK之HelloWord!

    使用工具:Android Studio 2.2.2 1. 配置local.properties添加NDK路径.    效果:当然,你也可以手输写进去. 2. 项目gradle.properties追加 ...

  9. SQL Server Wait Types Library

    https://www.sqlskills.com/blogs/paul/announcing-the-comprehensive-sql-server-wait-types-and-latch-cl ...

  10. Android 友盟社会化组件-分享实现

    本文章链接地址:http://dev.umeng.com/social/android/share/quick-integration 分享快速集成 1 产品概述 友盟社会化组件,可以让移动应用快速具 ...