• 解题报告-1012. Numbers With Repeated Digits

    时间:2023-11-25 15:39:05

    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) 解题报告

    时间:2023-11-24 13:58:19

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5108题目意思:给出一个数正整数 N,N <= 1e9,现在需要找出一个最少的正整数 M,使得 N/M 是素数。如果找不到就输出0.一开始有想过将所有 <= 1e9 的素数求出来的,不过绝对超...

  • 『ACM C++』PTA浙大 | 基础题 - Have Fun with Numbers

    时间:2023-11-21 17:38:10

    连着这两道都是开学前数构老师的“爱心作业”,还没上课开学就给我们布置作业了,这道题有点小坑,也经常遇到类似的问题,特地拿出来记录一下。------------------------------------------------题目---------------------------------...

  • UVA 12050 - Palindrome Numbers 模拟

    时间:2023-11-16 14:34:17

    题目大意:给出i,输出第i个镜像数,不能有前导0.题解:从外层开始模拟#include <stdio.h>int p(int x){ int sum, i; ;i<=x;i++) sum *= ; return sum;}int main(){ ...

  • POJ3641-Pseudoprime numbers(快速幂取模)

    时间:2023-11-15 18:23:36

    题目大意判断一个数是否是伪素数题解赤果果的快速幂取模。。。。代码:#include<iostream>#include<cmath>using namespace std;#define LL long longLL mul_mod(LL a,LL b,int n){ ...

  • UVa 11582 (快速幂取模) Colossal Fibonacci Numbers!

    时间:2023-11-15 17:53:14

    题意:斐波那契数列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

    时间:2023-11-13 12:32:08

    问题来源:Find All Numbers Disappeared in an Array 很久没有刷题了,感觉大脑开始迟钝,所以决定重拾刷题的乐趣。一开始不要太难,选一些通过率高的题目做,然后就看到了这个题目。我有些吃惊,这个题我虽然知道两种解法,但本身还是有难度的,居然通过率这么高。然后就搜索相...

  • HDU 1058 Humble Numbers (DP)

    时间:2023-11-12 21:08:11

    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 快速幂)

    时间:2023-11-11 13:10:53

    Raising Modulo NumbersTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 5934 Accepted: 3461DescriptionPeople are different. Some secretly read...

  • ZCMU 2177 Lucky Numbers (easy)

    时间:2023-11-10 21:07:31

    传送门:http://acm.zcmu.edu.cn/JudgeOnline/problem.php?id=21772177: Lucky Numbers (easy)时间限制: 2 Sec  内存限制: 256 MB提交: 42  解决: 21[提交][状态][讨论版]题目描述time limit...

  • Good Numbers

    时间:2023-11-10 19:35:08

    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 寒假训练

    时间:2023-10-08 23:06:49

    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

    时间:2023-09-23 15:41:26

    原题链接在这里: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

    时间:2023-09-23 15:41:38

    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)

    时间:2023-09-23 15:41:20

    445. 两数相加 II445. Add Two Numbers II题目描述给定两个非空链表来代表两个非负整数。数字最高位位于链表开始位置。它们的每个节点只存储单个数字。将这两数相加会返回一个新的链表。你可以假设除了数字 0 之外,这两个数字都不会以零开头。进阶:如果输入链表不能修改该如何处理?换...

  • [LeetCode] Add Two Numbers 两个数字相加

    时间:2023-09-23 15:41:14

    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...

  • 201. Bitwise AND of Numbers Range -- 连续整数按位与的和

    时间:2023-09-11 21:52:40

    Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive.For example, given the r...

  • 1069. The Black Hole of Numbers

    时间:2023-08-14 11:07:01

    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...

  • HDU 5676 ztr loves lucky numbers (模拟)

    时间:2023-07-05 20:49:50

    ztr loves lucky numbers题目链接:http://acm.hust.edu.cn/vjudge/contest/121332#problem/IDescriptionztr loves lucky numbers. Everybody knows that positive in...

  • [LeetCode] Lexicographical Numbers 字典顺序的数字

    时间:2023-06-01 19:49:14

    Given an integer n, return 1 - n in lexicographical order.For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9].Please optimize your algorith...