码迷,mamicode.com
首页 >  
搜索关键字:spoj balnum balanced    ( 1777个结果
Spoj PRIME1 - Prime Generator
题意翻译 求给定的两个数之间的素数 Translated by @kaiming 题目描述 Peter wants to generate some prime numbers for his cryptosystem. Help him! Your task is to generate all ...
分类:其他好文   时间:2018-06-30 12:45:31    阅读次数:166
LeetCode 110 Balanced Binary Tree
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the dep ...
分类:其他好文   时间:2018-06-28 18:19:28    阅读次数:165
树上莫队算法
简介 树上莫队,顾名思义就是把莫队搬到树上。 我们从一道题目入手[SDOI2018]原题识别 SPOJ Count on a tree II 题目意思很明确:给定一个$n$个节点的树,每个节点表示一个整数,问$u$到$v$的路径上有多少个不同的整数。 像这种不带修改数颜色的题首先想到的肯定是树套树莫 ...
分类:编程语言   时间:2018-06-25 12:59:50    阅读次数:748
SPOJ COT2 - Count on a tree II(树上莫队)
题目描述 给定一个n个节点的树,每个节点表示一个整数,问u到v的路径上有多少个不同的整数。 输入格式 第一行有两个整数n和m(n=40000,m=100000)。 第二行有n个整数。第i个整数表示第i个节点表示的整数。 在接下来的n-1行中,每行包含两个整数u v,描述一条边(u,v)。 在接下来的 ...
分类:其他好文   时间:2018-06-24 21:07:11    阅读次数:144
856. Score of Parentheses
Given a balanced parentheses string S, compute the score of the string based on the following rule: () has score 1 AB has score A + B, where A and B a ...
分类:其他好文   时间:2018-06-24 20:53:33    阅读次数:265
leetcode 856. Score of Parentheses
Given a balanced parentheses string S, compute the score of the string based on the following rule: Example 1: Input: "()" Output: 1 Example 2: Input: ...
分类:其他好文   时间:2018-06-24 16:12:06    阅读次数:435
【spoj】DIVCNTK
"Portal Spoj DIVCNTK" Solution 这题的话其实是。。洲阁筛模板题?差不多吧 题意就是给你一个函数$S_k(x)$ $$ S_k(n)=\sum\limits_{i=1}^{n} \sigma_0(i^k) $$ 其中$\sigma_0(x)$表示的是$x$的约数个数,现在 ...
分类:其他好文   时间:2018-06-17 20:50:06    阅读次数:184
[Cracking the Coding Interview] 4.4 Check Balanced
Implement a function to check if a binary tree is balanced. For the purpose of this question, a balanced tree is defined to be a tree such that the he ...
分类:其他好文   时间:2018-06-16 10:34:06    阅读次数:169
leetcode 110. Balanced Binary Tree
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the dep ...
分类:其他好文   时间:2018-06-13 23:29:31    阅读次数:188
【刷题】SPOJ 1812 LCS2 - Longest Common Substring II
A string is finite sequence of characters over a non empty finite set Σ. In this problem, Σ is the set of lowercase letters. Substring, also called fa ...
分类:其他好文   时间:2018-06-10 11:42:53    阅读次数:162
1777条   上一页 1 ... 27 28 29 30 31 ... 178 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!