hiho week 224 register

Ended

Participants:153

Verdict:Accepted
Score:100 / 100
Submitted:2018-10-17 23:05:16

Lang:GCC

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <stdio.h>
int cs[100004];
int nums[100004];
int A[50004];
int split(int* A, int ASize, int k)
{
    int i = 0,j = 0,l = 0;
    int count = 1, end = 0;
    int t = 0;
    int next = 0;
    
    for(i = 1;i < ASize;i++)
    {
        if(A[i] == A[i-1])
            count++;
        else
        {
            cs[j] = count;
            nums[j] = A[i-1];
            j++;
            count = 1;
        }
    }
    cs[j] = count;
    nums[j] = A[i-1];
    j++;
    for(i = 0;i < j;)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX