码迷,mamicode.com
首页 >  
搜索关键字:spoj balnum balanced    ( 1777个结果
POJ 3264 Balanced Lineup (线段树单点更新 区间查询)
POJ 3264 Balanced Lineup (线段树单点更新 区间查询)...
分类:其他好文   时间:2015-02-25 01:53:16    阅读次数:202
SPOJ Problem 5:The Next Palindrome
题目大意:根据给出的数字串求较大的最小回文串 简单题,可以从中间开始比较,如果左边大于右边的话则终止,若右边大于左边的话则中间+1,然后向左边推。输出时按左边复制一遍。#include#includeint t,i,j,l,r,n,pd,q,mid;char s[1000005];int main(...
分类:其他好文   时间:2015-02-24 22:08:52    阅读次数:200
Balanced Binary Tree
https://oj.leetcode.com/problems/balanced-binary-tree/Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced bina...
分类:其他好文   时间:2015-02-24 17:31:15    阅读次数:118
spoj10606 数位dp (求出现的数字,所有偶数出现奇数次,所有奇数出现偶数次)
http://www.spoj.com/problems/BALNUM/ SPOJ Problem Set (classical) 10606. Balanced Numbers Problem code: BALNUM Balanced numbers have been used by mathematicians for centu...
分类:其他好文   时间:2015-02-24 12:37:35    阅读次数:164
spoj 2398 Qtree3
Description给出一棵树,树节点的颜色初始时为白色,有两种操作:0 x:把x号节点颜色取反1 x:询问1到x路径上第一个黑点编号Solution最近想练练剖分和线段树,于是想到来做做Qtree系列,不会Lct嘤嘤嘤>_<这题比较裸,直接剖分然后维护区间最浅的黑色点标号就可以了注意到把1当做根节点,其实剖分后每个区间左区间显然是更浅的,如果有黑点直接统计答案就可以了Code#include <...
分类:其他好文   时间:2015-02-23 21:17:36    阅读次数:219
hdu3709 数位dp(自身平衡的数字)
http://acm.hdu.edu.cn/showproblem.php?pid=3709 Problem Description A balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagi...
分类:其他好文   时间:2015-02-22 23:06:28    阅读次数:194
POJ3264 Balanced Lineup 线段树 RMQ ST算法应用
Balanced Lineup Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 36813 Accepted: 17237 Case Time Limit: 2000MS DescriptionFor the daily milking, Farmer John’s N cows (1 ≤ N ≤...
分类:编程语言   时间:2015-02-22 21:58:46    阅读次数:188
SPOJ Problem 4:Transform the Expression
这题也不难,模拟一下栈,若搜到字符为+-则弹出栈顶,若搜到字符为*/且不为+-则弹出栈顶,然后把搜到的操作字符压入栈顶,字母就输出。#include#includechar s[500],symbol[500];int num[500],i,j,t,r;int main(){ int t; ...
分类:其他好文   时间:2015-02-22 20:37:47    阅读次数:174
最大公约数和最小公倍数
在ACM竞赛中,有很多题目都是关于最大公约数和最小公倍数的,今天,就带领大家一起来领略它的魅力。接下来,我 会分析几个经典的题目。好了,废话不多说,开始进入正题!   题目:http://www.spoj.com/problems/NUMTRYE/   题意:定义两个函数如下                          求如下表达式的值...
分类:其他好文   时间:2015-02-22 15:47:50    阅读次数:142
SPOJ 7001(莫比乌斯反演)
传送门:Visible Lattice Points题意:0#include #include #include #include #include #include #include #include #include #include #include #include #define LL l...
分类:其他好文   时间:2015-02-21 06:27:29    阅读次数:202
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!