当前位置:网站首页>*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++
边栏推荐
猜你喜欢
随机推荐
uni-app如何获取位置信息(经纬度)
梦想启航(第一篇博客)
TCP network application development process
本地存储待办事项(在待办事项上进行改进)
Redis set structure command
Swift简单实现待办事项
Voice chat app source code - produced by NASS network source code
OC -- Foundation -- array
关于学生管理系统(注册,登录,学生端)
*6-1 CCF 2015-03-2 数字排序
[code source] daily question tree
Indexes, views and transactions of MySQL
对象初始化
laravel 调用第三方 发送邮件 (php)
SurfaceView 闪屏(黑一下问题)
【代码源】每日一题 分数拆分
【cf】Round 128 C. Binary String
STM32+HC05串口蓝牙设计简易的蓝牙音箱
如何将Jar包部署到服务器,注:启动命令有无nohup有很大关系
OC -- Foundation -- string + date and time



![[gplt] 2022 popular lover (Floyd)](/img/30/c96306ca0a93f22598cec80edabd6b.png)



