会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Keambar
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
7
8
9
10
11
12
13
14
下一页
2014年7月25日
POJ 2230 (欧拉路)
摘要: 分析: 基础的欧拉路算法,变化在于要求每条边正向和反向各走一遍。 链式前向星构图,只要标记走过的单向边,边找边输出即可。code#include #include using namespace std;struct node { int v, ne;} edge[100009];int h...
阅读全文
posted @ 2014-07-25 16:34 keambar
阅读(186)
评论(0)
推荐(0)
2014年7月24日
SGU 157.Patience
摘要: 简单的搜索,在n>10时,要打表code:#include#include#includeusing namespace std;const int maxn = 20, N = 14;int n, p[maxn], ans = 0;void dfs (int emp){ int i, j, p0[...
阅读全文
posted @ 2014-07-24 09:57 keambar
阅读(256)
评论(0)
推荐(0)
SGU 155.Cartesian Tree
摘要: 时间限制:0.25s空间限制:6M题意: 给出n(n#include #include #include #include #include using namespace std;struct node { int key, val, ID;} p;struct answer { int fa...
阅读全文
posted @ 2014-07-24 08:40 keambar
阅读(423)
评论(0)
推荐(0)
2014年7月17日
SGU 154.Factorial
摘要: 时间限制:0.25s空间限制:4M题意 你的任务是找到最小自然数 N, 使N!在十进制下包含 Q个零. 众所周知 N! = 1*2*...*N. 例如, 5! = 120, 120 结尾包含1个零.Input 一个数 Q (0using namespace std;int check ...
阅读全文
posted @ 2014-07-17 19:04 keambar
阅读(225)
评论(0)
推荐(0)
SGU 152.Making round
摘要: 不断向下取直到,忽略的数累计到一个百分比,给当前百分比加1。 这道题要避免处理浮点数,用余数来处理,不然会wa 9 #include #include using namespace std;int g[10001];int x, n, sum, le;int main() { cin >>...
阅读全文
posted @ 2014-07-17 16:21 keambar
阅读(278)
评论(0)
推荐(0)
2014年7月16日
SGU 170.Particles
摘要: Solution: 这其实是道很简单的题。 只要从一端开始,以‘+’或‘-’,任意一种开始找,找到与目标串最近的相同字符的距离就是需要交换的次数。 +++——— 对齐第一个‘-’ —+++—— ---...
阅读全文
posted @ 2014-07-16 23:04 keambar
阅读(159)
评论(0)
推荐(0)
SGU 179.Brackets light
摘要: 时间限制:0.25s空间限制:12M题意 给定一个合法的仅由'(',')'组成的括号序列,求它的下一个合法排列.假定'('f[j]; 将最后的‘)’和‘(’ 交换位置,再把后面所以的括号反转。即可得到我们需要的解。code:#include #include #include usi...
阅读全文
posted @ 2014-07-16 21:10 keambar
阅读(330)
评论(0)
推荐(0)
SGU 181.X-Sequence
摘要: 时间限制:0.5s空间限制:4M题意: 令X0=A, Xi=(a*Xi-1^2,b*Xi-1+c)%m; 求Xk,(0#include #include #include using namespace std;const int INF = 111111;vector ans;...
阅读全文
posted @ 2014-07-16 19:45 keambar
阅读(197)
评论(0)
推荐(0)
2014年7月15日
SGU 149. Computer Network
摘要: 时间限制:0.25s空间限制:4M;题意: 给出一颗n(n#include #include #include using namespace std;#define mp make_pair#define fi first#define se second#define sz(x) ((int...
阅读全文
posted @ 2014-07-15 15:52 keambar
阅读(486)
评论(0)
推荐(0)
SGU 148.B-Station
摘要: 时间限制:0.25s空间限制:4M题目 在离著名的国家Berland不远的地方,有一个水下工作站。这个工作站有N层。已知:是第层装有Wi的水,最多可以容纳Li的水,恐怖分子炸毁第i的代价是Pi。第i层一旦被炸毁,该层所有的水都将倾泻到第i+1层。如果某一层的水量超过了它的容量(即Li),那么该...
阅读全文
posted @ 2014-07-15 11:31 keambar
阅读(534)
评论(0)
推荐(0)
上一页
1
···
7
8
9
10
11
12
13
14
下一页
公告