假装自己打比赛嘿嘿嘿

 #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的更多相关文章

  1. R - Cow and Message CodeForces - 1307C

    思路对了,但是不会写. 等差数列长度不是1就是2,所以不是一个字母就是俩字母,一开始写的时候直接枚举两个字母,然后让次数相乘.这样是不对的,比如abaabb,字母ab的个数应该是3+2+2,因该是每一 ...

  2. python爬虫学习(5) —— 扒一下codeforces题面

    上一次我们拿学校的URP做了个小小的demo.... 其实我们还可以把每个学生的证件照爬下来做成一个证件照校花校草评比 另外也可以写一个物理实验自动选课... 但是出于多种原因,,还是绕开这些敏感话题 ...

  3. 【Codeforces 738D】Sea Battle(贪心)

    http://codeforces.com/contest/738/problem/D Galya is playing one-dimensional Sea Battle on a 1 × n g ...

  4. 【Codeforces 738C】Road to Cinema

    http://codeforces.com/contest/738/problem/C Vasya is currently at a car rental service, and he wants ...

  5. 【Codeforces 738A】Interview with Oleg

    http://codeforces.com/contest/738/problem/A Polycarp has interviewed Oleg and has written the interv ...

  6. CodeForces - 662A Gambling Nim

    http://codeforces.com/problemset/problem/662/A 题目大意: 给定n(n <= 500000)张卡片,每张卡片的两个面都写有数字,每个面都有0.5的概 ...

  7. CodeForces - 274B Zero Tree

    http://codeforces.com/problemset/problem/274/B 题目大意: 给定你一颗树,每个点上有权值. 现在你每次取出这颗树的一颗子树(即点集和边集均是原图的子集的连 ...

  8. CodeForces - 261B Maxim and Restaurant

    http://codeforces.com/problemset/problem/261/B 题目大意:给定n个数a1-an(n<=50,ai<=50),随机打乱后,记Si=a1+a2+a ...

  9. CodeForces - 696B Puzzles

    http://codeforces.com/problemset/problem/696/B 题目大意: 这是一颗有n个点的树,你从根开始游走,每当你第一次到达一个点时,把这个点的权记为(你已经到过不 ...

随机推荐

  1. srpingboot web - 启动(3) 监听器

    接上一篇 一. getRunListeners() 在run() 方法中调用了 getRunListeners(args) 方法, 先看一下这个方法干了什么 private SpringApplica ...

  2. Django---Django安装数据库

    前面我们介绍了如何通过Django完成数据的接收和数据交互,那么我们都知道,数据一般都是通过数据库存储的,然而我们作为测试肯定和数据库也是经常打交道的,今天就简单的介绍下,如何在windows上安装数 ...

  3. 51Nod 1284 2 3 5 7的倍数 (容斥定理)

    给出一个数N,求1至N中,有多少个数不是2 3 5 7的倍数. 例如N = 10,只有1不是2 3 5 7的倍数. Input 输入1个数N(1 <= N <= 10^18). Outpu ...

  4. 如何在php7.2/php7.3中安装mcrypt扩展?

    mcrypt 是php里面重要的加密支持扩展库,linux环境下该库在默认情况下不开启.window环境下,PHP>=5.3,默认开启mcrypt扩展.mcrypt扩展是mcrypt加密库的接口 ...

  5. 字符串hash补充(模数情况下)

    字符串模板,在模数意义下的,比较好用 #include<stdio.h> typedef long long LL; /*[字符串哈希算法] 字符串哈希算法的提出,涉及到如何快速地求两个字 ...

  6. python的循环语句

    python的循环语句有两种:for 和 while,for循环是对可迭代对象进行迭代并处理,因此for的对象是一个可以迭代的对象,而while循环的条件则是一个布尔值可以是一个返回布尔值的表达式. ...

  7. JDK线程池和Spring线程池的使用

    JDK线程池和Spring线程池实例,异步调用,可以直接使用 (1)JDK线程池的使用,此处采用单例的方式提供,见示例: public class ThreadPoolUtil { private s ...

  8. JavaDay2(中)

    Java循环与分支练习 习题1: 输出1~100内前5个可以被3整除的数. public class Day2_Test1 { //输出1~100内前5个可以被3整除的数. public static ...

  9. [Python]find_all函数 2020.2.7

    .find_all(name,attrs,recursive,string,**kwargs) name:对标签名称的检索字符串attrs:对标签属性值的检索字符串,可标注属性检索recursive: ...

  10. Jungle Roads POJ - 1251 模板题

    #include<iostream> #include<cstring> #include<algorithm> using namespace std; cons ...