假装自己打比赛嘿嘿嘿

 #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. [转载]Ubuntu 使用Compiz配置炫酷3D桌面

    原文地址 个人引言: 这个Compiz使用与我的这篇Blog:打摆不顺利?是你没看这篇!相互有联系.这个Compiz是打摆工具之一,可以把打摆窗口调成透明,这样机房监控拍下来的屏幕会是打摆窗口下面的某 ...

  2. Java设计模式(一)UML总结

    定义 统一建模语言(英语: Unified Modeling Language ,缩写UML)是非专利的第三代建模和规约语言. UML特点 UML是一种开放的方法 用于说明.可视化.构建和编写一个正在 ...

  3. IIS7配置asp程序

    Windows 中IIS7.IIS7.5是默认不安装的,所以在安装完Windows Vista/windows 7/windows 2008之后如果需要安装IIS7/iis7.5的话,就要自己动手了. ...

  4. ASP.NET常用内置对象(二)Response

    response翻译为中文:响应. 将数据作为请求的结果从服务器发送到客户浏览器中,并提供有关响应的消息.它可用来在页面中输出数据,在页面中跳转,还可以传递各个页面的参数. Response对象是Sy ...

  5. python3包、模块、类、方法的认识

    包>>模块>>类>> 函数 包:就是一个目录,import time from+import导入包中的部分模块 直接到类 from budaoguan.common ...

  6. IDEA 找不到包或者找不到符号的一些解决办法

    有时使用IDE导入项目后,启动时会发生找不到包或者找不到符号的情况,下面有一些处理方法 1.右键项目Maven→Reimport 2.IDEA窗口左上角File→Invalidate and Rest ...

  7. Ubuntu16.04突然断网

    配置文件: sudo gedit /etc/network/interfaces 重启网络: 1.sudo /etc/init.d/networking restart 2.sudo service ...

  8. JS使用知识点理解

    var keyValue = $.request("keyValue"); $(function () { ////修改页面select下拉选框js $("#BloodB ...

  9. PP: Multi-Horizon Time Series Forecasting with Temporal Attention Learning

    Problem: multi-horizon probabilistic forecasting tasks; Propose an end-to-end framework for multi-ho ...

  10. 题解 P5613 【[MtOI2019]黑蚊子多】

    题目传送门 一道模拟题目,签到送分题. 您需要的知识 1.while循环 2.for循环 3.一维数组 思路: Step 1:按题目要求,定义a[],n,m,k int a[10001]; int n ...