CF1080A Petya and Origami 题解】的更多相关文章

Content 小 P 想给 \(n\) 位朋友各发一张邀请函,每张邀请函需要耗费 \(2\) 张红色纸,\(5\) 张绿色纸和 \(8\) 张蓝色纸.商店里面的纸是一堆一堆卖的,每堆里面有 \(k\) 张只含有红.绿.蓝三种颜色中的一个颜色的纸.求小 P 至少要买多少堆. 数据范围:\(1\leqslant n,k\leqslant 10^8\). Solution 直接看每种颜色需要多少堆,由于只能一堆一堆地买,所以只能多买,不能少买,因此答案就很显而易见了,分别是 \(\left\lcei…
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 <io…
Petya is having a party soon, and he has decided to invite his nn friends. He wants to make invitations in the form of origami. For each invitation, he needs two red sheets, five green sheets, and eight blue sheets. The store sells an infinite number…
Content 请找出一个由 \(n\) 个正整数组成的数列 \(\{a_1,a_2,\dots,a_n\}\),满足以下两种条件: \(\sum\limits_{i=1}^na_i^2\geqslant x\). \(\sum\limits_{i=1}^na_i\leqslant y\). 数据范围:\(1\leqslant n\leqslant 10^5\),\(1\leqslant x\leqslant 10^{12}\),\(1\leqslant y\leqslant 10^6\). S…
题解 CF1080A [Petya and Origami] 这道题其实要我们求的就是 \[\lceil 2*n/k \rceil + \lceil 5*n/k \rceil + \lceil 8*n/k \rceil\] 然后就做完了 # include <bits/stdc++.h> # define ll long long int main() { ll n, k; scanf("%lld%lld", &n, &k); ll ans = ((2 *…
这场比赛手速场+数学场,像我这样读题都读不大懂的蒟蒻表示呵呵呵. 第四题搞了半天,大概想出来了,但来不及(中途家里网炸了)查错,于是我交了两次丢了100分.幸亏这次没有掉rating. 比赛传送门:https://codeforces.com/contest/1080. A.Petya and Origami 题意:Petya要发出n张邀请函,每张请函需要2张红纸,5张绿纸,8张蓝纸.现在商店里有一些不同颜色的笔记本,每本中有k张颜色相同的纸,求最少要买几本笔记本. 这题就是一道模拟题,算出每种…
A. Petya and Origamitime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetya is having a party soon, and he has decided to invite his n friends. He wants to make invitations in the form of origami. Fo…
A. Petya and Origami time limit per test  1 second   memory limit per test  256 megabytes input standard input output standard output Petya is having a party soon, and he has decided to invite his nn friends. He wants to make invitations in the form…
A. Petya and Origami Water. #include <bits/stdc++.h> using namespace std; #define ll long long ll n, k; ll Get(ll x) { ? (x * n) / k : (x * n) / k + ; } int main() { while (scanf("%lld%lld", &n, &k) != EOF) { ll res = Get() + Get()…
[题解]折纸 origami [SCOI2007] [P4468] [Bzoj1074] 传送门:折纸 \(\text{origami [SCOI2007] [P4468]}\) \(\text{[Bzoj1074]}\) [题目描述] 初始有一个 \(100*100\) 的正方形纸片,现给出 \(n\) \((0 \leqslant n \leqslant 8)\) 条直线,将该纸片依次按照直线进行折叠,结束后会给出 \(m\) 个询问,每次询问求某个坐标上的点穿过了几层纸. [分析] [计算…