ACM输入总结

news2025/2/27 16:30:35

目录

一,输入结构

1,一级输入结构

2,嵌套输入结构

二,一级输入结构

HDU 1089 A+B for Input-Output Practice (I)

HDU 1090 A+B for Input-Output Practice (II)

HDU 1091 A+B for Input-Output Practice (III)

HDU 1095 A+B for Input-Output Practice (VII)

三,嵌套输入结构

HDU 1092 A+B for Input-Output Practice (IV)

HDU 1093 A+B for Input-Output Practice (V)

HDU 1094 A+B for Input-Output Practice (VI)

HDU 1096 A+B for Input-Output Practice (VIII)

四,输入字符串

(1)gets函数

CodeForces 616A Comparing Two Long Integers

(2)gets的替代函数

(3)scanf

HDU 5842 Lweb and String

(4)char数组 + cin

(4.1)cin

(4.2)cin.getline

(4.3)cin.get

(5)string

(5.1)cin

(5.2)getline

五,输入其他内容

1,输入整数、实数

CSU 1000 A+B (I)

CSU 1001 A+B (II)

CSU 1002 A+B (III)

2,用字符串输入整数、实数

CSU 1340 A Sample Problem

else

3,输入数字和字符的组合

4,表格型数据

5,其他输入技巧

(1)忽略输入


一,输入结构

1,一级输入结构

输入结构分为4类:

  • 只输入一个用例
  • 输入用例直到特殊用例:HDU 1091
  • 输入用例直到文件尾:HDU 1089
  • 先输入整数t再输入t个用例:HDU 1090

其中,每个用例都有明确的结束条件。

2,嵌套输入结构

每个用例内部,又可以包含若干部分,每一部分都有可能是只输入一个用例、输入用例直到特殊用例、先输入整数t再输入t个用例等情况,其中每个用例内部还可以继续嵌套。。。

二,一级输入结构

HDU 1089 A+B for Input-Output Practice (I)

题目:

Description

Your task is to Calculate a + b. 
Too easy?! Of course! I specially designed the problem for acm beginners. 
You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim. 

Input

The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line. 

Output

For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input. 

Sample Input

1 5
10 20

Sample Output

6
30

代码:

<iostream>
using namespace std;

int main()
{
	int a, b;
	while (cin >> a >> b)cout << a + b << endl;
	return 0;
}

HDU 1090 A+B for Input-Output Practice (II)

题目:

Description

Your task is to Calculate a + b. 

Input

Input contains an integer N in the first line, and then N lines follow. Each line consists of a pair of integers a and b, separated by a space, one pair of integers per line. 

Output

For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input. 

Sample Input

2
1 5
10 20

Sample Output

6
30

代码:

<iostream>
using namespace std;

int main()
{
	int n, a, b;
	cin >> n;
	while (n--)
	{
		cin >> a >> b;
		cout << a + b << endl;
	}
	return 0;
}

HDU 1091 A+B for Input-Output Practice (III)

题目:

Description

Your task is to Calculate a + b.

Input

Input contains multiple test cases. Each test case contains a pair of integers a and b, one pair of integers per line. A test case containing 0 0 terminates the input and this test case is not to be processed. 

Output

For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input. 

Sample Input

1 5
10 20
0 0

Sample Output

6
30

代码:

<iostream>
using namespace std;

int main()
{
	int a, b;
	while (cin >> a >> b)
	{
		if (a == 0 && b == 0)break;
		cout << a + b << endl;
	}
	return 0;
}

HDU 1095 A+B for Input-Output Practice (VII)

题目:

Description

Your task is to Calculate a + b. 

Input

The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line. 

Output

For each pair of input integers a and b you should output the sum of a and b, and followed by a blank line. 

Sample Input

1 5
10 20

Sample Output

6

30

代码:

#include<iostream>
using namespace std;

int main()
{
	int a, b;
	while (cin >> a >> b)cout << a + b << endl << endl;
	return 0;
}

三,嵌套输入结构

HDU 1092 A+B for Input-Output Practice (IV)

题目:

Description

Your task is to Calculate the sum of some integers. 

Input

Input contains multiple test cases. Each test case contains a integer N, and then N integers follow in the same line. A test case starting with 0 terminates the input and this test case is not to be processed. 

Output

For each group of input integers you should output their sum in one line, and with one line of output for each line in input. 

Sample Input

4 1 2 3 4
5 1 2 3 4 5
0 

Sample Output

10
15

代码:

#include<iostream>
using namespace std;

int main()
{
	int n, a, sum;
	while (cin >>n)
	{
		if (n == 0)break;
		sum = 0;
		while (n--)
		{
			cin >> a;
			sum += a;
		}
		cout << sum << endl;
	}
	return 0;
}

HDU 1093 A+B for Input-Output Practice (V)

题目:

Description

Your task is to calculate the sum of some integers. 

Input

Input contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in the same line. 

Output

For each group of input integers you should output their sum in one line, and with one line of output for each line in input. 

Sample Input

2
4 1 2 3 4
5 1 2 3 4 5

Sample Output

10
15

代码:

#include<iostream>
using namespace std;

int main()
{
	int t, n, a, sum;
	cin >> t;
	while (t--)
	{
		cin >> n;
		sum = 0;
		while (n--)
		{
			cin >> a;
			sum += a;
		}
		cout << sum << endl;
	}
	return 0;
}

HDU 1094 A+B for Input-Output Practice (VI)

题目:

Description

Your task is to calculate the sum of some integers. 

Input

Input contains multiple test cases, and one case one line. Each case starts with an integer N, and then N integers follow in the same line. 

Output

For each test case you should output the sum of N integers in one line, and with one line of output for each line in input. 

Sample Input

4 1 2 3 4
5 1 2 3 4 5

Sample Output

10
15

代码:

#include<iostream>
using namespace std;

int main()
{
	int n, a, sum;
	while (cin >> n)
	{
		sum = 0;
		while (n--)
		{
			cin >> a;
			sum += a;
		}
		cout << sum << endl;
	}
	return 0;
}

HDU 1096 A+B for Input-Output Practice (VIII)

题目:

Description

Your task is to calculate the sum of some integers. 

Input

Input contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in the same line. 

Output

For each group of input integers you should output their sum in one line, and you must note that there is a blank line between outputs. 

Sample Input

3
4 1 2 3 4
5 1 2 3 4 5
3 1 2 3

Sample Output

10

15

6

代码:

#include<iostream>
using namespace std;

int main()
{
	int t, n, a, sum;
	cin >> t;
	while (t--)
	{
		cin >> n;
		sum = 0;
		while (n--)
		{
			cin >> a;
			sum += a;
		}
		cout << sum << endl;
		if (t)cout << endl;
	}
	return 0;
}

四,输入字符串

(1)gets函数

C语言输入字符串,都是用char数组来表示字符串。

gets函数读取整行输入,直到遇到换行符,然后丢弃换行符,储存其他的字符,并在后面补一个'\0'

CodeForces 616A Comparing Two Long Integers

题目:

Description

You are given two very long integers a, b (leading zeroes are allowed). You should check what number a or b is greater or determine that they are equal.

The input size is very large so don't use the reading of symbols one by one. Instead of that use the reading of a whole line or token.

As input/output can reach huge size it is recommended to use fast input/output methods: for example, prefer to use scanf/printfinstead of cin/cout in C++, prefer to use BufferedReader/PrintWriter instead of Scanner/System.out in Java. Don't use the functioninput() in Python2 instead of it use the function raw_input().

Input

The first line contains a non-negative integer a.

The second line contains a non-negative integer b.

The numbers a, b may contain leading zeroes. Each of them contains no more than 106 digits.

Output

Print the symbol "<" if a < b and the symbol ">" if a > b. If the numbers are equal print the symbol "=".

Sample Input

Input

9
10

Output

<

Input

11
10

Output

>

Input

00012345
12345

Output

=

Input

0123
9

Output

>

Input

0123
111

Output

>

就是比较2个整数的大小,很简单。

主要就是c语言不熟悉。

代码:

#include<stdio.h>
#include<stdlib.h> 
#include<string.h>
 
 
int main()
{
	char*s1 = new char[1000000];
	char*s2 = new char[1000000];
	int l1, l2;
	char c;
	while (gets(s1) && gets(s2))
	{
		l1 = strlen(s1);
		l2 = strlen(s2);
		int i = 0, j = 0;
		while (s1[i] == '0'&& l1)
		{
			i++;
			l1--;
		}
		while (s2[j] == '0'&& l2)
		{
			j++;
			l2--;
		}
		if (l1 > l2)c='>';
		else if (l1 < l2)c='<';
		else
		{
			while (s1[i])
			{
				if (s1[i]>s2[j])
				{
					c = '>';
					break;
				}
				if (s1[i]<s2[j])
				{
					c = '<';
					break;
				}
				i++;
				j++;
				l1--;
			}
			if (l1 == 0)c = '=';
		}
		printf("%c\n", c);
	}
	return 0;
}

(2)gets的替代函数

可以用fgets或者gets_s替代gets函数,函数功能有差异但类似。

(3)scanf

scanf是读单词的形式,忽略开头的所有空白符,读到任意空白符就结束。

HDU 5842 Lweb and String

题目:

这个题目是说,任选一个从26个字母的集合到整数的集合的映射,然后求每一行的字符数组对应的数列的最长递增子序列的长度的最大值。

如果你以为我要说的是动态规划,那你就傻了。

因为映射可以任选,所以这个题目的意思是,输入一个字符串(只有小写字母),输出它有多少个不同的小写字母。

对,没错,就是这样,没了。

代码:

#include<iostream>
#include<cstring>
using namespace std;

char c[100001];
int l[26];

int main()
{
    int t;
    scanf("%d", &t);
    for (int cas = 1; cas <= t; cas++)
    {
        scanf("%s", c);
        int len = strlen(c);
        for (int i = 0; i < 26; i++)l[i] = 0;
        for (int i = 0; i < len; i++)l[c[i] - 'a']++;
        int sum = 0;
        for (int i = 0; i < 26; i++)sum += (l[i]>0);
        printf("Case #%d: %d\n", cas, sum);
    }
    return 0;
}

(4)char数组 + cin

(4.1)cin

cin输入用char数组表示的字符串,遇到空白符会结束输入。

如CSU 1260、CSU 1059、CSU 1019

(4.2)cin.getline

cin.getline可以读取整行字符串,每读取一行,把换行符丢弃。

如 CSU 1029

(4.3)cin.get

cin.get和cin.getline非常相似,但是换行符不会丢弃,而是继续放在输入缓冲区中。

CSU 2050

(5)string

(5.1)cin

cin输入字符串以空白符为结束,如CSU 1041、CSU 1112、CSU 1042 遥控机器人

(5.2)getline

getline读取一整行,如POJ 1035

五,输入其他内容

输入的内容,简单分类就是2种,数字和字符串,仔细分类的话有很多种。

1,输入整数、实数

输入整数是最常见的情况,例子非常多,如上面的HDU IO系列。

CSU 1000/1001/1002 A+B问题 覆盖了普通整数、大整数、实数的输入输出问题。

CSU 1000 A+B (I)

Description

Your task is to Calculate a + b.

Input

Input contains multiple test cases. Each test case consists of a pair of integers a and b(0<=a,b<=20), separated by a space, one pair of integers per line.

Output

For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.

Sample Input

1 1

Sample Output

2

代码:

#include<iostream>
using namespace std;
 
int main()
{
    inta, b;
    while(cin >> a >> b)
    {
        cout << a + b << endl;
    }
    return 0;
}

CSU 1001 A+B (II)

Description

Your task is to Calculate a + b.

Input

There are multiple test cases. Each test case contains only one line. Each line consists of a pair of real number a and b(0<=a,b<=1000000), separated by a space.

Output

For each case, output the answer in one line rounded to 4 digits after the decimal point.

Sample Input

1 5

10 20

0.1 1.5

Sample Output

6.0000

30.0000

1.6000

代码:

#include<iostream>
using namespace std;
 
int main()
{
    double a, b;
    while(cin >> a >> b)
    {
        printf("%.4f",a+b);
        cout <<  endl;
    }
    return 0;
}

CSU 1002 A+B (III)

Description

Your task is to Calculate a + b.

Input

There are multiple test cases. Each test case contains only one line. Each line consists of a pair of integers a and b(1=< a,b <=1016), separated by a space. Input is followed by a single line with a = 0, b = 0, which should not be processed.

Output

For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.

Sample Input

1 5
10 20
10000000000000000 10000000000000000
0 0

Sample Output

6
30
20000000000000000

代码:

#include<iostream>
using namespace std;
 
int main()
{
    long long a, b;
    while(cin >> a >> b)
    {
        if(a == 0 && b == 0)break;
        cout << a + b<<endl;
    }
    return 0;
}

2,用字符串输入整数、实数

CSU 1340 A Sample Problem

题目:

Description

   My girlfriend loves 7 very much, she thinks it is lucky! If an integer contains one or more 7, she will think it is lucky too!

Input

    The first line has one integer T (1 <= T <= 100), means there are T test cases.
    For each test case, there is only one line with an integer X (1 <= X <= 109).

Output

    For each test case, if X contains one or more 7, output “Lucky” (without quotation marks), otherwise output “Unlucky” (without quotation marks).

Sample Input

4
7
11
568
17171

Sample Output

Lucky
Unlucky
Unlucky
Lucky

HINT

    我们主要通过这个题目来感受一下一个完整的ACM竞赛的题目应当是什么样的。

    ACM竞赛题目本身的“格式”很明显:

    第一部分是对题目的描述,会交待题目的背景,以及你需要编程完成哪些任务等等。

    第二部分是对输入的约定,会告诉你题目是否有多组测试数据,每组测试数据的格式,每个参数的类型(整数,浮点数,字符串等)以及取值范围等等。

    第三部分是对输出的约定,也就是你的程序应当输出哪些内容以及具体的格式是什么。

    第四部分是一些样例,这些例子只是向你展示一部分测试数据以及对应的答案,目的是更好地帮助你理解题意,以及了解对输出格式的要求等。

    大家也许会和我当初刚接触ACM时一样心中充满了疑问,在这里我就为大家列举几个常见的问题:

    <1> 如果题目有多组数据,我们是不是也要像样例那样把所有的结果先都计算出来,然后再一起输出?

    这个是没必要的,你完全可以每处理完一组数据之后就立刻将这组数据对应的结果输出出来。

    但如果你是手动去敲这些样例的话,你会发现在屏幕上输入和输出是混在一起的,并不像样例那样输入和输出是分离的,这样会不会不符合要求呢?那么请看<2>,相信你的疑问就会被解答了。

    <2> OJ (Online Judge)怎么知道我的程序是不是写对了?

    OJ并不会去智能化地分析你的代码正确与否,而是用另一种巧妙的思路来判断你的程序是否符合要求:“喂”给你的程序一些输入数据(就像你在键盘上敲一些东西后敲回车一样),之后再将你的程序“产出”的东西(就像你在屏幕上看到的你的程序输出的东西一样)和标准的答案进行对比,如果你的程序得到的答案和标准的答案一模一样,那么就算你通过了这个题目。

    因此,即使你手动输入样例时屏幕上的输入和输出是混在一起也没关系,只要你的程序“产出”的东西和标准答案一模一样就可以了。

    也正是这种评判机制的关系,你不应当让程序打印一些提示语句,如“Please input two integers”等等,因为凡是你的程序输出的内容都会被拿来和标准答案进行对比,一旦输出了类似这样的题目没有要求输出的语句,就会和标准答案大相径庭了,自然就会认为你的程序是不正确的了。

    值得一提的是,尽管这样的评判机制似乎并不能完美地知道你的程序究竟是不是对的(想想看为什么?),不过如果测试数据足够强大的话,“你的程序是对的”的概率就会很高很高了。

    <3> 为什么我的程序通过了所有的样例,但是最后还是过不了这个题目?

    题目的样例只是一小部分测试数据,目的是为了更好地帮助你理解题意,以及了解对输出格式的要求等,因此通过了样例并不能够代表能通过所有的测试数据。只有通过了所有的测试数据才能得到“Accept”,也就是通过了这个题目。

    <4> 每组测试数据的答案输出完之后,是否都要换行?

    是的,即使题目里面没有明确说明,我们也应该在每组测试数据的答案输出完之后再输出一个“换行”(也就是“\n”),就像样例示意的那样。

    接下来我们谈谈这个题目的思路吧,相信大家应该都想到算法了:只要依次判断读入的整数的每一位是否是7就可以了。

代码:

#include<iostream>
#include<cstring>
using namespace std;
 
char c[10];
 
int main()
{
    ios_base::sync_with_stdio(false);
    int t;
    cin >> t;
    while (t--)
    {
        cin >> c;
        int f = 0;
        for (int i = 0; i < strlen(c); i++)if (c[i] == '7')f = 1;
        if (f)cout << "Lucky" << endl;
        else cout << "Unlucky" << endl;
    }
    return 0;
}

ACM的题目就是这样,明明输入的是1个整数,但是我完全可以看成输入的就是一个个字符,只需要看每个字符是不是7,而不需要任何数学计算。

else

CSU 1003
CSU 1053
HDU 1717 小数化分数2

3,输入数字和字符的组合

CodeForces 697B Barnicle

4,表格型数据

SGU 454 Kakuro

5,其他输入技巧

(1)忽略输入

有些输入内容是不需要的,那就可以把变量也省掉。

如输入m s n三个整数,但是s不需要,那么代码就是:

int main()
{
	int m, n;
	cin >> m >> n >> n;
......

如果需要忽略的输入是排在最后的,甚至连这种覆盖都不需要,直接不输入就行,OJ并不要求必须把输入数据全部输入到程序中,OJ只校验输出。

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

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

相关文章

浅谈智慧消防助力现代社会火灾防控 安科瑞 顾语欢

摘 要&#xff1a;随着我国经济水平的不断提高&#xff0c;科学技术取得了长足进步。科学技术的进步推动着社会不断前进&#xff0c;改变了各行各业的人们的生活。随着各种新型的技术尤其是人工智能技术的出现&#xff0c;社会进入了智能化时代。消防作为维护我们生活的一道重要…

ava算法_ 跳跃游戏(LeetCode_Hot100)

题目描述&#xff1a;给你一个非负整数数组 &#xff0c;你最初位于数组的 第一个下标 。数组中的每个元素代表你在该位置可以跳跃的最大长度。nums 判断你是否能够到达最后一个下标&#xff0c;如果可以&#xff0c;返回 &#xff1b;否则&#xff0c;返回 。truefalse 获得更…

[保研/考研机试] KY7 质因数的个数 清华大学复试上机题 C++实现

描述 求正整数N(N>1)的质因数的个数。 相同的质因数需要重复计算。如1202*2*2*3*5&#xff0c;共有5个质因数。 输入描述&#xff1a; 可能有多组测试数据&#xff0c;每组测试数据的输入是一个正整数N&#xff0c;(1<N<10^9)。 输出描述&#xff1a; 对于每组数…

vite+vue3项目环境搭建

1.安装 npm init vite 2.输入项目名称 vue3-project 3.选择框架 说明&#xff1a;vue 4.选择类别 说明&#xff1a;JavaScript 5.进入文件夹 cd vue3-project yarn npm run dev 6.打开local

十种排序算法(附动图)

排序算法 一、基本介绍 ​ 排序算法比较基础&#xff0c;但是设计到很多计算机科学的想法&#xff0c;如下&#xff1a; ​ 1、比较和非比较的策略 ​ 2、迭代和递归的实现 ​ 3、分而治之思想 ​ 4、最佳、最差、平均情况时间复杂度分析 ​ 5、随机算法 二、排序算法的分类 …

【LeetCode-中等】剑指 Offer 29. 顺时针打印矩阵(详解)

题目 输入一个矩阵&#xff0c;按照从外向里以顺时针的顺序依次打印出每一个数字。 示例 1&#xff1a; 输入&#xff1a;matrix [[1,2,3],[4,5,6],[7,8,9]] 输出&#xff1a;[1,2,3,6,9,8,7,4,5]示例 2&#xff1a; 输入&#xff1a;matrix [[1,2,3,4],[5,6,7,8],[9,10,1…

【前端 | CSS】滚动到底部加载,滚动监听、懒加载

背景 在日常开发过程中&#xff0c;我们会遇到图片懒加载的功能&#xff0c;基本原理是&#xff0c;滚动条滚动到底部后再次获取数据进行渲染。 那怎么判断滚动条是否滚动到底部呢&#xff1f;滚动条滚动到底部触发时间的时机和方法又该怎样定义&#xff1f; 针对以上问题我…

WinServer2016 DHCPv6部署

Windows Server 2016 部署 DHCPv6 应用场景&#xff1a;如果服务器的 idrac 地址配置之后忘记了&#xff0c;又无法不能重启服务器&#xff0c;可以通过 DHCPv6 来解决。因为服务器 idrac 的 ipv6 自动获取是默认开启的&#xff0c;那么可以用笔记本装个 windwos server 的系统…

Vue2 实现购物车功能(可直接使用)

目录 vue2.0实例简单购物车代码实现 vue2.0实例简单购物车 页面展示效果如下&#xff1a;​ 该购物车实现了自动计算小计、总价。 代码实现 <body><div id"app"><div><form action"">商品名称:<input type"text" …

卡巴斯基为基于Linux的嵌入式设备推出专用解决方案

导读卡巴斯基在其卡巴斯基嵌入式系统安全产品中引入了对 Linux 的支持。这种适应性强的多层解决方案现在为基于Linux的嵌入式系统、设备和场景提供优化的安全&#xff0c;合通常适用于这些系统的严格监管标准。 卡巴斯基在其卡巴斯基嵌入式系统安全产品中引入了对 Linux 的支持…

编程小白必看!Visual Studio 2022详细安装使用教程(C/C++编译器)

目录 【前言】 一、Visual Studio 2022简介 二、Visual Studio 2022下载安装 1.Visual Studio 2022下载地址 2.Visual Studio 2022安装 2.1下载完成后点击打开安装 2.2安装完毕以后需要重启软件&#xff0c;点击确定。 三、Visual Studio 2022使用教程 【最后】 &#x…

分享一颗能用在TYPE-C接口取电协议芯片LDR6328Q,方便好用

芯片功能&#xff1a;诱导PD充电器输出最大功率&#xff0c;支持最大诱骗20V电压。支持协议&#xff1a;PD/QC/三星AFC/华为SCP等主流快充协议 芯片封装&#xff1a;QFN16,SOP8多封装选择 芯片应用&#xff1a; 桶形连接器替换&#xff08;BCR&#xff09;&#xff0c;USB-A和m…

ABAP: SQL 多值查询

基础查数据 问题举例&#xff1a;例如查物料类型为ZFRT、ZROH和ZRSA的物料编码。 1、直接查询&#xff0c;三种不同类型的物料类型是或的关系。 SELECT DISTINCT ma~matnr ma~mtartFROM mara AS maINNER JOIN mbewh AS mbON ma~matnr mb~matnrINTO CORRESPONDING FIELDS OF…

模型训练----将日志输出为txt

1、写入txt 在云服务器上训练模型的时候&#xff0c;防止不显示输出&#xff0c;可以将训练日志写入txt import logging#初始化文件&#xff0c;filemodew每次覆盖文件 logging.basicConfig(filename./log.txt,format %(asctime)s - %(name)s - %(levelname)s - %(message)s-…

笔记本电脑合上盖后重新打开(秒开)处理方案

原因&#xff1a;合上盖默认进入休眠&#xff0c;电脑内存进入运存&#xff0c;重新打开数据重新传入内存&#xff0c;时间很长&#xff0c; 方案&#xff1a;将休眠模式改为从不即可

机器学习模型的可解释性:增加对人工智能系统的信任和理解

为了以道德和值得信赖的方式使用人工智能&#xff0c;研究人员必须继续创建平衡模型复杂性和易于解释的方法。 机器学习模型在各个领域的使用都取得了重大进展&#xff0c;包括自然语言处理、生成式人工智能和自主系统等。另一方面&#xff0c;随着模型复杂性和规模的增加&…

山东布谷科技直播平台搭建游戏开发技术分享:数据存储的重要意义

在市场上的热门的直播平台中&#xff0c;有很多小程序为用户提供各种各样的功能&#xff0c;这其中就有很多游戏小程序&#xff0c;当今社会独生子女众多&#xff0c;很多作为独生子女的用户都会去选择一个能够社交互动的APP来填补内心的空虚&#xff0c;而直播平台的实时互动的…

python自动化测试框架unittest与pytest的区别

前言&#xff1a; 有使用过unittest单元测试框架&#xff0c;再使用pytest单元测试框架&#xff0c;就可以明显感觉到pytest比unittest真的简洁、方便很多。 unittest与pytest的区别&#xff1a; 主要从用例编写规则、用例的前置和后置、参数化、断言、用例执行、失败重运行…

day24-106.从中序与后序遍历序列构造二叉树

106.从中序与后序遍历序列构造二叉树 力扣题目链接(opens new window) 根据一棵树的中序遍历与后序遍历构造二叉树。 注意: 你可以假设树中没有重复的元素。 例如&#xff0c;给出 中序遍历 inorder [9,3,15,20,7]后序遍历 postorder [9,15,7,20,3] 返回如下的二叉树&am…

CentOS 7 下 Keepalived + Nginx 实现双机高可用

CentOS 7 下 Keepalived Nginx 实现双机高可用 文章目录 CentOS 7 下 Keepalived Nginx 实现双机高可用服务器准备服务信息服务架构 服务安装nginxKeepalived 服务配置nginxKeepalived 启动服务nginxkeepalived 服务验证查看 VIP 状态CURL 命令访问浏览器访问 高可用验证停止…