呸,大傻逼题,我更傻逼ref

  1. #include <iostream>
  2. using namespace std;
  3. typedef long long ll;
  4. ll n, k, m, d, ans;
  5. int main(){
  6. cin>>n>>k>>m>>d;
  7. for(int i=1; i<=d; i++){
  8. ll x=n/(k*(i-1)+1);
  9. if(x==0) break;
  10. x = min(x, m);
  11. ll tms=n/x;
  12. if(tms<(i-1)*k+1) continue;
  13. ans = max(ans, i*x);
  14. }
  15. cout<<ans<<endl;
  16. return 0;
  17. }

cf965c Greedy Arkady的更多相关文章

  1. C. Greedy Arkady

    kk people want to split nn candies between them. Each candy should be given to exactly one of them o ...

  2. 「日常训练」Greedy Arkady (CFR476D2C)

    不用问为啥完全一致,那个CSDN的也是我的,我搬过来了而已. 题意(Codeforces 965C) $k$人分$n$个糖果,每个糖果至多属于1个人.A某人是第一个拿糖果的.(这点很重要!!) 他$x ...

  3. 【Codeforces Round #476 (Div. 2) [Thanks, Telegram!] C】Greedy Arkady

    [链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 枚举那个人收到了几次糖i. 最好的情况显然是其他人都只收到i-1次糖. 然后这个人刚好多收了一次糖 也即 (i-1)kx + x & ...

  4. Codeforces Round #476 (Div. 2) [Thanks, Telegram!] ABCDE

    修仙场,没脑子,C边界判错一直在写mdzz..D根本没怎么想. 第二天起来想了想D这不是水题吗立马A了.看了看E一开始想分配问题后来发觉想岔了,只需要每次都把树最后分配的点移到最前面就好了. A. P ...

  5. USACO . Greedy Gift Givers

    Greedy Gift Givers A group of NP (2 ≤ NP ≤ 10) uniquely named friends has decided to exchange gifts ...

  6. hdu4976 A simple greedy problem. (贪心+DP)

    http://acm.hdu.edu.cn/showproblem.php?pid=4976 2014 Multi-University Training Contest 10 1006 A simp ...

  7. ACM Greedy Mouse

    Greedy Mouse 时间限制:1000 ms  |  内存限制:65535 KB 难度:3   描述 A fat mouse prepared M pounds of cat food,read ...

  8. hdu 1053 (huffman coding, greedy algorithm, std::partition, std::priority_queue ) 分类: hdoj 2015-06-18 19:11 22人阅读 评论(0) 收藏

    huffman coding, greedy algorithm. std::priority_queue, std::partition, when i use the three commente ...

  9. Greedy

    在现实世界中,有这样一类问题:它有n个输入,而它的解就由这n个输入的某个子集组成,不过这个子集必须满足某些事先给定的条件.把那些必须满足的条件称为约束条件:而把满足约束条件的子集称为该问题的可行解.问 ...

随机推荐

  1. 快速获取雪碧图的图标样式插件 - gulp-css-spriter教程

    如何快速把合成好的雪碧图,快速获取图标的样式呢? 用gulp-css-spriter很简单. 第一步: 在某个文件夹用shitf+鼠标右键 第二步: npm install gulp-css-spri ...

  2. java.lang.IllegalArgumentException: Document base F:\personal\projects\annoMVC\web does not exist or is not a readable directory

    tomcat明明在d盘,怎么到F盘了...纳闷啊... 解决办法: 1停掉Tomcat服务2把/conf/Catalina/localhost下的文件删除掉(我在这个文件夹里发现了一个xml,指向了F ...

  3. pandas error记录随笔

    1.sys:1: DtypeWarning: Columns (0,1) have mixed types. Specify dtype option on import or 解决办法:PANDAS ...

  4. C++ 宏定义的简单使用

    1.定义常量 #define ARRMAX 50 int arr[ARRMAX]; (这种做法不如直接用const来直接定义常量.) 2.代替模板函数或者内联函数,将函数定义成宏.执行效率很快 #de ...

  5. SQL重复记录查询-count与group by having结合查询重复记录

    查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断select * from peoplewhere peopleId in (select  peopleId  from  p ...

  6. Sqlserver列出所有数据库名,表名,字段名【转】

    1.获取所有数据库名: SELECT Name FROM Master..SysDatabases ORDER BY Name 注意: 表Master与SysDatabases之间有两个点 2.获取所 ...

  7. GIT教程笔记

    GIT的工作流程: 先在工作目录中添加.修改文件 一般是在工作目录建立你的工程文件夹,然后通过命令行进入文件夹后  git init 初始化 将需要进行版本管理的文件放入缓存区  git add 文件 ...

  8. Tarjan在图论中的应用(一)——用Tarjan来实现强连通分量缩点

    前言 \(Tarjan\)是一个著名的将强连通分量缩点的算法. 大致思路 它的大致思路就是在图上每个联通块中任意选一个点开始进行\(Tarjan\)操作(依据:强连通分量中的点可以两两到达,因此从任意 ...

  9. python_60_装饰器3

    #嵌套函数 def foo(): print('in the foo') def bar(): print('in the bar') bar() #bar()#出错,无法在外边调用,bar函数的作用 ...

  10. IntelliJ IDEA中激活JRebel插件

    1. 下载激活软件:https://github.com/ilanyu/ReverseProxy/releases/tag/v1.0 我下载的是 2. 双击文件运行 3. 点击change licen ...