K - Downgrade Gym - 101775K
题目大意:一天不玩相当于A-B中将A转换为经验值,B舍弃掉,然后A=1,在通过升级所需要的经验值来判断可以升几级
题目连接:https://codeforces.com/gym/101775/problem/K
AC代码:
- #include<bits/stdc++.h>
- using namespace std;
- const int N=1E5+;
- int arr[N];
- int main(){
- int t;
- scanf("%d",&t);
- for(int i=;i<=t;i++){
- memset(arr,,sizeof(arr));
- int a,b,day;
- scanf("%d%d%d",&a,&b,&day);
- for(int j=;j<=a;j++) scanf("%d",&arr[j]);
- int a1=a;
- int b1=b;
- while(day--){
- b1=a1;
- a1=;
- for(int j=;j<=a;j++){
- if(b1>arr[j]){
- b1-=arr[j];
- a1++;
- }
- else break;
- }
- if(a1==&&b1==) break;
- }
- printf("Case #%d: %d-%d\n",i,a1,b1);
- }
- return ;
- }
K - Downgrade Gym - 101775K的更多相关文章
- 2017 ACM-ICPC EC-Final ShangHai 东亚洲大陆-上海
比赛链接:传送门 Gym 101775A Chat Group(签到:待补) Gym 101775B Scapegoat(待补) Gym 101775C Traffic Light(贪心+思维) 思路 ...
- django模型操作
Django-Model操作数据库(增删改查.连表结构) 一.数据库操作 1.创建model表
- Codeforces Gym 100187K K. Perpetuum Mobile 构造
K. Perpetuum Mobile Time Limit: 2 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/pro ...
- Codeforces Gym 100610 Problem K. Kitchen Robot 状压DP
Problem K. Kitchen Robot Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/10061 ...
- 【中途相遇法】【STL】BAPC2014 K Key to Knowledge (Codeforces GYM 100526)
题目链接: http://codeforces.com/gym/100526 http://acm.hunnu.edu.cn/online/?action=problem&type=show& ...
- K - Subarrays OR Gym - 102152K (思维)
题目链接: K - Subarrays OR Gym - 102152K 题目大意:T组测试样例,然后n个数,让你求每一个l,r中有多少个不同的异或值. 具体思路: 对于(1,i)这个区间, 我们当前 ...
- K - Video Reviews Gym - 101755K (二分)
题目链接: K - Video Reviews Gym - 101755K 题目大意: 一家公司想让个人给他们的产品评论,所以依次去找这个人,第i个人会评论当且仅当已经有个人评论或他确实对这个产品感兴 ...
- Gym 101981K - Kangaroo Puzzle - [玄学][2018-2019 ACM-ICPC Asia Nanjing Regional Contest Problem K]
题目链接:http://codeforces.com/gym/101981/problem/K Your friend has made a computer video game called “K ...
- codeforces gym 100971 K Palindromization 思路
题目链接:http://codeforces.com/gym/100971/problem/K K. Palindromization time limit per test 2.0 s memory ...
随机推荐
- 【i春秋综合渗透测试】《我很简单,请不要欺负我》
第2题:获取目标网站管理员的密码 扫到了后台(/admin),本来想用sqlmap跑一下,但是随便试了个弱口令(admin888)就进去了... 第3题: getshell 配置插马:登录后台 ...
- win10 Redis闪退问题
问题:双击redis-server.exe,闪退 解决办法:win+R,输入cmd进入命令行模式,接着cd进入Redis安装根目录,再输入:redis-server.exe redis.windows ...
- JSON字符串带BOM头"ufeff"
调用三方接口返回值JSON字符串带BOM头"\ufeff",JSON解析死活报错. 我是用SpringBoot的RestTemplate调用三方接口的,一开始返回值我是用对象接收返 ...
- Activiti入门案例
一.流程定义 Activiti-Designer 使用 Palette(画板) 在eclipse 或 idea 中安装activiti-designer 插件即可使用,画板中包括以下结点: Conne ...
- Building Applications with Force.com and VisualForce(Dev401)(十五):Data Management: Data management Overview
Dev401-016:Data Management: Data management Overview Course Objectives1.List typical data management ...
- fastai 官方教程之查看数据
本文为fastai官方教程编译版本.若有错误,欢迎指正. 总目录: *查看数据:本节为初级教程,介绍怎样快速的查看你的数据和模型预测结果.* 推理学习器(Inference Learner):本节为中 ...
- 上传到码云时遇到:Incorrect username or password ( access token )
由于之前上传到 码云时候使用命令:git push -u origin master时出现如下bug Incorrect username or password ( access token ) 时 ...
- [算法]合并链表&删除数组重复项
合并链表 题目 将两个有序链表合并为一个新的有序链表并返回.新链表是通过拼接给定的两个链表的所有节点组成的. 示例: 输入:1->2->4, 1->3->4 输出:1-> ...
- spring ioc源码简析
ClassPathXmlApplicationContext 首先我们先从平时启动spring常用的ClassPathXmlApplicationContext开始解析 ApplicationCont ...
- AttributeError: module 'tensorflow.python.keras.backend' has no attribute 'get_graph'处理办法
原因:安装的tensorflow版本和keras版本不匹配,只需卸载keras,重新安装自己tensorflow对应的版本. Keras与tensorflow版本匹配查询网站