akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>

int main() {
    int S,h,m,s;
    scanf("%d",&S);
    h = S / 3600;
    m = S % 3600 / 60;
    s = S % 3600 % 60;
    printf("%d:%d:%d\n",h,m,s);
    return 0;
}


Measured memory_bytes: 2720
#include<stdio.h>
#include<string.h>
int main(void){
 
  int N=0,len=0,count=0,i=0;
  scanf("%d",&N);
  char str[10];
  
  for(i=1;i<=N;i++){
    sprintf(str,"%d",i);
    len=strlen(str);
  	if(len%2 == 1){
    	count++;
    }
  }
  
  printf("%d",count);
 
 return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define fir first
#define sec second
#define db double
#define ll long long
#define ev eg[i].v
#define pb push_back
#define mod 1000000007
#define pir pair<int,int>
#define Rep(i,l,r) for(int i=(l);i<=(r);++i)
#define RepD(i,r,l) for(int i=(r);i>=(l);--i)
#define RepG(i,x) for(int i=hd[x];i;i=eg[i].nxt)
using namespace std;

const int N=2e5+5;

ll n,inv2=(mod+1)/2;
ll a[N],c[N],s[N],lst[N],t[N];

ll ksm(ll a,ll b){
	ll res=1;
	while(b){
		if(b&1) res=res*a%mod;
		a=a*a%mod,b>>=1;
	}
	return res;
}

ll add(ll x,ll y){for(;x<=n;x+=x&(-x)) t[x]+=y;}
ll qry(ll x){ll res=0;for(;x;x-=x&(-x)) res=(res+t[x])%mod;return res;}

int main(){
	ll sum=1,ans=0,res=0;
	scanf("%lld",&n);
	Rep(i,1,n) scanf("%lld",&a[i]),c[a[i]]++;
	RepD(i,n,1) c[i]+=c[i+1];
	Rep(i,1,n) c[i]-=(n-i),sum=sum*c[i]%mod;
	if(sum<=0){puts("0");return 0;}
	Rep(i,1,n){
		if(c[i]>1){
			lst[i]=lst[i-1];
			s[i]=(c[i]-1)*ksm(c[i],mod-2)%mod;
			if(s[i-1]>0) s[i]=s[i]*s[i-1]%mod;
		}
		else lst[i]=i;		
	}
	Rep(i,1,n){
		ans=(ans+(qry(a[i])-qry(lst[a[i]])+mod)%mod*s[a[i]]%mod*sum%mod)%mod;
		add(a[i],ksm(s[a[i]],mod-2));
	}
	ans=ans*inv2%mod;
	memset(t,0,sizeof(t));
	Rep(i,1,n){
		ans=(ans+(i-1-qry(a[i]))*sum%mod)%mod;
		add(a[i],1);	
	}
	memset(t,0,sizeof(t));
	RepD(i,n,1)
		if(s[a[i]]){
			res=(res+(qry(a[i]-1)-qry(lst[a[i]])+mod)%mod*s[a[i]]%mod*sum%mod)%mod;
			add(a[i],ksm(s[a[i]],mod-2));
		}
	res=res*inv2%mod;
	printf("%lld\n",(ans-res+mod)%mod);
	return 0;
}


Measured memory_bytes: 8064
import math

n = int(input())
li = list(map(int, input().split(" ")))

if 0 in li:
    print(0)
    exit()

ans = li[0]
del li[0]

for i in li:
    ans *= i
    if ans > 1000000000000000000:
        print(-1)
        exit()

print(ans)

Measured memory_bytes: 22684
def main(s):
  a = 0 #r-w 
  b = 0 #w-r 
  for i in s:
    if i == "R":
      a += 1
  ans = max(a,b) #無しもしない場合操作最大値 
  for i in s:
    if i == "R":
      a -= 1
    else:
      b += 1
    now = max(a,b)
    ans = min(ans, now)
  print(ans)
  
if __name__ == '__main__':
  n = int(input())
  s = input()
  main(s)

Measured memory_bytes: 9368
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
typedef long long int lli;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

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

int main(){
    int n;
    cin >> n;
    n--;
    vector<int> c(n), s(n), f(n);
    rep(i,n) cin >> c[i] >> s[i] >> f[i];
    for(int i = 0; i < n; i++){
        int t = c[i] + s[i];
        for(int j = i+1; j < n; j++){
            if (t <= s[j]){
                t = s[j];
                t += c[j];
            }else{
                t = f[j] * ceil((double)t / f[j]);
                t += c[j];
            }
        }
        cout << t << endl;
    }
    cout << 0 << endl;
    return 0;
}

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

typedef unsigned long long ull;

struct key {
    ull sum;
    ull count;
    ull index;
};

bool operator<(const key& l, const key& r) {
    return l.sum < r.sum || (l.sum == r.sum && l.count < r.count) || (l.sum == r.sum && l.count == r.count && l.index < r.index);
}

ull N, A, tmp;
vector<ull> x;
map<key, ull> cache;

ull solve(ull sum, ull count, ull index) {
    if (index == N) {
        if (count == 0) {
            return 0;
        } else if (count * A == sum) {
            return 1;
        } else {
            return 0;
        }
    }

    if (sum > N * A) {
        return 0;
    }

    key tmpkey;
    tmpkey.sum = sum;
    tmpkey.count = count;
    tmpkey.index = index;

    if (cache.find(tmpkey) == cache.end()) {
        cache[tmpkey] = solve(sum, count, index + 1) + solve(sum + x[index], count + 1, index + 1);
    }

    return cache[tmpkey];
}

int main(void) {
    cin >> N >> A;

    for (int i = 0; i < N; i++) {
        cin >> tmp;
        x.push_back(tmp);
    }

    cout << solve(0, 0, 0) << endl;

    return 0;
}


Measured memory_bytes: 26240
import java.util.Scanner;

public class Main {

    public static int a,b,c,Min,Mid,Max;
    public static void main(String[] args)
    {
        Scanner scan=new Scanner(System.in);
        a=scan.nextInt();
        b=scan.nextInt();
        c=scan.nextInt();

        if(a<=b){
            Min=a;
            Mid=b;
        }else{
            Min=b;
            Mid=a;
        }
        if(c<=Min){
            Mid=Min;
            Min=c;
        }else if(Min<c && c<Mid){
            Mid=c;
        }

        System.out.println(Min+Mid);
    }
}


Measured memory_bytes: 21844
#include <iostream>
#include <cstdlib>
using namespace std;

int compare_int(const void *a, const void *b){
    return *(int*)a - *(int*)b;
}

int main(){
    int N,*A,i,tmp,mod;
    cin >> N;
    A = new int[N];
    for(i=0;i<N;i++){
        cin >> A[i];
    }
    qsort(A,N,sizeof(int),compare_int);
    tmp = A[N-1];
    while(tmp!=A[0]){
        tmp = A[0];
        if(tmp==1){
            break;
        }
        for(i=1;i<N;i++){
            mod = A[i] % A[0];
            if(mod!=0){
                A[i] = mod;
            }else{
                A[i] = A[0];
            }
        }
        qsort(A,N,sizeof(int),compare_int);
    }
    cout << tmp << endl;
    return 0;
}

Measured memory_bytes: 1020
/* Author: $%U%$
 * Time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
**/
#include <bits/stdc++.h>
using namespace std;
#define fore(i, a, b) for (int i = a, to = b; i < to; i++)
#define foref(i, a, b) for (int i = b - 1, to = a; i >= to; i--)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define SZ(v) (int)v.size()
#define pb push_back
typedef long long Long;
typedef pair<int, int> Pair;
vector<Long> v;
Long n, k;
bool f(Long x) {
  Long ans = 0;
  fore(i, 0, n) ans += ((v[i] + x - 1) / x - 1);
  return ans <= k;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> k;
  v.resize(n);
  fore(i, 0, n) cin >> v[i];
  Long lo = 0, hi = (Long)1e9;
  while (hi - lo > 1) {
    Long mi = (hi + lo) / 2;
    if (f(mi))
      hi = mi;
    else
      lo = mi;
  }
  cout << hi << endl;

  return 0;
}

Measured memory_bytes: 4744
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define all(x) (x).begin(), (x).end()
#define PI 3.14159265358979323846264338327950L
using namespace std;
typedef long long ll;
typedef long double ld;
int main() {
    string s,t;
    cin>>s>>t;
    rep(i,s.size()){
        if(s[i]!=t[i]){
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";
}

Measured memory_bytes: 3568
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;

int main() {
  vector<ll> a(5,0);
  vector<ll> t(5,0);
  ll n,tt=0,m=0;
  cin >>n;
  rep(i,5){
    cin >>a[i];
    t[i]=n/a[i];
    if(n%a[i]!=0) ++t[i]; 
    m = max(m,t[i]);
  }
  cout << m+4 <<endl;
}



Measured memory_bytes: 256
N = int(input())
ls = ['z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y']
word = ''
while N != 0:
    word = ls[N%26] + word
    N = (N-1) // 26
print(word)

Measured memory_bytes: 9180
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// --------------------------------------------------------
#define FOR(i,l,r) for (int i = (l); i < (r); ++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) (c).begin(), (c).end()
#define RALL(c) (c).rbegin(), (c).rend()
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define MIN(c) *min_element(ALL(c))
#define MAX(c) *max_element(ALL(c))
#define SUM(c) accumulate(ALL(c), 0)
#define SUMLL(c) accumulate(ALL(c), 0LL)
#define SZ(c) ((int)(c).size())
#define debug(x) cerr << #x << " = " << (x) << '\n';
using P = pair<int,int>;
using VP = vector<P>;
using VVP = vector<VP>;
using VS = vector<string>;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<ll>;
using VVLL = vector<VLL>;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const ll MOD = 1000000007;
// const ll MOD = 998244353;
const int INF = 1 << 30;
// const ll INF = 1LL << 62;
// --------------------------------------------------------


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(10);

    string S; cin >> S;

    string ans;
    if (S[0] != S[1] && S[1] != S[2] && S[2] != S[3]) {
        ans = "Good";
    } else {
        ans = "Bad";
    }

    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 3556
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <random>
#include <cstdio>
#include <cstring>
#include <cmath>

// for i in f..<t {... : as Swift
#define forin(i, f, t) for(auto i = f; i < t; i++)

using namespace std;
using ll = long long;

ll gcd(ll a, ll b) {
    auto r = a % b;
    while (r > 0) {
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

int main() {
    ll t;
    cin >> t;
    //    t = 1;
    for (auto i = 0; i < t; i++) {
        ll a,b,c,d;
        //        a = 9; b = 7; c = 5; d = 9;
        cin >> a >> b >> c >> d;
        bool able = true;
        if (a < b || b > d) {
            able = false;
        } else if (b <= c) {
            able = true;
        } else {
            auto g = gcd(d, b);
            auto max = b - g + a % g;
            able = max <= c;
        }
        
        cout << (able ? "Yes" : "No") << endl;;
    }
}



Measured memory_bytes: 256
import java.util.*;

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    if(n%2!=0) {
      System.out.println((double)(n/2+1)/n);
    } else {
      System.out.println(0.5);
    }
  }
}

Measured memory_bytes: 23764
# -*- coding: utf-8 -*-
"""
Sugoroku
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0642

"""
import sys
import re


def solve(s):
    return max([len(r.group()) for r in re.finditer(r'1+', s)], default=0) + 1


def main(args):
    _ = input()
    ans = solve(input().replace(' ', ''))
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])



Measured memory_bytes: 6512
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);
//cin.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(int i=n;i>=m;i--)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
int main(){
    int n;cin>>n;
    double v[n];
    rep(i,0,n)cin>>v[i];
    sort(v,v+n);
    double ans=v[0];
    rep(i,1,n){
        ans=(ans+v[i])/2;
    }
    cout<<ans<<endl;
}


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

int main(void)
{
    int a,b,k;

    cin >> a >> b >> k;
    int count = 0;
    for(auto i = 100; i > 0; i--){
        if ((a % i == 0) && (b % i == 0)) {
            count++;
            if (count == k) {
                cout << i << endl;
                return 0;
            }
        }
    }

  
    return 0;
}

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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

//debug
//--------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//template
//--------------------------------------------
template<typename T>
istream& operator >>(istream& is, vector<T>& vec) {
  for(T& x: vec) is >> x;
  return is;
}
template<typename T>
ostream& operator <<(ostream& os, const vector<T>& vec) {
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : "\t" );
  }
  return os;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<vector<T>>& vv) {
	for (int i = 0; i < vv.size(); ++i) {
		s << vv[i] << endl;
	}
	return s;
}

//main code

constexpr LL inf = 100000000000;
int main(int argc, char const* argv[])
{
	LL a,b,q;
	cin >> a >> b >> q;
	VL s(a+2), t(b+2), x(q);
	s[0] = -inf;
	t[0] = -inf;
	s[a+1] = inf;
	t[b+1] = inf;
	for (int i = 1; i <= a; i++) {
		cin >> s[i];
	}
	for (int i = 1; i <= b; i++) {
		cin >> t[i];
	}
	cin >> x;
	for (int i = 0; i < q; i++) {
		LL ans = INT64_MAX;
		auto si = lower_bound(ALL(s),x[i]);
		auto ti = lower_bound(ALL(t),x[i]);
		LL su = *si - x[i];
		LL tu = *ti - x[i];
		LL sd = *(si-1) - x[i];
		LL td = *(ti-1) - x[i];
		ans = min(ans, max(su,tu));
		ans = min(ans, -min(sd,td));
		ans = min(ans, abs(min(abs(su*2-td), abs(su-td*2))));
		ans = min(ans, abs(min(abs(sd*2-tu), abs(sd-tu*2))));
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
    int a,b=0,c=1,d,ans;
    cin>>a;
    d=a;
    while(d>0){
        d=d/10;
        ans++;
    }
    
    for(int i=0;i<ans;i++){
        b=b+(a/c)%10;
        c=c*10;
    }
    if(a%b==0){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    
}

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

namespace ABCTemplate_C
{
    public class Program
    {
        static void Main(string[] args)
        {
            var c = new ProblemC();
        }
    }

    public class ProblemC
    {
        public ProblemC()
        {
            
            string[] input = Console.ReadLine().Split(' ');
            long n = long.Parse(input[0]);
            long k = long.Parse(input[1]);

            var rest = n % k;
            if (Math.Abs(rest - k) < rest)
            {
                rest = Math.Abs(rest - k);
            }
            
            //出力
            Console.WriteLine(rest);
        }
    }
}


Measured memory_bytes: 11220
#pragma G++ optimize (2)
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <string>
#define INF 0x3f3f3f3f
#define NO 30005
#define MO 100005
typedef long long ll;
//by Oliver
using namespace std;
ll read()
{
	char ch = ' ', last;
	ll ans = 0;
	while (ch < '0' || ch > '9')
		last = ch, ch = getchar();
	while (ch >= '0' && ch <= '9')
		ans = ans * 10 + int(ch - '0'), ch = getchar();
	if (last == '-')
		return -ans;
	return ans;
}
void write(ll x)
{
	if (x >= 10)
		write(x / 10);
	putchar(x % 10 + '0');
}
//head

int n, a[NO], ans;
//variable

void init()
{
	n = read();
	for (int i = 1; i <= 2 * n; i++)
		a[i] = read();
	sort(a + 1, a + 2 * n + 1);
}
//functions

int main()
{
	init();
	for (int i = 1; i <= n; i++)
		ans += min(a[i * 2 - 1], a[i * 2]);
	cout << ans << endl;
	return 0;
}
//main


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    string s;
    cin >> s;
    if(s[2]==s[3] && s[4]==s[5])
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
n,a,b,c,d = map(int,input().split())
s = input()

ans = "No"
if "##" in s[a-1:c] or "##" in s[b-1:d]: pass
else:
    if c<d: ans = "Yes"
    else:
        if "..." in s[b-2:d+1]: ans = "Yes"


print(ans)


Measured memory_bytes: 3572
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int x = scanner.nextInt();
            int sosu = 1;
            if(x < 2){
                sosu = 0;
            }
                
            for (int n = 3; n <= x; n += 2) {
                int a = 3;
                int b = 0;
                while (n >= a*a && b == 0) {
                    if (n % a == 0) {
                        b = b + 1;
                    }
                    a += 2;
                }
                if (b == 0) {
                    sosu++;
                }
            }
            System.out.println(sosu);
        }
    }
}



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

#define ll long long
#define mod 1000000007
#define pll pair<long long,long long>
#define pdd pair<long double,long double>
#define vll vector<ll>
#define rep(i,j,n) for(int i=j;i<n;i++)
#define mp make_pair
#define pb push_back
#define pf push_front
priority_queue<pll,vector<pll>,greater<pll> >pq;
priority_queue<ll,vector<ll>,greater<ll> >pq1;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,m,a,b;
    cin>>n>>m;
    vector<vector<ll> >child(n+1);
    map<ll,ll>m1;
    vector<ll>dp(n+1,1);
    for(int i=0;i<m;i++){
        cin>>a>>b;
        m1[b]++;
        child[a].pb(b);
    }
    queue<ll>q;
    for(ll i=1;i<=n;i++){
        if(m1[i]==0)
            q.push(i);
    }
    ll ans=0;
    while(!q.empty()){
        ll p=q.front();
        q.pop();
        for(ll i=0;i<child[p].size();i++){
            ll d=child[p][i];
            dp[d]=max(dp[d],dp[p]+1);
            ans=max(ans,dp[d]);
            m1[d]--;
            if(m1[d]==0)
                q.push(d);
        }
    }
    cout<<ans-1;
    return 0;
}



Measured memory_bytes: 12800
import sys
sys.setrecursionlimit(2 * 10 ** 5)


class TrieNode:
    def __init__(self, char):
        self.char = char
        self.nextnode = dict()
        self.is_indict = False


class Trie:
    def __init__(self, charset):
        self.charset = charset
        self.root = TrieNode('')

    def add(self, a_str):
        node = self.root
        for i, char in enumerate(a_str):
            if char not in node.nextnode:
                node.nextnode[char] = TrieNode(char)
            node = node.nextnode[char]
            if i == len(a_str) - 1:
                node.is_indict = True

    def dfs(self, node, dep):
        ret, cnt = 0, 0
        if node.is_indict:
            return 0
        for s in '01':
            if s not in node.nextnode:
                cnt += 1
            else:
                ret ^= self.dfs(node.nextnode[s], dep + 1)
        height = L - dep
        if cnt % 2:
            power2 = 0
            while height > 0 and height % 2 == 0:
                power2 += 1
                height //= 2
            ret ^= 2 ** power2
        return ret

    def debug_output(self, node, now):
        print(node.char, list(node.nextnode.items()), node.is_indict, now)
        if node.is_indict:
            print(now)
        for n in node.nextnode.values():
            self.debug_output(n, now + n.char)

N, L = map(int, input().split())
T = Trie('01')
for _ in range(N):
    T.add(input())
# T.debug_output(T.root, '')
print("Alice" if T.dfs(T.root, 0) else "Bob")


Measured memory_bytes: 142324
//----------------------------------------------------------------------
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
//----------------------------------------------------------------------

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;

int main(void) {
    ll x, y;
    cin >> x >> y;
    ll ans = 0;
    ll value = x;

    while(value <= y) {
        value *= 2;
        ans++;
    }
    cout << ans << endl;
    return 0;
}


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

int main(void){
  char fld[60][60];
  int h,w;
  
  cin >> h >> w;
  for (int i=1; i<=h; i++){
    cin >> (fld[i]+1);
  }
  for (int i=1; i<=h; i++){
    for (int j=1; j<=w; j++){
      int t=0;
      for (int dy=-1; dy<=1; dy++){
        for (int dx=-1; dx<=1; dx++){
          if (fld[i+dy][j+dx]=='#') t++;
        }
      }
      if (fld[i][j]=='.') fld[i][j] = t+'0';
    }
    cout << (fld[i]+1) << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
typedef long long ll;
using namespace std;
int v[10001], w[10001];
ll cache[101][100001];

ll calc(int W, int n) {
	if(W < 0) {
		return INT_MIN;
	}
	
	if(n==0 || W==0) {
		return 0;
	}
	
	if(cache[n][W]!=-1) {
		return cache[n][W];
	}
	
	cache[n][W] = max(calc(W-w[n], n-1) + v[n], calc(W, n-1));
	return cache[n][W];
}
int main() {
	int n,W;
	cin>>n>>W;   
	for (int i=0; i<n; i++) {
		cin>>w[i]>>v[i];
	}
	
	ll dp[101][100001];
	for (int i=0; i<=n; i++) {
		for(int j=0; j<=W; j++) {
			if(i==0 || j==0) {
				dp[i][j] = 0;
			} else {
				if(w[i-1] > j) {
					dp[i][j] = dp[i-1][j];
				} else {
					dp[i][j] = max(dp[i-1][j], dp[i-1][j-w[i-1]] + v[i-1]); 
				}
			}
		}
	}
	
	cout << dp[n][W];
	return 0;
}

Measured memory_bytes: 79104
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7 
#mod = 998244353
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10

N, X = MAP()

L = [0]*(N+1) #レベルiにおける全体の枚数
L[0] = 1

P = [0]*(N+1) #レベルiにおけるパティの枚数
P[0] = 1

for i in range(1, N+1):
	L[i] = L[i-1]*2 + 3
	P[i] = P[i-1]*2 + 1

def solve(i, x):  #レベルiの下からX層におけるパティの枚数
	if i == 0:
		if 0 < x:
			return 1
		else:
			return 0

	if x-1 <= L[i-1]:
		return solve(i-1, x-1)
	else:
		return P[i-1] + 1 + solve(i-1, x-L[i-1]-2)

print(solve(N, X))




Measured memory_bytes: 10512
#include <iostream>
#include <cstdlib>

using namespace std;

struct team{
	unsigned int time;
	unsigned int tm;
};

void func(team *a, int n)
{
	team t;
	for(int i = n-1; i >= 0; i--){
		for(int j = 1; j <= i; j++){
			if(a[j].time < a[j-1].time){
				t = a[j];
				a[j] = a[j-1];
				a[j-1] = t;
			}
		}
	}
	
	return ;
}

int main(int argc, char **argv)
{
	int n, m, s;
	team *a;
	
	while(1){
		cin >> n;
		if(n == 0){
			break;
		}
		a = (team *)calloc(n, sizeof(team));
		
		for(int i = 0; i < n; i++){
			cin >> a[i].tm;
			for(int j = 0; j < 4; j++){
				cin >> m >> s;
				a[i].time += 60*m+s;
			}
		}
		func(a, n);
		
		cout << a[0].tm << endl << a[1].tm << endl << a[n-2].tm << endl;
		free(a);
	}
	
	return 0;
}

Measured memory_bytes: 944
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;

const int mod = 1000000007;
//const int mod = 998244353;

struct mint {
    int64_t x;
    mint(int64_t x=0):x((x%mod+mod)%mod){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
    mint operator+(const mint a) const { return mint(*this) += a;}
    mint operator-(const mint a) const { return mint(*this) -= a;}
    mint operator*(const mint a) const { return mint(*this) *= a;}
    mint pow(int64_t t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    //for prime mod
    mint inv() const { return pow(mod-2);}
    mint& operator/=(const mint a) { return *this *= a.inv();}
    mint operator/(const mint a) {return mint(*this) /= a;}
};

istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

struct combination {
    vector<mint> frac, ifrac;
    combination(int n):frac(n+1), ifrac(n+1) {
        assert(n < mod);
        frac[0] = 1;
        for (int i = 1; i <= n; ++i) frac[i] = frac[i-1]*i;
        ifrac[n] = frac[n].inv();
        for (int i = n; i >= 1; --i) ifrac[i-1] = ifrac[i]*i;
    }
    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return frac[n]*ifrac[k]*ifrac[n-k];
    }
} c(300000);

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<ll> t(n), a(n);
    rep(i, n) {
        cin >> t[i];
    }
    rep(i, n) {
        cin >> a[i];
    }

    vector<ll> ans(n, -1);
    ans[0] = t[0];
    rep(i, n-1) {
        if(t[i] < t[i+1]) {
            ans[i+1] = t[i+1];
        } else {
            ans[i+1] = -t[i+1];
        }
    }

    auto zero = []() {
        cout << 0 << endl;
    };

    if(ans[n-1] > 0 and ans[n-1] != a[n-1] or ans[n-1] < 0 and -ans[n-1] < a[n-1]) {
        zero();
        return 0;
    }
    ans[n-1] = a[n-1];

    rep(i, n-1) {
        if(a[i] != a[i+1]) {
            if(ans[i]>0 and ans[i] != a[i] or ans[i]<0 and -ans[i]<a[i]) {
                zero();
                return 0;
            }
            ans[i] = a[i];
        } else {
            ans[i] = max(ans[i], -a[i]);
        }
    }

    mint aan = 1;

    rep(i, n) {
        if(ans[i] < 0) {
            aan *= -ans[i];
        }
    }

    cout << aan << endl;
}

Measured memory_bytes: 7296
#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<map>
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
int main() {
	int N, M, a, b;
	scanf("%d%d", &N, &M);
	vector<int> S, G;
	rep(i, 0, M) {
		scanf("%d%d", &a, &b);
		if (a > b)swap(a, b);
		if (a == 1)S.push_back(b);
		if (b == N)G.push_back(a);
	}
	sort(all(G));
	for (auto v : S) {
		if (binary_search(all(G), v)) {
			puts("POSSIBLE");
			return 0;
		}
	}
	puts("IMPOSSIBLE");
	return 0;
}

Measured memory_bytes: 1276
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
#%%code
def resolve():
    N=int(input())
    print(180*(N-2))
    
    

#%%submit!
resolve()

Measured memory_bytes: 38256
N, M = map(int, input().split())
l = [[] for _ in range(N)]
for i in range(M):
    p, s = input().split()
    l[int(p) - 1].append(s)

correct = 0
penalty = 0
for ll in l:
    if 'AC' not in ll:
        continue
    correct += 1
    penalty += ll.index('AC')

print(correct, penalty)

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

void visit(vector<vector<int>> const& g, int v, vector<bool>& used, vector<int>& res) {
    if(!used[v]) {
        used[v] = true;
        for(auto& to : g[v]) {
            visit(g, to, used, res);
        }
        res.push_back(v);
    }
}

vector<int> tsort(vector<vector<int>> const& g) {
    vector<bool> used(g.size());
    vector<int> res;
    for(int i=0; i<g.size(); ++i) {
        visit(g, i, used, res);
    }
    reverse(res.begin(), res.end());
    return res;
}

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> g(n);
    for(int i=0; i<m; ++i) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
    }
    auto res = tsort(g);
    bool f = true;
    for(int i=0; i<n-1; ++i) {
        bool f2 = false;
        for(int j=0; j<g[res[i]].size(); ++j) {
            f2 |= g[res[i]][j] == res[i+1];
        }
        f &= f2;
    }

    for(auto x : res) {
        cout << x+1 << endl;
    }
    cout << !f << endl;
}


Measured memory_bytes: 3968
#include <bits/stdc++.h>
#define int long long
#define rng(i, l, r) for (size_t i = (l); i < (r); ++i)
#define rep(i, n) rng(i, 0, n)
#define gnr(i, l, r) for (size_t i = (r)-1; i >= (l); i--)
#define per(i, b) gnr(i, 0, b)
#define ALL(obj) (obj).begin(), (obj).end()    //1,2,3,...
#define rALL(obj) (obj).rbegin(), (obj).rend() //...,3,2,1

using namespace std;

const int INF = 1e18;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
void solve()
{
    // remove the bottom 3 lines when you submit this code.
    std::ifstream in("./sample.txt");
    std::cin.rdbuf(in.rdbuf());

    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    cin >> n;
    int A[100010];
    rep(i, n) cin >> A[i];

    int cumGCD[100010];
    int rcumGCD[100010];
    for (int i = 0; i < n; i++)
    {
        if (i == 0)
        {
            cumGCD[i] = A[i];
        }
        else
        {
            cumGCD[i] = gcd(cumGCD[i - 1], A[i]);
        }
    }

    for (int i = n - 1; 0 <= i; i--)
    {
        if (i == n - 1)
        {
            rcumGCD[i] = A[i];
        }
        else
        {
            rcumGCD[i] = gcd(rcumGCD[i + 1], A[i]);
        }
    }

    int ans = -1;
    ans = max(ans, rcumGCD[1]);
    for (int i = 0; i < n - 2; i++)
    {
        ans = max(gcd(cumGCD[i], rcumGCD[i + 2]), ans);
    }
    ans = max(ans, cumGCD[n - 2]);

    cout << ans << endl;
}

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


Measured memory_bytes: 2560
#!/usr/bin python3
# -*- coding: utf-8 -*-

import sys
input = sys.stdin.readline

def main():
    A, B, N = map(int, input().split())
    N = min(B-1, N)
    ret = (N * A)//B - A * (N//B)
    print(ret)



if __name__ == '__main__':
    main()

Measured memory_bytes: 9088
#include <bits/stdc++.h>
#define ll long long
#define rgi register int
#define rgl register long long
#define il inline

il ll read() {
	rgl x = 0, f = 0, ch;
	while(!isdigit(ch = getchar())) f |= ch == '-';
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
	return f ? -x : x;
}

int main() {
	ll n = read(), ans = 0;
	if(n & 1) puts("0");
	else {
		for(rgl x = 10; x <= n; x *= 5) ans += (n / x);
		printf("%lld", ans);
	}
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); ++i)
#define outl(x) cout<< (x) << '\n'
#define fi first
#define se second
using pii = pair<int,int>;
using ll = long long;

bool prime[3900010] = {};
vector<int> v;

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

   int N;
   const int K = 900000;
   cin >> N;

   prime[2] = true;

   for (int i=3; i<=K; i+=2) {
      prime[i] = true;
   }

   for (int i=3; i*i <= K; i+=2) {
      if (prime[i]) {
         for (int k=i*2; k<=K; k+=i) {
            prime[k] = false;
         }
      }
   }


   int cnt = 0;
   for (int i=3; i<=55555; i+=2) {
      if (cnt == N) break;
      if (prime[i] && i % 5 == 1) {
         v.push_back(i);
         ++cnt;
      }
   }

   for (int i=0; i<v.size(); ++i) {
      cout << v[i] << (i+1 < v.size() ? ' ' : '\n');
   }

}



Measured memory_bytes: 1152
a, b, k = map(int, input().split())
if a > b:
    a, b = b, a
div_lst = []
for i in range(1, a+1):
    if a % i == 0 and b % i == 0:
        div_lst.append(i)
# print(div_lst)
print(div_lst[-k])

Measured memory_bytes: 2940
import Control.Applicative
import Control.Monad
import Data.Functor
import Data.List

readInts = map read . words <$> getLine :: IO [Int]

solve s = sub 0 0 s
  where
    sub r _ [] = r
    sub r t (c:cs)
      | c `elem` "ACGT" = sub (max r (t+1)) (t+1) cs
      | otherwise = sub r 0 cs

main = getLine >>= print . solve


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

#define int long long
#define itn int
#define For(i, a, b) for (int i = (a); i <= static_cast<int>(b); i++)
#define Forr(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--)
#define rep(i, n) For(i, 0, n - 1)
#define repall(i, arr) for (auto& i : (arr))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << '\n'
#define dump2(x, y) \
    cerr << #x << " = " << (x) << " " << #y << " = " << (y) << '\n'
#define SZ(x) ((int)(x).size())
#define bit(n) (1LL << (n))
constexpr int MOD = 1e9 + 7;

template <typename T>
using pq = priority_queue<T>;
template <typename T>
using pqr = priority_queue<T, vector<T>, greater<T>>;
const int INF = LLONG_MAX / 2;
using P = pair<int, int>;
using vec = vector<int>;
template <typename T>
using mat = vector<vector<T>>;

// clang-format off
template <typename T1, typename T2>
ostream& operator<<(ostream& stream, const pair<T1, T2>& p) { return stream << p.first << "," << p.second; }
template <typename T>
void print(const vector<T> vec) { rep (i, vec.size() - 1) cout << vec[i] << ' '; cout << vec[vec.size() - 1] << '\n'; }
template <typename Arg>
void print(const Arg arg) { cout << arg << '\n'; }
template <typename Head, typename... Args>
void print(const Head head, const Args... args) { cout << head << " "; print(args...); }
template <typename T, typename U>
void init(vector<T>& v, vector<U>& w) { rep (i, v.size()) cin >> v[i] >> w[i]; }
template <typename T>
void init(vector<T>& v) { rep (i, v.size()) cin >> v[i]; }
template <typename T>
T sum_(vector<T> vec, T init = 0) { return std::accumulate(all(vec), T(init)); }
template<typename T>
bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template<typename T>
bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
template <typename T>
int index(const T& vec, const typename T::iterator it) { return distance(vec.begin(), it); }
template <typename T = int>
mat<T> mmat(int n, int m=0) { return mat<T>(n, vector<T>(m)); }
template <typename T = int>
vector<T> ivec(int n) { vector<T> v(n); init(v); return v; }
// clang-format on

void yn(bool tf) { print(tf ? "Yes" : "No"); }
void YN(bool tf) { print(tf ? "YES" : "NO"); }

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
// -------------------------------------------------------------------
// sort 1 2 3 4
// pqr 1 2 3 must impl >

signed main() {
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vec p = ivec(n);

    int mi = INF;
    int cnt = 0;
    repall (x, p) {
        chmin(mi, x);
        if (mi == x) cnt++;
    }
    print(cnt);

    return 0;
}


Measured memory_bytes: 1792
#define _USE_MATH_DEFINES
#include <iostream>
#include <complex>
#include <algorithm>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <cmath>
#include <math.h>
#include <numeric>
#include <list>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <set>
#include <memory.h>
#include <memory>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cassert>
#include <map>
#include <cassert>
#include <time.h>

using namespace std;

typedef complex<double> xy_t;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<int , P> PP;
typedef pair<int, string> Ps;
typedef vector<int> vec;
typedef vector<vec> mat;
const int INF= 1 << 30;
const double EPS = 1e-9;
const double PI = 3.1415926535897932384626433832795;

#define rep(i, n) for(int i = 0; i < n; i++)

struct data{
	int score;
	int id;
	string name;
	data(){};
	data(int s, int id, string n){
		this->score = s;
		this->id = id;
		this->name = n;
	}
};

bool comp(data d1, data d2){
	return d1.score == d2.score ? d1.id < d2.id : d1.score > d2.score;
}

data ds[10];

int main(){
	int n;
	int w, l, d;
	int cnt = 0;
	while(cin >> n && n){
		if(cnt != 0){
			cout << endl;
		}else{
			cnt++;
		}
		rep(i, n){
			cin >> ds[i].name >> w >> l >> d;
			ds[i].score = w * 3 + d;
			ds[i].id = i;
		}
		sort(ds, ds + n, comp);
		rep(i, n) cout << ds[i].name << "," << ds[i].score << endl;
	}
	return 0;
}

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

const long N = 3005;

long n;
long long f[N][N], g[N][N], a[N], sum = 0;

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> n;
    for (long i = 1; i <= n; i++) cin >> a[i];
    for (long i = 1; i <= n; i++)
    {
        sum += a[i];
        f[i][i] = a[i];
        g[i][i] = 0;
    }
    for (long k = 1; k < n; k++)
    {
        for (long i = 1; i <= n - k; i++)
        {
            long j = i + k;
            long long tmp1 = a[i] + min(f[i + 1][j - 1], f[i + 2][j]);
            long long tmp2 = a[j] + min(f[i + 1][j - 1], f[i][j - 2]);
            f[i][j] = max(tmp1, tmp2);
        }
    }
    cout << f[1][n] + f[1][n] - sum;
    return 0;
}


Measured memory_bytes: 138112
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < n; i++)

int main(){
    string s;
    cin >>s;
    if (s=="AAA" || s=="BBB"){
        cout <<"No"<<endl;
    }
    else{
        cout <<"Yes"<<endl;
    }

}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
using namespace std;
int main()
{
  int n,q,timecount=0;
  cin >> n >> q;
  vector<string> name(n);
  vector<int> time(n);
  for(int variable = 0;variable < n;++variable){
    cin >> name[variable] >> time[variable];
  }
  for(int variable = 0;variable < time.size();++variable){
    if(q < time[variable]){
      time.push_back(time[variable] - q);
      name.push_back(name[variable]);
      timecount += q;
    }
    else{
      cout << name[variable] << " " << timecount + time[variable] << endl;
      timecount += time[variable];
    }
  }
}

Measured memory_bytes: 5528
function Picker(input) {
  var lines = input.split('\n');
  var fields = lines.reduce(function(all, line) { return all.concat(line.split(' ')); }, []);
  var p = 0;

  return {
    int: function() {
      return parseInt(fields[p++], 10);
    },
    float: function() {
      return parseFloat(fields[p++]);
    },
    str: function() {
      return fields[p++];
    }
  };
}

function Main(input) {
  var pick = Picker(input);
  var n = pick.int();
  var k = pick.int();
  var s = pick.str();

  var a = s.split(/(0+)/).map(function(e){ return e.length; });
  
  var sum = a.slice(0, 2 * k + 1).reduce(function(a, b){ return a + b; });
  var max = sum;

  for (var i = 2 * k + 1; i < a.length; i += 2) {
    sum += a[i] + a[i + 1] - a[i - 2 * k - 1] - a[i - 2 * k];
    if (sum > max) {
      max = sum;
    }
  }
  
  console.log(max);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 14156
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 30;
const int MOD = 1e9 + 7;

int main() {
  string s;
  cin >> s;
  cout << s.substr(0, s.length() - 8) << endl;
  return 0;
}


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

void insertion_sort(vector<int>& a) {
  for (int i = 0; i < a.size(); i++) {
    cout << a[i];
    if (i != a.size() - 1) cout << " ";
  }
  cout << "\n";
  for (int i = 1; i <= a.size() - 1; i++) {
    int v = a[i];
    int j = i - 1;
    while (j >= 0 && a[j] > v) {
      a[j + 1] = a[j];
      j--;
    }
    a[j + 1] = v;
    for (int i = 0; i < a.size(); i++) {
        cout << a[i];
        if (i != a.size() - 1) cout << " ";
    }
    cout << "\n";
  }
}

int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  insertion_sort(v);
}



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

odd = 0
even = 0

for i in a:
    if i %2 ==0:
        even +=1
    else:
        odd+=1
if even == n:
    if p == 0:
        print(2**n)
    else:
        print(0)
else:
    print(2**(n-1))

Measured memory_bytes: 3060
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <list>
using namespace std;

#define next '\n'
#define sp " "
#define print(x) cout << (x)
#define println(x) cout << (x) << next
#define stop return(0)
#define rep(i, n) for(int (i) = (0); (i) < (n); (++i))
#define FOR(i, start, end) for(int (i) = (start); (i) < (end); (++i))
#define foreach(e, elem) for(auto& (e) : (elem))
#define FAST ios::sync_with_stdio(false); cin.tie(nullptr)
#define size(s) (s).size()
#define all(vec) (vec).begin(), (vec).end()
#define pb(e) push_back(e);
using ll = long long;
using ull = unsigned long long;

int main() {
    string s;
    cin >> s;
    int cnt = 0;
    foreach(e, s){
        if(e == '1'){
            cnt++;
        }
    }
    println(cnt);
}

Measured memory_bytes: 256
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto N = readln.chomp.to!int;
    int c;
    foreach (i; 1..N+1) {
        if (i < 10 || (100 <= i && i < 1000) || (10000 <= i && i < 100000)) ++c;
    }
    writeln(c);
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
//#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<vector<int>> vii;
typedef vector<int> vi;
typedef vector<string> vs;


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


int main(){
    int n, X;
    cin >> n >> X;
    
    vi x(n);
    rep(i, n) cin >> x[i];

    int d = abs(x[0] - X);
    rep(i, n){
        d = __gcd(d, abs(x[i] - X));
    }

    cout << d << endl;
}

Measured memory_bytes: 640
#include  <stdio.h>

int main(){
  int N,X,T,Z;
    scanf("%d %d %d %d",&N,&X,&T,&Z);
  Z=0;
  while(N>0){
    N=N-X;
    Z=Z+1;
  }
  
    printf("%d\n",T*Z);
  return 0;
}

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

using namespace std;

#define pb push_back
#define endl '\n'
#define all(x) (x).begin(),(x).end()
#define ff first
#define ss second
#define sz(x) (int)(x).size()
#define f(n) for(int i=0;i<n;++i)
#define f2(n) for(int j=0;j<n;++j)
#define f3(n) for(int k=0;k<n;++k)
#define F(i,x,n,y) for(i=x;i<n;i+=y)
#define fi(i) for(i=0;i<n;++i)
#define fa(x,y) for(auto x:y)

//Warsaw debug template
#define LOCAL
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
    enable_if<sizeof dud<c>(0) x 1,debug&>::type operator<<(c i){
sim > struct rge {c b,e;};
sim > rge<c> range(c i, c j) {return rge<c>{i,j};}
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug{
#ifdef LOCAL
~debug() {cerr<<endl; }
eni(!=) cerr<< boolalpha << i; ris;}
eni(==) ris <<range(begin(i),end(i)); }
sim, class b dor(pair<b,c> d){
ris<<"("<<d.first<<","<<d.second<<")";
}
sim dor(rge<c> d){
    *this << "[";
    for(auto it=d.b;it!=d.e;++it)
        *this <<"," +(it==d.b)<< *it;
    ris<<"]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) "["<<#__VA_ARGS__":"<<(__VA_ARGS__)<<"]"
//End of debug template        
    

typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long long ll;


int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin>>n;
    vi v;
    f(n){
        int tmp;cin>>tmp;v.pb(tmp);
    }
    sort(all(v));
    cout<<v[n-1]-v[0];
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<algorithm>
#define int long long
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)


#define INF 1000000000000


signed main()
 {
   int n;
   cin>>n;
   cout<<3.14*n*2;

 }


Measured memory_bytes: 3788