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 改变随意两字符后成功转换 再者是两个都有和两个都没有 ...
随机推荐
- 3Sum Smaller -- LeetCode
Given an array of n integers nums and a target, find the number of index triplets i, j, k with 0 < ...
- 【动态规划】Gym - 101147H - Commandos
裸dp,看代码. #include<cstdio> #include<algorithm> #include<cstring> using namespace st ...
- 【计算几何】【极角序】【前缀和】bzoj1132 [POI2008]Tro
把点按纵坐标排序,依次枚举,把它作为原点,然后把之后的点极角排序,把叉积的公式稍微化简一下,处理个后缀和统计答案. #include<cstdio> #include<cmath&g ...
- 9.1(java学习笔记)正则表达式
一.正则表达式 1.1正则表达式 正则表达式是描述一种规则,通过这个规则可以匹配到一类字符串. 2.1正则语法 2.1.1普通字符:字母.数字.下划线.汉字以及没有特殊意义的符号都是普通字符. 正则表 ...
- Exercise01_09
public class S{ public static void main(String[] args){ double w=4.5; double h=7.9; double d; double ...
- Spring的Aop 注解配置
1,导包 2,准备目标对象 package com.songyan.anno; public interface UserService { void save(); void delete(); v ...
- SpringMVC实现操作的第二种方式
一: 运行效果: 点击提交之后显示效果 二: (1).web.xml <?xml version="1.0" encoding="UTF-8"?> ...
- touch: cannot touch ‘/var/jenkins_home/copy_reference_file.log’: Permission denied Can not write to /var/jenkins_home/copy_reference_file.log. Wrong volume permissions?
问题:在从 https://c.163.com/hub#/m/repository/?repoId=3093 下载镜像 docker pull hub.c.163.com/library/jenkin ...
- ES6/ES2015核心内容(下)
import export 这两个家伙对应的就是es6自己的module功能. 我们之前写的Javascript一直都没有模块化的体系,无法将一个庞大的js工程拆分成一个个功能相对独立但相互依赖的小工 ...
- [转载]centos 6.4中git如何正常显示中文
FROM: http://ju.outofmemory.cn/entry/63250 系统版本:centos 6.4 git版本:1.7.1,使用yum直接安装的. 当使用git status查看时, ...