【算法笔记自学】第 5 章 入门篇(3)——数学问题

news2025/2/24 6:28:31

5.1简单数学

#include <cstdio>
#include <algorithm>
using namespace std;
bool cmp(int a,int b){
     return a>b;
}
void to_array(int n,int num[]){
    for(int i=0;i<4;i++){
        num[i]=n%10;
        n /=10;
     }
}
int to_number(int num[]){
    int sum=0;
    for(int i=0;i<4;i++){
        sum=sum*10+num[i];
    }
    return sum;
}
int main(){
    int n,MIN,MAX;
    scanf("%d",&n);
    int num[5];
    while(1){
       to_array(n,num);
       sort(num,num+4);
       MIN=to_number(num);
       sort(num,num+4,cmp);
       MAX=to_number(num);
       n=MAX-MIN;
       printf("%04d-%04d=%04d\n",MAX,MIN,n);
       if(n==0||n==6174)break;
    }
    return 0;
}

#include <cstdio>
#include <cmath>

int main() {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    int delta = b * b - 4 * a * c;
    if (delta < 0) {
        printf("No Solution");
    } else if (delta == 0) {
        printf("%.2f", -b / (2.0 * a));
    } else {
        printf("%.2f %.2f",  (-b - sqrt((double)delta)) / (2.0 * a), (-b + sqrt((double)delta)) / (2.0 * a));
    }
    return 0;
}

5.2最大公约数与最小公倍数

#include <cstdio>
#include <cmath>
int gcd(int a,int b){
    if(b==0)return a;//求最大公约数的辗转相除法递归写法
    else return gcd(b,a%b);
}
int main() {
    int m,n;
    while(scanf("%d%d",&m,&n)!=EOF){
        printf("%d\n",gcd(m,n));
    }
    return 0;
}

#include <cstdio>

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

int main() {
    int a, b;
    scanf("%d%d", &a, &b);
    printf("%d", a / gcd(a, b) * b);
    return 0;
}

5.3分数的四则运算

#include <cstdio>
#include <algorithm>
using namespace std;

struct Fraction {
    int up, down;
};

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

Fraction reduction(Fraction fraction) {
    if (fraction.down < 0) {
        fraction.up = -fraction.up;
        fraction.down = -fraction.down;
    }
    if (fraction.up == 0) {
        fraction.down = 1;
    } else {
        int d = gcd(abs(fraction.up), abs(fraction.down));
        fraction.up /= d;
        fraction.down /= d;
    }
    return fraction;
}

int main() {
    Fraction fraction;
    scanf("%d%d", &fraction.up, &fraction.down);
    Fraction result = reduction(fraction);
    if (result.down == 1) {
        printf("%d", result.up);
    } else {
        printf("%d %d", result.up, result.down);
    }
    return 0;
}

#include <cstdio>
#include <algorithm>
using namespace std;

struct Fraction {
    int up, down;
};

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

Fraction reduction(Fraction fraction) {
    if (fraction.down < 0) {
        fraction.up = -fraction.up;
        fraction.down = -fraction.down;
    }
    if (fraction.up == 0) {
        fraction.down = 1;
    } else {
        int d = gcd(abs(fraction.up), abs(fraction.down));
        fraction.up /= d;
        fraction.down /= d;
    }
    return fraction;
}

Fraction add(Fraction f1, Fraction f2) {
    Fraction result;
    result.up = f1.up * f2.down + f2.up * f1.down;
    result.down = f1.down * f2.down;
    return reduction(result);
}

int main() {
    Fraction f1, f2;
    scanf("%d%d%d%d", &f1.up, &f1.down, &f2.up, &f2.down);
    Fraction result = add(f1, f2);
    if (result.down == 1) {
        printf("%d", result.up);
    } else {
        printf("%d %d", result.up, result.down);
    }
    return 0;
}

#include <cstdio>
#include <algorithm>
using namespace std;

struct Fraction {
    int up, down;
};

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

Fraction reduction(Fraction fraction) {
    if (fraction.down < 0) {
        fraction.up = -fraction.up;
        fraction.down = -fraction.down;
    }
    if (fraction.up == 0) {
        fraction.down = 1;
    } else {
        int d = gcd(abs(fraction.up), abs(fraction.down));
        fraction.up /= d;
        fraction.down /= d;
    }
    return fraction;
}

Fraction sub(Fraction f1, Fraction f2) {
    Fraction result;
    result.up = f1.up * f2.down - f2.up * f1.down;
    result.down = f1.down * f2.down;
    return reduction(result);
}

int main() {
    Fraction f1, f2;
    scanf("%d%d%d%d", &f1.up, &f1.down, &f2.up, &f2.down);
    Fraction result = sub(f1, f2);
    if (result.down == 1) {
        printf("%d", result.up);
    } else {
        printf("%d %d", result.up, result.down);
    }
    return 0;
}

#include <cstdio>
#include <algorithm>
using namespace std;

struct Fraction {
    int up, down;
};

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

Fraction reduction(Fraction fraction) {
    if (fraction.down < 0) {
        fraction.up = -fraction.up;
        fraction.down = -fraction.down;
    }
    if (fraction.up == 0) {
        fraction.down = 1;
    } else {
        int d = gcd(abs(fraction.up), abs(fraction.down));
        fraction.up /= d;
        fraction.down /= d;
    }
    return fraction;
}

Fraction multiply(Fraction f1, Fraction f2) {
    Fraction result;
    result.up = f1.up * f2.up;
    result.down = f1.down * f2.down;
    return reduction(result);
}

int main() {
    Fraction f1, f2;
    scanf("%d%d%d%d", &f1.up, &f1.down, &f2.up, &f2.down);
    Fraction result = multiply(f1, f2);
    if (result.down == 1) {
        printf("%d", result.up);
    } else {
        printf("%d %d", result.up, result.down);
    }
    return 0;
}

#include <cstdio>
#include <algorithm>
using namespace std;

struct Fraction {
    int up, down;
};

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

Fraction reduction(Fraction fraction) {
    if (fraction.down < 0) {
        fraction.up = -fraction.up;
        fraction.down = -fraction.down;
    }
    if (fraction.up == 0) {
        fraction.down = 1;
    } else {
        int d = gcd(abs(fraction.up), abs(fraction.down));
        fraction.up /= d;
        fraction.down /= d;
    }
    return fraction;
}

Fraction div(Fraction f1, Fraction f2) {
    Fraction result;
    result.up = f1.up * f2.down;
    result.down = f1.down * f2.up;
    return reduction(result);
}

int main() {
    Fraction f1, f2;
    scanf("%d%d%d%d", &f1.up, &f1.down, &f2.up, &f2.down);
    Fraction result = div(f1, f2);
    if(!f2.up){
    	printf("undefined");
	}
    else if (result.down == 1) {
        printf("%d", result.up);
    } else {
        printf("%d %d", result.up, result.down);
    }
    return 0;
}

5.4素数 

#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
bool isPrime(int n){
    if(n<=1)return false;
    int sqr=(int)sqrt(1.0*n);
    for(int i=2;i<=sqr;i++){
        if(n%i==0)return false;
    }
    return true;

}
int main() {
    int n;
    scanf("%d",&n);
    if(isPrime(n))printf("Yes");
    else printf("No");
    return 0;
}

#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;
bool isPrime(int n){
    if(n<=1)return false;
    int sqr=(int)sqrt(1.0*n);
    for(int i=2;i<=sqr;i++){
        if(n%i==0)return false;
    }
    return true;

}
int main() {
    int n;
    scanf("%d",&n);
    for(int i=1;i<n+1;i++)
    {
        if(isPrime(i))printf("%d\n",i);

    }
    return 0;
}

5.5质因子分解

#include <cstdio>
int main() {
    int n;
    scanf("%d", &n);
    int counter = 0;
    while (n % 2 == 0) {
        counter++;
        n /= 2;
    }
    printf("%d", counter);
    return 0;
}

#include <cstdio>
#include <cmath>
#include <cstring>
#include <vector>
using namespace std;

const int MAXN = 1000 + 1;
bool isPrime[MAXN];
vector<int> primes;

void getPrimes(int n) {
    memset(isPrime, true, sizeof(isPrime));
    for (int i = 2; i <= n; i++) {
        if (isPrime[i]) {
            primes.push_back(i);
            for (int j = i + i; j <= n; j += i) {
                isPrime[j] = false;
            }
        }
    }
}

int main() {
    int n;
    scanf("%d", &n);
    getPrimes((int)sqrt(1.0 * n));
    for (int i = 0; i < primes.size() && n > 1; i++) {
        int counter = 0;
        while (n > 1 && n % primes[i] == 0) {
            counter++;
            n /= primes[i];
        }
        if (counter > 0) {
            printf("%d %d\n", primes[i], counter);
        }
    }
    if (n > 1) {
        printf("%d 1", n);
    }
    return 0;
}

5.6大整数运算 

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

typedef vector<int> BigInt;

BigInt toBigInt(string nums) {
    BigInt result;
    for (int i = (int)nums.length() - 1; i >= 0; i--) {
        result.push_back(nums[i] - '0');
    }
    return result;
}

int compare(BigInt a, BigInt b) {
    if (a.size() > b.size()) {
        return 1;
    } else if (a.size() < b.size()) {
        return -1;
    } else {
        for (int i = (int)a.size() - 1; i >= 0; i--) {
            if (a[i] > b[i]) {
                return 1;
            } else if (a[i] < b[i]) {
                return -1;
            }
        }
        return 0;
    }
}

int main() {
    string nums1, nums2;
    cin >> nums1 >> nums2;
    BigInt a = toBigInt(nums1);
    BigInt b = toBigInt(nums2);
    int compareResult = compare(a, b);
    if (compareResult < 0) {
        printf("a < b");
    } else if (compareResult > 0) {
        printf("a > b");
    } else {
        printf("a = b");
    }
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

typedef vector<int> BigInt;

BigInt toBigInt(string nums) {
    BigInt result;
    for (int i = (int)nums.length() - 1; i >= 0; i--) {
        result.push_back(nums[i] - '0');
    }
    return result;
}

BigInt add(BigInt a, BigInt b) {
    BigInt c;
    int carry = 0;
    for (int i = 0; i < a.size() || i < b.size(); i++) {
        int aDigit = i < a.size() ? a[i] : 0;
        int bDigit = i < b.size() ? b[i] : 0;
        int sum = aDigit + bDigit + carry;
        c.push_back(sum % 10);
        carry = sum / 10;
    }
    if (carry) {
        c.push_back(carry);
    }
    return c;
}

void print(BigInt a) {
    for (int i = (int)a.size() - 1; i >= 0; i--) {
        cout << a[i];
    }
}

int main() {
    string nums1, nums2;
    cin >> nums1 >> nums2;
    BigInt a = toBigInt(nums1);
    BigInt b = toBigInt(nums2);
    print(add(a, b));
    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

typedef vector<int> BigInt;

BigInt toBigInt(string nums) {
    BigInt result;
    for (int i = (int)nums.length() - 1; i >= 0; i--) {
        result.push_back(nums[i] - '0');
    }
    return result;
}
int compare(BigInt a, BigInt b) {
    if (a.size() > b.size()) {
        return 1;
    } else if (a.size() < b.size()) {
        return -1;
    } else {
        for (int i = (int)a.size() - 1; i >= 0; i--) {
            if (a[i] > b[i]) {
                return 1;
            } else if (a[i] < b[i]) {
                return -1;
            }
        }
        return 0;
    }
}
BigInt sub(BigInt a, BigInt b) {
    BigInt c;
    for (int i = 0; i < a.size() || i < b.size(); i++) {
        int bDigit = i < b.size() ? b[i] : 0;
        if (a[i] < bDigit) {
            a[i + 1]--;
            a[i] += 10;
        }
        c.push_back(a[i] - bDigit);
    }
     while (c.size() > 1 && c.back() == 0) {
        c.pop_back();
    }
    return c;
}

void print(BigInt a) {
    for (int i = (int)a.size() - 1; i >= 0; i--) {
        cout << a[i];
    }
}

int main() {
    string nums1, nums2;
    cin >> nums1 >> nums2;
    BigInt a = toBigInt(nums1);
    BigInt b = toBigInt(nums2);
     if (compare(a, b) >= 0) {
        print(sub(a, b));
    } else {
        cout << "-";
        print(sub(b, a));
    }
    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

typedef vector<int> BigInt;

BigInt toBigInt(string nums) {
    BigInt result;
    for (int i = (int)nums.length() - 1; i >= 0; i--) {
        result.push_back(nums[i] - '0');
    }
    return result;
}
int compare(BigInt a, BigInt b) {
    if (a.size() > b.size()) {
        return 1;
    } else if (a.size() < b.size()) {
        return -1;
    } else {
        for (int i = (int)a.size() - 1; i >= 0; i--) {
            if (a[i] > b[i]) {
                return 1;
            } else if (a[i] < b[i]) {
                return -1;
            }
        }
        return 0;
    }
}
BigInt mul(BigInt a, int b) {
    BigInt c;
    int carry=0;;
    for (int i = 0; i < a.size(); i++) {
        int temp=a[i]*b+carry;
        c.push_back(temp%10);
        carry=temp/10;
    }
    while(carry!=0){
        c.push_back(carry%10);
        carry/=10;
    }
    while (c.size() > 1 && c.back() == 0) {
        c.pop_back();
    }
    return c;
}

void print(BigInt a) {
    for (int i = (int)a.size() - 1; i >= 0; i--) {
        cout << a[i];
    }
}

int main() {
     string nums;
    int b;
    cin >> nums >> b;
    BigInt a = toBigInt(nums);
    print(mul(a, b));
    return 0;
    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

typedef vector<int> BigInt;

BigInt toBigInt(string nums) {
    BigInt result;
    for (int i = (int)nums.length() - 1; i >= 0; i--) {
        result.push_back(nums[i] - '0');
    }
    return result;
}

BigInt mul(BigInt a, BigInt b) {
    BigInt c = BigInt(a.size() + b.size() + 1, 0);
    for (int i = 0; i < a.size(); i++) {
        for (int j = 0; j < b.size(); j++) {
            c[i + j] += a[i] * b[j];
        }
    }
    for (int i = 0; i < a.size() + b.size(); i++) {
        if (c[i] >= 10) {
            c[i + 1] += c[i] / 10;
            c[i] = c[i] % 10;
        }
    }
    while (c.size() > 1 && c.back() == 0) {
        c.pop_back();
    }
    return c;
}

void print(BigInt a) {
    for (int i = (int)a.size() - 1; i >= 0; i--) {
        cout << a[i];
    }
}

int main() {
    string nums1, nums2;
    cin >> nums1 >> nums2;
    BigInt a = toBigInt(nums1);
    BigInt b = toBigInt(nums2);
    print(mul(a, b));
    return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

typedef vector<int> BigInt;

BigInt toBigInt(string nums) {
    BigInt result;
    for (int i = (int)nums.length() - 1; i >= 0; i--) {
        result.push_back(nums[i] - '0');
    }
    return result;
}

BigInt div(BigInt a, int b, int &r) {
    BigInt c;
    for (int i = (int)a.size() - 1; i >= 0; i--) {
        r = r * 10 + a[i];
        c.push_back(r / b);
        r = r % b;
    }
    reverse(c.begin(), c.end());
    while (c.size() > 1 && c.back() == 0) {
        c.pop_back();
    }
    return c;
}

void print(BigInt a) {
    for (int i = (int)a.size() - 1; i >= 0; i--) {
        cout << a[i];
    }
}

int main() {
    string nums;
    int b, r = 0;
    cin >> nums >> b;
    if (b == 0) {
        cout << "undefined";
        return 0;
    }
    BigInt a = toBigInt(nums);
    BigInt q = div(a, b, r);
    print(q);
    cout << " " << r;
    return 0;
}

5.7扩展欧几里得算法

#include <cstdio>
#include <algorithm>
using namespace std;

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

int main() {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    printf(c % gcd(a, b) == 0 ? "Yes" : "No");
    return 0;
}

#include <cstdio>
#include <algorithm>
using namespace std;

int exGcd(int a, int b, int &x, int &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    int d = exGcd(b, a % b, x, y);
    int temp = x;
    x = y;
    y = temp - a / b * y;
    return d;
}

int main() {
    int a, b, x, y;
    scanf("%d%d", &a, &b);
    int d = exGcd(a, b, x, y);
    int step = b / d;
    int minX = (x % step + step) % step;
    printf("%d %d", minX, (d - a * minX) / b);
    return 0;
}

#include <cstdio>
#include <algorithm>
using namespace std;

int exGcd(int a, int b, int &x, int &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    int d = exGcd(b, a % b, x, y);
    int temp = x;
    x = y;
    y = temp - a / b * y;
    return d;
}

int solve(int a, int b, int c) {
    int x, y;
    int d = exGcd(a, b, x, y);
    if (c % d) {
        return -1;
    } else {
        int step = abs(b / d);
        int minX = (c * x / d % step + step) % step;
        return minX;
    }
}

int main() {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    int minX = solve(a, b, c);
    if (minX == -1) {
        printf("No Solution");
    } else {
        printf("%d %d", minX, (c - a * minX) / b);
    }
    return 0;
}

#include <cstdio>
#include <algorithm>
using namespace std;

int exGcd(int a, int b, int &x, int &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    int d = exGcd(b, a % b, x, y);
    int temp = x;
    x = y;
    y = temp - a / b * y;
    return d;
}

int solve(int a, int b, int c) {
    int x, y;
    int d = exGcd(a, b, x, y);
    if (c % d) {
        return -1;
    } else {
        int step = abs(b / d);
        int minX = (c * x / d % step + step) % step;
        return minX;
    }
}

int main() {
    int a, c, m, x, y;
    scanf("%d%d%d", &a, &c, &m);
    int minX = solve(a, m, c);
    if (minX == -1) {
        printf("No Solution");
    } else {
        printf("%d", minX);
    }
    return 0;
}

#include <cstdio>
#include <algorithm>
using namespace std;

int exGcd(int a, int b, int &x, int &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    int d = exGcd(b, a % b, x, y);
    int temp = x;
    x = y;
    y = temp - a / b * y;
    return d;
}

int invert(int a, int m) {
    int x, y;
    int d = exGcd(a, m, x, y);
    if (d != 1) {
        return -1;
    } else {
        return (x % m + m) % m;
    }
}

int main() {
    int a, m;
    scanf("%d%d", &a, &m);
    int result = invert(a, m);
    if (result == -1) {
        printf("No Solution");
    } else {
        printf("%d", result);
    }
    return 0;
}

#include <cstdio>
#include <algorithm>
using namespace std;

int exGcd(int a, int b, int &x, int &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    int d = exGcd(b, a % b, x, y);
    int temp = x;
    x = y;
    y = temp - a / b * y;
    return d;
}

int invert(int a, int m) {
    int x, y;
    int d = exGcd(a, m, x, y);
    if (d != 1) {
        return -1;
    } else {
        return (x % m + m) % m;
    }
}

int main() {
    int n, a, m, b;
    scanf("%d%d%d", &n, &a, &m);
    int result = invert(abs(a), m);
    for (int i = 0; i < n; i++) {
        scanf("%d", &b);
        result = (result * b) % m;
    }
    printf("%d", result);
    return 0;
}

5.8组合数

#include <cstdio>
int cal(int n,int p)
{
    if(n<p)return 0;
    return n/p+cal(n/p,p);

}
int main() {
    int n,p=2;
    scanf("%d", &n);
    printf("%d", cal(n,p));
    return 0;
}

#include <cstdio>

typedef long long LL;

LL C(LL n, LL m) {
    LL ans = 1;
    for (LL i = 1; i <= m; i++) {
        ans = ans * (n - m + i) / i;
    }
    return ans;
}

int main() {
    LL n, m;
    scanf("%lld%lld", &n, &m);
    printf("%lld", C(n, m));
    return 0;
}

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

BitWidget,自定义bit控件

由于QBitArray并不满足我做界面是的需求&#xff0c;所以参照QBitArray简单的写了个控件&#xff0c;如下所示&#xff0c;源码及实例在我上传的资源包中 实例 帮助文档如图所示&#xff08;部分&#xff09; 帮助文档&#xff08;在资源包中&#xff09; 1.html文档 2.chm文…

使用Python绘制和弦图

使用Python绘制和弦图 和弦图效果代码 和弦图 和弦图用于展示数据的多对多关系&#xff0c;适合用于社交网络、交通流量等领域的分析。 效果 代码 import pandas as pd import holoviews as hv from holoviews import opts hv.extension(bokeh)# 示例数据 data [(A, B, 2),…

Java对象通用比对工具

目录 背景 思路 实现 背景 前段时间的任务中&#xff0c;遇到了需要识别两个对象不同属性的场景&#xff0c;如果使用传统的一个个属性比对equals方法&#xff0c;会存在大量的重复工作&#xff0c;而且为对象新增了属性后&#xff0c;比对方法也需要同步修改&#xff0c;不方…

JUC(java.util.concurrent)中的常见类

文章目录 Callable接口ReentrantLockReentrantLock 和 synchronized 的区别:如何选择使用哪个锁? 信号量SemaphoreCountDownLatch多线程环境使用ArrayList多线程使用 哈希表相关面试题 JUC放了和多线程有关的组件 Callable接口 和Runnable一样是描述一个任务,但是有返回值,表…

查询某个县区数据,没有的数据用0补充。

加油&#xff0c;新时代打工人&#xff01; 思路&#xff1a; 先查出有数据的县区&#xff0c;用县区编码判断&#xff0c;不存在县区里的数据。然后&#xff0c;用union all进行两个SQL拼接起来。 SELECTt.regionCode,t.regionName,t.testNum,t.sampleNum,t.squareNum,t.crop…

springboot+vue+mybatis图书馆借阅管理系统+PPT+论文+讲解+售后

21世纪的今天&#xff0c;随着社会的不断发展与进步&#xff0c;人们对于信息科学化的认识&#xff0c;已由低层次向高层次发展&#xff0c;由原来的感性认识向理性认识提高&#xff0c;管理工作的重要性已逐渐被人们所认识&#xff0c;科学化的管理&#xff0c;使信息存储达到…

三分钟内了解卷轴模式

在数字化时代的浪潮中&#xff0c;卷轴商业模式巧妙地将积分体系、互动任务、社交裂变、虚拟经济体系以及个性化成长路径等多元要素融为一体。 积分体系&#xff1a;激发参与动力的源泉 卷轴商业模式的核心在于其精心构建的积分系统。新用户踏入平台&#xff0c;即获赠一笔启…

基于自编码器的时间序列异常检测方法(以传感器数据为例,MATLAB R2021b)

尽管近年来研究者对自编码器及其改进算法进行了深入研究&#xff0c;但现阶段仍存在以下问题亟须解决。 1) 无监督学习模式对特征提取能力的限制与有监督学习相比&#xff0c;无监督学习模式摆脱了对样本标签的依赖、避免了人工标注的困难&#xff0c;但也因此失去了样本标签的…

LLM - 循环神经网络(RNN)

1. RNN的关键点&#xff1a;即在处理序列数据时会有顺序的记忆。比如&#xff0c;RNN在处理一个字符串时&#xff0c;在对字母表顺序有记忆的前提下&#xff0c;处理这个字符串会更容易。就像人一样&#xff0c;读取下面第一个字符串会更容易&#xff0c;因为人对字母出现的顺序…

一站式解决方案:用ChatGPT和AutoGPT组建你的个人写作团队

ChatGPT 在 AI 内容创作领域带来了巨大的飞跃&#xff0c;然而它在撰写完整文章时偶尔会陷入废话和奇怪主题。作为专业作家、AI专家及OpenAI Beta测试人员&#xff0c;我一直探索AI写作。虽然ChatGPT表现出色&#xff0c;但有时难以达到创造高质量文章的标准。 最近&#xff0…

EtherCAT转Profinet网关配置说明第二讲:上位机软件配置

EtherCAT协议转Profinet协议网关模块&#xff08;XD-ECPNS20&#xff09;&#xff0c;不仅可以实现数据之间的通信&#xff0c;还可以实现不同系统之间的数据共享。EtherCAT协议转Profinet协议网关模块&#xff08;XD-ECPNS20&#xff09;具有高速传输的特点&#xff0c;因此通…

githup开了代理push不上去

你们好&#xff0c;我是金金金。 场景 git push出错 解决 cmd查看 git config --global http.proxy git config --global https.proxy 如果什么都没有&#xff0c;代表没设置全局代理&#xff0c;此时如果你开了代理&#xff0c;则执行如下&#xff0c;设置代理 git con…

Github:git提交代码到github

创建 GitHub 仓库 a. 登录到您的 GitHub 账户。 b. 点击右上角的 "" 图标&#xff0c;选择 "New repository"。 c. 填写仓库名称&#xff08;例如 "Mitemer"&#xff09;。 d. 添加项目描述&#xff08;可选&#xff09;。 e. 选择仓库为 &…

微信小程序的轻松音乐-计算机毕业设计源码48092

目 录 摘要 1 绪论 1.1研究背景与意义 1.2研究现状 1.3论文结构与章节安排 2 基于微信小程序的轻松音乐系统分析 2.1 可行性分析 2.1.1 技术可行性分析 2.1.2 经济可行性分析 2.1.3 法律可行性分析 2.2 系统功能分析 2.2.1 功能性分析 2.3 系统用例分析 2.4 系统…

排序——数据结构与算法 总结8

目录 8.1 排序相关概念 8.2 插入排序 8.2.1 直接插入排序&#xff1a; 8.2.2 折半插入排序&#xff1a; 8.2.3 希尔排序&#xff1a; 8.3 交换排序 8.3.1 冒泡排序&#xff1a; 8.3.2 快速排序&#xff1a; 8.4 选择排序 8.4.1 简单选择排序 8.4.2 堆排序 8.5 归并…

C++--partition库函数

介绍 在C中&#xff0c;partition函数通常是指STL&#xff08;Standard Template Library&#xff09;中的std::partition算法&#xff0c;它用于对一个序列进行分区操作。具体来说&#xff0c;std::partition接受一个范围和一个谓词&#xff08;predicate&#xff09;作为参数…

策略为王股票软件源代码-----如何修改为自己软件73------------主界面右下角,大盘指数,时间显示 ,

IDS_MAINFRAME_SHINDEXTIP "沪:%2.f %+.2f %.2f亿" IDS_MAINFRAME_SZINDEXTIP "深:%2.f %+.2f %.2f亿" 主界面右下角,大盘指数,时间显示 , if( TIMER_TIME == nIDEvent ) { CSPTime time = CSPTime::GetCurrentTime(); …

去除gif动图背景的工具网站

选择视频或GIF - 取消屏幕 (unscreen.com)https://www.unscreen.com/upload

【论文解读】LivePortrait:具有拼接和重定向控制的高效肖像动画

&#x1f4dc; 文献卡 英文题目: LivePortrait: Efficient Portrait Animation with Stitching and Retargeting Control;作者: Jianzhu Guo; Dingyun Zhang; Xiaoqiang Liu; Zhizhou Zhong; Yuan Zhang; Pengfei Wan; Di ZhangDOI: 10.48550/arXiv.2407.03168摘要翻译: *旨在…

以腾讯为例,手把手教你搭建产品帮助中心

一个精心设计的产品帮助中心对于提高用户满意度和体验至关重要。腾讯&#xff0c;作为全球领先的互联网企业&#xff0c;通过其多样化的产品线&#xff08;包括微信、QQ、腾讯游戏、腾讯视频等&#xff09;吸引了亿万用户。下面将以腾讯为例&#xff0c;向您展示如何搭建一个高…