New Year Transportation(水)】的更多相关文章

New Year Transportation Time Limit:2000MS     Memory Limit:262144KB     64bit IO Format:%I64d & %I64u Submit Status Description New Year is coming in Line World! In this world, there are n cells numbered by integers from 1 to n, as a 1 × n board. Peo…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4940 Destroy Transportation system Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 21    Accepted Submission(s): 17 Problem Description Tom is a…
Description Tom is a commander, his task is destroying his enemy’s transportation system. Let’s represent his enemy’s transportation system as a simple directed graph G with n nodes and m edges. Each node is a city and each directed edge is a directe…
转载请注明出处: http://www.cnblogs.com/fraud/          ——by fraud Apple Transportation Time Limit: 1 Second      Memory Limit: 32768 KB There's a big apple tree in the forest. In the tree there are N nodes (numbered from 0 to N - 1), and the nodes are conne…
Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K          Description Background  Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there real…
Heavy Transportation POJ 1797 最短路变形 题意 原题链接 题意大体就是说在一个地图上,有n个城市,编号从1 2 3 ... n,m条路,每条路都有相应的承重能力,然后让你求从编号为1的城市到编号为n的城市的路线中,最大能经过多重的车. 解题思路 这个题可以使用最短路的思路,不过转移方程变了\(dis[j]=max(dis[j], min(dis[u], e[u][j]))\).这里dis[j]表示从标号为1的点到达编号为j的点的路径中,最小的承重能力,就像短板效应样…
Nasty Hacks Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 3049    Accepted Submission(s): 2364 Problem Description You are the CEO of Nasty Hacks Inc., a company that creates small pieces of…
总时间限制:  1000ms 内存限制:  65536kB 描述 任意输入两个正整数m, n (1 < m < n <= 5000),依次输出m到n之间每个数的最大质因子(包括m和n:如果某个数本身是质数,则输出这个数自身). 输入 一行,包含两个正整数m和n,其间以单个空格间隔. 输出 一行,每个整数的最大质因子,以逗号间隔. 样例输入 5 10 样例输出 5,3,7,2,3,5 还是水题.. 查看 #include <iostream> #include <cstr…
Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two lines, which together with x-axis forms a containe…
炎炎夏日,还是呆在空调房里切切题吧. Container With Most Water,题意其实有点噱头,简化下就是,给一个数组,恩,就叫 height 吧,从中任选两项 i 和 j(i <= j),使得 Math.min(height[i], height[j]) * (j - i) 最大化,求解这个最大值. O(n^2) O(n^2) 复杂度的解法非常容易想到,直接两两枚举. var maxArea = function(height) { var len = height.length;…
Codeforces-566F 题目大意:给出一个有序数列a,这个数列中每两个数,如果满足一个数能整除另一个数,则这两个数中间是有一条边的,现在有这样的图,求最大联通子图. 题解:并不需要把图搞出来,可以直接dp,$f[i]$表示以第$i$个数为开头的最大的联通子图,转移类似最长上升子序列,$f[i]=max(f[i],f[j]+1)$ Code: #include<iostream> #include<cstdio> #include<algorithm> #incl…
Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 132  Solved: 75 Description 水叮当得到了一块五颜六色的格子形地毯作为生日礼物,更加特别的是,地毯上格子的颜色还能随着踩踏而改变.为了讨好她的偶像虹猫,水叮当决定在地毯上跳一支轻盈的舞来卖萌~~~地毯上的格子有N行N列,每个格子用一个0~5之间的数字代表它的颜色.水叮当可以随意选择一个0~5之间的颜色,然后轻轻地跳动一步,左上角的格子所在的联通块里的所有格子就会变成她选择的那…
传送门 Heavy Transportation Time Limit: 3000MS   Memory Limit: 30000K Total Submissions: 31882   Accepted: 8445 Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever…
CSU 1772 漫漫上学路 Time Limit: 1000MS   Memory Limit: 131072KB   64bit IO Format: %lld & %llu Submit Status Description 对于csuxushu来说,能够在CSU(California State University)上学是他一生的荣幸.CSU校园内的道路设计的十分精巧,由n+1条水平道路和n+1条竖直道路等距交错而成,充分体现了校园深厚的文化底蕴.然而不幸的是CS市每到夏季,天降大雨,…
据说是道lct求深度的题 但是在小猫大的指点下用分块就n^1.5水过了 = =数据忘记加强系列 代码极其不美观,原因是一开始是听小猫大讲的题意,还以为是弹到最前面... #include <cstdio> #include <cmath> using namespace std; int n,m,p,q,k; ],b[],c[]; int main() { scanf("%d",&n); ;i<=n;i++) scanf(]); int N=(in…
(卧槽,居然规定了修改的两点直接相连,亏我想半天) 非常水的题,用dfs序(而且不用重复,应该是直接规模为n的dfs序)+树状数组可以轻松水 收获:树状数组一遍A(没啥好骄傲的,那么简单的东西) #include <cstdio> #include <iostream> using namespace std; ,n,m,p,q,a[],l[],pos[],end[],son[],bro[],h[]; void add(int x,int y) { while(x<=N) {…
题目链接 现在代码能力没上升,倒是越来越会找水题了(比例题还水的裸题你值得拥有) 这网站不是针对竞赛的,所以时空限制都很宽松 然后就让我水过去了 对于每个点,包括自己的前m个元素是否取都是一种状态,所以状压一下(才1024不要怂) #include <cstdio> int n,m,q; ]; ][]; int max(int a,int b){return(a<b)?b:a;} int main() { scanf("%d%d%d",&n,&m,&a…
bzoj 3856: Monster 虽然是sb题,,但是要注意h可能<=a,,,开始忘记判了WA得很开心. #include <iostream> #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace std; long long h, a, b, k; int main(){ ; while(scanf(&qu…
题目链接:水叮当的舞步 我现在开始发题目链接了(主要还是因为懒得整理题面)-- 这道题一开始是看到MashiroSky在写,于是我也开始写这道题了(说白了就是狙击他)-- 这道题看到这么小的范围当然给人的第一感觉就是搜索了.于是我果断写了个搜索,后果很惨--我都没敢交上去-- 后来想了各种优化,一路优化到了$80$分.最后的我想不出来了,于是就去翻了题解,终于弄全了. 首先,这道题最好使用迭代加深搜索.因为普通的$dfs$太慢,而$bfs$空间又开不下(听说某位大神使用$bfs$切掉了). 接下…
一.mysql中的优化 where语句的优化 1.尽量避免在 where 子句中对字段进行表达式操作select id from uinfo_jifen where jifen/60 > 10000;优化后:Select id from uinfo_jifen where jifen>600000; 2.应尽量避免在where子句中对字段进行函数操作,这将导致mysql放弃使用索引 select uid from imid where datediff(create_time,'2011-11…
这个效果是我从bootstrap-material-design上面分离下来的,bootstrap-material-design的一些组件样式我不太不喜欢,但是非常喜欢这个水波纹效果,所以就有了这篇文章: 先上效果图: 点击按钮后,会有一道波纹扩散开来 下面是资源地址:http://pan.baidu.com/s/1pL6LGBh 提取密码: 7y6x 就两文件: 下面是使用教程: 第一步:引入rippels.css 和rippels.js <link rel="stylesheet&q…
1050: 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 154  Solved: 112[Submit][Status][Web Board] Description 写一个函数,使给定的一个二维数组(3×3)转置,即行列互换. Input 一个3x3的矩阵 Output 转置后的矩阵 Sample Input 1 2 3 4 5 6 7 8 9 Sample Output 1 4 7…
桶装水 送水 消费充值PDA会员管理系统 介绍 主要功能:会员管理临时开卡.新增会员.修改会员.删除会员场馆管理仓管信息管理.租凭信息管理会员卡管理会员卡类型设置.会员发卡.会员信息管理.体验用户发卡.活动名称管理.绑定手牌充值管理充值优惠套餐色织.充值卡写卡.充值卡充值.优惠套餐充值.充值卡管理系统设置角色管理.系统用户管理.PDA用户管理.密码修改.系统日志.报表日志.安全退出…
[A005]NOIP2008 ISBN号码(一大桶水)[难度A]—————————————————————————————————————————————————————————————————————————— [题目要求] 每一本正式出版的图书都有一个ISBN号码与之对应,ISBN码包括9位数字.1位识别码和3位分隔符,其规定格式如“x-xxx-xxxxx-x”,其中符号“-”就是分隔符(键盘上的减号),最后一位是识别码,例如0-670-82162-4就是一个标准的ISBN码.ISBN码的首…
SCU 4437  Carries Time Limit:0MS     Memory Limit:0KB     64bit IO Format:%lld & %llu  Practice  Description Carries frog has nn integers a1,a2,…,ana1,a2,…,an, and she wants to add them pairwise. Unfortunately, frog is somehow afraid of carries (进位).…
不要问我ege怎么装 http://tieba.baidu.com/p/2227018541 好,现在我们装好了ege 开始写2048吧 没有算法,单纯模拟,不用讲解——这才叫[水]的含义 界面极度简单,不喜勿喷 #include<iostream> #include <math.h> #include <cstdlib> #include <fstream> #include <Windows.h> #include <direct.h&…
因为最近的生活太颓废总是不做题而被老师D了一番, 所以今天晚上到bzoj上去刷了几道水题.....   bzoj 4320: ShangHai2006 Homework 题目大意 维护一个支持两个操作的集合: 1) 插入一个数x 2) 询问集合中所有数中 mod x 最小是多少 解题思路 似乎log家族没有什么好的办法解决这道题? 考虑 sqrt() 的方法. 当询问 x <= sqrt(m) 的时候, 直接存一下就可以了. 当询问 x > sqrt(m) 的时候,把n分成 n / x 块,…
DP 水题 Description A number whose only prime factors are 2,3,5 or 7 is called a humble number. The sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 24, 25, 27, ... shows the first 20 humble numbers. Write a program to find and print…
BZOJ 1666 水.. BZOJ 1579 分层图最短路. BZOJ 1782 从一开始若某头牛停在U,那么U的子树的时间都会加一用BIT维护DFS序就行了 BZOJ 1572 贪心+堆 排序后查看是否超过了时间,超过了就弹出 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <queue> #define LL lon…
A. Alyona and copybooks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Little girl Alyona is in a shop to buy some copybooks for school. She study four subjects so she wants to have equal…