hdu 5596 GTW likes gt】的更多相关文章

GTW likes gt 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5596 Description Long long ago, there were n adorkable GT. Divided into two groups, they were playing games together, forming a column. The i−th GT would randomly get a value of ability bi.…
题目链接: hdu 5596 题意不难懂(虽然我还是看了好久)大概就是说 n 个人排成一列,分成两组, 第 i 秒时第 i 个人会消灭掉前面比他 b[i] 值低的且和他不同组的人,c[i] 表示第 c[i] 秒时前面 1-c[i] 个人每个人的 b[i] 值都会 +1,问你最后还会存活几个人. 一开始看到它的数据范围我在想会不会需要用到树状数组或线段树去优化呢?(惯性思维改不了 -.-||),后来觉得好像有其他的简单的方法,认真想了好久然后试了一下果然可以:离线处理(一开始以为它强制在线,后来发…
GTW likes gt Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 833    Accepted Submission(s): 299 Problem Description Long long ago, there were n adorkable GT. Divided into two groups, they were…
GTW likes function 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5596 Description Now you are given two definitions as follows. f(x)=∑xk=0(−1)k22x−2kCk2x−k+1,f0(x)=f(x),fn(x)=f(fn−1(x))(n≥1) Note that φ(n) means Euler's totient function.(φ(n)is an…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5597 题意: http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=658&pid=1003 题解: f0(1)=2;  f0(2)=3;  f0(3)=4; f1(1)=3;  f1(2)=4;  f1(3)=5; f2(1)=4;  ...... 所以归纳出:fn(x)=n+x+1;  orz 然后求euler(…
题意: 问题描述 某一天,GTW听了数学特级教师金龙鱼的课之后,开始做数学<从自主招生到竞赛>.然而书里的题目太多了,GTW还有很多事情要忙(比如把妹),于是他把那些题目交给了你.每一道题目会给你一个函数f(x)=ax^2+bx+cf(x)=ax​2​​+bx+c,求这个函数在整数区间[l,r][l,r]之间的最值. 输入描述 第一行一个整数T,表示数据组数.(T\leq 1000T≤1000) 对于每一组数据,有一行,共五个整数a,b,c,l,r.(|a|\leq 100,|b|\leq 1…
思路:直接暴力枚举区间[l,r]的整数值,然后max和min就可以了. AC代码: #pragma comment(linker, "/STACK:1024000000,1024000000") #include<iostream> #include<cstdio> #include<cstring> #include<cmath> #include<math.h> #include<algorithm> #inc…
GTW likes math  Memory Limit: 131072/131072 K (Java/Others) 问题描述 某一天,GTW听了数学特级教师金龙鱼的课之后,开始做数学<从自主招生到竞赛>.然而书里的题目太多了,GTW还有很多事情要忙(比如把妹),于是他把那些题目交给了你.每一道题目会给你一个函数f(x)=ax^2+bx+cf(x)=ax​2​​+bx+c,求这个函数在整数区间[l,r][l,r]之间的最值. 输入描述 第一行一个整数T,表示数据组数.(T\leq 1000T…
题目链接: GTW likes gt  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 131072/131072 K (Java/Others) 问题描述 从前,有nn只萌萌的GT,他们分成了两组在一起玩游戏.他们会排列成一排,第ii只GT会随机得到一个能力值b_ib​i​​.在第ii秒的时候,第ii只GT可以消灭掉所有排在他前面的和他不是同一组的且能力值小于他的GT. 为了使游戏更加有趣,GT的首领GTW会发功mm次,第ii次发功的…
GTW likes function      Memory Limit: 131072/131072 K (Java/Others) 问题描述 现在给出下列两个定义: f(x)=f_{0}(x)=\sum_{k=0}^{x}(-1)^{k}2^{2x-2k}C_{2x-k+1}^{k},f_{n}(x)=f(f_{n-1}(x))(n\geq 1)f(x)=f​0​​(x)=∑​k=0​x​​(−1)​k​​2​2x−2k​​C​2x−k+1​k​​,f​n​​(x)=f(f​n−1​​(x)…
题目链接: GTW likes function Time Limit: 4000/2000 MS (Java/Others)     Memory Limit: 131072/131072 K (Java/Others) Problem Description   Now you are given two definitions as follows. f(x)=∑xk=0(−1)k22x−2kCk2x−k+1,f0(x)=f(x),fn(x)=f(fn−1(x))(n≥1) Note th…
GTW likes gt Accepts: 54 Submissions: 782 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) 从前,有nnn只萌萌的GT,他们分成了两组在一起玩游戏.他们会排列成一排,第iii只GT会随机得到一个能力值bib_ib​i​​.在第iii秒的时候,第iii只GT可以消灭掉所有排在他前面的和他不是同一组的且能力值小于他的GT.为了使游戏更加有趣,G…
GTW likes math Accepts: 472 Submissions: 2140 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) 问题描述 某一天,GTW听了数学特级教师金龙鱼的课之后,开始做数学<从自主招生到竞赛>.然而书里的题目太多了,GTW还有很多事情要忙(比如把妹),于是他把那些题目交给了你.每一道题目会给你一个函数f(x)=ax2+bx+cf(x)=求这个函…
GTW likes math  Accepts: 472  Submissions: 2140  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 131072/131072 K (Java/Others) Problem Description After attending the class given by Jin Longyu, who is a specially-graded teacher of Mathematics,…
更新: 这是中文题目的链接: http://bestcoder.hdu.edu.cn/contests/contest_chineseproblem.php?cid=659&pid=1001 这道题还可以用优先队列来做,优先队列的特性可以很好的返回两个队列中b最小的值. 下面说过了,c[i] += c[i-1]是来获得前缀和.前面的节点没发功增加一次,就相当于b[i]-1,b[i]-c[i-1]的值,就是到达第i时间是,b[i]相对的减少量.我们设置两个队列,根据需要,将b[i]-c[i-1]的…
思路:一个O(n)O(n)的做法.我们发现b_1,b_2,...,b_xb​1​​,b​2​​,...,b​x​​都加11就相当于b_{x+1},b_{x+2},...,b_nb​x+1​​,b​x+2​​,...,b​n​​都减11.然后我们可以倒着做,记一下最大值,如果遇到了修改操作,就把最大值减11,然后判断一下这个人会不会被消灭掉,然后再更新一下最大值. 1 #define cn(i,p,q) for(int i=p;i<=q;i++) 2 #define cn1(i,p,q) for(…
#include <bits/stdc++.h> typedef long long LL; const int MOD = (int)1e9 + 7; LL L,R,G,T; int dp[62 + 1][2][2][2][2]; bool vis[62 + 1][2][2][2][2]; inline void add(int &a,int b) { a += b; if (a >= MOD) a -= MOD; if (a < 0) a += MOD; } int c…
构造 1002 GTW likes gt 题意:中文题面 分析:照着题解做的,我们可以倒着做,记一下最大值,如果遇到了修改操作,就把最大值减1,然后判断一下这个人会不会被消灭掉,然后再更新一下最大值.不知道其他的做法是怎么样的 #include <cstdio> #include <algorithm> #include <cstring> using namespace std; #define lson l, mid, o << 1 #define rs…
GTW likes gt    Memory Limit: 131072/131072 K (Java/Others) 问题描述 从前,有nn只萌萌的GT,他们分成了两组在一起玩游戏.他们会排列成一排,第ii只GT会随机得到一个能力值b_ib​i​​.在第ii秒的时候,第ii只GT可以消灭掉所有排在他前面的和他不是同一组的且能力值小于他的GT. 为了使游戏更加有趣,GT的首领GTW会发功mm次,第ii次发功的时间为c_ic​i​​,则在第c_ic​i​​秒结束后,b_1,b_2,...,b_{c…
GTW likes math Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 942    Accepted Submission(s): 426 Problem Description After attending the class given by Jin Longyu, who is a specially-graded t…
GTW likes gt  Accepts: 75  Submissions: 261  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 131072/131072 K (Java/Others) Problem Description Long long ago, there were nn adorkable GT. Divided into two groups, they were playing games together,…
GTW likes math Accepts: 472      Submissions: 2140  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 131072/131072 K (Java/Others) Problem Description After attending the class given by Jin Longyu, who is a specially-graded teacher of Mathematic…
GTW likes gt  Accepts: 132  Submissions: 772  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 131072/131072 K (Java/Others) 问题描述 从前,有nn只萌萌的GT,他们分成了两组在一起玩游戏.他们会排列成一排,第ii只GT会随机得到一个能力值b_ib​i​​.在第ii秒的时候,第ii只GT可以消灭掉所有排在他前面的和他不是同一组的且能力值小于他的GT. 为了使游戏更…
Sightseeing Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1023    Accepted Submission(s): 444 Problem Description Tour operator Your Personal Holiday organises guided bus trips across the Ben…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1052 Problem Description Here is a famous story in Chinese history. "That was about 2300 years ago. General Tian Ji was a high official in the country Qi. He likes to play horse racing with the king and…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4897 Problem Description There is an old country and the king fell in love with a devil. The devil always asks the king to do some crazy things. Although the king used to be wise and beloved by his peopl…
31 Rikka with Parenthesis II (六花与括号II) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Description 题目描述 As we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to…
HDU 3496 Watch The Movie(看电影) Time Limit: 1000MS   Memory Limit: 65536K [Description] [题目描述] New semester is coming, and DuoDuo has to go to school tomorrow. She decides to have fun tonight and will be very busy after tonight. She like watch cartoon…
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=4308 Saving Princess claire_ Description Princess claire_ was jailed in a maze by Grand Demon Monster(GDM) teoy.Out of anger, little Prince ykwd decides to break into the maze to rescue his lovely Prince…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2426 For any school, it is hard to find a feasible accommodation plan with every student assigned to a suitable apartment while keeping everyone happy, let alone an optimal one. Recently the president of…