01 2021 档案
摘要:https://www.dotcpp.com/oj/problem1462.html 时间限制: 1Sec 内存限制: 128MB 题目描述 Huffman树在编码中有着广泛的应用。在这里,我们只关心Huffman树的构造过程。 给出一列数{pi}={p0, p1, …, pn-1},用这列数构造H
阅读全文
摘要:https://www.dotcpp.com/oj/problem1475.html 题目描述 输入两个整数a和b,输出这两个整数的和。a和b都不超过100位。 算法描述 由于a和b都比较大,所以不能直接使用语言中的标准数据类型来存储。对于这种问题,一般使用数组来处理。 定义一个数组A,A[0]用于
阅读全文
摘要:https://www.dotcpp.com/oj/problem1474.html #include<iostream> using namespace std; void multiply(int x[], int t) { for (int i = 0; i < x[4999]; i++) x
阅读全文
摘要:http://lx.lanqiao.cn/problem.page?gpid=T6 资源限制 时间限制:1.0s 内存限制:256.0MB 问题描述 对于长度为5位的一个01串,每一位都可能是0或1,一共有32种可能。它们的前几个是: 00000 00001 00010 00011 00100 请按
阅读全文
摘要:http://lx.lanqiao.cn/problem.page?gpid=T7 问题描述 利用字母可以组成一些美丽的图形,下面给出了一个例子: ABCDEFG BABCDEF CBABCDE DCBABCD EDCBABC 这是一个5行7列的图形,请找出这个图形的规律,并输出一个n行m列的图形。
阅读全文
摘要:查找整数 lx.lanqiao.cn/problem.page?gpid=T9 #include<iostream> using namespace std; int main() { int num, flag; cin >> num; int* x = new int[num]; for (in
阅读全文
摘要:杨辉三角形 http://lx.lanqiao.cn/problem.page?gpid=T10 #include<iostream> using namespace std; int main() { int x[34][34] = { 0 }; for (int i = 0; i < 34; i
阅读全文
摘要:回文数 http://lx.lanqiao.cn/problem.page?gpid=T47 #include<iostream> using namespace std; int main() { int x1, x2, x3, x4; for (int i = 1000; i < 10000;
阅读全文
摘要:http://lx.lanqiao.cn/problem.page?gpid=T48 #include<iostream> using namespace std; int main() { int sum; cin >> sum; int x1, x2, x3, x4, x5, x6; for (
阅读全文
摘要:http://lx.lanqiao.cn/problem.page?gpid=T49 #include<iostream> #include<string.h> using namespace std; char inttochar(int x) { if (x >= 0 && x <= 9) re
阅读全文
摘要:http://lx.lanqiao.cn/problem.page?gpid=T50 最开始犯了一个错误,用了strlen()函数但是忘了加头文件<string.h> 然后提交这个 #include<iostream> #include<string.h> using namespace std;
阅读全文
摘要:https://www.dotcpp.com/oj/problem1094.html getchar()在这里用来捕获回车,先输入n的值,然后敲回车,缓冲区会有一个回车,getline()会读入,用getchar()读入回车,清空缓冲区。 #include<iostream> #include<st
阅读全文

浙公网安备 33010602011771号