# xtu 1268 Strange Optimization 湘潭邀请赛I

Strange Optimization Bobo is facing a strange optimization problem. Given n,m, he is going to find a real number α such that f(12+α) is maximized, where f(t)=mini,j∈Z|in−jm+t|. Help him! Not...

# xtu 1267 Highway 湘潭邀请赛H

Highway In ICPCCamp there were n towns conveniently numbered with 1,2,…,n connected with (n−1) roads. The i-th road connecting towns ai and bi has length ci. It is guaranteed that any two...

# xtu 1266 Parentheses 2017湘潭邀请赛G

Parentheses Bobo has a very long sequence divided into n consecutive groups. The i-th group consists of li copies of character ci where ci is either "(" or ")". As the sequence may not be va...

# xtu 1264 Partial Sum 2017湘潭邀请赛E

Partial Sum Bobo has a integer sequence a1,a2,…,an of length n. Each time, he selects two ends 0≤lr≤n and add |∑rj=l+1aj|−C into a counter which is zero initially. He repeats the selection fo...

# 2016长城信息杯中国大学生程序设计竞赛中南邀请赛 xtu 1243 2016

http://www.dengwenhuo.cn/?id=194 Given a2×2 matrix A=(a 11 a 21  a 12 a 22  ),    findA n  whereA 1 =A,A n =A×A n−1  . As the result may be large, you are going to find onl...

# 2016长城信息杯中国大学生程序设计竞赛中南邀请赛 xtu 1249 Rolling Variance

Bobo learnt that the variance of a sequencea1,a2,…,anis ∑ni=1(ai−a¯)2n−1−−−−−−−−−−−−√ where a¯=∑ni=1ain. Bobo has a sequencea1,a2,…,an, and he would like to find the variance o...

# 2016长城信息杯中国大学生程序设计竞赛中南邀请赛 xtu 1250 Super Fast Fourier Transform

http://www.dengwenhuo.cn/?id=196 Bobo has two sequences of integers{a1,a2,…,an}and{b1,b2,…,bm}. He would like to find ∑i=1n∑j=1m⌊|ai−bj|−−−−−−−√⌋. Note that⌊x⌋denotes the maximum intege...

# 2016长城信息杯中国大学生程序设计竞赛中南邀请赛 xtu 1245 Hamiltonian Path

http://www.dengwenhuo.cn/?id=197 In ICPCCamp, there arencities andmdirected roads between cities. Thei-th road going from theai-th city to thebi-th city iscikilometers long. For each ...

# 2016长城信息杯中国大学生程序设计竞赛中南邀请赛 xtu 1244 Gambling

http://www.dengwenhuo.cn/?id=199 In ICPCCamp, gambling is conducted as follow. A player will draw balls from an opaque bag containingared balls,bgreen balls andcblue balls initially. Balls ...

# 2016长城信息杯中国大学生程序设计竞赛中南邀请赛 xtu 1246 Heartstone

http://www.dengwenhuo.cn/?id=201 Bobo is playing Heartstone. There arenminions in the battlefield. Thei-th minion hashihit points (HP). Bobo uses two kinds of magic. The one is Arcane Sh...

# 2016长城信息杯中国大学生程序设计竞赛中南邀请赛 xtu 1252 Defense Tower

http://www.dengwenhuo.cn/?id=200 In ICPCCamp, there arencities and(n−1)(bidirectional) roads between cities. Thei-th road is between theai-th andbi-th cities. It is guaranteed that citi...

# 模板收集

ll exmod[100005],rmod[100005]; ll multimod(ll a,ll b,ll mod) { ll ans = 0; for ( ; b; b >>= 1, a = (a<<1)%mod) if (b&1) { ans = (ans + a)%mod; }...

# hdu 3068 最长回文 Manacher算法

http://acm.hdu.edu.cn/showproblem.php?pid=3068 #include #include #include #include #include using namespace std; int main() { char s[220005],str[220005]; int p[220005],n; int an...

# 加油

Problem Description   NightGuard非常喜欢开车旅行。每年5.1节，他都要开着自己的车到一个风景比较好的地方去度假。由于路途遥远，汽车的油箱容量有限，装不下足够的汽油。NightGuard想了一个办法，自己再带上一个桶，用桶来装汽油，这样，汽油就不会不够了。   现在的问题是这样的，油箱一开始是满的，NightGuard想要用桶装尽可能多的汽油.桶的体积为V，路上总...

# dijkstra算法实现

#include #include using namespace std; const int maxnum = 100; const int maxint = 999999; // 各数组都从下标1开始 int dist[maxnum]; // 表示当前点到源点的最短路径长度 int prev[maxnum]; // 记录当前点的前一个结点 int c[maxnum][...

190条 共13页1 2 3 4 5 ... 下一页 尾页
个人资料
• 访问：64955次
• 积分：2248
• 等级：
• 排名：第19730名
• 原创：160篇
• 转载：30篇
• 译文：0篇
• 评论：1条
文章分类
最新评论