Codeforces Round 585
Codeforces Round 585
浅论如何发现自己是傻子的……
反正今天是完全蒙的,水了签到题就跑了……
A. Yellow Cards
签到题。
众所周知,CF的签到题一般是一道神神奇奇的数学题。思路2s出,细节一大堆……
当然,这个做法的时间复杂度并不优秀……
#include<bits/stdc++.h>
using namespace std;
int a1,a2,k1,k2,n,n1,n2,mmin,mmax;
int p[2010];
int main()
{
scanf("%d%d%d%d%d",&a1,&a2,&k1,&k2,&n);
n1=n;
n2=n;
for(int i=1;i<=a1;i++) {
p[i]=k1;
}
for(int i=1;i<=a2;i++) {
p[a1+i]=k2;
}
sort(p+1,p+a1+a2+1);
for(int i=1;i<=a1+a2;i++) {
if(n1-p[i]>=0) {
mmax++;
n1-=p[i];
}
else {
break;
}
}
for(int i=a1+a2;i>=1;i--) {
if(n2-p[i]+1>=0) {
n2-=(p[i]-1);
}
else {
break;
}
if(i==1) {
mmin=n2;
}
}
printf("%d %d",mmin,mmax);
return 0;
}
B. The Number of Products
死活不会做,弄了个前缀积,却发现不知道如何遍历。还一门心思去弄双指针……
C. Swap Letters
D. Ticket Game
E. Marbles
F. Radio Stations
耻辱啊,耻辱……
Codeforces Round 585的更多相关文章
- Codeforces Round #585 (Div. 2) D. Ticket Game
链接: https://codeforces.com/contest/1215/problem/D 题意: Monocarp and Bicarp live in Berland, where eve ...
- Codeforces Round #585 (Div. 2) C. Swap Letters
链接: https://codeforces.com/contest/1215/problem/C 题意: Monocarp has got two strings s and t having eq ...
- Codeforces Round #585 (Div. 2) B. The Number of Products(DP)
链接: https://codeforces.com/contest/1215/problem/B 题意: You are given a sequence a1,a2,-,an consisting ...
- Codeforces Round #585 (Div. 2) A. Yellow Cards(数学)
链接: https://codeforces.com/contest/1215/problem/A 题意: The final match of the Berland Football Cup ha ...
- B. The Number of Products(Codeforces Round #585 (Div. 2))
本题地址: https://codeforces.com/contest/1215/problem/B 本场比赛A题题解:https://www.cnblogs.com/liyexin/p/11535 ...
- A. Yellow Cards ( Codeforces Round #585 (Div. 2) 思维水题
---恢复内容开始--- output standard output The final match of the Berland Football Cup has been held recent ...
- Codeforces Round #585 (Div. 2)
https://www.cnblogs.com/31415926535x/p/11553164.html 感觉很硬核啊这场,,越往后越做不动,,,emmmm,,,(这场是奔着最后一题 2sat 来的, ...
- Codeforces Round #585 (Div. 2) [补题]
前言 2019.9.16 昨天下午就看了看D题,没有写对,因为要补作业,快点下机了,这周争取把题补完. 2019.9.17 这篇文章或者其他文章难免有错别字不被察觉,请读者还是要根据意思来读,不要纠结 ...
- Codeforces Round #585 (Div. 2) E. Marbles (状压DP)
题目:https://codeforc.es/contest/1215/problem/E 题意:给你一个序列,你可以交换相邻的两个数,要达到一个要求,所有相同的数都相邻,问你交换次数最少是多少 思路 ...
随机推荐
- 【Leetcode_easy】925. Long Pressed Name
problem 925. Long Pressed Name solution1: class Solution { public: bool isLongPressedName(string nam ...
- Sed之大小写转换
使用sed进行大小写转换 大写转小写 echo "ABCD"|sed 's#[A-Z]#\l&#g' 小写转大写 echo "abcd"|sed 's# ...
- http响应时长分析
curl -o /dev/null -s -w "time_namelookup:%{time_namelookup}::time_connect:%{time_connect}::time ...
- etcd学习之安装与命令
ETCD学习 下载etcd #下载 wget https://github.com/etcd-io/etcd/releases/download/v3.3.18/etcd-v3.3.18-linux- ...
- 【C/C++开发】C语言实现函数可变参数
函数原型: int printf(const char *format[,argument]...) 返 回 值: 成功则返回实际输出的字符数,失败返回-1. 函数说明: ...
- Appium移动自动化测试-----(六)3.AppiumDesktop功能描述
一般功能 这些能力跨越多个驱动因素. 能力 描述 值 automationName 使用哪个自动化引擎 Appium(默认)或Selendroid或者UiAutomator2或者Espresso对于A ...
- GWAS中的名称概念
基因: 是指决定生物某一遗传性状的染色体DNA片段 基因型: `基因型`又称`遗传型`,是某一生物个体全部基因组合的总称.它反应生物体的遗传构成,即从双亲获得的全部基因的总和.遗传学中具体使用的基因型 ...
- qt QML弹出新页面之后,如何屏蔽上一个页面的按钮区域事件
Rectangle{ //Rectangle是要显示的新页面 //增加一个mouseArea:,必须好把MouseArea作为第一个子元素,如果放在最后且不设置z属性的话,会覆盖其//他控件 Mous ...
- [转帖]PCIe 6.0 v0.3版本草案已完稿:2021年转正、x16带宽飙至128GB/s
PCIe 6.0 v0.3版本草案已完稿:2021年转正.x16带宽飙至128GB/s https://www.cnbeta.com/articles/tech/899389.htm 硬件发展突飞猛进 ...
- uwsgi03----直接部署
1.http 和 http-socket的使用上有一些区别: http: 自己会产生一个http进程(可以认为与nginx同一层)负责路由http请求给worker, http进程和worker之间使 ...