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 题意:给你一个序列,你可以交换相邻的两个数,要达到一个要求,所有相同的数都相邻,问你交换次数最少是多少 思路 ...
随机推荐
- C#中 [], List, Array, ArrayList 區別
[] 是針對特定類型.固定長度的.List 是針對特定類型.任意長度的.Array 是針對任意類型.固定長度的.ArrayList 是針對任意類型.任意長度的.Array 和 ArrayList 是通 ...
- 原生JavaScript判断浏览器对CSS属性是否支持
/*判断浏览器是否支持某个css属性*/ function SupportCss(attrName){ var i=0, arr = SupportCss.opt.aBrowser, eleStyle ...
- Linux终极shell-zsh的完美配置方案!——oh-my-zsh
Zsh 介绍 Zsh 兼容 Bash,据传说 99% 的 Bash 操作 和 Zsh 是相同的 Zsh 官网:http://www.zsh.org/ 先看下你的 Linux支持哪些 shell:cat ...
- VueX(vue状态管理)简单小实例
VueX:状态管理 Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式.它采用集中式存储管理应用的所有组件的状态,并以相应的规则保证状态以一种可预测的方式发生变化. 核心模块:State. ...
- Appium移动自动化测试-----(六)1.appium-desktop下载安装
Appium 移动测试中有个很重新的组件 Appium-Server,它主要用来监听我们的移动设备(真机或模拟器),然将不同编程语言编写的 appium 测试脚本进行解析,然后,驱动移动设备来运行测试 ...
- 《ucore lab3》实验报告
资源 ucore在线实验指导书 我的ucore实验代码 练习1:给未被映射的地址映射上物理页 题目 完成do_pgfault(mm/vmm.c)函数,给未被映射的地址映射上物理页.设置访问权限的时候需 ...
- 判断List集合为空还是null的正确打开方式
事故场景还原 最近在写一个项目的时候遇到一个这样一个问题,我简单的还原一下场景,这是模拟一个简单的管理系统 ① 一张简单的客户表 CREATE TABLE customer( id INT(11) N ...
- [转帖]重估BAT与华为的云上野心
重估BAT与华为的云上野心 https://www.leiphone.com/news/201910/Z5aLhckqUjCNJ49o.html 本文作者:王刚 2019-10-11 16:19 导语 ...
- [转帖]商用数据库之死:Oracle 面临困境
商用数据库之死:Oracle 面临困境 投递人 itwriter 发布于 2019-10-20 08:22 评论(1) 有238人阅读 原文链接 [收藏] « » https://news.cnblo ...
- STM32F103芯片SPI控制NRF24L012.4G无线模块交互通信实验
1.NRF24L01模块的资料百度搜索一下就有很多.这里我就不做介绍本文主要侧重于应用层面实验介绍与分享. 2.先看下原理图. 根据原理图:写出NRF24L01 C语言驱动文件如下: #includ ...