当前位置:网站首页>*7-1 CCF 2015-09-1 sequence segmentation
*7-1 CCF 2015-09-1 sequence segmentation
2022-07-25 09:39:00 【Ye Xiaobai】
Sequence segmentation
Title Description

Source code
#include<iostream>
using namespace std;
int main()
{
int n, last, current, sum=0;
cin >> n;
cin >> last;
sum = 1;
for (int i = 1; i < n; i++)
{
cin >> current;
if (last != current) sum++;
last = current;
}
cout << sum << endl;
return 0;
}
About this problem
First number It must take some time Each subsequent number is different from the previous number Order sum++
边栏推荐
- OC -- Foundation -- dictionary
- 正奇边形可划分成多少区域
- Android 如何使用adb命令查看应用本地数据库
- Database operation language (DML)
- Machine learning -- detailed introduction of standardscaler (), transform (), fit () in sklearn package
- 【代码源】每日一题 - 排队
- How to obtain location information (longitude and latitude) by uni app
- 【cf】Round 128 C. Binary String
- [code source] daily question - queue
- 文件--初识
猜你喜欢
随机推荐
OC -- category extension agreement and delegation
SurfaceView 闪屏(黑一下问题)
Machine learning -- detailed introduction of standardscaler (), transform (), fit () in sklearn package
OC--初识
【Android studio】批量数据导入到android 本地数据库
CoreData存储待办事项
Swift创作天气APP
How to write Android switching interface with kotlin
[gplt] 2022 popular lover (Floyd)
【代码源】每日一题 分割(nlogn&n解法)
【cf】Round 128 C. Binary String
Android 如何使用adb命令查看应用本地数据库
学习 Redis linux 安装Redis
Android & Kotlin : 困惑解答
Redis string 结构命令
STM32+HC05串口蓝牙设计简易的蓝牙音箱
[code source] a prime number of fun every day (BFS)
用kotlin怎么写Android切换界面
How to configure SSH after changing the computer
[GYCTF2020]Node Game









