当前位置:网站首页>CCF sequence segmentation (Full Score code + problem solving idea) 201509 -1
CCF sequence segmentation (Full Score code + problem solving idea) 201509 -1
2022-06-30 14:41:00 【A cute little monkey】
Title Description

Their thinking
When in an array The current number is different from the previous one , Add one to the number of paragraphs , So when you enter an array , Accumulated number of segments according to special judgment
Code implementation
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int N = 1010;
int a[N];
int main()
{
int n;
cin >> n;
int res = 1;
for (int i = 0; i < n; i ++)
{
cin >> a[i];
if (i && a[i] != a[i - 1]) res ++; // When the number is not a[0] And the number is not equal to the previous number , Add one to the number of paragraphs
}
cout << res;
return 0;
}
边栏推荐
- [extensive reading of papers] analyzing connections between user attributes, images, and text
- PHP recursive multi-level classification, infinite classification
- @ResponseBody的作用
- Notes on reverse learning in the first week of winter vacation
- JS array
- ctfshow nodejs
- Notepad regular delete the line of the keyword
- Judgment of deep learning experiment results
- remote: Support for password authentication was removed on August 13, 2021. Please use a personal ac
- DefCamp Capture the Flag (D-CTF) 2021-22 web
猜你喜欢

DiceCTF - knock-knock

Detailed explanation of settimeout() and setinterval()
![[buuctf] [geek challenge 2019] secret file](/img/00/23bebd013eb4035555c0057725e3c4.jpg)
[buuctf] [geek challenge 2019] secret file

remote: Support for password authentication was removed on August 13, 2021. Please use a personal ac

V3 03_ Getting started

PS tip: the video frame to Layer command cannot be completed because dynamiclink is not available

PS cutting height 1px, Y-axis tiling background image problem
[email protected][])"/>NoViableAltException([email protected][])

The first three passes of sqli Labs

JS to realize simple lottery function
随机推荐
Summary of use of laravel DCAT admin
The JSON data returned from the control layer to JS has a "\" translator. How to remove it
[extensive reading of papers] multimodal attribute extraction
Greedy interval problem (5)
【BUUCTF】 EasySql
Double pointer circular linked list
Searching for single element in dichotomy
notepad正则删除关键词所在行
Attack and defense world web questions
Pseudocode writing specification
【BUUCTF】 Have Fun
Logiciel de récupération de données easyrecovery15 téléchargement
Component communication mode
Programming exercises: special numbers (problem solving ideas + code implementation)
Notes on reverse learning in the first week of winter vacation
Sum of squares of two pointers
Lfi-rce without controllable documents
Project management - common English vocabulary I
Four isolation levels of MySQL
Laravel configures passport and returns token using JWT