当前位置:网站首页>[CCF CSP] 201509-1 sequence segmentation
[CCF CSP] 201509-1 sequence segmentation
2022-07-22 04:00:00 【Jenny, Jenny】
Problem description
Question number : | 201509-1 |
The title of the test question : | Sequence segmentation |
The time limit : | 1.0s |
Memory limit : | 256.0MB |
Problem description : | Problem description Give a sequence of integers , The longest continuous sequence of integers in a sequence is counted as a segment , How many segments are there in a sequence ? Input format The first line of input contains an integer n, Represents the number of integers in a sequence . Output format Output an integer , Indicates that a given sequence of numbers has multiple segments . The sample input 8 Sample output 5 Sample explanation 8 8 8 It's the first paragraph ,0 It's the second paragraph ,12 12 It's the third paragraph , The penultimate integer 8 It's the fourth paragraph , the last one 0 It's the fifth paragraph . Evaluate use case size and conventions 1 ≤ n ≤ 1000,0 ≤ ai ≤ 1000. |
#include<bits/stdc++.h>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
int** arr = new int*[m];
for (int i = 0; i < m; i++)
{
arr[i] = new int[n];
}
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
cin >> arr[m - j - 1][i];
}
}
for (int i = 0; i < m; i++)
{
for (int j = 0; j < n; j++)
{
cout<<arr[i][j]<<' ';
}
cout << endl;
}
return 0;
}
边栏推荐
- 从浏览器上传、下载Excel文件到数据库
- 32位栈溢出进阶
- PCIE链路初始化&训练
- Monai label -- use AI to accelerate your segmentation annotation
- Upload and download Excel files from the browser to the database
- February day
- Li Shuo, vice president of Baidu: AI can go deep into the scene and create real value. From sensors to large screens, it is just the beginning of digitalization
- Shell编程-函数
- 【CCF CSP】201612-1中间数
- 3.3栈和队列的应用
猜你喜欢
随机推荐
Sequences, Time Series and Prediction in Tessorflow quizs on Coursera (二)
Typora使用小手册
2.3线性表的链式表示(2)
2.2 sequential representation of linear table
NFTScan 与 Port3 在 NFT 数据领域达成战略合作
Application of breadth first traversal BFS and depth first traversal DFS to graph -- cloning graph based on leetcode133
Chapter III after class exercises 15-23
C#程序设计经典教程
Idea建文件夾時,文件夾的空文件夾的展開與重疊
Excel实操笔记1
SCA在得物DevSecOps平台上应用
压缩字符串
密码学知识-加密介绍-1
Field injection is not recommended
shell-循环
10 papers of ant security laboratory were included by ccf-a top meeting to explore the realization of AI credibility from the perspective of algorithm
解决ssh登录后闲置时间过长而断开连接
2.3线性表的链式表示(1)
32位栈溢出进阶
Xiangtan party and government delegation visited Qilin Xin'an for investigation