[LeetCode] 628. Maximum Product of Three Numbers_Easy
Given an integer array, find three numbers whose product is maximum and output the maximum product.Example 1:Input: [1,2,3]Output: 6Example 2:Input: [...
Binary Numbers(HDU1390)
Binary Numbers点我Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3820 Accepted Submission(s)...
UVa #11582 Colossal Fibonacci Numbers!
巨大的斐波那契数The i'th Fibonacci number f (i) is recursively defined in the following way:f (0) = 0 and f (1) = 1f (i+2) = f (i+1) + f (i) for every i ≥ 0Y...
解题报告-1012. Numbers With Repeated Digits
Given a positive integer N, return the number of positive integers less than or equal to N that have at least 1 repeated digit. Example 1:Input: 20Out...
BestCoder19 1001.Alexandra and Prime Numbers(hdu 5108) 解题报告
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5108题目意思:给出一个数正整数 N,N <= 1e9,现在需要找出一个最少的正整数 M,使得 N/M 是素数。如果找不到就输出0.一开始有想过将所有 <= 1e9 的素数求出来的,不过绝对超...
『ACM C++』PTA浙大 | 基础题 - Have Fun with Numbers
连着这两道都是开学前数构老师的“爱心作业”,还没上课开学就给我们布置作业了,这道题有点小坑,也经常遇到类似的问题,特地拿出来记录一下。------------------------------------------------题目---------------------------------...
UVA 12050 - Palindrome Numbers 模拟
题目大意:给出i,输出第i个镜像数,不能有前导0.题解:从外层开始模拟#include <stdio.h>int p(int x){ int sum, i; ;i<=x;i++) sum *= ; return sum;}int main(){ ...
POJ3641-Pseudoprime numbers(快速幂取模)
题目大意判断一个数是否是伪素数题解赤果果的快速幂取模。。。。代码:#include<iostream>#include<cmath>using namespace std;#define LL long longLL mul_mod(LL a,LL b,int n){ ...
UVa 11582 (快速幂取模) Colossal Fibonacci Numbers!
题意:斐波那契数列f(0) = 0, f(1) = 1, f(n+2) = f(n+1) + f(n) (n ≥ 0)输入a、b、n,求f(ab)%n分析:构造一个新数列F(i) = f(i) % n,则所求为F(ab)如果新数列中相邻两项重复出现的话,则根据递推关系这个数列是循环的。相邻两项所有可...
leetcode之Find All Numbers Disappeared in an Array
问题来源:Find All Numbers Disappeared in an Array 很久没有刷题了,感觉大脑开始迟钝,所以决定重拾刷题的乐趣。一开始不要太难,选一些通过率高的题目做,然后就看到了这个题目。我有些吃惊,这个题我虽然知道两种解法,但本身还是有难度的,居然通过率这么高。然后就搜索相...
HDU 1058 Humble Numbers (DP)
Humble NumbersTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18238 Accepted Submission(s):...
Raising Modulo Numbers(POJ 1995 快速幂)
Raising Modulo NumbersTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 5934 Accepted: 3461DescriptionPeople are different. Some secretly read...
ZCMU 2177 Lucky Numbers (easy)
传送门:http://acm.zcmu.edu.cn/JudgeOnline/problem.php?id=21772177: Lucky Numbers (easy)时间限制: 2 Sec 内存限制: 256 MB提交: 42 解决: 21[提交][状态][讨论版]题目描述time limit...
Good Numbers
Problem DescriptionIf we sum up every digit of a number and the result can be exactly divided by 10, we say this number is a good number.You are requi...
C - Reduced ID Numbers 寒假训练
T. Chur teaches various groups of students at university U. Every U-student has a unique Student Identification Number (SIN). A SIN s is an integer in...
LeetCode Add Two Numbers II
原题链接在这里:https://leetcode.com/problems/add-two-numbers-ii/题目:You are given two linked lists representing two non-negative numbers. The most significant...
[leetcode]445. Add Two Numbers II 两数相加II
You are given two non-empty linked lists representing two non-negative integers. The most significant digit comes first and each of their nodes contai...
LeetCode 445. 两数相加 II(Add Two Numbers II)
445. 两数相加 II445. Add Two Numbers II题目描述给定两个非空链表来代表两个非负整数。数字最高位位于链表开始位置。它们的每个节点只存储单个数字。将这两数相加会返回一个新的链表。你可以假设除了数字 0 之外,这两个数字都不会以零开头。进阶:如果输入链表不能修改该如何处理?换...
[LeetCode] Add Two Numbers 两个数字相加
You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai...
1069. The Black Hole of Numbers
For any 4-digit integer except the ones with all the digits being the same, if we sort the digits in non-increasing order first, and then in non-decre...