counting the numbers】的更多相关文章

题意: 给定$a,b,c$ ,求解满足 $1 \leq m \leq b, 1 \leq n \leq c, a | mn$ 的 $(m,n)$ 数对个数. $a \leq INTMAX$, $b \leq LONGLONGMAX$ 解法 原问题相当于求解 $mn \  mod \  a \equiv 0$ 的数对个数. $(m \  mod \ a) n \ mod \ a \equiv 0$ 这样$m$ ,实际有效的是 $m \ mod \ a$. 这样我们可以将原问题中的 $m$ 分为 $…
Xiao Ming's Hope Time Limit:1000MS     Memory Limit:32768KB  Description Xiao Ming likes counting numbers very much, especially he is fond of counting odd numbers. Maybe he thinks it is the best way to show he is alone without a girl friend. The day…
Given an array "nums" of integers and an int "k", Partition the array (i.e move the elements in "nums") such that, * All elements < k are moved to the left * All elements >= k are moved to the right Return the partition…
Xiao Ming's Hope Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1668    Accepted Submission(s): 1109 Problem Description Xiao Ming likes counting numbers very much, especially he is fond of cou…
Given an array nums of integers and an int k, partition the array (i.e move the elements in "nums") such that: All elements < k are moved to the left All elements >= k are moved to the right Return the partitioning index, i.e the first ind…
Xiao Ming's Hope Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description Xiao Ming likes counting numbers very much, especially he is fond of counting odd numbers. Maybe he thinks it is the best way to…
1012. Complement of Base 10 Integer Every non-negative integer N has a binary representation.  For example, 5 can be represented as "101" in binary, 11 as "1011" in binary, and so on.  Note that except for N = 0, there are no leading z…
Xiao Ming's Hope Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1786    Accepted Submission(s): 1182 Problem Description Xiao Ming likes counting numbers very much, especially he is fond of cou…
原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=4349 Xiao Ming's Hope Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1723    Accepted Submission(s): 1144 Problem Description Xiao Ming likes coun…
最近开始刷lintcode,记录下自己的答案,数字即为lintcode题目号,语言为python3,坚持日拱一卒吧... (一). 回文字符窜问题(Palindrome problem) 627. Longest Palindrome 给出一个包含大小写字母的字符串.求出由这些字母构成的最长的回文串的长度是多少. 数据是大小写敏感的,也就是说,"Aa" 并不会被认为是一个回文串 输入 : s = "abccccdd" 输出 : 7 说明 : 一种可以构建出来的最长回…