akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
using namespace std;

int main(){
  int n, d, x;
  cin >> n;
  cin >> d >> x;
  int ans = 0;
  for (int i = 0; i < n; i++){
    int k;
    cin >> k;
    ans += ((d-1) / k) + 1;
  }

  cout << ans + x << "\n";
  return 0;
}

Measured memory_bytes: 256
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>

#define FASTIO
#define ALL(v) (v).begin(), (v).end()
#define rep(i, l, r) for (int i = (l); i < (r); ++i)

#ifdef FASTIO
#define scanf abacaba
#define printf abacaba
#endif

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;


/*
ll pw(ll a, ll b) {
	ll ans = 1; while (b) {
		while (!(b & 1)) b >>= 1, a = (a * a) % MOD;
		ans = (ans * a) % MOD, --b;
	} return ans;
}
*/

int n;

vector<pair<int, int>> ed;

int main() {
#ifdef FASTIO
	ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#endif
	cin >> n;
	int k = (n / 2) * 2;
	for (int i = 1; i <= k; ++i)
		for (int j = i + 1; j <= k; ++j)
			if (i + j != k + 1) {
				ed.emplace_back(i, j);
			}
	if (n % 2 == 1) {
		for (int i = 1; i < n; ++i)
			ed.emplace_back(i, n);
	}
	cout << ed.size() << "\n";
	for (auto e: ed) {
		cout << e.first << " " << e.second << "\n";
	}
	return 0;
}




Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define LL long long
 
int n;
LL a[100005];
LL dp[100005][2];

LL max( LL i , LL j ){
	if  ( i < j ) return j;
	return i;
}

LL f( int i, int sign ){
	if ( i == n-1 ) {
		if ( sign ) return -a[i];
		return a[i];
	}
	
	LL &ans = dp[i][sign];
	if ( ans != -1 ) return ans;
	ans = -1e18;
	ans = max( ans , f(i+1,0) + ((sign)?-a[i]:a[i]));
	ans = max( ans , f(i+1,1) + ((sign^1)?-a[i]:a[i]));
	return ans;
}

int main(){
  	
  	scanf("%d",&n);
  	for ( int i = 0; i < n; i++ ) scanf("%lld",&a[i]);
  	memset(dp,-1,sizeof(dp));
  	
  	printf("%lld\n",f(0,0));
	return 0;
}

Measured memory_bytes: 7296
main(c,t){double*p=t,v;for(;~scanf("%s%c",&t,&c);c&2&&printf("%f ",v))v=t&4112?*++p=atoi(&t):(*--p=t&1?t&2?t&4?*p/v:*p+v:*p-v:*p*v);}

Measured memory_bytes: 0
/**
 *
 * AtCoder Beginner Contest 105 - Problema C: Base -2 Number (https://abc105.contest.atcoder.jp/tasks/abc105_c)
 *
 * Find the base -2 representation of N.
 *
 * Math solution: the least significant digit d of N is zero if N is even; zero otherwise. Let
 * M = (N - d) / (-2): the remainder digits of N are the digits of M.
 */
#include <iostream>
#include <stack>

using namespace std;

void solve(int N)
{
    stack<char> ds;

    do {
        int d = abs(N % 2);
        ds.push('0' + d);
        N -= d;
        N /= (-2);
    } while (N);

    while (not ds.empty()) {
        cout << ds.top();
        ds.pop();
    }
    cout << endl;
}

int main()
{
    ios::sync_with_stdio(false);

    int N;
    cin >> N;

    solve(N);

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>
#include <cassert>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    rep(i, n) {
        cin >> a[i];
    }
    cout << 1 + ((n - k) + (k - 2 )) / (k - 1) << endl;
    return 0;
}

Measured memory_bytes: 768
/*
    ->->->->-> Vora Mahammasasim <-<-<-<-<-
*/
#include<bits/stdc++.h>
#include<stdio.h>
#define Quick std :: ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define pb emplace_back
#define Mod 1000000007
#define all(a) a.begin(),a.end()
#define ps(a) partial_sum(all(a),a.begin())
using namespace std;





signed main(){

    Quick;
    int x,k,d;
    cin>>x>>k>>d;
    x = abs(x);
    int p = x%d;
    int q = x/d;
    int ans1;
    if(q == k) cout<<p;
    else if(q < k){
        k -= q;
        if(k&1) cout<<min(abs(p-d),abs(p+d));
        else cout<<p;
    }
    else cout<<x - (k*d);
}



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

const function<ll(ll, ll)> addQll = [](ll l, ll r) { return l + r; };

template <typename T>
class node {
public:
	T val, lazy;
	node<T> *l, *r;
	node() {}
	node(T val_, T lazy_, node<T>* l_ = nullptr, node<T>* r_ = nullptr) : val(val_), lazy(lazy_), l(l_), r(r_) {}
	void init(T val_, T lazy_, node<T>* l_ = nullptr, node<T>* r_ = nullptr) {
		val = val_;
		lazy = lazy_;
		l = l_;
		r = r_;
	}
};

template <typename T>
class DynamicLazySegmentTree {
	using func_t = function<T(T, T)>;
	const ll n;
	const T id1, id2;
	func_t merge1, merge2;
	node<T> *root;
	vector<node<T>> pool;
	int it;
	ll size(ll n) {
		ll res = 1;
		while (res < n) res <<= 1;
		return res;
	}
	node<T> *new_node() {
		pool[it].init(id1, id2);
		return &pool[it++];
	}
	node<T> *push(node<T> *t, ll lb, ll ub) {
		if (t == nullptr || t->lazy == id2) return t;
		if (lb + 1 < ub) {
			if (t->l == nullptr) t->l = new_node();
			if (t->r == nullptr) t->r = new_node();
			t->l->lazy = merge2(t->l->lazy, t->lazy);
			t->r->lazy = merge2(t->r->lazy, t->lazy);
		}
		t->val = merge2(t->val, t->lazy * (ub - lb));
		t->lazy = id2;
		return t;
	}
	node<T> *suc(ll l, ll r, node<T> *t, ll lb, ll ub, T val) {
		if (ub <= l || r <= lb) return t;
		if (t == nullptr) t = new_node();
		if (l <= lb && ub <= r) {
			t->lazy = merge2(t->lazy, val);
			return t;
		}
		t = push(t, lb, ub);
		int c = (lb + ub) / 2;
		t->l = suc(l, r, t->l, lb, c, val);
		t->r = suc(l, r, t->r, c, ub, val);
		t->val = merge1(t->l == nullptr ? id1 : merge2(t->l->val, t->l->lazy * (c - lb)), t->r == nullptr ? id1 : merge2(t->r->val, t->r->lazy * (ub - c)));
		return t;
	}
	T sub(ll l, ll r, node<T> *t, ll lb, ll ub) {
		if (t == nullptr || ub <= l || r <= lb) return id1;
		t = push(t, lb, ub);
		if (l <= lb && ub <= r) return t->val;
		int c = (lb + ub) / 2;
		return merge1(sub(l, r, t->l, lb, c), sub(l, r, t->r, c, ub));
	}
public:
	DynamicLazySegmentTree(ll n_, T id1_, T id2_, func_t merge1_, func_t merge2_, int PMAX = 1e7)
		: n(size(n_)), id1(id1_), id2(id2_), merge1(merge1_), merge2(merge2_), root(nullptr), pool(PMAX), it(0) {}
	void update(ll l, ll r, T val) {
		root = suc(l, r + 1, root, 0, n, val);
	}
	T find(ll l, ll r) {
		return sub(l, r + 1, root, 0, n);
	}
};

int main()
{
	cin.sync_with_stdio(false);
	int n, q, com, s, t, x;
	cin >> n >> q;
	DynamicLazySegmentTree<ll> lst(n, 0, 0, addQll, addQll, 3e5);
	while (q--) {
		cin >> com >> s >> t; s--; t--;
		if (com) {
			printf("%lld\n", lst.find(s, t));
		}
		else {
			cin >> x;
			lst.update(s, t, x);
		}
	}
	return 0;
}

Measured memory_bytes: 8960
#include <iostream>
#include <vector>

template <class T> inline bool chmin(T &a, const T &b) {
  return (a > b) ? a = b, true : false;
}

int main() {
  int N, W;
  std::cin >> N >> W;
  std::vector<int> w(N);
  std::vector<int> v(N);
  for (int i = 0; i < N; ++i)
    std::cin >> w[i] >> v[i];

  int K = N * 1000;
  long long inf = 1LL << 60;
  std::vector<std::vector<long long>> dp(
      N + 7, std::vector<long long>(2 * K + 7, inf));
  // dp[i][k] = i 個目までみて価値の合計が k となる場合の重さの最小値

  dp[0][0] = 0;
  for (int i = 0; i < N; ++i) {
    for (int k = 0; k <= K; ++k) {
      chmin(dp[i + 1][k], dp[i][k]);
      chmin(dp[i + 1][k + v[i]], dp[i][k] + w[i]);
    }
  }

  long long res = -1;
  for (int k = 0; k <= K; ++k) {
    if (dp[N][k] <= W)
      res = k;
  }
  std::cout << res << std::endl;
}


Measured memory_bytes: 169216
import java.util.*;
class Main {
public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
	int n = in.nextInt();
	if (n/10 == 9 || n%10 == 9) {
		System.out.println("Yes");
	}else{
		System.out.println("No");
	}

	}
}

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

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)
#define mp make_pair

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int32 a,b;
    cin >> a >> b;
    if((a + b) % 2 == 0){
        cout << (a + b) / 2 << endl;
    }else{
        cout << "IMPOSSIBLE\n";
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int N,L;
 
    cin>>N>>L;


    int sum=0;
    if(L>=0){
        for(int i=2;i<N+1;i++){
            sum+= L+i-1;
        }
    }
    else if((L+N-1)<0){
        for(int i=1;i<N;i++){
            sum+= L+i-1;
        }
    }
    else{
        for(int i=1;i<N+1;i++){
            sum+= L+i-1;
        }
    }

  
    cout<<sum<<endl;


}



Measured memory_bytes: 256
#include<iostream> 
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <vector>

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

int main() {
	int n, a;
	cin >> n >> a;
	if (n % 500 == 0) {
		cout << "Yes" << endl;
	}
	else {
		if (a >= n % 500 ) {
			cout << "Yes" << endl;
		}
		else {
			cout << "No" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3528
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output
def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

# Binary converter
def to_bin(x):
    return bin(x)[2:]

# Set 2 dimension list
def dim2input(N):
    li = []
    for _ in range(N):
        li.append(input().split())
    return li

# --------------------------------------------

dp = None

def main():
    N = int(input())
    D = collections.defaultdict(lambda: 0)
    ans = 0

    for _ in range(N):
        D[input()] += 1

    for v in D.values():
        if v % 2 == 1:
            ans += 1

    print(ans)

main()


Measured memory_bytes: 19500
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007


#A
def A():
    a,b = LI()
    if not (a*b)%2:
        print("Even")
    else:
        print("Odd")
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    A()


Measured memory_bytes: 39792
#include<iostream>
using namespace std;
int main() {
	int m = 0, f = 0, r = 0;
	int h = 0;
	while (1)
	{
		cin >> m >> f >> r;
		if (m == -1 && f == -1 && r == -1)
		{
			return 0;
		}
		h = m + f;
		if (m == -1 || f == -1)
		{
			cout << "F\n";
		}
		else if (80<=h)
		{
			cout << "A\n";
		}
		else if (65<=h)
		{
			cout << "B\n";
		}
		else if (50<=h)
		{
			cout << "C\n";
		}
		else if (30<=h)
		{
			if (50<=r)
			{
				cout << "C\n";
			}
			else
			{
				cout << "D\n";
			}
		}
		else
		{
			cout << "F\n";
		}
	}
}


Measured memory_bytes: 3004
import sys
input = sys.stdin.readline

def main():
    S = list(input())
    X, Y = map(int, input().split())

    Xs = []
    Ys = []
    line = True
    first = True
    x0, y0 = 0, 0
    a = 0
    for s in S:
        if s == 'F':
            a += 1
        else:
            if first:
                if a > 0:
                    x0 = a
                a = 0
                first = False
                line = False
                continue
            if a > 0:
                if line:
                    Xs.append(a)
                else:
                    Ys.append(a)
                a = 0
            if line:
                line = False
            else:
                line = True
    if a > 0:
        if line:
            Xs.append(a)
        else:
            Ys.append(a)

    Lx = sum(Xs)+x0
    dpx = [[False for _ in range(2*Lx+1)] for _ in range(len(Xs)+1)]
    dpx[0][x0+Lx] = True

    for i, x in enumerate(Xs):
        for j in range(2*Lx+1):
            if j+x <= 2*Lx:
                dpx[i+1][j+x] = dpx[i][j] or dpx[i+1][j+x]
            if j-x >= 0:
                dpx[i+1][j-x] = dpx[i][j] or dpx[i+1][j-x]

    Ly = sum(Ys)+y0
    dpy = [[False for _ in range(2*Ly+1)] for _ in range(len(Ys)+1)]
    dpy[0][y0+Ly] = True

    for i, y in enumerate(Ys):
        for j in range(2*Ly+1):
            if j+y <= 2*Ly:
                dpy[i+1][j+y] = dpy[i][j] or dpy[i+1][j+y]
            if j-y >= 0:
                dpy[i+1][j-y] = dpy[i][j] or dpy[i+1][j-y]
    #print(Lx, Ly)
    if (not -Lx <= X <= Lx) or (not -Ly <= Y <= Ly): 
        print('No')
    elif dpx[-1][X+Lx] and dpy[-1][Y+Ly]:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()

Measured memory_bytes: 172168
// Code by ajcxsu
// Problem: Convex_Hall

#include<bits/stdc++.h>
#define EPS (1e-3)
using namespace std;


struct Point {
    double x,y;
    Point(double x=0.0, double y=0.0):x(x), y(y) {};

    Point operator + (Point b) { return Point(x+b.x, y+b.y); }
    Point operator - (Point b) { return Point(x-b.x, y-b.y); }
    Point operator * (double b) { return Point(x*b, y*b); }

    double norm() { return x*x+y*y; }
    double abs() { return sqrt(norm()); }

    bool operator <(const Point &p) {
        return x!=p.x?x<p.x:y<p.y;
    }
} ;
typedef Point Vector;
typedef vector<Point> Polygon;

double dot(Point a, Point b) { return a.x*b.x+a.y*b.y; }
double cross(Point a, Point b) { return a.x*b.y-a.y*b.x; }

int ccw(Vector a, Vector b) {
    if(cross(a,b)>EPS) return 1;
    if(cross(a,b)<-EPS) return -1;
    return 0;
}
int ccw(Point p0, Point p1, Point p2) {
    return ccw(p1-p0, p2-p0);
}


istream& operator >>(istream &in, Point &x) {
    in>>x.x>>x.y;
    return in;
}
ostream& operator <<(ostream &out, Point x) {
    out<<(int)x.x<<' '<<(int)x.y;
    return out;
}

int main() {
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    Point p[100010];
    for(int i=0;i<n;i++) cin>>p[i];

    sort(p,p+n);

    Polygon u,l; // upper lower
    u.push_back(p[0]), u.push_back(p[1]);
    l.push_back(p[n-1]), l.push_back(p[n-2]);

    for(int i=2;i<n;i++) {
        for(int n=u.size(); n>=2 && ccw(u[n-2], u[n-1], p[i])>0; n--) u.pop_back(); // 这里变量混用了..见谅
        u.push_back(p[i]);
    }
    for(int i=n-3;i>=0;i--) {
        for(int n=l.size(); n>=2 && ccw(l[n-2], l[n-1], p[i])>0; n--) l.pop_back();
        l.push_back(p[i]);
    }
    reverse(l.begin(),l.end());
    for(int i=u.size()-2;i>=1;i--) l.push_back(u[i]);
    cout<<l.size()<<endl;
    int sta=0;
    for(int i=1, n=l.size();i<n;i++) {
        if(l[i].y<l[sta].y) sta=i;
        else if(l[i].y==l[sta].y && l[i].x<l[sta].x) sta=i;
    }
    cout<<l[sta]<<endl;
    for(int i=(sta+1)%l.size(), n=l.size(); i!=sta;i=(i+1)%n) {
        cout<<l[i]<<endl;
    }
    return 0;
}



Measured memory_bytes: 7140
#include <algorithm>
#include <iostream>
using namespace std;
using ll = long long;
#define repl(i, l, r) for (int i = l; i < r; i++)
#define rep(i, n) repl(i, 0, n)
const ll MOD = 1000000007;
pair<int, int> a[10], b[10];
int main() {
	int n;
	cin >> n;
	ll a[n];
	rep(i, n) cin >> a[i];
	bool ch = 0;
	rep(i, n) if (a[i] == 0) ch = 1;
	if (ch) {
		cout << 0 << endl;
		return 0;
	}
	ll p = 1e18, now = 1;
	;
	rep(i, n) {
		p /= a[i];
		if (p < 1) {
			cout << -1 << endl;
			return 0;
		}
		now *= a[i];
	}
	cout << now << endl;
	return 0;
}

Measured memory_bytes: 4392
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
typedef pair<int, int> pii;
typedef priority_queue<int> PQ;
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; }
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;



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


	char c;
	cin >> c;
	c++;
	cout << (char)c << endl;
	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repb(i, n) for (int i = (n-1); i >= 0; i--)
#define rea(i, a, b) for (int i = (a); i < (b); i++)
#define reab(i, a, b) for (int i = (a)-1; i >= (b); i--)
#define ALL(a) (a).begin(),(a).end()
#define SZ(x) ((int)(x).size())
#define PRINT(V) for (auto v:(V)) {cerr << v << " ";} cerr << endl
#define dump(x) cerr << #x << " : " << (x) << endl
#define dump2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")" << endl
inline ll GCD(ll a, ll b){return b ? GCD(b, a % b) : a;}
const int MOD = 1000000007;
const int INF = 1000000000;
/* END OF TEMPLATE */

typedef vector<vector<int> > Matrix;
Matrix d;
Matrix d_cp;

void warshall_floyd(int n) { // nは頂点数
  for (int i = 0; i < n; i++)      // 経由する頂点
    for (int j = 0; j < n; j++)    // 開始頂点
      for (int k = 0; k < n; k++)  // 終端
        d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
}

int main() {
  int n, m;
  cin >> n >> m;

  d = Matrix(n, vector<int>(n, INF));
  for (int i = 0; i < n; i++) d[i][i] = 0;
  
  for (int i = 0; i < m; i++) {
    int from, to, cost;
    cin >> from >> to >> cost;
    d[from-1][to-1] = cost;
    d[to-1][from-1] = cost;
  }
  d_cp = d;
  
  warshall_floyd(n);
  ll ans = 0;
  rep(i, n){
      rea(j, i, n){
          if(d_cp[i][j] != INF && d_cp[i][j] > d[i][j]) ans++;
      }
  }
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1e9)
#define PI (acos(-1))
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl



int main() {
    int A, B, T;  cin >> A >> B >> T;

    int ans = 0;
    rep(i, T/A) {
        ans += B;
    }
    print(ans);
}

Measured memory_bytes: 256
#include <iostream>
#include <queue>
using namespace std;
using ll=long long;
int main(){
  ll n, k;
  cin >> n >> k;
  queue<int> que;
  while(n!=0){
    que.push(n%k);
    n/=k;
  }
  cout << que.size();
  return 0;
}

Measured memory_bytes: 256
c=[]
for i in range(3):
    c.append(list(map(int,input().split())))

for i in range(2):
    if c[0][i]-c[0][i+1]!=c[1][i]-c[1][i+1] or  c[1][i]-c[1][i+1]!=c[2][i]-c[2][i+1]:
        print("No")
        exit()
print("Yes")

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

int main(){
  int A,B,C;
  cin>>A>>B;
  if(13<=A) C=B;
  else if(6<=A && A<=12) C=(B/2); 
  else if(A<=5) C=0;
  
  cout<< C <<endl;
}


Measured memory_bytes: 256
typedef long long ll;
#include<bits/stdc++.h>
using namespace std;
int main()
{
ll m,n;
while(scanf("%lld %lld",&m,&n)!=EOF){
ll sum=0;
for(ll i=m-1;i>0;i--) sum+=i;
for(ll i=n-1;i>0;i--) sum+=i;
printf("%lld\n",sum);
}
}


Measured memory_bytes: 256
if __name__ == "__main__":
    q, h, s, d = map(int, input().split())
    n = int(input())

    # まず1リットルあたりの単価を求める
    value = list()
    value.append(q*4)
    value.append(h*2)
    value.append(s)
    value.append(d/2)

    ans = 0
    if min(value) == value[3]:
        if n % 2 == 1:
            ans += n // 2 * d
            ans += min(value[0:3])
        else:
            ans += n // 2 * d
    else:
        ans += min(value) * n

    print(ans)

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

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

  int sum = 0;
  for (int i = 0; i < n; i ++) {
    if (i == a[a[i]]) sum ++;
  }

  cout << sum / 2 << endl;
}

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

using namespace std;

typedef int ll;

#define eps 1e-9
#define all(a)   a.begin(),a.end()
#define mp make_pair
#define F first
#define S second
#define pb push_back
#define sz size()
#define sl(inp) scanf("%d",&inp)
#define sd(inp) scanf("%d",&inp)

const long long linf = 1e18+5;
const int mod = (int) 1e9 + 7;
const int inf = 4000;

ll fpow(ll base,ll power){
  ll result = 1;
  while (power > 0){
    if (power%2 == 1) result=(result*base);
  	base = (base*base);
  	power /= 2;
  }
	return result;
}

ll n, k, depth[4000];
vector<ll> adj[4000];
bool vis1[4000], vis2[4000];

void dfs(ll node, ll par){
	
	if(par != -1) depth[node] = depth[par] + 1;

	for ( ll ix = 0 ; ix < adj[node].sz ; ix ++ ){
		ll to = adj[node][ix];
		if ( to != par ){
			dfs(to, node);
		}
	}
}

pair<ll,ll> edge[4000];

int main(){
	cin >> n >> k;
    ll i, j;
    for ( i = 0 ; i < n - 1 ; i ++ ){
    	ll u, v;
    	cin >> u >> v;
    	adj[u].pb(v);
    	adj[v].pb(u);
    	edge[i] = mp(u, v);
    }

    ll cnt = inf;

    if ( k % 2 == 0 ){

	   	for ( i = 1 ; i <= n ; i ++ ){
	   		ll center = i;
	   		memset(depth, 0, sizeof(depth));
	   		dfs(i, -1);
	   		ll tcnt = 0, j;
	   		for ( j = 1 ; j <= n ; j ++ ){
	   			if ( depth[j] > k / 2 ){
	   				tcnt ++;
	   			}
	   		}
	   		cnt = min(cnt, tcnt);
	   	}

	}
	else{

		for ( j = 0 ; j < n - 1 ; j ++ ){
			i = edge[j].F;
			ll other = edge[j].S;
			
			memset(depth, 0, sizeof(depth));
			memset(vis1, 0, sizeof(vis1));
			dfs(i, -1);

			
			ll hcnt = 0, ix;
			
			for ( ix = 1 ; ix <= n ; ix ++ ){
				// cout << " ix is " << ix << "\n";
				if (depth[ix] > k / 2){
					vis1[ix] = true;
					hcnt ++;
				}
			}
			// cout << i << " " << other << " the edge \n";
			memset(depth, 0, sizeof(depth));
			memset(vis2, 0, sizeof(vis2));

			

			dfs(other, -1);
			

			for ( ix = 1 ; ix <= n ; ix ++ ){
				if ( depth[ix] > k / 2 ){
					vis2[ix] = true;
				}
			}

			for ( ix = 1 ; ix <= n ; ix ++ ){
				if ( vis1[ix] == 1 && vis2[ix] == 0 ){
					hcnt --;
				}
			}
			
			cnt = min(cnt, hcnt);
		}

	}

    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 512
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.util.*

fun main(args: Array<String>) {
    val sc = FastScanner(System.`in`)

    val n = sc.nextInt()
    val z = sc.nextInt()
    val w = sc.nextInt()
    val a = Array(n) { sc.nextInt() }

    println(solve(a, z, State(w, 0, 1)))
}


data class State(val other: Int, val cur: Int, val pl: Int)


val solved = mutableMapOf<State, Int>()

fun solve(cards: Array<Int>, card:Int, st: State): Int {
    if (solved.containsKey(st)) return solved[st] ?: throw Exception()

    val cur = st.cur
    val other = st.other
    val pl = st.pl

    if (cur >= cards.size) return Math.abs(card - other)

    if (pl == 1) {
        var best = Math.abs(cards.last() - other)
        for (i in cur until cards.size) {
            best = Math.max(best, solve(cards, other, State(cards[i], i + 1, 2)))
        }
        solved[st] = best
        return best
    }
    if (pl == 2) {
        var best = Math.abs(cards.last() - other)
        for (i in cur until cards.size) {
            best = Math.min(best, solve(cards, other, State(cards[i], i + 1, 1)))
        }
        solved[st] = best
        return best
    }

    throw  Exception()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}

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

#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s); i<(long long)(n);i++)
#define mod 1000000007
typedef long long ll;

int main() {
    int h,w;cin>>h>>w;
    int cnt=0;

    rep(i,h){
        rep(j,w){
            char a;cin>>a;
            if(a=='#'){
                cnt++;
            }
        }
    }

    if(cnt==h+w-1){
        cout<<"Possible"<<endl;
        return 0;
    }
    cout<<"Impossible"<<endl;

}


Measured memory_bytes: 256
/*************************
author : coldbeer
2019-05-26 05:46:46 PM IST
*************************/
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"

typedef long long ll;
vector<set<ll>> bulb(11,set<ll>());
vector<ll> p(11,0);

int main()
{
	ll n,m; cin >> n >> m;
	for(ll i = 0;i < m;i++){
		ll k; cin >> k;
		for(ll j = 0;j < k;j++){
			ll item;
			cin >> item;
			bulb[i + 1].insert(item);
		}
	}

	for(ll i = 0;i < m;i++) cin >> p[i + 1];

	ll ans = 0;
	for(ll i = 0;i < (1<<n);i++){
		vector<ll> temp;
		for(ll j = 0;j < n;j++){
			if((i & (1 << j)))
				temp.push_back(j + 1);
		}
			vector<ll> cnt(11,0);
			for(ll x : temp){
				for(int z = 1;z < m + 1;z++)
					if(bulb[z].count(x)) cnt[z]++;
			}
			ll ctr = 0;
			for(int z = 1;z < m + 1;z++)
				if(cnt[z] % 2 == p[z]) ctr++;
			if(ctr == m) ans++;
			temp.clear();
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
import collections

n = int(input())
A = list(map(int, input().split()))

over_two = collections.Counter(A)
Over_two = []
Over_four = []

for key, val in over_two.items():
    if val <= 1:
        pass
    elif val >= 4:
        Over_four.append(key)
        Over_two.append(key)
    else:
        Over_two.append(key)

Over_four.append(0)
Over_two.append(0)
Over_two.append(0)

Over_two = sorted(Over_two, reverse=True)
Over_four = sorted(Over_four, reverse=True)

can_one = Over_four[0] * Over_four[0]
can_two = Over_two[0] * Over_two[1]

ans = max(can_one, can_two)

print(ans)

Measured memory_bytes: 18600
/*
LANG:C++
PROB:

*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <iostream>
// #define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)


using namespace __gnu_pbds;
using namespace std;


typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
typedef unsigned long long ui64;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }
const int mod=1000000007;
  i64 poww(i64 a, i64 b)
  {
    a%=mod;
    i64 res=1;
    while(b)
      {
if(b&1)res=res*a%mod;

      a=a*a%mod;
      b/=2;

      }
      return res;
  }
  i64 inv(i64 a)
  {
    return poww(a,mod-2);
  }
  void solve()
  {
i64 sum=0;
int n;
cin>>n;
vi64 v(n);
forn(i,n){cin>>v[i];sum+=v[i];}
sum%=mod;

i64 ans=0,pre=0;
forn(i,n)
{
ans+=(v[i])*(sum-v[i]);
sum-=v[i];
sum%=mod;
ans%=mod;
}
if(ans<0)ans+=mod;
cout<<ans;

  }
  
  int main()
  {
ios::sync_with_stdio(false);
    cin.tie(nullptr);
    #ifndef ONLINE_JUDGE
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
    #endif
int t=1;
while(t--)
{
  solve();
}

    return 0;
  }


Measured memory_bytes: 4776
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int a,b;
    cin >> a >> b;
    if(b%2 != 0)cout << "No" << endl;
    else{
        if(2*a <= b && b <= 4*a)cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}

Measured memory_bytes: 3636
N = int(input())
 
PS = [[], [], [], []]
S = "RLUD".index
 
for i in range(N):
    x, y, d = input().split(); x = int(x); y = int(y)
    PS[S(d)].append((x, y))
 
T = [0]
INF = 10**9
 
dymin = INF; dymax = -INF
P = []
for i in [0, 1]:
    xmin = INF; xmax = -INF
    for x, y in PS[i]:
        dymin = min(dymin, y)
        dymax = max(dymax, y)
        xmin = min(xmin, x)
        xmax = max(xmax, x)
    P.append((xmin, xmax))
for x0 in P[0]:
    for x1 in P[1]:
        T.append(max(x1 - x0, 0) / 2.)
 
dxmin = INF; dxmax = -INF
Q = []
for i in [2, 3]:
    ymin = INF; ymax = -INF
    for x, y in PS[i]:
        dxmin = min(dxmin, x)
        dxmax = max(dxmax, x)
        ymin = min(ymin, y)
        ymax = max(ymax, y)
    Q.append((ymin, ymax))
for y0 in Q[0]:
    for y1 in Q[1]:
        T.append(max(y1 - y0, 0) / 2.)
 
for x0 in [dxmin, dxmax]:
    for x in P[0]:
        T.append(max(x0 - x, 0))
    for x in P[1]:
        T.append(max(x - x0, 0))
for y0 in [dymin, dymax]:
    for y in Q[0]:
        T.append(max(y0 - y, 0))
    for y in Q[1]:
        T.append(max(y - y0, 0))
 
ans = 10**30
for t in T:
    xmin = dxmin; xmax = dxmax
    ymin = dymin; ymax = dymax
 
    xi, xa = P[0]
    if xi != INF:
        xmin = min(xmin, xi+t)
        xmax = max(xmax, xa+t)
    xi, xa = P[1]
    if xi != INF:
        xmin = min(xmin, xi-t)
        xmax = max(xmax, xa-t)
    yi, ya = Q[0]
    if yi != INF:
        ymin = min(ymin, yi+t)
        ymax = max(ymax, ya+t)
    yi, ya = Q[1]
    if yi != INF:
        ymin = min(ymin, yi-t)
        ymax = max(ymax, ya-t)
    ans = min(ans, (xmax - xmin) * (ymax - ymin))
print("%.6f" % ans)

Measured memory_bytes: 16888
#include<bits/stdc++.h>
using namespace std;
#define INF 1e18
long long int dp[405][405],arr[405],n;
long long int solve(long long int idx1,long long int idx2)
{
   if(idx1==idx2)
   	return 0;
   if(dp[idx1][idx2]!=-1)
   	return dp[idx1][idx2];
   long long int sum=0,i,j,mini=INF,val;
   for(i=idx1;i<=idx2;i++)
   	sum+=arr[i];
   //cout << "ok" << endl;
   //cout << idx1 << " " << idx2 << endl;
   for(i=idx1;i<idx2;i++)
    {
    	val=solve(idx1,i)+solve(i+1,idx2)+sum;
    	//cout << val << " " << i << endl;
    	mini=min(mini,val);
    }
    //cout << mini << endl;
    dp[idx1][idx2]=mini;
    return dp[idx1][idx2];
}
int main()
{
	long long int i,j,k,a,b,idx1,idx,ans;
    cin >> n;
    memset(dp,-1,sizeof(dp));
    /*for(i=1;i<=n;i++)
    {
    	for(j=1;j<=n;j++)
    		cout << dp[i][j] << " ";
    	cout << endl;
    }*/
    for(i=1;i<=n;i++)
    	cin >> arr[i];
    cout << solve(1,n) << endl;
	return 0;
}

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

int main(){
  int n, m;
  int a[100][100], b[100], c[100]={};

  cin>>n>>m;
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      cin>>a[i][j];
    }
  }
  for(int i=0;i<m;i++) cin>>b[i];

  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      c[i]+=a[i][j]*b[j];
    }
    cout<<c[i]<<endl;
  }
  
  return 0;
}

Measured memory_bytes: 3132
#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> col;
vector<vector<int>> grh;
void err() {
  cout << -1 << '\n';
  exit(0);
}
inline void chmax (int& a, int b) {
  if (a < b) a = b;
}
void dfs(int crr, int c, vector<int>&cnt) {
  col[crr] = c;
  cnt[c]++;
  for (int nxt = 0; nxt < n; nxt++) {
    if (!grh[crr][nxt]) {
      if (col[nxt] == -1) {
        dfs(nxt, 1 - c, cnt);
      } else if (col[nxt] == c) {
        err();
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  col.resize(n, -1);
  grh.resize(n, vector<int>(n, 0));
  for (int i = 0; i < n; i++) {
    grh[i][i] = 1;
  }
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    grh[a][b] = grh[b][a] = 1;
  }
  vector<int> pbl(n + 1, false);
  pbl[0] = true;
  int sum = 0;
  for (int i = 0; i < n; i++) {
    if (col[i] == -1) {
      vector<int> cnt(2, 0);
      dfs(i, 0, cnt);
      sum += cnt[0] + cnt[1];
      for (int j = sum; j >= 0; j--) {
        pbl[j] = (j >= cnt[0] && pbl[j - cnt[0]]) || (j >= cnt[1] && pbl[j - cnt[1]]);
      }
    }
  }
  int maxv = 0;
  for (int i = 0; i <= n / 2; i++) {
    if (pbl[i]) chmax(maxv, i);
  }
  long long ret = (long long)maxv * (maxv - 1) / 2 + (long long)(n - maxv) * (n - maxv - 1) / 2;
  cout << ret << '\n';
  return 0;
}

Measured memory_bytes: 2176
#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
string str;
ll a[200010], sma, xx, yy, b[200010], ans, lake, num;
bool jud[200010];
vector<ll> vec[200010], la;
int main(void){
    // Your code here!
    xx = -1, yy = -1;
    cin >> str;
    for (ll i = 0; i < str.length(); i++){
        if (str[i] == '_'){
            a[i + 1] = a[i];
        } else {
            a[i + 1] = a[i] + (str[i] == '/' ? 1 : -1);
        }
        sma = min(sma, a[i + 1]);
    }
    for (ll i = 0; i <= str.length(); i++){
        a[i] -= sma;
        vec[a[i]].push_back(i);
    }
    for (ll i = 200010; i >= 0; i--){
        if (vec[i].size() == 0) continue;
        if (xx == -1){
            xx = vec[i][0];
            yy = vec[i][vec[i].size() - 1];
            for (ll j = xx; j <= yy; j++){
                b[j] = i;
            }
        } else {
            for (ll j = vec[i][0]; j < xx; j++) b[j] = i;
            for (ll j = yy + 1; j <= vec[i][vec[i].size() - 1]; j++) b[j] = i;
            xx = min(xx, vec[i][0]), yy = max(vec[i][vec[i].size() - 1], yy);
        }
    }
    for (ll i = 0; i < str.length(); i++){
        lake += b[i] - a[i];
        if (b[i] - a[i] > 0 && b[i + 1] - a[i + 1] == 0){
            la.push_back(lake);
            ans += lake;
            lake = 0;
            num++;
        }
    }
    cout << ans << endl;
    cout << num;
    for (ll i = 0; i < la.size(); i++) cout << ' ' <<  la[i];
    cout << endl;
}



Measured memory_bytes: 8852
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        MyScanner sc = new MyScanner();

        int n = sc.nextInt();
        int[] a = new int[n];

        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
            min = Math.min(a[i], min);
            max = Math.max(a[i], max);
        }

        long ans = Long.MAX_VALUE;
        for (int i = min; i <= max; i++) {
            long tmp = 0;

            for (int j : a) {
                tmp += Math.abs(j - i) * Math.abs(j - i);

                if (tmp > ans)
                    break;
            }

            ans = Math.min(tmp, ans);
        }

        System.out.println(ans);
    }

    static class MyScanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (IOException ignored) {
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}

Measured memory_bytes: 22996
N = int(input())
P = list(map(int,input().split()))
P.append(2*10**5+1)
minPi = P[0]
A = 0
for i in range(N):
    minPi = min(P[i],minPi)
    if P[i] <= minPi:
        A += 1
print(A)
        

Measured memory_bytes: 32256
#include <stdio.h>
 
int main(){
	double N,K,ch,ch2;
	int count=0;
	double num=0.0;
	scanf("%lf%lf",&N,&K);
	for(int i=1.0000;i<=N;i++){
		ch2=1.00;
		ch=i;
		count=0;
		if(ch>=K){
			ch2=1.0000000000;
		}else{
			while(ch<K){
				ch=ch*2.00000000;
				//printf("%lf\n",ch);
				count++;
			}
			//printf("count=%d\n",count);
			if(count==1){
				ch2=0.5;
			}else{
			for(int j=1;j<=count;j++){
				ch2=ch2*(0.5000000000);
				//printf("ch2=%lf\n",ch2);
			}
		}
		}
		num+=(1.00000000/N)*ch2;
		//printf("num=%lf\n",num);
	}
	printf("%.16lf\n",num);
	return 0;
}

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define ld long double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

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

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin>>n;
    set<char> S;
    rep(i,n){
        char c; cin>>c;
        S.ins(c);
    }
    if (S.size()==3){
        cout<<"Three\n";
    }else{
        cout<<"Four\n";
    }

    return 0;
}


Measured memory_bytes: 256
def calc_expected_value(n):
    return (n+1) / 2


n, k_range = map(int, input().split())
p = list(map(int, input().split()))
e_list = [0] * n
ans_list = [0] * n
ans = 0.0

for i in range(n):
    e_list[i] = calc_expected_value(p[i])
    if i == k_range-1:
        ans_list[i] = sum([e_list[i-k] for k in range(k_range)])
    else:
        ans_list[i] = ans_list[i-1] + e_list[i] - e_list[i-k_range]

print(max(ans_list))

Measured memory_bytes: 25148
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
	return list(map(int,input().split()))
def m(): #複数文字
	return map(int,input().split())
def onem(): #Nとかの取得
	return int(input())
def s(x): #圧縮
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): #listをスペースごとに分ける
	return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
	return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""

n = onem()

po = n//200

print(10-po)


Measured memory_bytes: 65136
s = input()
t = ["maerd","remaerd","esare","resare"]
s = s[::-1]
while True:
    if len(s) == 0:
        print("YES")
        break
    elif s[:5] in t:
        s = s[5:]
    elif s[:6] in t:
        s = s[6:]
    elif s[:7] in t:
        s = s[7:]
    else:
        print("NO")
        break

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

int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int n; cin >> n;
  string s;cin >> s;
  vector<ll> a(n);
  a[0] = s[0] == 'W';
  for(int i = 1; i < n; i++) {
    a[i] += a[i - 1] + (s[i] == 'W');
  }
  ll ans = 1e18;
  for(int i = 0; i < n; i++) {
    ll res = 0;
    if(i) res += a[i - 1];
    res += (n - i - 1) - (a[n - 1] - a[i]);
    ans = min(ans, res);
  }
  cout << ans << endl;
}


Measured memory_bytes: 2964
import java.util.Scanner;


public class Main{

	public static void main(String args[]){
		int i,j,n,h;
		Scanner sc=new Scanner(System.in);
		n=Integer.parseInt(sc.next());
		int s[]=new int[n+1];
		for(i=0;i<n;i++){
			s[i]=Integer.parseInt(sc.next());
			
		}
		
		
		
		int q=Integer.parseInt(sc.next());
		int t[]=new int[q+1];
		
		for(i=0;i<q;i++){
			t[i]=Integer.parseInt(sc.next());
		}
		
		int count=0;

		
		for(i=0;i<q;i++){
			int a=0,b=n;
			
	
			while(a<b){
				h=(a+b)/2;
				if (t[i] == s[h]){
					count++;
					break;
				} 
				if (t[i]<s[h])
					
					b = h;
				else 
					a = h+1;	
				
			}
			
		}
		
		
		System.out.println(count);		
	}
}


/*int n,k;
Scanner sc=new Scanner(System.in);
n=Integer.parseInt();
int tr[]=new int[n+1];*/

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

int main(){
    int n;
    string s;
    
    cin >> n >> s;
    
    int add_l = 0;
    int l_count = 0;
    for(int i = 0; i < n; i++){
        if(s.at(i) == '(')l_count++;
        else if(l_count > 0)l_count--;
        else add_l++;
    }
    
    for(int i = 0; i < add_l; i++){
        cout << "(";
    }
    
    cout << s;
    
    for(int i = 0; i < l_count; i++){
        cout << ")";
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define F first
#define S second
#define int long long
#define lint long long
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

using namespace std;
using namespace __gnu_pbds;
template <typename T> 
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int N=1e6+5, MOD=1e9+7;
const lint INF=1e18;
lint _add(lint x, lint y) {
    lint ret=x+y;
    while(ret<0LL) ret+=MOD;
    return ret;
}
lint _mult(lint x, lint y) {
    x%=MOD; y%=MOD;
    lint ret=x*y;
    ret%=MOD;
    while(ret<0LL) ret+=MOD;
    return ret;
}
inline int modpow(lint base, int exp, int modulo) {
  base %= modulo;  lint result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulo;
    base = (base * base) % modulo; exp >>= 1;
  }
  return result;
}

int n, ans;
signed main()
{
    ans=2; //n and n-1
    cin >> n;
    if(n==2)
    {
        cout << 1;
        return 0;
    }
    for(int i = 2; i < N; i++)
    {
        if(i*i>n) break;
        if(n%i==0)
        {
            int tmp = n;
            while(tmp%i==0)
            {
                tmp/=i;
            }
            if(tmp%i==1)
            {
               // cout << i << endl;
                ans++;
            }
        }
    }
    n--;
    for(int i = 2; i < N; i++)
    {
        if(i*i>n) break;
        if(n%i==0)
        {
            ans += 1 + (i!=n/i);
        }
    }
    cout << ans;
}

Measured memory_bytes: 256
import sys

class Node: 
    def __init__(self, x, y = None, z = None): 
        self.data = x 
        self.prev = y 
        self.next = z 

class LinkedList: 
    def __init__(self): 
        self.top = Node(None) 
        self.top.next = self.top
        self.top.prev = self.top
    def insert(self, x):
        a = Node(x)
        self.top.next.prev = a
        a.next = self.top.next
        self.top.next = a
        a.prev = self.top
    def search(self, x):
        nil = self.top
        node = nil.next
        while node != nil and node.data != x:
            node = node.next
        return node
    def _delete(self, node):
        if node != self.top:
            np = node.prev
            nn = node.next
            np.next = nn
            nn.prev = np
    def delete_data(self, x):
        node = self.search(x)
        self._delete(node)
    def deleteFirst(self):
        nil = self.top
        self._delete(nil.next)
    def deleteLast(self):
        nil = self.top
        self._delete(nil.prev)
    def output(self):
        nil = self.top
        node = nil.next
        datalist = []
        while node != nil:
            datalist.append(node.data)
            node = node.next
        print(" ".join(datalist))

n = int(input()) 
L = LinkedList()
nil = L.top
for cmd in sys.stdin:
    cmd = cmd.strip("\n")
    if "insert" in cmd:
        L.insert(cmd[7:])
    elif "deleteFirst" in cmd:
        L.deleteFirst()
    elif "deleteLast" in cmd: 
        L.deleteLast()
    elif "delete " in cmd:
        L.delete_data(cmd[7:])

L.output()


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

using namespace std;
#define int long long
const int MOD = 1000000007;

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, X;
	cin >> X >> N;
	vector<int> A(N);
	int res = 0;
	set<int> st;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		st.insert(A[i]);
	}
	int x = 0;
	while (true) {
		int t = X - x;
		if (st.find(t) == st.end()) {
			res = t;
			break;
		}
		t = X + x;
		if (st.find(t) == st.end()) {
			res = t;
			break;
		}
		x++;
	}
	cout << res << endl;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long int ll;
typedef pair<int,int> P;
const ll MOD=1000000007LL;
const ll INF=1000000000LL;
const int MAX=100001;
int main(){
    int n;
    while(cin>>n,n){
    vector<int> p[110];
    for(int i=0;i<n;i++){
        int m;
        cin>>m;
        for(int j=0;j<m;j++){
            int pp;cin>>pp;
            p[i].push_back(pp);
            sort(all(p[i]));
        }
    }
    int k;
    cin>>k;
    vector<int> l;
    for(int j=0;j<k;j++){
        int ll;cin>>ll;
        l.push_back(ll);
    }
    sort(all(l));
    int c=0;
    int ans=0;
    for(int i=0;i<n;i++){
        if(includes(all(p[i]),all(l))){
            c++;
            ans=i+1;
        }
    }
    if(c!=1){
        cout<<-1<<endl;
    }else{
        cout<<ans<<endl;
    }
    }
    return 0;
}

                           



Measured memory_bytes: 3152