进阶数据结构——高精度运算

目录

  • 前言
  • 一、高精度运算的定义与背景
  • 二、高精度运算的实现方式
  • 三、高精度运算的算法实现
  • 四、高精度运算的应用场景
  • 五、代码模版(c++)
  • 六、经典例题
    • 1.[高精度加法](https://www.lanqiao.cn/problems/1516/learning/?page=1&first_category_id=1&name=%E9%AB%98%E7%B2%BE%E5%BA%A6%E5%8A%A0%E6%B3%95)
    • 3.[高精度减法](https://www.luogu.com.cn/problem/P2142)
    • 3.[高精度乘法](https://www.lanqiao.cn/problems/1515/learning/?page=1&first_category_id=1&name=%E9%98%B6%E4%B9%98%E8%AE%A1%E7%AE%97)
    • 4.[高精度除法](https://www.luogu.com.cn/problem/P1480)
  • 七、总结
  • 结语

前言

从这期开始我们就开始进入进阶数据结构的学习了。进阶数据结构中的高精度运算分析,主要聚焦于如何在计算机编程中有效处理超出常规数据类型表示范围的极大或极精确数值。

在这里插入图片描述

一、高精度运算的定义与背景

高精度运算是指在计算机编程中,对超出常规数据类型(如整型、浮点型)所能表示范围的极大或极精确数值进行的各种数学运算。在标准的计算机编程语言中,内置的整数和浮点数类型有其固定的字节数和精度限制,一旦数字过大或精度过高,就会导致溢出或精度丢失的问题。因此,高精度运算技术应运而生。

二、高精度运算的实现方式

高精度运算的实现方式通常涉及自定义数据结构来存储极大数值的每一位。这些数据结构能够模拟人类手算时多位数列的运算规则,使得在理论上能够处理任意长度和精度的数字。常见的实现方式包括:
数组:数组是最常用的数据结构之一,在高精度运算中,可以使用数组来存储每一位数字。例如,在C++中,可以使用std::vector或std::deque等动态数组来分别存储每一位数字。这种方式的好处是访问和修改数字的各个位非常方便,且能够处理任意长度的数字。
字符串:在某些情况下,也可以使用字符串来表示高精度数。字符串的好处是能够直接输入和输出,且不需要考虑数字的位数和进位问题。但是,字符串中的每一位是一个字符,不能直接进行运算,必须先将它转化为数值再进行运算,这增加了运算的复杂性。

三、高精度运算的算法实现

高精度运算的算法实现包括加、减、乘、除等基本运算。以下是对这些运算的简要分析:

加法:高精度加法的基本思想是将两个加数和被加数数组从第一位开始对其,并从第一位开始向后遍历,每一位相加并判断进位,直至到达输入数据末端为止。最后,如果最高位有进位,则需要添加一位。
减法:高精度减法与加法类似,但需要注意处理借位问题。当被减数小于减数时,需要向前一位借位。借位的过程可以通过在该位加上10并减去下一位的值来实现。同时,需要注意处理结果的符号和前导零。
乘法:高精度乘法的基本思想是两个数组相对应位置的数字相乘并考虑进位。可以使用双重循环来遍历两个数组的每一位,并将乘积累加到结果数组中。最后,需要处理进位问题。
除法:高精度除法相对复杂,通常使用长除法或更高效的算法如Karatsuba算法等来实现。除法的关键是逐位确定商的值,并通过减法来确定余数。由于除法运算的复杂性,实现时需要注意处理各种边界情况和异常情况。

四、高精度运算的应用场景

高精度运算在许多领域都有广泛的应用场景,包括但不限于:

科学计算:在科学计算中,经常需要处理小数点后几百位甚至更多的数字,高精度运算能够提供必要的精度和范围支持。
金融计算:在金融领域,高精度运算用于处理大额货币交易和精确计算利息等金融指标。
密码学:在密码学中,高精度运算用于实现加密算法和生成大素数等安全操作。
计算机图形学:在计算机图形学中,高精度运算用于处理浮点数运算中的精度丢失问题,以确保图形的精确渲染。

五、代码模版(c++)

六、经典例题

1.高精度加法

蓝色字体点进去看原题
蓝色字体点进去看原题
蓝色字体点进去看原题

#include<iostream>
#include<cstring>
using namespace std;const int Base = 1000;			//进制数
const int Capacity = 100;		//数组容量class BigInt {
private:int m_size;int m_data[Capacity];void removeLendingZero();				//去除前导0
public:BigInt(int v);				BigInt();								BigInt(char s[]);						//将数字字符串存入数据void print(char end);BigInt(const BigInt& bi);BigInt& operator=(const BigInt& bi);int compare(const BigInt& bi);BigInt operator+(const BigInt& bi);BigInt operator-(const BigInt& bi);BigInt operator*(const BigInt& bi);BigInt operator/(const BigInt& bi);
};BigInt::BigInt() {m_size = 0;memset(m_data, 0, sizeof(m_data));
}BigInt::BigInt(int v) {m_size = 0;while (v > 0) {m_data[m_size++] = v % Base;v /= Base;}
}BigInt::BigInt(char s[]) {m_size = 0;int b = 1;memset(m_data, 0, sizeof(m_data));for (int i = strlen(s) - 1; i >= 0; i--) {m_data[m_size] += (s[i] - '0') * b;b *= 10;if (b >= Base) {b = 1;m_size++;m_data[m_size] = 0;}}if (m_data[m_size] > 0) m_size++;removeLendingZero();
}BigInt::BigInt(const BigInt& bi) {m_size = bi.m_size;memcpy(m_data, bi.m_data, sizeof(bi.m_data));
}BigInt& BigInt::operator=(const BigInt& bi) {m_size = bi.m_size;memcpy(m_data, bi.m_data, sizeof(m_data));return *this;
}void BigInt::print(char end) {cout << (m_size == 0 ? 0 : m_data[m_size - 1]);for (int i = m_size - 2; i >= 0; i--) {for (int j = Base / 10; j > 0; j /= 10) {cout << (m_data[i] / j) % 10;}}cout << end;
}void BigInt::removeLendingZero() {while (m_size > 0 && m_data[m_size - 1] == 0) {m_size--;}
}int BigInt::compare(const BigInt& bi) {if (m_size != bi.m_size)return m_size > bi.m_size ? 1 : -1;for (int i = m_size - 1; i >= 0; i--) {if (m_data[i] != bi.m_data[i]) return m_data[i] > bi.m_data[i] ? 1 : -1;}return 0;
}BigInt BigInt::operator+(const BigInt& bi) {BigInt ret;int carry = 0, i;for (i = 0; i < bi.m_size || i < m_size || carry > 0 ; i++) {/*if (i < m_size)*/carry += m_data[i];/*if (i < bi.m_size)*/carry += bi.m_data[i];ret.m_data[i] = carry % Base;carry /= Base;}ret.m_size = i;		//注意此时ret的长度就是为ireturn ret;
}int main() {char s1[1000], s2[1000];while (cin >> s1 >> s2) {BigInt a(s1), b(s2);(a + b).print('\n');}return 0;
}

3.高精度减法

这一题你们要注意范围长度,还要处理负数的情况

#include<iostream>
#include<cstring>
using namespace std;const int Base = 1000;			//进制数
const int Capacity = 10086 / 3 + 1;		//数组容量class BigInt {
private:int m_size;int m_data[Capacity];void removeLendingZero();				//去除前导0
public:BigInt(int v);				BigInt();								BigInt(char s[]);						//将数字字符串存入数据void print(char end);BigInt(const BigInt& bi);BigInt& operator=(const BigInt& bi);int compare(const BigInt& bi);BigInt operator+(const BigInt& bi);BigInt operator-(const BigInt& bi);BigInt operator*(const BigInt& bi);BigInt operator/(const BigInt& bi);
};BigInt::BigInt() {m_size = 0;memset(m_data, 0, sizeof(m_data));
}BigInt::BigInt(int v) {m_size = 0;while (v > 0) {m_data[m_size++] = v % Base;v /= Base;}
}BigInt::BigInt(char s[]) {m_size = 0;int b = 1;memset(m_data, 0, sizeof(m_data));for (int i = strlen(s) - 1; i >= 0; i--) {m_data[m_size] += (s[i] - '0') * b;b *= 10;if (b >= Base) {b = 1;m_size++;m_data[m_size] = 0;}}if (m_data[m_size] > 0) m_size++;removeLendingZero();
}BigInt::BigInt(const BigInt& bi) {m_size = bi.m_size;memcpy(m_data, bi.m_data, sizeof(bi.m_data));
}BigInt& BigInt::operator=(const BigInt& bi) {m_size = bi.m_size;memcpy(m_data, bi.m_data, sizeof(m_data));return *this;
}void BigInt::print(char end) {cout << (m_size == 0 ? 0 : m_data[m_size - 1]);for (int i = m_size - 2; i >= 0; i--) {for (int j = Base / 10; j > 0; j /= 10) {cout << (m_data[i] / j) % 10;}}cout << end;
}void BigInt::removeLendingZero() {while (m_size > 0 && m_data[m_size - 1] == 0) {m_size--;}
}int BigInt::compare(const BigInt& bi) {if (m_size != bi.m_size)return m_size > bi.m_size ? 1 : -1;for (int i = m_size - 1; i >= 0; i--) {if (m_data[i] != bi.m_data[i]) return m_data[i] > bi.m_data[i] ? 1 : -1;}return 0;
}BigInt BigInt::operator+(const BigInt& bi) {BigInt ret;int carry = 0, i;for (i = 0; i < bi.m_size || i < m_size || carry > 0 ; i++) {/*if (i < m_size)*/carry += m_data[i];/*if (i < bi.m_size)*/carry += bi.m_data[i];ret.m_data[i] = carry % Base;carry /= Base;}ret.m_size = i;		//注意此时ret的长度就是为ireturn ret;
}BigInt BigInt::operator-(const BigInt& bi) {BigInt ret;int carry = 0;ret.m_size = m_size;for (int i = 0; i < m_size; i++) {ret.m_data[i] = m_data[i] - carry;if (i < bi.m_size) ret.m_data[i] -= bi.m_data[i];	//一定是判断减数的每一位减完了没有,如果没有结果值为乱数if (ret.m_data[i] < 0) {ret.m_data[i] += Base;carry = 1;}else carry = 0;		//注意carry一定要重新赋值为0,不然到下一位的时候carry的值就被污染了}ret.removeLendingZero();return ret;
}int main() {char s1[100087], s2[100087];while (cin >> s1 >> s2) {BigInt a(s1), b(s2);if (a.compare(b) >= 0) (a - b).print('\n');else {cout << "-";(b - a).print('\n');}}return 0;
}

3.高精度乘法

#include<iostream>
#include<cstring>
using namespace std;const int Base = 1000;			//进制数
const int Capacity = 1000;		//数组容量class BigInt {
private:int m_size;int m_data[Capacity];void removeLendingZero();				//去除前导0
public:BigInt(int v);				BigInt();								BigInt(char s[]);						//将数字字符串存入数据void print(char end);BigInt(const BigInt& bi);BigInt& operator=(const BigInt& bi);int compare(const BigInt& bi);BigInt operator+(const BigInt& bi) const;BigInt operator-(const BigInt& bi) const;BigInt operator*(const BigInt& bi) const;BigInt operator/(const BigInt& bi) const;
};BigInt::BigInt() {m_size = 0;memset(m_data, 0, sizeof(m_data));
}BigInt::BigInt(int v) {m_size = 0;while (v > 0) {m_data[m_size++] = v % Base;v /= Base;}
}BigInt::BigInt(char s[]) {m_size = 0;int b = 1;memset(m_data, 0, sizeof(m_data));for (int i = strlen(s) - 1; i >= 0; i--) {m_data[m_size] += (s[i] - '0') * b;b *= 10;if (b >= Base) {b = 1;m_size++;m_data[m_size] = 0;}}if (m_data[m_size] > 0) m_size++;removeLendingZero();
}BigInt::BigInt(const BigInt& bi) {m_size = bi.m_size;memcpy(m_data, bi.m_data, sizeof(bi.m_data));
}BigInt& BigInt::operator=(const BigInt& bi) {m_size = bi.m_size;memcpy(m_data, bi.m_data, sizeof(m_data));return *this;
}void BigInt::print(char end) {cout << (m_size == 0 ? 0 : m_data[m_size - 1]);for (int i = m_size - 2; i >= 0; i--) {for (int j = Base / 10; j > 0; j /= 10) {cout << (m_data[i] / j) % 10;}}cout << end;
}void BigInt::removeLendingZero() {while (m_size > 0 && m_data[m_size - 1] == 0) {m_size--;}
}int BigInt::compare(const BigInt& bi) {if (m_size != bi.m_size)return m_size > bi.m_size ? 1 : -1;for (int i = m_size - 1; i >= 0; i--) {if (m_data[i] != bi.m_data[i]) return m_data[i] > bi.m_data[i] ? 1 : -1;}return 0;
}BigInt BigInt::operator+(const BigInt& bi) const {BigInt ret;int carry = 0, i;for (i = 0; i < bi.m_size || i < m_size || carry > 0 ; i++) {if (i < m_size)carry += m_data[i];if (i < bi.m_size)carry += bi.m_data[i];ret.m_data[i] = carry % Base;carry /= Base;}ret.m_size = i;		//注意此时ret的长度就是为ireturn ret;
}BigInt BigInt::operator-(const BigInt& bi) const {BigInt ret;int carry = 0;ret.m_size = m_size;for (int i = 0; i < m_size; i++) {ret.m_data[i] = m_data[i] - carry;if (i < bi.m_size) ret.m_data[i] -= bi.m_data[i];	//一定是判断减数的每一位减完了没有,如果没有结果值为乱数if (ret.m_data[i] < 0) {ret.m_data[i] += Base;carry = 1;}else carry = 0;		//注意carry一定要重新赋值为0,不然到下一位的时候carry的值就被污染了}ret.removeLendingZero();return ret;
}BigInt BigInt:: operator*(const BigInt& bi) const {BigInt ret;ret.m_size = m_size + bi.m_size;for (int i = 0; i < ret.m_size; i++) {ret.m_data[i] = 0;}for (int i = 0; i < m_size; i++) {int carry = 0;for (int j = 0; j < bi.m_size; j++) {ret.m_data[i + j] += m_data[i] * bi.m_data[j] + carry;if (ret.m_data[i + j] >= Base) {carry = ret.m_data[i + j] / Base;ret.m_data[i + j] %= Base;}else carry = 0;}ret.m_data[i + bi.m_size] += carry;}ret.removeLendingZero();return ret;
}int main() {int n;while (cin >> n) {BigInt ret(1);for (int i = 2; i <= n; i++) {ret = ret * i;}ret.print('\n');}return 0;
}

4.高精度除法

#include<iostream>
#include<cstring>
using namespace std;const int Base = 1000;
const int Capacity = 10000;class BigInt {
private:int m_data[Capacity];int m_size;void removeLeadingZeros();public:BigInt();BigInt(int v);BigInt(const BigInt& bi);BigInt(char s[]);BigInt& operator=(const BigInt& bi);void print(char end);int compare(const BigInt& bi);BigInt operator+(const BigInt& bi) const;BigInt operator-(const BigInt& bi) const;BigInt operator*(const BigInt& bi) const;BigInt operator/(const BigInt& bi) const;
};BigInt::BigInt(int v) {m_size = 0;while(v > 0) {m_data[m_size++] = v % Base;v /= Base;}
}BigInt::BigInt() :m_size(0) {memset(m_data, 0, sizeof(m_data));
}BigInt::BigInt(const BigInt& bi) :m_size(bi.m_size) {memcpy(m_data, bi.m_data, sizeof(bi.m_data));
}BigInt::BigInt(char s[]) {m_size = 0;m_data[m_size] = 0;int b = 1;for (int i = strlen(s) - 1; i >= 0; i--) {m_data[m_size] += (s[i] - '0') * b;b *= 10;if (b >= Base) {m_size++;b = 1;m_data[m_size] = 0;}}if (m_data[m_size] > 0) {		//注意m_size可能会比原来多所以要判断m_size++;}removeLeadingZeros();
}BigInt& BigInt::operator=(const BigInt& bi) {m_size = bi.m_size;memcpy(m_data, bi.m_data, sizeof(m_data));return *this;
}void BigInt::print(char end) {cout << (m_size == 0 ? 0 : m_data[m_size - 1]);for (int i = m_size - 2; i >= 0; i--) {for (int j = Base / 10; j > 0; j/=10) {cout << (m_data[i] / j) % 10;}}cout << end;
}int BigInt::compare(const BigInt& bi) {if (m_size != bi.m_size) {return m_size > bi.m_size ? 1 : -1;}for (int i = m_size - 1; i >= 0; i--) {if (m_data[i] != bi.m_data[i])return m_data[i] > bi.m_data[i] ? 1 : -1;}return 0;
}void BigInt::removeLeadingZeros() {while (m_size > 0 && m_data[m_size - 1] == 0) {m_size--;}
}BigInt BigInt::operator+(const BigInt& bi) const {BigInt ret;int i = 0, carry = 0;for (; i < m_size || i < bi.m_size || carry > 0; i++) {if (i < m_size) carry += m_data[i];if (i < bi.m_size) carry += bi.m_data[i];ret.m_data[i] = carry % Base;carry /= Base;}ret.m_size = i;return ret;
}BigInt BigInt::operator-(const BigInt& bi) const {BigInt ret;int carry = 0;ret.m_size = m_size;		//被减数赋值给retfor (int i = 0; i < ret.m_size; i++) {ret.m_data[i] = m_data[i] - carry;if (i < bi.m_size) ret.m_data[i] -= bi.m_data[i];if (ret.m_data[i] < 0) {carry = 1;ret.m_data[i] += Base;}else {carry = 0;}}ret.removeLeadingZeros();return ret;
}BigInt BigInt::operator*(const BigInt& bi) const {BigInt ret;ret.m_size = m_size + bi.m_size;for (int i = 0; i < ret.m_size; i++) {ret.m_data[i] = 0;}for (int i = 0; i < m_size; i++) {int carry = 0;for (int j = 0; j < bi.m_size; j++) {ret.m_data[i + j] += m_data[i] * bi.m_data[j] + carry;if (ret.m_data[i + j] >= Base) {carry = ret.m_data[i + j] / Base;ret.m_data[i + j] %= Base;}else {carry = 0;}}ret.m_data[i + bi.m_size] += carry;}ret.removeLeadingZeros();return ret;
}BigInt BigInt::operator/(const BigInt& bi) const {BigInt ret, carry = 0;int l , r , mid;for (int i = m_size - 1; i >= 0; i--) {carry = carry * Base + m_data[i];l = -1;r = Base;while (l + 1 < r) {mid = (l + r) / 2;if ((bi * mid).compare(carry) <= 0) {l = mid;}else r = mid;}ret.m_data[i] = l;carry = carry - bi * l;}ret.m_size = m_size;ret.removeLeadingZeros();return ret;
}int main() {char s1[10000], s2[10000];while (cin >> s1 >> s2) {BigInt a(s1), b(s2);if (a.compare(b) >= 0)(a - b).print('\n');else {cout << '-';(b - a).print('\n');}}return 0;
}

七、总结

高精度运算是一种重要的进阶数据结构技术,它能够处理超出常规数据类型表示范围的极大或极精确数值。通过自定义数据结构(如数组或字符串)和专门的算法实现(如加法、减法、乘法和除法),高精度运算能够在许多领域提供必要的精度和范围支持。掌握高精度运算技术对于提高程序的性能和效率具有重要意义。

结语

当前进阶的数据结构比之前学的初级数据结构要复杂了,希望大家一定要动手敲一遍代码,敲完之后提交到例题里检查一下是否正确,出现bug不用慌张,耐心差错,这样你的水平才能提升。

在这里插入图片描述

希望大家可以一键三连,后续我们一起学习,谢谢大家!!!

在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/10305.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

使用 cmake

使用前注意 : CMake是一种跨平台的构建系统&#xff0c;它用于管理软件构建过程&#xff0c;尤其适合多语言、多配置的项目。CMake不直接构建软件&#xff0c;而是生成特定构建工具&#xff08;如Makefile或Visual Studio项目&#xff09;所需的配置文件。 如果仅仅使用 qt 编…

(1)Linux高级命令简介

Linux高级命令简介 在安装好linux环境以后第一件事情就是去学习一些linux的基本指令&#xff0c;我在这里用的是CentOS7作演示。 首先在VirtualBox上装好Linux以后&#xff0c;启动我们的linux&#xff0c;输入账号密码以后学习第一个指令 简介 Linux高级命令简介ip addrtou…

【ArcMap零基础训练营】03 常用数据网站的数据下载及处理

03 常见数据网站的数据下载及处理 230108直播录像 常见数据下载及nc文件批处理 数据源网站汇总 名称网址备注RESDChttps://www.resdc.cn/中科院地理科学与资源研究所&#xff0c;非会员用户每日5次下载&#xff0c;大部分有用的资源均收费。TPDChttps://data.tpdc.ac.cn/国家青…

MySQL数据库(二)

一 DDL (一 数据库操作 1 查询-数据库&#xff08;所有/当前&#xff09; 1 所有数据库&#xff1a; show databases; 2 查询当前数据库&#xff1a; select database(); 2 创建-数据库 可以定义数据库的编码方式 create database if not exists ax1; create database ax2…

步入响应式编程篇(三)之spring webFlux与R2DBC

spring webFlux与R2DBC 前言Spring webFlux与spring mvc的对比spring mvcspring webFluxSSE的demo R2DBC 前言 前面介绍响应式编程主要用到基于Stream API的Reactor API的方式&#xff0c;但如今业务操作需结合springboot&#xff0c;所以spring webFlux使用的更多&#xff0c…

19.Word:小马-校园科技文化节❗【36】

目录 题目​ NO1.2.3 NO4.5.6 NO7.8.9 NO10.11.12索引 题目 NO1.2.3 布局→纸张大小→页边距&#xff1a;上下左右插入→封面&#xff1a;镶边→将文档开头的“黑客技术”文本移入到封面的“标题”控件中&#xff0c;删除其他控件 NO4.5.6 标题→原文原文→标题 正文→手…

redis数据安全与性能保障

数据安全与性能保障 1、持久化1.1 快照持久化1.2 AOF持久化1.3 重写/压缩AOF文件 2、复制2.1 Redis复制的启动过程2.2 主从链 3、处理系统故障3.1 验证快照文件和AOF文件 4、事务4.1 java中的redis事务使用 如有侵权&#xff0c;请联系&#xff5e; 如有错误&#xff0c;也欢迎…

【AI非常道】二零二五年一月(二),AI非常道

经常在社区看到一些非常有启发或者有收获的话语&#xff0c;但是&#xff0c;往往看过就成为过眼云烟&#xff0c;有时再想去找又找不到。索性&#xff0c;今年开始&#xff0c;看到好的言语&#xff0c;就记录下来&#xff0c;一月一发布&#xff0c;亦供大家参考。 有关AI非…

从巫师求雨说起

树上停着一只猫头鹰&#xff1a; 你相信吗&#xff1f;这不是一般的鸟&#xff0c;猫头鹰其实是一个人&#xff0c;它是一个巫师变的。 你不相信&#xff1f;那我问你&#xff0c;为什么猫头鹰和乌鸦一样&#xff0c;那叫声&#xff0c;常常让人瘆得慌&#xff1f;(owl&#x…

【C++】类和对象

面向对象编程 学习过C语言的小伙伴知道&#xff1a;C语言是面向过程的&#xff0c;关注的是过程&#xff0c;分析出求解问题的步骤&#xff0c;通过函数调用逐步解决问题。 面向过程编程也叫结构化编程。虽然结构化编程的理念提高了程序的清晰度&#xff0c;可靠性&#xff0c…

21.3-启动流程、编码风格(了解) 第21章-FreeRTOS项目实战--基础知识之新建任务、启动流程、编码风格、系统配置 文件组成和编码风格(了解)

21.3-启动流程、编码风格(了解) 启动流程 第一种启动流程(我们就使用这个): 在main函数中将硬件初始化、RTOS系统初始化&#xff0c;同时创建所有任务&#xff0c;再启动RTOS调度器。 第二种启动流程&#xff1a; 在main函数中将硬件初始化、RTOS系统初始化&#xff0c;只…

富文本 tinyMCE Vue2 组件使用简易教程

参考官方教程 TinyMCE Vue.js integration technical reference Vue2 项目需要使用 tinyMCE Vue2 组件(tinymce/tinymce-vue)的第 3 版 安装组件 npm install --save "tinymce/tinymce-vue^3" 编写组件调用 <template><Editorref"editor"v-m…

vue框架技术相关概述以及前端框架整合

vue框架技术概述及前端框架整合 1 node.js 介绍&#xff1a;什么是node.js Node.js就是运行在服务端的JavaScript。 Node.js是一个事件驱动I/O服务端JavaScript环境&#xff0c;基于Google的V8引擎。 作用 1 运行java需要安装JDK&#xff0c;而Node.js是JavaScript的运行环…

【AI】Deepseek本地部署探索,尝试联网搜索

前言 1月下旬&#xff0c;Deepseek-R1横空出世&#xff0c;其依靠堪比GPT-o1的推理能力&#xff0c;训练成本及使用成本均只有gpt几十分之一甚至百分之一的超高性价比&#xff0c;以及它足够“OPEN”的特性直接暴打人工智能的资本行业&#xff0c;本着求实求新的精神&#xff…

DeepSeek介绍

目录 前言 1.介绍一下你自己 2.什么是CUDA CUDA的核心特点&#xff1a; CUDA的工作原理&#xff1a; CUDA的应用场景&#xff1a; CUDA的开发工具&#xff1a; CUDA的局限性&#xff1a; 3.在AI领域&#xff0c;PTX是指什么 1. PTX 的作用 2. PTX 与 AI 的关系 3. …

WGCLOUD服务器资源监控软件使用笔记 - Token is error是什么错误

[wgcloud-agent]2025/01/30 10:41:30 WgcloudAgent.go:90: 主机监控信息上报server开始 [wgcloud-agent]2025/01/30 10:41:30 WgcloudAgent.go:99: 主机监控信息上报server返回信息: {"result":"Token is error"} 这个错误是因为agent配置的wgToken和serv…

OpenAI-Edge-TTS:本地化 OpenAI 兼容的文本转语音 API,免费高效!

文本转语音&#xff08;TTS&#xff09;技术已经成为人工智能领域的重要一环&#xff0c;无论是语音助手、教育内容生成&#xff0c;还是音频文章创作&#xff0c;TTS 工具都能显著提高效率。今天要为大家介绍的是 OpenAI-Edge-TTS&#xff0c;一款基于 Microsoft Edge 在线文本…

Leetcode 131 分割回文串(纯DFS)

131. 分割回文串https://leetcode.cn/problems/palindrome-partitioning/https://leetcode.cn/problems/palindrome-partitioning/ 给你一个字符串 s&#xff0c;请你将 s 分割成一些子串&#xff0c;使每个子串都是 回文串 。返回 s 所有可能的分割方案。 示例 1&#xff1a…

服务器虚拟化技术详解与实战:架构、部署与优化

&#x1f4dd;个人主页&#x1f339;&#xff1a;一ge科研小菜鸡-CSDN博客 &#x1f339;&#x1f339;期待您的关注 &#x1f339;&#x1f339; 引言 在现代 IT 基础架构中&#xff0c;服务器虚拟化已成为提高资源利用率、降低运维成本、提升系统灵活性的重要手段。通过服务…

记录一次,PyQT的报错,多线程Udp失效,使用工具如netstat来检查端口使用情况。

1.问题 报错Exception in thread Thread-1: Traceback (most recent call last): File "threading.py", line 932, in _bootstrap_inner File "threading.py", line 870, in run File "main.py", line 456, in udp_recv IndexError: list…