CF Codeforces Round #256 (Div. 2) D (448D) Multiplication Table
二分!!!
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的更多相关文章
- 水题 Codeforces Round #308 (Div. 2) A. Vanya and Table
题目传送门 /* 水题:读懂题目就能做 */ #include <cstdio> #include <iostream> #include <algorithm> ...
- Codeforces Round #256 (Div. 2) D. Multiplication Table(二进制搜索)
转载请注明出处:viewmode=contents" target="_blank">http://blog.csdn.net/u012860063?viewmod ...
- Codeforces Round #256 (Div. 2) 题解
Problem A: A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standar ...
- 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 ...
- 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 ...
- CF Codeforces Round #231 (Div. 2)
http://codeforces.com/contest/394 话说这次CF做的超级不爽,A题一开始交过了,我就没再管,B题还没看完呢,就死困死困的,后来觉得B题枚举一下估计能行,当时是觉得可以从 ...
- Codeforces Round #256 (Div. 2) B. Suffix Structures(模拟)
题目链接:http://codeforces.com/contest/448/problem/B --------------------------------------------------- ...
- [cf]Codeforces Round #784(Div 4)
由于一次比赛被虐得太惨,,生发开始写blog的想法,于是便有了这篇随笔(找了个近期的cf比赛练练手(bushi))第一次写blog,多多包涵. 第二场cf比赛,第一场打的Div2,被虐太惨,所以第二场 ...
- Codeforces Round #256 (Div. 2/B)/Codeforces448B_Suffix Structures(字符串处理)
解题报告 四种情况相应以下四组数据. 给两字符串,推断第一个字符串是怎么变到第二个字符串. automaton 去掉随意字符后成功转换 array 改变随意两字符后成功转换 再者是两个都有和两个都没有 ...
随机推荐
- ASP.NET Core 2.2 基础知识(十八) 托管和部署 概述
为了方便演示,以 .NET Core 控制台应用程序讲解. 我们新建一个控制台应用程序,安装 "Newtonsoft.Json" Nuget 包,然后右键点击该项目,选择" ...
- jQuery的实用技巧
1.禁用页面的右键菜单 $(document).ready(function(){ $(document).bind("contextmenu",function(e){ retu ...
- Scrum实施调查案例
什么是敏捷开发方法?什么是SCRUM? 有人在这个字面上下功夫,说敏捷就是反应要灵敏,动作要快捷:有人还在字面上进行延伸,说敏捷就是又好又快,或者就是多快好省:有人说敏捷就是光写代码不写文档:有人觉得 ...
- csdn下载频道 循环登录的解决方法
一直循环登录,明明登录成功,跳转页面后还是无法下载,还是要登录,一直循环. 解决方法是修改密码.看来asp果然是垃圾啊.
- [Contest20171109]函数(lipshitz)
大M正在学习函数的光滑性并对Lipshitz常数非常感兴趣:当一个定义域为$[l,r]$的函数$f$,对于定义域内的任意$x,y$都有$\left|f(x)-f(y)\right|\leq K\cdo ...
- boost 1.57 vs2013 编译
启动vs2013中的命令行注意区分32/64, 进入boost目录, 再次运行 bootstrap.bat 编译: bjam.exe stage --toolset=msvc-12.0 --sta ...
- Swift中结合使用枚举与Switch
定义: 用法:
- 关于数字、数据处理的几个PHP函数汇总
1. / 得到的结果是浮点数 2. % 求余数 3.ceil():得到大于当前数字的整数 $num=3.4; $num=ceil($num); echo $num; 的到的结果是4 $num=3. ...
- Looking deeper into SQL Server using Minidumps
https://blogs.msdn.microsoft.com/sqlcat/2009/09/11/looking-deeper-into-sql-server-using-minidumps/ A ...
- Visual Studio 版本互转工具
Visual Studio 版本互转工具 http://www.cnblogs.com/flydoos/archive/2011/08/20/2146121.html http://www.cnblo ...