玛莱之盾
码龄5年
关注
提问 私信
  • 博客:70,151
    70,151
    总访问量
  • 78
    原创
  • 431,067
    排名
  • 42
    粉丝
  • 0
    铁粉
IP属地以运营商信息为准,境内显示到省(区、市),境外显示到国家(地区)
IP 属地:江苏省
  • 加入CSDN时间: 2020-01-08
博客简介:

naexting的博客

查看详细资料
个人成就
  • 获得81次点赞
  • 内容获得22次评论
  • 获得448次收藏
  • 代码片获得3,124次分享
创作历程
  • 82篇
    2021年
成就勋章
TA的专栏
  • C++
    54篇
  • 洛谷
    17篇
  • PTA
    36篇
  • 数据结构
    5篇
  • 蓝桥杯
    3篇
  • 深度学习
    2篇
  • 前端
    5篇
  • 单片机
    13篇
兴趣领域 设置
  • 数据结构与算法
    推荐算法
  • 人工智能
    opencv计算机视觉深度学习神经网络自然语言处理pytorch图像处理回归
创作活动更多

HarmonyOS开发者社区有奖征文来啦!

用文字记录下您与HarmonyOS的故事。参与活动,还有机会赢奖,快来加入我们吧!

0人参与 去创作
  • 最近
  • 文章
  • 代码仓
  • 资源
  • 问答
  • 帖子
  • 视频
  • 课程
  • 关注/订阅/互动
  • 收藏
搜TA的内容
搜索 取消

【转载】【C/C++】求最大公约数的三种方法

一、最大公约数与最小公倍数最大公约数,属于数论所探究的内容。最大公约数可以通过下面的三种方法求出来。最小公倍数呢,它与最大公约数的乘机为所求数之积。比如求 x,y的最大公约数和最小公倍数记住这个公式:== xy=最小公倍数最大公约数==二、求最大公约数的三种方法①辗转相除法算法流程图代码块:int measure(int x, int y){ int z = y; while(x%y!=0) { z = x%y; x = y; y = z; } retur
转载
发布博客 2021.11.02 ·
1347 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

全错位排列问题

问题描述这是一个很经典的数学问题:有一个人写了n封信件,对应n个信封,然而粗心的秘书却把所有信件都装错了信封,那么一共有多少种装错的装法?数学抽象这个问题可抽象为以下一个数学问题:已知一个长度为n的有序序列{a1,a2,a3,…,an},打乱其顺序,使得每一个元素都不在原位置上,则一共可以产生多少种新的排列?例如:原序列为{a,b,c,d,e},则新序列{b,c,d,e,a}为其一个全错位排列,新序列中每一个元素都不在原来的位置上。问题解决首先考虑几种简单的情况:原序列长度为1序列中只有一个
转载
发布博客 2021.10.01 ·
1339 阅读 ·
0 点赞 ·
0 评论 ·
3 收藏

负数取余问题

前言:对于两个相同符号的数取余大家都很熟悉,但是对于一正一负的数取余呢?大家可能觉得会很陌生,今天在刷leetcode7:整数反转(easy)这道题的时候,想起了这个知识点,遂打算探讨一番。自然数取余定义分为两种:1)定义1:如果a和d是两个自然数,d非零,可以证明存在两个唯一的整数 q 和 r,满足a=qd+r且0 ≤ r < d(其中q为商,r为余数)。定义1一般作为数学中的取余法则,即两个数取余,余数总是为正数。举例:5%3=3x1+2,商为1,余数为2(-5)%(-3)=(-3)
转载
发布博客 2021.10.01 ·
7831 阅读 ·
8 点赞 ·
2 评论 ·
33 收藏

vscode debug 数组

1、添加检测(type()[number])begintype,类型number,查看数量begin,起始地址指针2、直接查看鼠标指向变量名即可转载
转载
发布博客 2021.09.19 ·
771 阅读 ·
0 点赞 ·
0 评论 ·
2 收藏

1090 Highest Price in Supply Chain (25 分)

A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys products from one’s supplier in a price P an
原创
发布博客 2021.09.16 ·
180 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1079 Total Sales of Supply Chain (25 分)

A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone on the chain buys products from one’s supplier in a price P an
原创
发布博客 2021.09.16 ·
106 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1102 Invert a Binary Tree (25 分)

The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a whiteboard so fuck off.Now it’s your turn to prove that YOU CAN invert a binary tree!Input Specificati
原创
发布博客 2021.09.16 ·
81 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1020 Tree Traversals (25 分)

Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the corresponding binary tree.Input Specification:Each input
原创
发布博客 2021.09.16 ·
84 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1086 Tree Traversals Again (25 分)

An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is traversed, the stack operations are: push(1); push(2); push(3); pop(); pop(
原创
发布博客 2021.09.16 ·
97 阅读 ·
0 点赞 ·
0 评论 ·
1 收藏

1091 Acute Stroke (30 分)

One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in which the core regions are identified in each MRI slice, your job is to calculate the volume of the stroke core.Input Specificat
原创
发布博客 2021.09.14 ·
96 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1103 Integer Factorization (30 分)

The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program to find the K−P factorization of N for any positive integers N, K and P.Input Specification:Each input fi
原创
发布博客 2021.09.14 ·
92 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1056 Mice and Rice (25 分)

Mice and Rice is the name of a programming contest in which each programmer must write a piece of code to control the movements of a mouse in a given map. The goal of each mouse is to eat as much rice as possible in order to become a FatMouse.First the pl
原创
发布博客 2021.09.14 ·
159 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1051 Pop Sequence (25 分)

Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, …, N and pop randomly. You are supposed to tell if a given sequence of numbers is a possible pop sequence of the stack. For example, if M is 5 and N is 7, we can obtain
原创
发布博客 2021.09.14 ·
113 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1071 Speech Patterns (25 分)

People often have a preference among synonyms of the same word. For example, some may prefer “the police”, while others may prefer “the cops”. Analyzing such patterns can help to narrow down a speaker’s identity, which is useful when validating, for exampl
原创
发布博客 2021.09.14 ·
101 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1054 The Dominant Color (20 分)

Behind the scenes in the computer’s memory, color is always talked about as a series of 24 bits of information for each pixel. In an image, the color with the largest proportional area is called the dominant color. A strictly dominant color takes more than
原创
发布博客 2021.09.14 ·
125 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1100 Mars Numbers (20 分)

People on Mars count their numbers with base 13:Zero on Earth is called “tret” on Mars.The numbers 1 to 12 on Earth is called “jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec” on Mars, respectively.For the next higher digit, Mars people name
原创
发布博客 2021.09.14 ·
89 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1060 Are They Equal (25 分)

If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×10510^5105 with simple chopping. Now given the number of significant digits on a machine and two float numbers, you
原创
发布博客 2021.09.14 ·
84 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1063 Set Similarity (25 分)

Given two sets of integers, the similarity of the sets is defined to beNc/Nt×100N_c/N_t×100Nc​/Nt​×100​%, whereNcN_cNc​​​ is the number of distinct common numbers shared by the two sets, and NtN_tNt​​​ is the total number of distinct numbers in the two set
原创
发布博客 2021.09.13 ·
88 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1047 Student List for Course (25 分)

Zhejiang University has 40,000 students and provides 2,500 courses. Now given the registered course list of each student, you are supposed to output the student name lists of all the courses.Input Specification:Each input file contains one test case. For
原创
发布博客 2021.09.13 ·
113 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏

1039 Course List for Student (25 分)

Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered course list for each student who comes for a query.Input Specification:Each input file contai
原创
发布博客 2021.09.13 ·
120 阅读 ·
0 点赞 ·
0 评论 ·
0 收藏
加载更多