<commit_before>#include <bits/stdc++.h>
#define forn(i,j,k) for(int i=j; i<k; i++)
using namespace std;

typedef long long ll;

/*
 * Largest Sum Contiguous Subarray
 * Kadane Algorithm
 * Complexity O(n)
 */

inline ll get_max_sum(ll * data, int size){
    ll maxn = data[0], aux = data[0];
    forn(i, 1, size){
        aux = max(data[i], data[i] + aux);
        maxn = max(maxn, aux);
    }
    return maxn;
}

int main(){
    //Faster input and output
    ios::sync_with_stdio(false);
    cin.tie(0);

    int size = 8;
    ll *data  = new ll[size];

    forn(i, 0, size)
        scanf("%lld", &data[i]);

    ll res = get_max_sum(data, size);
    printf("The max that can be done with \
            Contiguous elements isin the array: %lld \n", res);

    return 0;<commit_msg>Make more semantic kadane algorithm.<commit_after>#include <bits/stdc++.h>
#define forn(i,j,k) for(int i=j; i<k; i++)
using namespace std;

typedef long long ll;

/*
 * Largest Sum Contiguous Subarray
 * Kadane Algorithm
 * Complexity O(n)
 */

inline ll get_max_sum(ll * data, int size){
    ll max_so_far= data[0],  max_ending_here = data[0];
    forn(i, 1, size){
        max_ending_here = max(data[i], data[i] + max_ending_here);
        max_so_far = max(max_so_far, max_ending_here);
    }
    return max_so_far;
}

int main(){
    //Faster input and output
    ios::sync_with_stdio(false);
    cin.tie(0);

    int size = 8;
    ll *data  = new ll[size];

    forn(i, 0, size)
        scanf("%lld", &data[i]);

    ll res = get_max_sum(data, size);
    printf("The max sum that can be done with \n \
            Contiguous elements is: %lld \n", res);

    return 0;
{'fraction_non_alphanumeric': 0.1475211608222491, 'fraction_numerical': 0.008464328899637243, 'mean_word_length': 2.8221709006928406, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5514524', 'n_tokens_mistral': 659, 'n_tokens_neox': 625, 'n_words': 177}