akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;


typedef long long ll;
int main() {
  int n;
  cin >> n;
  vector<ll> v(n);
  REP(i,n)cin >> v[i];

  sort(ALL(v), greater<ll>());
  ll res = 0;
  int f = 0;
  for (int i=0; i<n-2; ++i) {
//    cout <<res << endl;
    if (v[i+1] + v[i+2] > v[i]) {
      res += v[i]+v[i+1] + v[i+2];
      f++;
      i+=2;
      if (f==2) break;
    }
  }
  if (f != 2)
    res = 0;
  REP(i, n-5) {
    int arr[6] = {0,0,0,1,1,1};
    do {
      ll t1[3]; int tt1 = 0;
      ll t2[3]; int tt2 = 0;
      REP(j,6) {
        if (arr[j])
          t1[tt1++] = v[i+j];
        else
          t2[tt2++] = v[i+j];
      }
      if (t1[0]<t1[1]+t1[2] && t2[0]<t2[1]+t2[2]) {
        ll wa = 0;
        REP(j,6) wa+=v[i+j];
        res = max(res,wa);
        break;
      }
    } while(next_permutation(arr,arr+6));
  }
  cout <<res << endl;
}

Measured memory_bytes: 1652
#include <iostream>

using namespace std;

int main()
{
	int n,k;
	int arr[100000];

	cin >> n >> k;
	for(int i=0 ; i<n ; i++)
		cin >> arr[i];

	int count = 0;
	for(int i=0 ; i<n ; i++)
	{
		if(arr[i] >= k)	count++;
	}

	cout << count;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int INF = 1000000000; //
const ll LINF = (ll) 4000000000000000000; //
const ll MOD = (ll) 1000000007; //
const double PI = acos(-1.0); //

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,n) for(int i=1;i<=(int)(n);i++)
#define rep3(i,n) for(int i=0;i<=(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define repll(i,n) for(ll i=0;i<(ll)(n);i++)
#define repll2(i,n) for(ll i=1;i<=(ll)(n);i++)
#define REPLL(i,m,n) for(ll i=m;i<(ll)(n);i++)
#define MP make_pair
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl
#define NP(v) next_permutation(v.begin(),v.end())

//------------------------------------------------------

int main() {
    ll n;
    cin >> n;
    ll a[n];
    rep(i, n) cin >> a[i];

    ll now_sum = 0;
    ll adjust1 = 0;
    ll adjust2 = 0;

    //最初が正

    rep(i, n) {
        if (i % 2 == 0) {
            if (now_sum + a[i] <= 0) {
                ll after = 1 - now_sum;
                adjust1 += abs(a[i] - after);
                now_sum = 1;
            } else {
                now_sum += a[i];
            }
        } else {
            if (now_sum + a[i] >= 0) {
                ll after = -1 - now_sum;
                adjust1 += abs(a[i] - after);
                now_sum = -1;
            } else {
                now_sum += a[i];
            }
        }
    }

    now_sum = 0;

    rep(i, n) {
        if (i % 2 == 1) {
            if (now_sum + a[i] <= 0) {
                ll after = 1 - now_sum;
                adjust2 += abs(a[i] - after);
                now_sum = 1;
            } else {
                now_sum += a[i];
            }
        } else {
            if (now_sum + a[i] >= 0) {
                ll after = -1 - now_sum;
                adjust2 += abs(a[i] - after);
                now_sum = -1;
            } else {
                now_sum += a[i];
            }
        }
    }

    cout << min(adjust1, adjust2) << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <ios>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <forward_list>
#include <random>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <unordered_map>
#include <unordered_set>
#endif

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm( a, b ) (a)/__gcd((a),(b))*(b)
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 200005;

const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};

vector< int > Div( int n ) {
    vector< int > ret;
    for( int i = 1; i * i <= n; ++i ) {
        if( n % i == 0 ) {
            ret.pb( i );

            if( i * i != n ) ret.pb( n / i );
        }
    }
    sort( all( ret ) );
    return ret;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, m;
    string s;
    cin >> n >> m >> s;
    vector< int > v;
    int pos = s.size() - 1;
    while( pos != 0 ) {
        int cnt = 0;
        int mn = pos;
        for( int i = pos; i >= max(pos - m, 0); --i ) {
            if( s[i] == '0' ) {
                mn = i;

            }
        }
        if( mn == pos ) {
            cout << -1 << endl;
            return 0;

        }
        v.pb( pos - mn );
        pos = mn;

    }

    for( int i = v.size() - 1; i >= 0; --i ) {
        cout << v[i] << " ";

    }
    cout << endl;

    return 0;
}



Measured memory_bytes: 1096
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
#include <bitset>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define rep2(i, a)for(auto i : a)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x, std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
#define vec_unique(_a) _a.erase(std::unique(all(_a)), _a.end());
#define vvec vector<vector<ll>>
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
const int mod = 1000000007;
ll power(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x *= x; p /= 2; } else { a *= x; p--; } }return a; }
ll mpower(ll x, ll p) { ll a = 1; while (p > 0) { if (p % 2 == 0) { x = x * x % mod; p /= 2; } else { a = a * x % mod; p--; } }return a; }
ll co(ll n, ll k) { ll a = 1; rep(i, 1, k) { a *= n - i + 1; a /= i; }return a; }
ll mc(ll n, ll m) { ll k = 1, l = 1; rep(i, n - m + 1, n + 1) k = k * i % mod; rep(i, 1, m + 1) l = l * i % mod; l = mpower(l, mod - 2); return k * l % mod; }
void end() {
	puts("NO");
	exit(0);
}
int main() {
	int n, m;
	cin >> n >> m;
	vector<ll> x(n), y(n), z(n);
	rep(i, 0, n)cin >> x[i] >> y[i] >> z[i];
	ll ans = 0ll, sum;
	rep(_i, 0, 8) {
		vector<ll> list;
		sum = 0ll;
		rep(i, 0, n) {
			ll v = 0ll;
			v += ((_i >> 2 & 1) ? 1 : -1) * x[i];
			v += ((_i >> 1 & 1) ? 1 : -1) * y[i];
			v += ((_i & 1) ? 1 : -1) * z[i];
			list.push_back(v);
		}
		sort(all(list), std::greater<ll>());
		rep(i, 0, m)sum += list[i];
		ans = max(ans, sum);
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 3732
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include<iostream>
#include<string>
#include <vector>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)

using namespace std;

int main(){

	int N,n, S = 0;
	scanf("%d", &N);
	n = N;
	REP(i, 11){
		S += (N % 10);
		N = N / 10;
	}

	if (n%S == 0){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in range(n - 1):
  minj = i
  for j in range(i, n):
    if a[j] < a[minj]:
      minj = j
  if i != minj:
    a[minj], a[i] = a[i], a[minj]
    ans += 1

print(" ".join(map(str, a)))
print(ans)


Measured memory_bytes: 5600
#include <bits/stdc++.h>
#include <set>
#define ll long long 
#include <string>
#define pb push_back
#define mp make_pair
# define pi 3.14159265358979323846
#define mod 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define rep1(i,n) for(i=1;i<n;i++)
using namespace std;
void fastio()
{
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

}
ll int multiply(ll int a,ll int b)
{
	ll int ans=(a%mod*b%mod)%mod;
	return ans;
}
ll int add(ll int a, ll int b)
{
	ll int ans=(a%mod+b%mod)% mod;
	return ans;
}
 
void solve()
{
	ll int n,k;cin>>n>>k;
	ll int ans=1;
	while(n--)
	{
		ll int c1=ans*2;
		ll int c2=ans+k;
		ans=min(c1,c2);

	}
	cout<<ans<<endl;

}

int main()
{ 
	fastio();
    ll int t;
    // cin>>t;
    t=1;
    while(t--)
    {
    	solve();
    }
}

	
		
	
	
	
	





Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
    int n,m,k,ans=0;
    cin >> n >> m >> k;
    int a[n],b[m];
    rep(i,n) cin >> a[i];
    rep(i,m) cin >> b[i];
    long Sa[n+1],Sb[m+1];
    Sa[0]=0;Sb[0]=0;
    rep(i,n) Sa[i+1] = Sa[i]+a[i];
    rep(i,m) Sb[i+1] = Sb[i]+b[i];
    rep(i,n+1){//Aを何番目まで読むか
        long cur = k-Sa[i];
        if(cur<0) continue;
        else{
            int ok = 0,ng = m+1;
            while(ng-ok>1){
                int mid = (ok+ng)/2;
                if(Sb[mid]<=cur) ok = mid;
                else ng = mid;
            }
            ans = max(ans,i+ok);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 8312
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		if(a == b && b == c){
			System.out.println(1);
		}
		else if(a == b || b == c || a ==c){
			System.out.println(2);
		}
		else{
			System.out.println(3);
		}

	}

}


Measured memory_bytes: 21972
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1001001001
#define LINF 1001001001001001001
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LLP;

int main() {
  
  int N;
  cin >> N;
  vector<int> A(N), B(N);
  rep(i,N) cin >> A[i];
  rep(i,N) cin >> B[i];

  map<int, int> count_A, count_B;
  rep(i,N) {
    count_A.emplace(i + 1, 0);
    count_B.emplace(i + 1, 0);
  }
  rep(i,N) {
    count_A[A[i]]++;
    count_B[B[i]]++;
  }
  for (int i = 1; i <= N; i++) {
    if (count_A[i] + count_B[i] > N) {
      cout << "No" << endl;
      return 0;
    }
  }

  vector<int> C(N + 1, 0), D(N + 1, 0);
  for (int i = 1; i <= N; i++) {
    C[i] = C[i - 1] + count_A[i];
    D[i] = D[i - 1] + count_B[i];
  }
  int d = 0;
  for (int i = 1; i <= N; i++) {
    d = max(d, C[i] - D[i - 1]);
  }

  cout << "Yes" << endl;
  rep(i,N) {
    cout << B[(N + i - d) % N];
    if (i < N - 1) cout << " ";
    else cout << endl;
  }

  return 0;
}

Measured memory_bytes: 25176
<?php
list($n, $k) = explode(' ', trim(fgets(STDIN)));
$h = explode(' ', trim(fgets(STDIN)));

$c = 0;
for ($i = 0; $i < $n; $i++) {
    if ($h[$i] >= $k) {
        $c++;
    }
}

echo $c . PHP_EOL;


Measured memory_bytes: 12792
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define intarr(arr, n)  ll arr[n];  for (ll i = 0; i < n; i++)  cin >> arr[i]
#define inpvec(vec,n) for(ll i=0;i<n;i++){ll var;cin>>var;vec.push_back(var);}
#define ff first
#define ss second
#define pb push_back
#define mkp make_pair
#define vec vector<ll>
#define pi pair<ll,ll>
#define changeline cout<<endl
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define rev(i,a,b) for(ll i=a;i>=b;i--)
#define all(v) v.begin(),v.end()
#define mod2 998244353
#define NO cout << "NO" <<endl
#define YES cout << "YES" <<endl
#define mem(arr,val) memset(arr,val,sizeof(arr));
const ll mod=1e9+7;
#define piii 3.14159265358979323846264338327950
#define print(a, n, m)     for (ll i = n; i < m; i++) {  cout << a[i] << " "; }  cout << endl
#define con continue

bool prime(ll n) 
{ 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (ll i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}
bool isPerfectSquare(ll x) {   
  long double sr = sqrt(x); 
  return ((sr - floor(sr)) == 0); 
} 
bool subsequence_checker(string str1, string str2, ll m, ll n) 
{ 
    if (m == 0) return true; 
    if (n == 0) return false; 
    if (str1[m-1] == str2[n-1]) 
        return subsequence_checker(str1, str2, m-1, n-1); 
    return subsequence_checker(str1, str2, m, n-1); 
}
bool cmp(const pair<int,int> &a,  const pair<int,int> &b) 
{ 
    if(a.ff == b.ff)
        return a.ss < b.ss;
    return (a.ff > b.ff); 
}
//////////////////////////////////////////////////// Lets Do It ////////////////////////////////////////////////////////



void solve()
{

    ll n,d;
    cin>>n>>d;
    d = d*d;
    ll ans = 0;

    loop(i,0,n)
    {
        ll x,y;
        cin>>x>>y;

        if(x*x+y*y<=d)
            ans++;
    }   
    cout<<ans;

    return;
}
 
int main()
{
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
    IOS;
    ll t;
    //cin>>t;
    t=1;

    while(t--){
        solve();
        //cout<<endl;
    }

    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
} 

Measured memory_bytes: 3680
// Problem : D - Derangement
// Contest : AtCoder - AtCoder Beginner Contest 072
// URL : https://atcoder.jp/contests/abc072/tasks/arc082_b
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,b,a) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a,x) for (auto& a : x)
 
#define bug(x) cout<<#x<<"="<<x<<endl; 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
 
template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const ld pii=3.14159265359; 
const int MOD = 1000000007;
const char nl = '\n';
const int MX = 200001; //check the limits, dummy
 
int main() 
{
	ios_base::sync_with_stdio(0); cin.tie(0);    
	int N;
	cin>>N;
	vi v(N+1);
	FOR(x,1,N+1)
		cin>>v[x];
	vi ind;
	FOR(x,1,N+1)
	{
		if(x==v[x])
			ind.pb(x);
	}
	int ans=0;
	F0R(x,sz(ind))
	{
		ans++;
		if(x!=sz(ind)-1 && ind[x+1]==ind[x]+1)
			x++;
	}
	cout<<ans;
	return 0;
}
 
// read the question correctly (ll vs int)
// template by bqi343

Measured memory_bytes: 4312
#include <bits/stdc++.h>

using namespace std;

typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;

int main() {
	int N;
	cin >> N;
	int da = 0, db = 0, dc = 0;
	for(int i = 0; i < N; i++) {
		int a, b, c, nda, ndb, ndc;
		cin >> a >> b >> c;
		nda = a + max(db, dc);
		ndb = b + max(da, dc);
		ndc = c + max(da, db);
		da = nda; db = ndb; dc = ndc;
	}
	cout << max(da, max(db, dc)) << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <climits>
#define ll long long
using namespace std;
ll n, x, ans;
ll a[2005], b[2005];
int main()
{
	cin >> n >> x;
	for(int i=1; i<=n; i++)
	{
		cin >> a[i];
		b[i] = a[i];
	};
	ans = LLONG_MAX;
	for(int k=0; k<n; k++)
	{
		ll tmp = 0;
		for(int i=1; i<=n; i++)
		{
			int be = (i-k <= 0)? i-k+n: i-k;
			b[i] = min(b[i], a[be]);
			tmp += b[i];
		}
		ans = min(ans, tmp + k*x);
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, a = 1, count = -1;
  cin >> N;
  
  vector<int> vec(N);

  for (int i = 0; i < N; i++)
    cin >> vec.at(i);
  
  for (int i = 0; i < N; i++) {
    a = vec.at(a - 1);
    
    if (a == 2) {
      count = i + 1;
      break;}
  }
    
    cout << count << endl; 
}


Measured memory_bytes: 640
n, k, q = map(int, input().split())
a = []

for i in range(q):
  a.append(int(input()))

points = [k for i in range(n)]
minus_ones = [-1 for i in range(n)]

for i in range(q):
    points[a[i]-1] += 1
  
for i in range(n):
    points[i] -= q

for i in range(n):
  if points[i] > 0:
    print("Yes")
  else:
    print("No")

Measured memory_bytes: 59096
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    A=LI()
    if 0 in A:
        print(0)
        return 
    ans = 1
    for a in A:
        ans *= a
        if(ans > 10**18):
            print(-1)
            return
    print(ans)
if __name__ == '__main__':
    main()

Measured memory_bytes: 99324
#include<bits/stdc++.h>
#include <array>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

struct Problem {

	void Solve() {
		UL N; cin >> N;
		string A, B, C; cin >> A >> B >> C;
		UL ans = 0;
		rep(i, N) {
			if (A[i] == B[i] && B[i] == C[i]) continue;
			else if (A[i] == B[i]) ans++;
			else if (B[i] == C[i])ans++;
			else if (C[i] == A[i]) ans++;
			else ans += 2;
		}
		cout << ans << endl;
	}

	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;


int main(void){
    // Your code here!

    int n;
    cin>>n;
    if(n%10 == 2 ||n%10 == 4||n%10 == 5||n%10 == 7||n%10 == 9) cout<<"hon"<<endl;
    else if(n%10 == 0 ||n%10 == 1||n%10 == 6||n%10 ==8) cout<<"pon"<<endl;
    else if(n%10 == 3) cout<<"bon"<<endl;
}


Measured memory_bytes: 3632
from functools import reduce
N = int(input())
A = [int(i) for i in input().split()]
A.sort(reverse=True)
if A[-1] == 0:
    print(0)
else:
    s = 1
    for a in A:
        s *= a
        if s == 0:
            print(0)
            break
        if s > 10**18:
            print(-1)
            break
    else:
        print(s)

Measured memory_bytes: 22588
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define endl '\n'
bool comp(pair<string,int> a,pair<string,int> b)
{
    return a.second>b.second;
}
int main()
{
   int x;
   cin>>x;
   map<int,int>m;
   vector<pair<string,int>>v(400);
   for (int i = 0; i < x; i++)
   {
       string s;int sc;
       cin>>s>>sc;
      m[sc]=i+1;
      v[i]=make_pair(s,sc);
   }
   sort(v.begin(),v.begin()+x);
   vector<pair<string,int>>v1[200];
   int c=0;
   for (int i = 0; i < x; i++)
   {
       if(v[i].first==v[i+1].first)
       {
        v1[c].push_back(make_pair(v[i].first,v[i].second));
       }
       else
       {
           v1[c].push_back(make_pair(v[i].first,v[i].second));
           c++;
       }
   }
   for (int i = 0; i < c; i++)
   {
       sort(v1[i].begin(),v1[i].end(),comp);
   }
   for (int i = 0; i < c; i++)
   {
       for (int j = 0; j < v1[i].size(); j++)
       {
           cout<<m[v1[i][j].second]<<endl;
       }
       
   }
   
   
   
   
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define rep(i,a,n) for(int i = a; i < n; i++)
#define pb push_back
#define eb emplace_back
#define dump(x) cout << #x << " = " << (x) << endl
#define chk() cout << "now" << endl;
#define SORT(c) sort((c).begin(), (c).end())
#define SORTG(c) sort((c).begin(), (c).end(), greater<int>());
#define fi first
#define se second
  
typedef pair<int,int> P;
typedef vector<int> vi;

int N,K,INF=1e9+7;

void comb(vector<vector <int> > &v){
      for(int i = 0;i <v.size(); i++){
              v[i][0]=1;
                  v[i][i]=1;
                    }
        for(int k = 1;k <v.size();k++){
                for(int j = 1;j<k;j++){
                          v[k][j]=(v[k-1][j-1]+v[k-1][j]);
                          if(v[k][j]>=INF) v[k][j]=v[k][j]%INF;
                              }
                  }
}


signed main() {
    cin>>N>>K;
    int L=N-K;
    int MAX=max(L,K);
    vector<vector<int> > v(MAX+2,vector<int>(MAX+2,0));
    comb(v);

    if(N==K) {
        cout<<1<<endl;
        rep(i,0,K-1) {
            cout<<0<<endl;
        }
    }else{
    rep(i,1,K+1) {
        if(i==1) {
            cout<<L+1<<endl;
            continue;
        }
        if(i-1>L) cout<<0<<endl;
        else {
            int ret1=v[K-1][i-1];
            int ret2=v[L+1][i];
            int ret=ret1*ret2;
            if(ret>=INF) ret=ret%INF;
            cout<<ret<<endl;
        }
    }
    }
    return 0;
}

            



Measured memory_bytes: 31616
#![allow(unused_imports)]

use std::cell::RefCell;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::fmt::{Debug, Formatter, Write as FmtWrite};
use std::io::{stderr, stdin, BufRead, Write};
use std::mem::{replace, swap};
use std::ops::*;
use std::rc::Rc;

// -----------------------------------------------
// Framework <https://github.com/vain0x/procon>
// -----------------------------------------------

//
// Macro debug!
//

#[cfg(debug_assertions)]
include!{"./procon/debug.rs"}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($($arg:expr),*) => {};
}

//
// Macro input!
//

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//
// IteratorExt
//

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}


//
// Main
//

fn main() {
    input! {
        n: usize,
        xs: [usize; n],
    }

    let mut ys = vec![];
    ys.resize(n, 0);

    for i in 0..n {
        let j = n - i;

        let mut s = 0;
        for a in 1..(n + 1) {
            if n < a * j {
                break;
            }
            s += ys[a * j - 1];
        }
        
        if s % 2 != xs[j - 1] {
            ys[j - 1] = 1;
        }
    }

    let count: usize = ys.iter().sum();
    let ps = ys.iter().enumerate().filter(|&(_, &y)| y == 1).map(|(i, _)| i + 1).vec();

    println!("{}", count);
    for p in ps {
        println!("{}", p);
    }
}


Measured memory_bytes: 10876
#include <iostream>
#include <vector>
#include <algorithm>

int main() {
  long long H, result = 1, enemy_num = 1;
  std::cin >> H;
  
  while (H != 1) {
    result += enemy_num * 2;
    enemy_num *= 2;
    H /= 2;
  }
  
  std::cout << result << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>

int main()
{
    //
    char c[2];
    scanf("%c %c", &c[0], &c[1]);
    if (c[0] < c[1])
        puts("<");
    else if (c[0] > c[1])
        puts(">");
    else
        puts("=");
}


Measured memory_bytes: 764
using System;
using System.Collections.Generic;
using System.Linq;

namespace ABC113_B
{
	internal class Program
	{
		public static void Main(string[] args)
		{
			int n = int.Parse(Console.ReadLine());
			string[] input = Console.ReadLine().Split(' ');
			int t = int.Parse(input[0]);
			int a = int.Parse(input[1]);

			string[] h = Console.ReadLine().Split(' ');
			List<int> hArrs = new List<int>();
			List<double> hotMinArrs = new List<double>();

			for (int i = 0; i < n; i++)
			{
				hArrs.Add(int.Parse(h[i]));
				hotMinArrs.Add(Math.Abs(a - (t - hArrs[i] * 0.006)));
			}
			
			Console.WriteLine(hotMinArrs.IndexOf(hotMinArrs.Min()) + 1);
		}
	}
}

Measured memory_bytes: 13280
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e6+5,mod=998244353;
vector<int>v[N];
int n,a[N];
ll sum[N],p[N],f[N],inv[N];
int main()
{
    inv[1]=1;
    for(int i=2;i<=1000000;i++) inv[i]=(mod-mod/i)*inv[mod%i]%mod;
    int tot=0;
    for(int i=1;i<=1000000;i++)
        for(int j=i;j<=1000000;j+=i)
            v[j].push_back(i),tot++;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        for(int j=0;j<v[a[i]].size();j++)
            p[v[a[i]][j]]=(p[v[a[i]][j]]+sum[v[a[i]][j]]*a[i])%mod,sum[v[a[i]][j]]=(sum[v[a[i]][j]]+a[i])%mod;
    }
    ll ans=0;
    for(int i=1000000;i>=1;i--)
    {
        ans=(ans+p[i]*inv[i])%mod;
        for(int j=0;j<v[i].size()-1;j++)
            p[v[i][j]]=(p[v[i][j]]-p[i])%mod;
    }
    ans=(ans+mod)%mod;
    printf("%lld\n",ans);
}


Measured memory_bytes: 141824
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Main m = new Main();
        m.solve();
    }
    private void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        List<Path>[] graph = new List[N];
        for (int i = 0; i < N; i++) {
            graph[i] = new ArrayList<>();
        }
        for (int i = 0; i < N - 1; i++) {
            int a = scan.nextInt()-1;
            int b = scan.nextInt()-1;
            long c = scan.nextLong();
            Path p1 = new Path(b, c);
            graph[a].add(p1);
            Path p2 = new Path(a, c);
            graph[b].add(p2);
        }
        int Q = scan.nextInt();
        int K = scan.nextInt()-1;
        Queue<Integer> queue = new ArrayDeque<>();
        long[] distances = new long[N];
        boolean[] visited = new boolean[N];
        Arrays.fill(distances, Long.MAX_VALUE);
        distances[K] = 0;
        queue.add(K);
        while(!queue.isEmpty()) {
            int current = queue.poll();
            visited[current] = true;
            List<Path> neighbors = graph[current];
            for (Path p : neighbors) {
                if (visited[p.to]) {
                    continue;
                }
                distances[p.to] = distances[current] + p.cost;
                queue.add(p.to);
            }
        }
        for (int i = 0; i < Q; i++) {
            int from = scan.nextInt() - 1;
            int to = scan.nextInt() - 1;
            System.out.println(distances[from] + distances[to]);
        }
    }

    class Path {
        int to;
        long cost;
        Path(int to, long cost) {
            this.to = to;
            this.cost = cost;
        }
    }
}


Measured memory_bytes: 181540
using System;
namespace ITP1_2_B
{
    class Program
    {
        static void Main(string[] args)
        {
            var S = Console.ReadLine().Split();
            var a = int.Parse(S[0]);
            var b = int.Parse(S[1]);
            var c = int.Parse(S[2]);
            if(a < b && b < c)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 17988
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define SIZE(array) (sizeof(array) / sizeof(array[0]))

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define MAX_V 100000

#define MOD 1000000007L
#define INF 2147483647

ll nnn(ll n, ll x) {
	if (n == -1) {
		return -1;
	}
	return n / x;
}

signed main() {
	ll a, b, x;
	ll t = 1000000000000000000LL;
	cin >> a >> b >> x;
	cout << (nnn(b, x) - nnn(a - 1, x)) << endl;
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(){
  string s;cin>>s;
  rep(i,12){
    cout<<s[i];
    if(i==3)cout<<" ";
  }
  cout<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>

int main(int argc, char* argv[])
{
  int n = 13;
  std::map< int, int > mp;

  mp[1] = 99;
  for (int i = 2; i <= n; i++) {
    mp[i] = i;
  }

  int a, b;
  std::cin >> a >> b;
  std::string judge = "Draw";
  if (mp[a] > mp[b]) {
    judge = "Alice";
  } else if (mp[a] < mp[b]) {
    judge = "Bob";
  } else {
    judge = "Draw";
  }

  std::cout << judge << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"

typedef long long ll;
#define all(x) (x).begin(), (x).end()  // sortなどの引数を省略
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define max3(x, y, z) max(x, max(y, z))
#define min3(x, y, z) min(x, min(y, z))

#ifdef _MSC_FULL_VER  //デバッグ出力
#define dout cout
#define debug() if (true)
#define check(x) std::cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) std::cout << "☆" << x << endl
#else
#define dout \
  if (false) cout
#define debug() if (false)
#define check(x) \
  if (false) cout << "★" << #x << "の値:" << (x) << endl
#define pass(x) \
  if (false) cout << "☆" << x << endl
#endif

using namespace std;
int main() {
	int a, b;
	cin >> a >> b;
	if (b<a * 2 or b>a * 4) {
		cout << "No";
		return 0;
	} else if(b%2==1){
		cout << "No";
		return 0;
	}
	cout << "Yes";
	return 0;
}
/*
//よく使うやつ
int N;
cin >> N;
vector<int> list(N);
rep(i,N) {
  cin >> list[i];
}
//配列(スタックとしても使える)
vector<int> list;
list.at(i)
vector<vector<int>> list(10, vector<int>(10));
//ソート クイックだからO(NlogN)
sort(all(list));
sort(all(list), greater<int>());

//配列の内容表示
dout << "====listの内容====\n";
for (int edp = 0; edp < N; edp++) dout << list[edp] << endl;
dout << "====ここまで====\n";


//配列の最小最大(Nは要素数)
*min_element(all(c))
*max_element(all(c))

//a[0]からa[N]を逆順にする(計算量はO(N))
reverse(all(a));
//listの末尾に要素を追加
list.push_back(10);
//listの末尾から要素を削除
list.pop_back();
//空ですか？
list.empty()



//キュー(待ち行列)
//定義
queue<int> a;
//追加
a.push(x);
//取る
a.pop();
//チェック
a.front()
//サイズ
a.size()
//空ですか
a.empty()



//優先度付きキュー※全部計算量がO(NlogN)あるので注意
// int 型の要素を持ち、最も小さい値を取り出す形の priority_queue を定義
priority_queue<int, vector<int>, greater<int>> Q1;
// double 型の要素を持ち、最も大きい値を取り出す形の priority_queueを定義
priority_queue<double, vector<double>, less<double>> Q2;
//追加
a.push(x);
//取る
a.pop();
//一番小さいの教えて下さい
a.top()
//サイズ
a.size()
//空ですか
a.empty()



//部分文字列
//添字3から5文字
s.substr(3,5)
//添字3から全部
s.substr(3)

//入れ替え
swap(a,b);



// int 型の番地に string 型の変数を記録する場合（2^31 要素の string型配列と同じような感じ）
map<int, string> mp;
for (auto itr =mp.begin(); itr != mp.end(); itr++) {
	//順番にマップを眺める。itr->firstでキー、itr->secondがバリュー
}

//ソート済みのaの中で初めてx以上になるインデックスを返す
lower_bound(all(a), x) - a

//next_permutation
do {
  //ここにパーテーションがくる
} while (next_permutation(s.begin(), s.end()));

//set
set<int> hoge;
hoge.insert(50);  //hogeに挿入。重複は無視される。
hoge.insert(20);  //内部は小さい順に並ぶ
hoge.erase(50);   //hogeから消し去る。
//40以上である最小の要素を指すイテレーターを返す。
//もちろんそんなものはないからEndが出力される
auto itr1 = Set.lower_bound(40);
if (itr1 == Set.end()) cout << "End" << endl;
else cout << (*itr1) << endl;

//pair
//たくさんつくる
vector<pair<int,string>> hoge(10);
//参照
hoge[0].first
sort(all(hoge), greater<pair<int, string>>());




*/


Measured memory_bytes: 3604
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<queue>
#include<bitset>
#include<map>
using namespace std;
template<typename __T>
inline void read(__T &x)
{
    x=0;
    int f=1;char c=getchar();
    while(!isdigit(c)){if(c=='-')	f=-1;c=getchar();}
    while(isdigit(c))	{x=x*10+c-'0';c=getchar();}
    x*=f;
}
int n;
int x;
int ans=0;
int tmp=0;
int main()
{
	read(n);
	for(int i=1;i<=n;i++)
	{
		read(x);
		if(x==i)
			tmp++;
		else
		{
			ans+=(tmp+1)/2;
			tmp=0;
		}
	}
	ans+=(tmp+1)/2;
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <deque>

using namespace std;

typedef long long ll;
#define x first
#define y second
#define mp make_pair

string s;
int q;
bool je;
deque <char> dq;

int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> s;
for(int i = 0 ; i < (int)s.size() ; ++i){
	dq.push_front(s[i]);
}
cin >> q;
for(int i = 0 ; i < q ; ++i){
	int type;
	cin >> type;
	if(type == 1){
		je ^= 1;
	}
	else{
		int x;
		char c;
		cin >> x >> c;
		--x;
		if((je ^ x)){
			dq.push_front(c);
		}
		else{
			dq.push_back(c);
		}
	}
}
if(!je){
	while(!dq.empty()){
		cout << dq.back();
		dq.pop_back();
	}
}
else{
	while(!dq.empty()){
		cout << dq.front();
		dq.pop_front();
	}
}
cout << endl;

return 0;
}



Measured memory_bytes: 976
#include <iostream>
#include <vector>
using namespace std;

#define SPACE 21

int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int main(void){
    while(true){
        int n;
        cin >> n;
        if(n == 0){ break; }

        int x, y;
        vector<vector<bool> > field(SPACE, vector<bool>(SPACE, false));
        for(int i = 0; i < n; i++){
            cin >> x >> y;
            field[x][y] = true;
        }

        int m, l, d_int;
        char d;
        cin >> m;
        x = y = 10;
        for(int i = 0; i < m; i++){
            cin >> d >> l;
            switch(d){
            case 'N': d_int = 0; break;
            case 'E': d_int = 1; break;
            case 'S': d_int = 2; break;
            case 'W': d_int = 3; break;
            }

            for(int j = 0; j < l; j++){
                x += dx[d_int];
                y += dy[d_int];
                if(field[x][y]){
                    field[x][y] = false;
                    --n;
                }
            }
        }

        if(n == 0){ cout << "Yes" << endl; }
        else{ cout << "No" << endl; }
    }

    return 0;
}

Measured memory_bytes: 3092
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

#ifdef LOCAL
#include "../ACL.hpp"
#else
#include <atcoder/all>
#endif

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

long long op(LL a, LL b) {
    return max(a,b);
}

long long e() {
    return 0;
}

void solve() {
    LL n,k;
    cin >> n >> k;
    VLL a(n);
    REP(i,0,n) cin >> a[i];
    VI dp(n,1);
    atcoder::segtree<LL, op, e> seg(300000+1);
    seg.set(a[0],1);
    REP(i,1,n) {
        dp[i] = seg.prod(max(0LL,a[i]-k),min(300000LL+1,a[i]+k+1)) + 1;
        seg.set(a[i],dp[i]);
    }
    cout << *max_element(all(dp)) << endl;
}

signed main() {
    solve();
    
    return 0;
}

Measured memory_bytes: 17264
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#define range(i, r) for(int i=0;i<r;i++)
#define ranges(i, l, r) for(int i=l;i<r;i++)
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi std::vector<std::vector<int> >
#define vvl std::vector<std::vector<ll> >
#define MODs 1000000007;
#define MODn 1000000009;
typedef long long int ll;
using namespace std;

int main(int argc, char const *argv[]) {
  int A, B;
  std::cin >> A >> B;
  if(A == B){
    std::cout << 2*A << '\n';
  }else{
    std::cout << 2* max(A, B) -1<< '\n';
  }
  return 0;
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int N, sum=0, max;
    cin >> N;
    vector<int> m(N);

    for (int i = 0; i < N; i++)
    {
        cin>>m.at(i);
    }
    max = m.at(0);
    for (int i = 0; i < N; i++){
        if(m.at(i)<max){

        }
        else if(m.at(i)>=max)
        {
            max = m.at(i);
            sum++;
        }

    }
    
        cout << sum << endl;
}

Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include "bits/stdc++.h"

#define REP(i,x,y) for(ll i=(x);i<(y);i++)
#define RREP(i,x,y) for(ll i=(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
//#define int long long

using namespace std;

// conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

#define dump(x)  cout << #x << " = " << (x) << endl
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

typedef long long ll;

const ll MOD = 1e9 + 7;

class BIT
{
public:
    vector<ll> bit;
    ll M;

    BIT(ll M):
            bit(vector<ll>(M+1, 0)), M(M) {}

    ll sum(ll i) {
        if (!i) return 0;
        return bit[i] + sum(i-(i&-i));
    }

    void add(ll i, ll x) {
        if (i > M) return;
        bit[i] += x;
        add(i+(i&-i), x);
    }
};


class FSilverFoxVsMonster {
public:
    void solve(std::istream& in, std::ostream& out) {
        int N;
        ll D, A;
        in >> N >> D >> A;
        vector<pair<ll, ll>> XH(N+1);
        REP(i,1,N+1) in >> XH[i].first >> XH[i].second;
        sort(all(XH));
        BIT bit(N+1);
        REP(i,1,N+1) {
            bit.add(i, XH[i].second - bit.sum(i-1));
        }

        int left = 0, right; // [left, right)
        ll answer = 0;
        while(left <= N) {
            while (left <= N && bit.sum(left) <= 0) left++;
            if (left > N) break;
            auto itr = upper_bound(all(XH),pair<ll, ll>(XH[left].first + 2 * D, 1e10), [&](const pair<ll, ll>& a, const pair<ll, ll>& b) {
                return a.first < b.first;
            });
            right = min((int)distance(XH.begin(), itr), N+1);
            ll attack = (bit.sum(left) - 1) / A + 1;
            answer += attack;
            bit.add(left, -attack * A);
            bit.add(right, attack * A);
        }
        out << answer << "\n";
    }
};


signed main() {
    FSilverFoxVsMonster solver;
    std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 4992
N, K = [int(n) for n in input().split()]
S = input()

sentous = []
sentou = 0
counts = [0]
count = 0
prev = 0
for s in S:
    count += 1
    sentou += 1
    if s != prev and s == '1':
        if count > 1:
            sentous.append(sentou - 1)
        sentou = 1
    elif s != prev and s == '0':
        # sentou = 0
        if K > 0:
            K -= 1
        else:
            counts.append(count - 1)
            count -= sentous.pop(0)
    prev = s

print(max(max(counts), count))


Measured memory_bytes: 4804
#include <iostream>
#include <vector>
#include <string>
//#include <algorithm>
//#include <math.h>
//#include <queue>
//#include <stack>
//#include <iomanip>

// sometimes used
//#include <set>
//#include <map>
//#include <numeric>
//#include <list>
//#include <deque>
//#include <unordered_map>

typedef long long LL;
//typedef long double LD;
using namespace std;
 
//#define MOD 1000000007
//#define MAX 100100
//#define NIL -1

int main() {
    LL n;
    string x;
    cin >> n;
    cin >> x;
    vector<LL> keta(n);
    vector<LL> res_p(n,0);
    vector<LL> res_m(n,0);
    LL res_p_all=0;
    LL res_m_all=0;
    LL first_div=0;
    for(LL i=0; i<n; i++){
        LL tmp=x[i]-'0';
        keta[i]=tmp;
        first_div+=tmp;
    }

    LL div_p=first_div+1;
    LL div_m=first_div-1;

    res_p[n-1]=1%div_p;

    for(LL i=n-2; i>=0; i--){
        res_p[i]=(res_p[i+1]*2)%div_p;
    }
    for(LL i=0; i<n; i++){
        res_p_all*=2;
        res_p_all+=keta[i];
        res_p_all%=div_p;
    }
    if(div_m!=0){
        res_m[n-1]=1%div_m;
        for(LL i=n-2; i>=0; i--){
            res_m[i]=(res_m[i+1]*2)%div_m;
        }
        for(LL i=0; i<n; i++){
            res_m_all*=2;
            res_m_all+=keta[i];
            res_m_all%=div_m;
        }
    }

    LL div_pm;
    LL res;
    LL cnt_div;

    for(LL i=0; i<n; i++){
        LL ans=0;
        if(keta[i]==0){
            div_pm=div_p;
        }else{
            div_pm=div_m;
        }
        if(div_pm==0){
            cout << ans << endl;
        }else{
            if(keta[i]==0){
                res=res_p_all+res_p[i];
            }else{
                res=res_m_all-res_m[i]+div_pm;
            }
            res%=div_pm;
            ans++;
            if(res==0){
                cout << ans << endl;
            }else{
                while(res>0){
                    cnt_div=0;
                    LL res_cpy=res;
                    while(res_cpy>0){
                        if(res_cpy%2==1){
                            cnt_div++;
                        }
                        res_cpy/=2;
                    }
                    res%=cnt_div;
                    ans++;
                }
                cout << ans << endl;
            }
        }
    }

    return 0;
}


Measured memory_bytes: 8396
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
		String s = next();
		String output = "Yes";
		if((s.contains("N") && !s.contains("S")) || 
		(!s.contains("N") && s.contains("S")) || 
		(s.contains("E") && !s.contains("W")) || 
		(!s.contains("E") && s.contains("W"))){
			output = "No";
		}
		myout(output);
	}
	//Method addition frame start



	//Method addition frame end
}


Measured memory_bytes: 32924