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个点的树,你从根开始游走,每当你第一次到达一个点时,把这个点的权记为(你已经到过不 ...
随机推荐
- 题解【洛谷P5767】[NOI1997]最优乘车
题面 一道很经典的最短路模型转换问题. 考虑如何建图. 我们可以发现,对于每一条公交线路,可以将这条线路上 可以到达的两个点 连一条权值为 \(1\) 的边. 获取一条公交线路上的每一个点可以使用读取 ...
- thinkphp3.2短信群发项目实例
项目功能是企业给客户群发短信,我就写这么多,也不知道你能不能运行成功,如果有问题可以在QQ上问我:605114821 项目文件SMS_V2.zip下载地址,百度云:http://yun.baidu.c ...
- Unity踩坑记录
最近开始学习Unity,因为会一点儿C#,Delphi,Python,三种都是半桶水都算不上的级别. 首先排除了Python,其次delphi是我最喜欢的,奈何它目前我能了解到的引擎都很老了,dilp ...
- nodeJS菜鸟教程笔记
http模块 var http = require('http'); // 引入http模块 var url = require('url'); // 引入url模块 var querystring ...
- linux--nginx学习
nginx 1.nginx安装编译 1.yum install nginx(自动解决依赖) 2.源代码编译安装(优秀,自由选择软件版本,自定义第三方功能比如开启https) 3.rpm手动安装(垃圾) ...
- java - GC垃圾收集器详解(三)
以前收集器的特点 年轻代和老年代是各自独立且连续的内存块 年轻代收集必须使用单个eden+S0+S1进行复制算法 老年代收集扫描整个老年代区域 都是以尽可能少而快速地执行GC为设计原则 G1是什么 G ...
- php 时间 日期
获取月初与月末 /** * 获取当前月初与月末时间 * * */ $month =8; $year = 2019; $startDay = $year . '-' . $month . '-1'; $ ...
- webpack 代理问题
devServer host: '0.0.0.0' 或者是ip 形式的 ,proxy 中 的 target,host 需要为ip形式的地址, host: 'aa.a.com' 为字符形式的 ,prox ...
- Linux的VMware虚拟机无法上网问题
很多时候,Linux无法上网,不管改成nat模式还是主机模式都不行.这时候可以选择进行重置: 首先点击编辑,之后点击虚拟网络编辑器, 然后移除VMnet0和VMnet8网络,点击确定: 然后再打开虚拟 ...
- Codeforce 459A - Pashmak and Garden (已知两点求另外两点构成正方形)
Pashmak has fallen in love with an attractive girl called Parmida since one year ago... Today, Pashm ...