
CCF
做点题做点题
烟 鬼
这个作者很懒,什么都没留下…
展开
-
CCF 2016-12-1 中间数
题目链接: 2016-12-1 中间数.问题描述 在一个整数序列a1, a2, …, an中,如果存在某个数,大于它的整数数量等于小于它的整数数量,则称其为中间数。在一个序列中,可能存在多个下标不相同的中间数,这些中间数的值是相同的。 给定一个整数序列,请找出这个整数序列的中间数的值。输入格式 输入的第一行包含了一个整数n,表示整数序列中数的个数。 第二行包含n个正整数,依次表示a1, a2, …, an。输出格式 如果约定序列的中间数存在,则输出中间数的值,否则输出-1表示不存原创 2021-06-07 23:12:15 · 152 阅读 · 0 评论 -
CCF 2016-09-1 最大波动
题目链接: 2016-09-1 最大波动.问题描述 小明正在利用股票的波动程度来研究股票。小明拿到了一只股票每天收盘时的价格,他想知道,这只股票连续几天的最大波动值是多少,即在这几天中某天收盘价格与前一天收盘价格之差的绝对值最大是多少。输入格式 输入的第一行包含了一个整数n,表示小明拿到的收盘价格的连续天数。 第二行包含n个正整数,依次表示每天的收盘价格。输出格式 输出一个整数,表示这只股票这n天中的最大波动值。样例输入62 5 5 7 3 5样例输出4样例说明 第四原创 2021-06-04 21:01:40 · 138 阅读 · 0 评论 -
CCF 2016-04-1 折点计数
题目链接: 2016-04-1 折点计数.问题描述 给定n个整数表示一个商店连续n天的销售量。如果某天之前销售量在增长,而后一天销售量减少,则称这一天为折点,反过来如果之前销售量减少而后一天销售量增长,也称这一天为折点。其他的天都不是折点。如下图中,第3天和第6天是折点。 给定n个整数a1, a2, …, an表示销售量,请计算出这些天总共有多少个折点。 为了减少歧义,我们给定的数据保证:在这n天中相邻两天的销售量总是不同的,即ai-1≠ai。注意,如果两天不相邻,销售量可能相同。输入格原创 2021-06-04 20:55:00 · 96 阅读 · 0 评论 -
CCF 2015-12-1 数位之和
题目链接: 2015-12-1 数位之和.问题描述 给定一个十进制整数n,输出n的各位数字之和。输入格式 输入一个整数n。输出格式 输出一个整数,表示答案。样例输入20151220样例输出13样例说明 20151220的各位数字之和为2+0+1+5+1+2+2+0=13。评测用例规模与约定 所有评测用例满足:0 ≤ n ≤ 1000000000。code#include <iostream>using namespace std;int mai原创 2021-06-04 20:46:34 · 106 阅读 · 0 评论 -
CCF 2015-03-1 图像旋转
题目链接: 2015-03-1图像旋转.code#include <iostream>using namespace std;int main() { int n, m; cin >> n >> m; int** nums; nums = new int* [n]; for (int i = 0; i < n; i++) { nums[i] = new int[m]; } for (int i = 0;原创 2021-06-02 23:18:27 · 72 阅读 · 0 评论 -
CCF 2015-09-1 数列分段
题目链接: 2015-09-1 数列分段.code#include <iostream>using namespace std;int main() { int n; cin >> n; int *nums = new int [n]; for(int i=0; i<n; i++) { cin >> nums[i]; } int count = 0; int temp = nums[0]; count++; for(i原创 2021-06-02 01:40:00 · 82 阅读 · 0 评论 -
CCF 2014-12-1 门禁系统
题目链接: 2014-12-1 门禁系统.code#include <iostream>using namespace std;int main() { int n; cin >> n; int* record = new int[n]; int* count = new int[n] {0, 0}; for (int i = 0; i < n; i++) { cin >> record[i]; } for (int i = 0; i原创 2021-06-01 13:08:16 · 128 阅读 · 0 评论 -
CCF 2014-09-1 相邻数对
题目链接: 2014-09-1 相邻数对.code#include <iostream>#include <algorithm> //引入sort函数using namespace std;int main() { int n; cin >> n; int* nums = new int[n]; for (int i = 0; i < n; i++) cin >> nums[i]; sort(nums, nums + n原创 2021-06-01 13:06:10 · 93 阅读 · 0 评论 -
CCF 2014-03-1 相反数
题目链接: 2014-03-1 相反数.code#include <iostream>#include <algorithm> //sort函数using namespace std;int main() { int N; cin >> N; int* nums = new int[N]; for (int i = 0; i < N; i++) cin >> nums[i]; sort(nums, nums + N);原创 2021-05-31 20:26:39 · 95 阅读 · 0 评论 -
CCF 2013-12-1 出现次数最多的数
题目链接: 2013-12-1 出现次数最多的数.code#include<iostream>using namespace std;int main() { int n; cin >> n; int *nums = new int[n]; for (int i = 0; i < n; i++) cin >> nums[i]; int (*statistic)[2] = new int[n][2]; for (int i = 0; i原创 2021-05-31 19:36:16 · 72 阅读 · 0 评论 -
CCF 2020-06-1 线性分类器
菜归菜,题还是要做的,准备一下9月份的认证考试题目链接: 2020-06-1 线性分类器.demo#include<iostream>using namespace std;int main() { int n, m; cin >> n; cin >> m; int (*points)[2] = new int[n][2]; char *points_flag = new char[n]; int (*lines)[3] = new int原创 2021-05-31 11:29:13 · 133 阅读 · 0 评论