C++-CodeForces-1307A/1307B/1307C
假装自己打比赛嘿嘿嘿

#include <bits/stdc++.h>
using namespace std;
int t,n,d,a[];
int main(){
for(cin>>t;t--;){
cin>>n>>d;
for(int i=;i<=n;i++)cin>>a[i];
for(int i=;i<=n;i++){
int move=min(a[i],d/(i-));
a[]+=move;
d-=move*(i-);
}
cout<<a[]<<endl;
}
return ;
}


#include <bits/stdc++.h>
using namespace std;
int main(){
int t,n,x;
for(cin>>t;t--;){
cin>>n>>x;
int ans=;
for(int a;n--;){
cin>>a;
ans=min(ans,max(,(x+a-)/a));
if(a==x)ans=;
}
cout<<ans<<endl;
}
return ;
}

#include <bits/stdc++.h>
using namespace std;
long long f[][],c[],ans;
char s[];
int main(){
scanf("%s",s);
for(int i=;s[i];i++){
for(int q='a';q<='z';q++){
f[q][s[i]]+=c[q];
ans=max(ans,f[q][s[i]]);
}
ans=max(ans,++c[s[i]]);
}
cout<<ans<<endl;
return ;
}
C++-CodeForces-1307A/1307B/1307C的更多相关文章
- R - Cow and Message CodeForces - 1307C
思路对了,但是不会写. 等差数列长度不是1就是2,所以不是一个字母就是俩字母,一开始写的时候直接枚举两个字母,然后让次数相乘.这样是不对的,比如abaabb,字母ab的个数应该是3+2+2,因该是每一 ...
- python爬虫学习(5) —— 扒一下codeforces题面
上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...
- 【Codeforces 738D】Sea Battle(贪心)
http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...
- 【Codeforces 738C】Road to Cinema
http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...
- 【Codeforces 738A】Interview with Oleg
http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...
- CodeForces - 662A Gambling Nim
http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...
- CodeForces - 274B Zero Tree
http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...
- CodeForces - 261B Maxim and Restaurant
http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...
- CodeForces - 696B Puzzles
http://codeforces.com/problemset/problem/696/B 题目大意: 这是一颗有n个点的树,你从根开始游走,每当你第一次到达一个点时,把这个点的权记为(你已经到过不 ...
随机推荐
- P2048 [NOI2010]超级钢琴 [堆+st表]
考虑只能取长度为 [L,R] 的,然后不难想到用堆搞. 搞个前缀和的st表,里面维护的是一个 最大值的位置 struct rmq { int mx[N][20] ; void qwq(int n) { ...
- Bonny校园app使用体验
Bonny校园是一款集校园表白墙.失物招领处和二手市场集一体的一款校园app,旨在帮助大学生解决校内的生活问题.这款app功能比较齐全,表白墙内含有许多有趣的信息展示,失物招领处内可以详细的展示捡到东 ...
- send and recieve message with myself (python socket )
# socket server import socket sk = socket.socket() sk.bind(("127.0.0.1",8082)) sk.listen() ...
- Java基础汇总2019
1.事务的ACID性: (1)原子性:要么做,要么都不做.程序操作执行未成功,则所做的更改会被撤销: (2)一致性:比如转账,a转给b一百元,则a的账户少100,b的账户多100,前后数据要一致: ( ...
- Centos下查看CPU个数跟核数
总核数 = 物理CPU个数 X 每颗物理CPU的核数 总逻辑CPU数 = 物理CPU个数 X 每颗物理CPU的核数 X 超线程数 查看物理CPU个数 cat /proc/cpuinfo| grep & ...
- 安装AB到CentOS(YUM)
运行环境 系统版本:CentOS Linux release 7.3.1611 (Core) 软件版本:httpd-tools-2.4.6 硬件要求:无 安装过程 1.安装YUM-EPEL源 HTTP ...
- LeetCode 112. 路径总和 (递归遍历二叉树)
题目链接:https://leetcode-cn.com/problems/path-sum/ 给定一个二叉树和一个目标和,判断该树中是否存在根节点到叶子节点的路径,这条路径上所有节点值相加等于目标和 ...
- H5_0010:JS动态创建CSS,并向CSS中传入参数值
1,在html中定义style 2,js中创建css,并添加进入head标签style中 !function(e, t, i) { n.classList && n.classList ...
- [CF2B] The least round way - dp
给定由非负整数组成的n×n 的正方形矩阵,你需要寻找一条路径: 以左上角为起点 每次只能向右或向下走 以右下角为终点 并且,如果我们把沿路遇到的数进行相乘,积应当是最小"round" ...
- execute、executeUpdate、executeQuery的区别
链接:https://blog.csdn.net/u012501054/article/details/80323176 链接:https://blog.csdn.net/CNAHYZ/article ...