ICode9

精准搜索请尝试: 精确搜索
  • PAT Advanced 1027 Colors in Mars(20)2022-08-21 00:31:45

    题目描述: People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 digits for Green, and the last 2 digits for Blue. Th

  • CF715C Digit Tree2022-08-15 21:32:58

    沝黑。 首先这种统计路径的问题一般联想点分治,然后考虑如何处理经过一个点 \(u\) 的路径。 考虑有一个点 \(p\in u\) 的子树,然后记录路径 \(p\to u\) 和路径 \(u\to p\) 的答案。前者放入一个映射统计,后者存在数组 \(S\) 里面。 最后整体统计,枚举 \(x\in S\),设 \(x\lt M\),统计映射

  • LeetCode 2094. Finding 3-Digit Even Numbers2022-08-08 03:00:27

    原题链接在这里:https://leetcode.com/problems/finding-3-digit-even-numbers/ 题目: You are given an integer array digits, where each element is a digit. The array may contain duplicates. You need to find all the unique integers that follow the given requirem

  • 适合初学者的使用CNN的数字识别项目:Digit Recognizer with CNN for beginner2022-08-01 14:32:52

    准备工作 数据集介绍 数据文件 train.csv 和 test.csv 包含从零到九的手绘数字的灰度图像。 每张图像高 28 像素,宽 28 像素,总共 784 像素。每个像素都有一个与之关联的像素值,表示该像素的亮度或暗度,数字越大表示越暗。该像素值是介于 0 和 255 之间的整数,包括 0 和 255。 训练数据

  • day312022-07-28 18:02:49

    1.剑指 Offer 14- II. 剪绳子 II 1 class Solution { 2 public: 3 int cuttingRope(int n) { 4 if(n <= 3) return n - 1; 5 long res = 1; 6 while(n > 4){ 7 n -= 3; 8 res = (res * 3) % 1000000007; 9

  • [LeetCode] 2310. Sum of Numbers With Units Digit K2022-06-19 14:05:54

    Given two integers num and k, consider a set of positive integers with the following properties: The units digit of each integer is k. The sum of the integers is num. Return the minimum possible size of such a set, or -1 if no such set exists. Not

  • Leetcode 2259. 移除指定数字得到的最大结果(可以,一次过)2022-06-17 17:03:04

    给你一个表示某个正整数的字符串 number 和一个字符 digit 。 从 number 中 恰好 移除 一个 等于 digit 的字符后,找出并返回按 十进制 表示 最大 的结果字符串。生成的测试用例满足 digit 在 number 中出现至少一次。 示例 1: 输入:number = "123", digit = "3" 输出:"12" 解释:"123"

  • 整数分解和for循环2022-06-09 13:31:13

    整数分解: 什么是整数分解:就是输入的一为数比如356,那么输出出来的就是653. 也就是把数字逆向输出 整数分解:又称素因素分解,把个位,十位,百位   案例 键盘录入,定义一个number,键盘录入接受一下,定义一个次数, 然后while(执行条件)循环, int digit = number %10;result = result*10+digit;Sys

  • 1027 Colors in Mars(20分)2022-06-02 17:32:54

    People in Mars represent the colors in their computers in a similar way as the Earth people. That is, a color is represented by a 6-digit number, where the first 2 digits are for Red, the middle 2 digits for Green, and the last 2 digits for Blue. The only

  • LeetCode 0190 Reverse Bits2022-05-30 21:33:33

    原题传送门 1. 题目描述 2. Solution 1 1、思路分析 逐位颠倒 We first initialize result to 0. We then iterate from 0 to 31 (an integer has 32 bits). In each iteration: We first shift result to the left by 1 bit. Then, if the last digit of input n is 1, we add 1

  • shell编程——正则表达式2022-05-06 19:03:23

    正则表达式 用一个“字符串公式”来描述一个特征,然后去验证另一个“字符串”是否符合这个特征 shell与正则表达式 以下命令支持正则表达式 locate sed find grep vim awk 正则表达式字符类型 元字符 定位符 匹配符 限定符 POSIX字符 元字符符号 定位符 定位符 说明

  • hdu Rightmost Digit2022-05-03 19:31:06

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1061 水题快速幂,求余进行最后一个取尾操作就可以,坑点不大, 直接上代码: Talk is cheap. Show me the code. #include<bits/stdc++.h> using namespace std; long long t; long long fastpow(long long a,long long b) { lon

  • 【leetcode】291 周赛2022-05-01 19:00:06

    T1 6047. 移除指定数字得到的最大结果 给你一个表示某个正整数的字符串 number 和一个字符 digit 。 从 number 中 恰好 移除 一个 等于 digit 的字符后,找出并返回按 十进制 表示 最大 的结果字符串。生成的测试用例满足 digit 在 number 中出现至少一次。 思路 将字符串转化列

  • 剑指 Offer 67. 把字符串转换成整数2022-04-20 22:01:39

    思路:模拟,排除边界情况 Python: class Solution: def strToInt(self, str: str) -> int: if not str or (len(str)==1 and (str[0]<'0' or str[0]>'9')): return 0 str=str.strip() count=len(str) dig

  • 我的第一篇随笔 P1118 [USACO06FEB]Backward Digit Sums G/S 题解2022-04-05 21:32:44

    P1118 [USACO06FEB]Backward Digit Sums G/S 题解 ··· #include<bits/stdc++.h> #define rep(i,x,n) for(int i=x;i<=n;i++) using namespace std; int s[20][20];//系数 int st[20];//判断dfs时数有没有被枚举过 int d[20];//数字 vector<int> q; int n,target; void ini

  • 人人能看懂的区块链底层技术简介2022-02-23 14:03:50

    加密的奥义是上下文。比如“的”GBK编码是B5C4,用“高档”的加密算法固定变成100个字节,还是不够安全。破解者收集大量密文后进行统计,发现有100个字节出现次数非常多,那它就很可能对应“的”。然后再使用语言模型,如“我的”、“你的”都是高频词,再找出“我”、“你”等等。请浏览下:

  • 我的代码笔记2022-02-08 01:31:08

    public/assets/js/backend/support/support.js 1 update student set s_birth = DATE_FORMAT(SUBSTR(idcard,7,8),'%Y-%m-%d') ,s_age=2022-SUBSTR(idcard,7,4) 2 where LENGTH(idcard)=18 3 and idcard regexp '^[1-9][[:digit:]]{7}((0[[:digit:]])|(1[

  • toLocaleString()使用2022-02-07 18:33:00

    1 const num = 1000000; 2 //整数部分每三位追加一个逗号 3 num.toLocaleString(); //1,000,000 4 //转换为百分比 5 num.toLocaleString("zh", { style: "percent" }); // 100000000% 6 //转换为货币显示 7 num.toLocaleString("zh", { style: "

  • Python之阿姆斯特朗数的两种情况2022-01-31 16:58:29

    如果一个n位正整数等于其各位数字的n次方之和,则称该数为阿姆斯特朗数。 例如1^3 + 5^3 + 3^3 = 153。 1000以内的阿姆斯特朗数: 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407。 (1)下面检测输入的数是否是阿姆斯特朗数。 代码: # 获取用户输入的数字 num = int(input("请输入一

  • 1152 Google Recruitment (20 分)(字符串处理)2022-01-25 22:00:24

    In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is super-simple, a URL consisting of the first 10-digit prime found in consecutive digits of the natural constan

  • 洛谷AT3867 [AGC021A] Digit Sum 22022-01-24 13:02:59

    传送门 题意翻译 给出N,求小于等于N的正整数中用十进制表示各数位数字之和的最大值。 思路: 分两种情况: 1.本身所有数都加起来 2.把第1位-1,剩下来的全部变成9 代码也不难: #include<bits/stdc++.h> using namespace std; char a[20]; int ans1,ans2;//ans1为第一种情况,ans2为第二

  • GRE数学入门级词汇2022-01-20 22:31:12

    1.Arithmetic 算术 integer整数 positive number正数 negative number负数 odd number奇数 even number偶数 prime number质数 composite number合数 multiple倍数 factor/divisor因数 least common multiple最小公倍数 greatest common factor/divisor最大公约数 product

  • Python 数字转中文表述2022-01-20 11:01:22

    Python 数字转中文表述 想起来很久之前产品提了一个需求,用户输入一串数字,我们要将其转换为对应的中文,如: -> 123456789 -> 一亿二千三百四十五万六千七百八十九 这点需求而已,动手操作一下,想法就是先设置几个档位去找到对应的单位,如个十百千万,还有一个细节就是零这个字什么时候才

  • 【LeetCode】剑指 Offer 44. 数字序列中某一位的数字2022-01-03 13:35:17

    【LeetCode】剑指 Offer 44. 数字序列中某一位的数字 文章目录 【LeetCode】剑指 Offer 44. 数字序列中某一位的数字 package offer; public class Solution44 { public static void main(String[] args) { int n = 11; Solution44 solution = new

  • 绘制七段数码管(python)2022-01-03 09:03:40

            我们日常所见的霓虹灯很多都是由数码管所组成的,根据不同数码管的显色来显示不同的数字,那python语境下如何绘制数码管呢? 首先要明确数码管绘制的方式和方向:  由此代码为: #七段数码管的绘制 from turtle import * from time import * def Gap(): #预留数码管

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有