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个点的树,你从根开始游走,每当你第一次到达一个点时,把这个点的权记为(你已经到过不 ...
随机推荐
- 一维数组、二维数组——Java
一. 一维数组 1. 数组是相同类型数据的有序集合 相同类型的若干个数据,按照一定先后次序排列组合而成 每个数组元素可以通过一个下标来访问它们 其中,每一个数据称作一个数组元素 2. 数组特点: 其 ...
- Spark学习之路 (十九)SparkSQL的自定义函数UDF[转]
在Spark中,也支持Hive中的自定义函数.自定义函数大致可以分为三种: UDF(User-Defined-Function),即最基本的自定义函数,类似to_char,to_date等 UDAF( ...
- 树莓派3B从装系统到安装RYU过程
1.首先安装的是2019-09-26-raspbian-buster-lite系统 2.更换成国内源 更改apt源 sudo nano /etc/apt/sources.list(更改apt源) de ...
- POI导出PPT
1.null <!-- https://mvnrepository.com/artifact/org.apache.poi/poi --> <dependency> <g ...
- 记一个js toUpperCase函数 大小写特性
toUpperCase()是javascript中小写变大写的函数 "ı".toUpperCase() == 'I',"ſ".toUpperCase() == ...
- Git和TortoiseGit
1.简介 Git是一个开源的分布式版本控制系统,用于敏捷高效的处理任何或大或小的项目.它采用了分布式版本库的方式,不必服务器端软件支持. 2.Git和Svn的区别 1.Git 是分布式的,SVN 不是 ...
- ASP.NET MVC5 的请求管道和运行生命周期
https://www.jianshu.com/p/848fda7f79e0 请求处理管道 请求管道是一些用于处理HTTP请求的模块组合,在ASP.NET中,请求管道有两个核心组件:IHttpModu ...
- java课堂测试
package 作业2; //信1805-1 杨一帆 20183608 public class ScoreInformation1 { private String stunumber; pr ...
- VScode usage
Common settings editor.minimap.enabled //close the preview workbench.editor.show tabs // show f ...
- CLOUD将excel数据引入单据体
http://club.kingdee.com/forum.php?mod=viewthread&tid=989239 http://club.kingdee.com/forum.php?mo ...