A. Petya and Origami

题目链接:https://codeforc.es/contest/1080/problem/A

题意:

给出n,k,k表示每个礼品里面sheet的数量(礼品种类可以不同),现在给n位朋友送礼,每位朋友需要2个xx,5个xx,8个xx,问最少需要买多少礼品。

题解:

水过~

代码如下:

#include <cstring>
#include <cstdio>
#include <algorithm>
#include <iostream>
using namespace std; typedef long long ll;
ll n,k; int main(){
cin>>n>>k;
ll r = *n,g = *n,b = *n;
ll ans = r/k+(r%k!=)+g/k+(g%k!=)+b/k+(b%k!=);
cout<<ans;
}

Codeforces Round #524 (Div. 2) A. Petya and Origami的更多相关文章

  1. Codeforces Round #524 (Div. 2)(前三题题解)

    这场比赛手速场+数学场,像我这样读题都读不大懂的蒟蒻表示呵呵呵. 第四题搞了半天,大概想出来了,但来不及(中途家里网炸了)查错,于是我交了两次丢了100分.幸亏这次没有掉rating. 比赛传送门:h ...

  2. Codeforces Round #524 (Div. 2)

    A. Petya and Origamitime limit per test1 secondmemory limit per test256 megabytesinputstandard input ...

  3. Codeforces Round #524 (Div. 2) Solution

    A. Petya and Origami Water. #include <bits/stdc++.h> using namespace std; #define ll long long ...

  4. Codeforces Round #524 (Div.2)题解

    题解 CF1080A [Petya and Origami] 这道题其实要我们求的就是 \[\lceil 2*n/k \rceil + \lceil 5*n/k \rceil + \lceil 8*n ...

  5. Codeforces Round #425 (Div. 2) B. Petya and Exam(字符串模拟 水)

    题目链接:http://codeforces.com/contest/832/problem/B B. Petya and Exam time limit per test 2 seconds mem ...

  6. Codeforces Round #425 (Div. 2) B - Petya and Exam

    地址:http://codeforces.com/contest/832/problem/B 题目: B. Petya and Exam time limit per test 2 seconds m ...

  7. Codeforces Round #510 (Div. 2) D. Petya and Array(树状数组)

    D. Petya and Array 题目链接:https://codeforces.com/contest/1042/problem/D 题意: 给出n个数,问一共有多少个区间,满足区间和小于t. ...

  8. Codeforces Round #524 (Div. 2) F. Katya and Segments Sets(主席树)

    https://codeforces.com/contest/1080/problem/F 题意 有k个区间,区间的种类有n种,有m个询问(n,m<=1e5,k<=3e5),每次询问a,b ...

  9. Codeforces Round #524 (Div. 2) E. Sonya and Matrix Beauty(字符串哈希,马拉车)

    https://codeforces.com/contest/1080/problem/E 题意 有一个n*m(<=250)的字符矩阵,对于每个子矩阵的每一行可以任意交换字符的顺序,使得每一行每 ...

随机推荐

  1. 002---Python基本数据类型--字符串

    字符串 .caret, .dropup > .btn > .caret { border-top-color: #000 !important; } .label { border: 1p ...

  2. ChipScope软件使用

    内容组织 1.建立工程  2.插入及配置核  2.1运行Synthesize  2.2新建cdc文件  2.3 ILA核的配置  3. Implement and generate programmi ...

  3. Oracle错误记录

    1 SQLPlus无法登陆oracle,PLSql可以登陆,报错ORA-12560 环境变量 右击计算机属性-->高级系统设置-->高级-->环境变量-->系统变量--> ...

  4. Scala继承

    override重写 为什么要用override关键字?因为这样更清楚,不容易出错,比如打错字了,就没覆盖成功,但是不会报错 override可以覆盖feild和method class Person ...

  5. P2340 奶牛会展(状压dp)

    P2340 奶牛会展 题目背景 奶牛想证明它们是聪明而风趣的.为此,贝西筹备了一个奶牛博览会,她已经对N 头奶牛进行 了面试,确定了每头奶牛的智商和情商. 题目描述 贝西有权选择让哪些奶牛参加展览.由 ...

  6. linux shell中读写操作mysql数据库

    本文介绍了如何在shell中读写mysql数据库.主要介绍了如何在shell 中连接mysql数据库,如何在shell中创建数据库,创建表,插入csv文件,读取mysql数据库,导出mysql数据库为 ...

  7. android开源项目之OTTO事件总线(二)官方demo解说

    官方demo见  https://github.com/square/otto 注意自己该编译版本为2.3以上,默认的1.6不支持match_parent属性,导致布局文件出错. 另外需要手动添加an ...

  8. howto:在构建基于debian的docker基础镜像时,更换国内包源

    debian经常被用作构建应用镜像的基础镜像,如微软在构建linux下的dotnetcore基础镜像时,提供了基于debian 8(jessie)和debian 9(stretch)的镜像. 由于这些 ...

  9. scidb

    貌似是给科学家用的数据库,暂不研究

  10. Android OpenStreetMap(OSM) 使用 osmbonuspack 进行导航

    关于OpenStreetMap的介绍,国内还是很少,csdn上面有一篇,写的不错,我也就不再做重复的事情了. 这里贴出链接地址:http://blog.csdn.net/mad1989/article ...