akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> pipii;
typedef vector<vector<ll>> matrix;

int cnt(int a, int b) {
	int r = 0;
	while(a) r += a /= b;
	return r;
}

bool comp[101];
void solve() {
	for(int i = 2; i * i <= 100; i++) {
		for(int j = i*i; j <= 100; j += i) {
			comp[j] = true;
		}
	}
	vector<ll> dp;
	dp.resize(76);
	dp[1] = 1;
	int n;
	cin >> n;
	for(int i = 2; i <= n; i++) {
		if(comp[i]) continue;
		int maxAmt = cnt(n, i);
		vector<ll> ndp;
		ndp.resize(76);
		for(int a = 0; a < dp.size(); a++) {
			for(int x = 0; x <= maxAmt && a*(x+1) < ndp.size(); x++) {
				ndp[a*(x+1)] += dp[a];
			}
		}
		dp = ndp;
	}
	cout << dp[75] << endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
	/*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
	*/
	solve();
}


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

class Program {
  static void Main() {
    int n = int.Parse(Console.ReadLine());
    for (int i = 0; i < n; i++) {
      var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
      int r = a[0];
      int t = a[1];
      var dir = r % 100 == 0;
      var agl = t % 30 == 0;
      int d1 = r / 100;
      int a1 = (t / 30) * 5;
      int d2 = r / 100 + 1;
      int a2 = (t / 30 + 1) * 5;
      if (dir && agl) Console.WriteLine(d1 + a1);
      else if (dir) Console.WriteLine("{0} {1}", d1 + a1, d1 + a2);
      else if (agl) Console.WriteLine("{0} {1}", d1 + a1, d2 + a1);
      else Console.WriteLine("{0} {1} {2} {3}", d1 + a1, d2 + a1, d1 + a2, d2 + a2);
    }
  }
}


Measured memory_bytes: 20412
#include <iostream>
#include <map>
#include <vector>

using namespace std;

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

int main(){
    int n, m; cin >> n >> m;
    vector<pair<int, int>> v(m);
    vector <bool> used(m, false);
    rep(i, m){
        int a, b; cin >> a >> b;
        a--; b--;
        v[i] = make_pair(a, b);
    }
    int ans = 0;

    int l = 0;
    bool ok = true;
    while (1){
        int cp = -1;
        int i;
        for (i = 0; i < m; i++){
            if (v[i].first <= l && (cp == -1 || v[i].second > v[cp].second)){
                cp = i;
            }
        }
        if (cp == -1 || used[cp] == true){
            ok = false; break;
        }
        else {
            ans++;
            used[cp] = true;
            if (v[cp].second == n - 1){
                break;
            }
            else {
                l = v[cp].second + 1;
            }
        }
    }
    if (ok){
        cout << ans << endl;
    }
    else {
        cout << "Impossible" << endl;
    }
}

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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

bool used[30303];

int main() {
    int N;
    cin >> N;
    vector<int> ans;
    if (N == 3) {
        cout << "2 5 63" << endl;
        return 0;
    }
    if (N == 4) {
        cout << "2 5 20 63" << endl;
        return 0;
    }
    else if (N == 5) {
        cout << "2 5 20 30 63" << endl;
        return 0;
    }
    ll sum = 0;
    for (int i = 2; i <= 30000; ++i) {
        if (i%6 == 0 or i%6 == 2 or i%6 == 3 or i%6 == 4) {
            sum += i;
            ans.push_back(i);
            used[i] = true;
        }
        if (ans.size() == N) {
            break;
        }
    }
    if (sum%6) {
        int tmp = sum%6;
        if (tmp == 2) {
            rep(i, N) if (ans[i] == 8) {
                rep(j, 30001) if (!used[j] and j%6==0 and j > 0) {
                    ans[i] = j;
                    break;
                }
            }
        }
        else if (tmp == 3) {
            rep(i, N) if (ans[i] == 9) {
                rep(j, 30001) if (!used[j] and j%6==0 and j > 0) {
                    ans[i] = j;
                    break;
                }
            }
        }
        else if (tmp == 5) {
            rep(i, N) if (ans[i] == 9) {
                rep(j, 30001) if (!used[j] and j%6==4 and j > 0) {
                    ans[i] = j;
                    break;
                }
            }
        }
    }
    rep(i, N) {
        if (i) cout << " ";
        cout << ans[i];
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll n;
ll a[401];
ll pre[401];
ll memo[401][401];
ll findans(ll i,ll j)
{
    if(i==j)
    {
        return 0;
    }
    if(memo[i][j]!=-1)
    {
        return memo[i][j];
    }
    ll ans=100000000000000000;
    for(ll k=i;k<=j-1;k++)
    {
        if(i>0)
        {
            ans=min(ans,findans(i,k)+findans(k+1,j)+pre[j]-pre[i-1]);
        }
        else
        {
            ans=min(ans,findans(i,k)+findans(k+1,j)+pre[j]);
        }
    }
    return memo[i][j]=ans;
}
int main(){
    // Your code here!
    cin>>n;
    //vector<ll>v;
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
    }
    pre[0]=a[0];
    for(ll i=1;i<n;i++)
    {
        pre[i]=pre[i-1]+a[i];
    }
    for(ll i=0;i<=400;i++)
    {
        for(ll j=0;j<=400;j++)
        {
            memo[i][j]=-1;
        }
    }
    //seen.clear();
    cout<<findans(0,n-1);
    
   // cout<<x;
}


Measured memory_bytes: 1536
x1, y1, x2, y2 = map(int, input().split())
y3 = y2 + (x2 - x1)
x3 = x2 - (y2 - y1)
y4 = y1 + (x2 - x1)
x4 = x1 - (y2 - y1)
print(x3, y3, x4, y4)

Measured memory_bytes: 2940
#include<stdio.h>
#include<iso646.h>

int main(){

  int a[7] = {1,3,5,7,8,10,12};
  int b[4] = {4,6,9,11};
  int c[1] = {2};
  int x,y,ansx,ansy;

  scanf("%d %d",&x,&y);

  for(int i=0; i<7; i++){
    if(x==a[i])ansx=0;
    if(y==a[i])ansy=0;
  }

  for(int i=0; i<4; i++){
    if(x==b[i])ansx=1;
    if(y==b[i])ansy=1;
  }

  for(int i=0; i<2; i++){
    if(x==c[i])ansx=2;
    if(y==c[i])ansy=2;
  }

  if(ansx == ansy){
    printf("Yes\n");
  }else{
    printf("No\n");
  }

  return 0;
}


Measured memory_bytes: 128
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v, y, m; };

ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

double g(double x, double y, int _x, int _y) {
	double dx = x - _x, dy = y - _y;
	return sqrt(dx * dx + dy * dy);
}

double f(double x, double y, int l, int u, int r, int d) {
	double mini;
	bool fx = (x >= l && x <= r), fy = (y >= u && y <= d);
	if (fx && fy) mini = 0;
	if (fx && !fy) mini = min(abs(y - u), abs(y - d));
	if (!fx && fy) mini = min(abs(x - l), abs(x - r));
	if (!fx && !fy) mini = DBL_MAX;
	mini = min(mini, g(x, y, l, u));
	mini = min(mini, g(x, y, l, d));
	mini = min(mini, g(x, y, r, u));
	mini = min(mini, g(x, y, r, d));
	return mini;
}

int main() {
	for (;;) {
		int N, sx, sy, ex, ey;
		cin >> N >> sx >> sy >> ex >> ey;
		if (N == 0) break;
		vector<int> l(N), u(N), r(N), d(N), h(N);
		for (int i = 0; i < N; i++)
			cin >> l[i] >> u[i] >> r[i] >> d[i] >> h[i];
		double ub = DBL_MAX;
		for (int i = 0; i < N; i++) {
			double ax = sx, ay = sy, bx = ex, by = ey, mini = DBL_MAX;
			for (int t = 0; t < 100; t++) {
				double cx = (ax * 2 + bx) / 3, cy = (ay * 2 + by) / 3;
				double dx = (ax + bx * 2) / 3, dy = (ay + by * 2) / 3;
				double cf = f(cx, cy, l[i], u[i], r[i], d[i]);
				double df = f(dx, dy, l[i], u[i], r[i], d[i]);
				if (cf < df) { bx = dx; by = dy; mini = cf; }
				else {ax = cx; ay = cy; mini = df; }
			}
			double r;
			if (mini <= h[i]) r = mini;
			else r = (h[i] * h[i] + mini * mini) / (h[i] * 2);
			ub = min(ub, r);
		}
		printf("%.10f\n", ub);
	}
}

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

int main() {
    int s;
    cin >> s;
    int i = 1;
    map<int, bool> MP;
    MP[s] = true;
    while (true) {
        if (s % 2 == 0) s /= 2;
        else s = 3 * s + 1;
        i++;
        if (MP[s]) {
            cout << i << endl;
            return 0;
        }
        MP[s] = true;
    }
    return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

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

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

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

    string S, T;
    cin >> S >> T;
    cout << T <<S << endl;
    return 0;
}

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

#define pout(n)  printf ("%d\n", n)

#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());

const int d4x[4] = {1, 0, -1, 0};
const int d4y[4] = {0, 1, 0, -1};
const int d8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const int d8y[8] = { 0,1,1,1,0,-1,-1,-1 };

#define MAX_N (int)2e5+20
#define INF 1e12+20

typedef long long ll;
using namespace std;

int n;
int main() {
	cin >> n;
	int l[2*n];
	rep(i,0,2*n){
		cin >> l[i];
	}
	sort(l,l+2*n);
	int sum = 0;
	for(int i = 1;i < 2*n; i += 2){
		sum += min(l[i-1],l[i]);
	}
	pout(sum);
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <map>
#include <set>

#define MIN_INT -2147483648
#define MAX_INT 2147483647
#define MIN_LONG -9223372036854775808L
#define MAX_LONG 9223372036854775807L
#define PI 3.141592653589793238462643383279502884L

#define long long long int

using std::vector;
using std::map;
using std::set;
using std::string;
using std::pair;
using std::cin;
using std::cout;
using std::cerr;

// @author: pashka

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

    int n;
    cin >> n;
    string s;
    cin >> s;
    long res = 0;
    vector<vector<long>> d(n + 1, vector<long>(n + 1));
    for (int m = 0; m < (1 << n); m++) {
        string a = "";
        string b = "";
        for (int i = 0; i < n; i++) {
            if (m & (1 << i)) {
                a += s[i];
            } else {
                b += s[i];
            }
        }
        int na = a.size();
        int nb = b.size();
        for (int i = 0; i <= na; i++)
            for (int j = 0; j <= nb; j++)
                d[i][j] = 0;
        d[0][0] = 1;
        for (int i = 0; i <= na; i++) {
            for (int j = 0; j <= nb; j++)
                if (d[i][j]) {
                    if (i < na && s[2 * n - 1 - i - j] == a[i]) {
                        d[i + 1][j] += d[i][j];
                    }
                    if (j < nb && s[2 * n - 1 - i - j] == b[j]) {
                        d[i][j + 1] += d[i][j];
                    }
                }
        }
        res += d[na][nb];
    }
    cout << res << "\n";

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
//using namespace __gnu_pbds;

#define ll       long long
#define DS       pair<ll, ll>
#define READ(f)  freopen(f, "r", stdin)
#define WRITE(f) freopen(f, "w", stdout)

const int N = 1e5 + 5;
const int MOD = 1e9 + 7;
const double PI = 2 * acos(0.0);
//template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

ll a[N], fact[N], cntMax[N], cntMin[N];

ll bigMod(ll b, ll p, ll m) {
    ll ret = 1, cur = b % m;
    while (p) {
        if (p & 1) ret = (ret * cur) % m;
        cur = (cur * cur) % m;
        p = p >> 1;
    }
    return ret;
}

ll modInv(ll a, ll m) {
    return bigMod(a, m - 2, m);
}

void go() {
    fact[0] = 1;
    for (int i = 1; i < N; i++) {
        fact[i] = fact[i - 1] * i;
        fact[i] %= MOD;
    }
}

ll nCr(int n, int r) {
    ll y = (fact[r] * fact[n - r]) % MOD;
    return (fact[n] * modInv(y, MOD)) % MOD;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    go();
    int n, k;
    cin >> n >> k;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    sort(a + 1, a + n + 1);
    ll combi = 0;
    for (int i = k; i <= n; i++) {
        combi += nCr(i - 2, k - 2);
        combi %= MOD;
        cntMax[i] = combi;
    }
    for (int i = 1, x = n - 2; (i + k - 1) <= n; i++, x--) {
        cntMin[i] = combi;
        combi -= nCr(x, k - 2);
        combi %= MOD;
        if (combi <= 0) combi += MOD, combi %= MOD;
    }
//    for (int i = 1; i <= n; i++) {
//        cout << i << " : " << cntMax[i] << endl;
//    }
//    puts("\n");
//    for (int i = 1; i <= n; i++) {
//        cout << i << " : " << cntMin[i] << endl;
//    }
    int mx = 0, mn = 0;
    for (int i = 1; i <= n; i++) {
        mx += ((cntMax[i] * (a[i] % MOD)) % MOD);
        mx %= MOD;
        if (mx <= 0) mx += MOD, mx %= MOD;
        mn += ((cntMin[i] * (a[i] % MOD)) % MOD);
        mn %= MOD;
        if (mn <= 0) mn += MOD, mn %= MOD;
    }
    mx -= mn;
    mx %= MOD;
    if (mx <= 0) mx += MOD, mx %= MOD;
    cout << mx << '\n';
    return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <vector>
#include <array>
#include <map>
#include <iterator>
#include <algorithm>

#define X first
#define Y second

using namespace std;

int q;
vector<pair<string,string>> dataset;

int ans(pair<string, string> &data)
{
    array<array<int,1001>,1001> dp = {};
    for (unsigned int i=1; i<=data.X.length(); ++i) {
        for (unsigned int j=1; j<=data.Y.length(); ++j) {
            if (data.X[i-1] == data.Y[j-1]) dp[i][j] = max({dp[i-1][j-1] + 1, dp[i-1][j], dp[i][j-1]});
            else dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
        }
    }
    return dp[data.X.length()][data.Y.length()];
}

int main(int argc, char **argv)
{
    cin >> q;
    for (int i=0; i<q; ++i) {
        dataset.emplace_back(std::make_pair("",""));
        cin >> dataset[i].X;
        cin >> dataset[i].Y;
    }
    for (int i=0; i<q; ++i) {
        cout << ans(dataset[i]) << endl;
    }

    return 0;
}



Measured memory_bytes: 7144
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define pp pair<int,int>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define ld long double
#define al(a) (a).begin(),(a).end()
#define mk make_pair
#define check cout<<"?"<<endl;

ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;

int main(){
    string s; cin>>s;
    for(auto ch:s) cout<<"x";
    cout<<endl;
}

Measured memory_bytes: 3624
use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let n = match buf.trim().parse::<i32>() {
		Ok(n) => n,
		_ => panic!(""),
	};
	let all = n / 2 + n%2;
	println!("{}", all as f32 / n as f32);
}

Measured memory_bytes: 4352
#include <iostream> // cout, endl, cin
using namespace std;

int main(){
    long long N,A,B,C,D;
    cin>>N;
    A=0;
    B=N;
    C=1;
    D=1;
    while(C*D<N){
        C++;
        D++;
    }
     for(int i=1;i<=C;i++){
        A=i;
        //cout<<i<<endl;
        if(N%A==0 & N/A<B){
            if(B==A){
                B=N/A;
                break;
            }
            B=N/A;
         //cout<<A<<" "<<B<<endl;
        }
    }
    A=N/B;
    //cout<<A<<" "<<B<<" "<<C<<endl;
    cout<<(A-1)+(B-1)<<endl;
}

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

int main() {
    int N, M;
    cin >> N >> M;
    vector<bool> v(N + 1, true);
    for (int i = 0; i < M; i++) {
        int a;
        cin >> a;
        v[a] = false;
    }
    vector<int> dp(N + 1, 0);
    dp[0] = 1;
    if (v[1]) dp[1] = 1;
    for (int i = 2; i <= N; i++) {
        if (v[i]) {
            dp[i] = dp[i - 1] + dp[i - 2];
            dp[i] %= 1000000007;
        }
    }
    cout << dp[N] << endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main() {
int counter=0;
int a[3]={};
for(int i=0; i<3; i++){
cin>>a[i];}
sort(a,a+3);
if(a[0]%2==a[1]%2){
cout<<(2*a[2]-a[1]-a[0])/2<<endl;}
else
cout<<(2*a[2]-a[1]-a[0])/2+2<<endl;}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long int
#define ldouble long double
#define vin vector<int>
#define pqueue priority_queue
#define rep(a,n) for(int i=(a);i<(n);i++)
#define INF (int)1000000007

//setprecision()<<

using namespace std;

void fin(int n,vin &a){
    rep(0,n){
        cin>>a.at(i);
    }
}

signed main(){
    typedef pair<int,int> P;
    int N;
    cin>>N;
    vector<int> a(0);
    rep(0,N){
        int n;
        cin>>n;
        if(n%2==0) a.push_back(n);
    }
    rep(0,a.size()){
        if(a.at(i)%3!=0 && a.at(i)%5!=0){
            cout<<"DENIED"<<endl;
            return 0;
        }
    }
    cout<<"APPROVED"<<endl;
    return 0;
}

Measured memory_bytes: 256
def main():
    e=enumerate
    n,m,*u=map(int,open(0).read().split())
    dp=[[1]*(m+1)for _ in range(n+1)]
    dpi=dp[0]
    for i,s in e(u[:n]):
        dpi1=dp[i+1]
        for j,t in e(u[n:]):
            dpi1[j+1]=(dpi[j+1]+dpi1[j]-dpi[j]*(s!=t))%(10**9+7)
        dpi=dpi1
    print(dpi[m])
main()

Measured memory_bytes: 72412
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <iostream>
#include <set>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <complex>
#include <map>
#include <queue>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<double, int> pdi;
typedef pair<double, double> pdd;
typedef vector<string> vs;

double d[1005][1005];

double p2(double x) {
  return x * x;
}

int main() {
  vi x(2), y(2), r(2);
  int n;
  cin >> x[0] >> y[0] >> x[1] >> y[1] >> n;
  for (int i = 0; i < n; ++i) {
    int a,b,c;
    cin >> a >> b >> c;
    x.push_back(a);
    y.push_back(b);
    r.push_back(c);
  }
  n += 2;
  for (int i = 0; i < n; ++i) for (int j = 0; j < n; ++j) {
    d[i][j] = max(0., sqrt(p2(x[i] - x[j]) + p2(y[i] - y[j])) - r[i] - r[j]);
  }
  vd dist(n, 1e18);
  dist[0] = 0;
  set<pdi> q;
  q.insert(pdi(0, 0));
  while (!q.empty()) {
    int v = q.begin()->second;
    q.erase(q.begin());
    for (int i = 0; i < n; ++i) {
      double nd = dist[v] + d[i][v];
      if (nd < dist[i]) {
        q.erase(pdi(dist[i], i));
        dist[i] = nd;
        q.insert(pdi(dist[i], i));
      }
    }
  }
  printf("%.15lf\n", dist[1]);
  return 0;
}

Measured memory_bytes: 8320
import math
n = int(input())
xs = [int(_) for _ in input().split()]
ys = [int(_) for _ in input().split()]

print(sum([abs(x-y) for x, y in zip(xs, ys)]))
print(math.sqrt(sum([pow(abs(x-y),2) for x, y in zip(xs, ys)])))
print(math.pow(sum([pow(abs(x-y),3) for x, y in zip(xs, ys)]), 1/3))
print(max([abs(x-y) for x, y in zip(xs, ys)]))

Measured memory_bytes: 7832
#include <iostream>
#include <vector>
#include <numeric>

using namespace std; 

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


int main() {
    
  int A,B,ans;

  cin >> A >> B;

  B += A * 3;

  ans = B / 2;
  
  cout << ans << endl;

  return 0;
}

/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/

Measured memory_bytes: 256
#include<vector>
#include<map>
#include<algorithm>
#include<set>
#include<iostream>
#include<string>
#include<set>
#include<queue>
#include<random>
//#include<unordered_set>

using namespace std;

/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> st;*/

#pragma GCC optimize("Ofast")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")

#define pb push_back
#define ld long double
#define int long long

mt19937 rnd(51);

const int N = 3010, MOD = 998244353;
int dp[N][N];

int32_t main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, s;
    cin >> n >> s;
    vector<int> a(n);
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    dp[0][0] = 1;
    for (int i = 0; i < n; i++){
        for (int j = 0; j <= s; j++){
            dp[i + 1][j] = (dp[i][j] * 2 + dp[i + 1][j]) % MOD;
            if (j + a[i] <= s){
                dp[i + 1][j + a[i]] = (dp[i][j] + dp[i + 1][j + a[i]]) % MOD;
            }
        }
    }
    cout << dp[n][s];
    return 0;
}


Measured memory_bytes: 74084
#include <algorithm>
#include <bits/stdc++.h>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <vector>

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef ::std::int_fast64_t i64;
typedef ::std::uint_fast64_t u64;
typedef ::std::int_fast32_t i32;
typedef ::std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(::std::istream& is, ::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    vector.reserve(size);
    ::std::copy_n(::std::istream_iterator<T>(is), size, ::std::back_inserter(vector));
  }
  template <typename T>
  void read(::std::vector<T>& vector, const typename ::std::vector<T>::size_type size) {
    ::tools::read(::std::cin, vector, size);
  }

  template <typename T, ::std::size_t N>
  void read(::std::istream& is, ::std::array<T, N>& array) {
    ::std::copy_n(std::istream_iterator<T>(is), N, array.begin());
  }
  template <typename T, ::std::size_t N>
  void read(::std::array<T, N>& array) {
    ::tools::read(::std::cin, array);
  }
}

#endif

// main.cpp

int main() {
  i64 N, K;
  std::cin >> N >> K;
  std::cout << (N >= 2 * K - 1 ? "YES" : "NO") << std::endl;
  return 0;
}

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

using namespace std;
int main()
{
  int a,b,c,x,y ;
  cin >> a>>b>>c>>x>>y ;
  
  if(a+b<2*c){
    cout << a*x+b*y << endl;
  }else{
    if(x<y){
      int ans1 = 2*c*y ;
      int ans2 = 2*c*x + (y-x)*b ;
      if(ans1<ans2)
        cout << ans1 << endl;
      else
        cout << ans2 << endl;        
  }else{
      int ans3 = 2*c*x ;
      int ans4 = 2*c*y + (x-y)*a ;
      if(ans3<ans4)
        cout << ans3 << endl;
      else
        cout << ans4 << endl;        
    }
  }
    return 0;
}


Measured memory_bytes: 256
int main(){
  int n,i,j,k;
  scanf("%d",&n);
  int m[n+1];
  for(i=1;i<=n;i++){
    m[i]=0;
  }
  for(i=1;i<105;i++){
    for(j=1;j<105;j++){
      for(k=1;k<105;k++){
        int s=i*i+j*j+k*k+i*j+j*k+k*i;
        if(s<=n){
       	 m[s]++;
        }
      }
    }
  }
  for(i=1;i<=n;i++){
    printf("%d\n",m[i]);
  }
}

Measured memory_bytes: 1724
/*#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdio>
#include<deque>
#include<iomanip>
#include <numeric>*/
#include<bits/stdc++.h>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);(i)--)
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef deque<ll> dll;
typedef pair<ll, ll> P;
#define mod 1e9 + 7;


int main(){
    ll n,p,ans=1,ret=0;
	string s;
	bool x = false;
	cin >> n;
	vi a(n);
	rep(i,n) {
		cin >> a[i];
		if(a[i] % 2 == 1) x = true;
	}
	if(!x) cout << "second\n";
	else cout << "first\n";
    return 0;
}  


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T> inline void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T> inline void First(T condition){ if(condition) cout << "First" << endl; else cout << "Second" << endl; }
int character_count(string text, char character){ int ans = 0; for(int i = 0; i < text.size(); i++){ ans += (text[i] == character); } return ans; }
long power(long base, long exponent, long module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ long root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position move_pattern[4] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++){ ans += to_string(*i) + " "; } ans.pop_back(); cout << ans << endl; }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
#define mod long(1e9 + 7)
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl(long(n))
#define fcout cout << fixed << setprecision(10)
#define highest(x) (63 - __builtin_clzl(x))

int main(){
    string S, T;
    cin >> S >> T;
    for(int i = 0; i < S.size(); i++){
        S.push_back(S[0]);
        S.erase(S.begin());
        if(S == T){
            Yes(true);
            return 0;
        }
    }
    Yes(false);
}


Measured memory_bytes: 256
s=input()
ss=len(s)
c=0

for i in range(0,ss//2):
  if s[2*i]=="R"or s[2*i]=="U"or s[2*i]=="D":
    c=c+1
  if s[2*i+1]=="L"or s[2*i+1]=="U"or s[2*i+1]=="D":
    c=c+1
    
if ss%2==0:
  if c==ss:
    print("Yes")
  else:
    print("No")
else:
  if c==ss-1 and (s[-1]=="R"or s[-1]=="U"or s[-1]=="D"):
    print("Yes")
  else:
    print("No")
  

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

int main(){
  int  A[5][4][11];
  int n;
  int b, f, r, v;

 for ( int i = 0; i < 5; i++){
    for ( int j = 0; j < 4; j++){
      for ( int k = 0; k < 11; k++){
        A[i][j][k] = 0;
      }
    }
  }

  cin >> n;

  for ( int i = 0; i < n; i++ ){
    cin >> b >> f >> r >> v;
    A[b][f][r] += v;
  }

  for ( int i = 1; i < 5; i++){
      for ( int j = 1; j < 4; j++){
        for ( int k = 1; k < 11; k++){
          cout << " " << A[i][j][k];
        }
        cout << endl;
      }
      if (i != 4) cout << "####################" << endl;
    }

return 0;
}

Measured memory_bytes: 3088
S = str(input())

test1 = ['R','U','D']
test2 = ['L','U','D']

isTapable = True

for i in range(len(S)):
    if i % 2 == 0:
        if S[i] in test1:
            isTapable = True
        else:
            isTapable = False
            break
    else:
        if S[i] in test2:
            isTapable = True
        else:
            isTapable = False
            break

if isTapable:
    print('Yes')
else:
    print('No')


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

#define REP(i, e) for(int (i) = 0; (i) < (e); ++(i))
#define FOR(i, b, e) for(int (i) = (b); (i) < (e); ++(i))
#define ALL(c) (c).begin(), (c).end()
#define SIZE(x) ((int)(x).size())
#define MIN(c) (*min_element(ALL(c))) 
#define MAX(c) (*max_element(ALL(c)))
#define ACC(c) (accumulate(ALL(c), 0))
#define SLL(x, n) ((x) << (n))
#define SRL(x, n) ((x) >> (n))
#define MIN2(a, b) ((a) < (b)) ? (a) : (b)
#define MAX2(a, b) ((a) > (b)) ? (a) : (b)
#define MP(a, b) (make_pair((a), (b)))
#define ENDL "\n"
#define PRINT(x) cout << (x) << ENDL

using namespace std;
using ll = long long;
using pint = pair<int, int>;

inline int in(int& a) {return scanf("%d", &a);}
inline void out(int n) {printf("%d\n", n);}
auto pint_compare = [](pint x, pint y) -> bool{return (x.first < y.first);};

int N, K;
int V[100];

int value(int A, int B, int k){
    priority_queue<int, vector<int>, greater<int> > own;
    REP(i, A) own.push(V[i]);
    REP(i, B) own.push(V[N - 1 - i]);
    REP(i, k){
        if(!own.empty() && own.top() < 0) own.pop();
    }
    int ret = 0;
    while(!own.empty()){
        ret += own.top();
        own.pop();
    }
    return ret;
}

signed main(){
    cin >> N >> K;
    REP(i, N) cin >> V[i];
    int max = 0;
    int min_NK = MIN2(N, K);
    for(int A = 0; A <= min_NK; A++){
        for(int B = 0; A + B <= min_NK; B++){
            max = MAX2(max, value(A, B, K - A - B));
        }
    }
    PRINT(max);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef unsigned long long ll;
#define INF 1000000000
using namespace std;
int main(void){
    int d,g;
    cin>>d>>g;
    vector<int>p(d);
    vector<int>c(d);
    for(int i=0;i<d;i++){
        cin>>p[i]>>c[i];
    }
    int ans=INF;
    for(int mask=0;mask<(1<<d);mask++){
        int s=0,num=0,rest_max=-1;
        for(int i=0;i<d;i++){
            if(mask>>i&1){
                s+=100*(i+1)*p[i]+c[i];
                num+=p[i];
            }else{
                rest_max=i;
            }
        }
        if(s<g){
            int s1=100*(rest_max+1);
            int need=(g-s+s1-1)/s1;
            if(need>=p[rest_max]){
                continue;
            }
            num+=need;
        }
        ans=min(ans,num);
    }
    cout<<ans<<endl;
}

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

  void print(int N,int A[]){
      for(int i=0;i<N-1;i++){
        cout<<A[i]<<" ";
      }
      cout<<A[N-1]<<endl;
  }

  void insertionSort(int N,int A[]){
      print(N,A);
      for(int i=1;i<N;i++){
         int v=A[i];
         int j=i-1;
         while(j>=0&&v<A[j]){
             A[j+1]=A[j];
             j--;
         }
         A[j+1]=v;
         print(N,A);
      }

  }

  int main(){
     int N;
     cin>>N;
     int A[N];
     for(int i=0;i<N;i++){
        cin>>A[i];
     }

     insertionSort(N,A);



     return 0;
  }



Measured memory_bytes: 3072
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);

impl<T: PartialEq> Eq for Total<T> {}

impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

//const MAX:usize = 100006;
//const INF:u64 = u64::max_value();

fn main() {
    let n:i32 = read();
    println!("{}", 180*n-360);
}


Measured memory_bytes: 4352
#include<cstdio>
const int MAXN = 400;
const int MOD = 998244353;
int inv[MAXN + 5];
struct mint{
    int x;
    mint(int _x=0) : x(_x) {}
    friend mint operator + (const mint &a, const mint &b) {return a.x + b.x >= MOD ? a.x + b.x - MOD : a.x + b.x;}
    friend mint operator - (const mint &a, const mint &b) {return a.x - b.x < 0 ? a.x - b.x + MOD : a.x - b.x;}
    friend mint operator * (const mint &a, const mint &b) {return 1LL * a.x * b.x % MOD;}
    friend mint operator / (const mint &a, const int &b) {return a * inv[b];}
};
mint pow_mod(mint b, int p) {
    mint ret = 1;
    while( p ) {
        if( p & 1 ) ret = ret*b;
        b = b*b;
        p >>= 1;
    }
    return ret;
}
void init() {
    inv[1] = 1;
    for(int i=2;i<=MAXN;i++)
        inv[i] = MOD - 1LL*inv[MOD%i]*(MOD/i)%MOD;
}
mint coef[MAXN + 5][MAXN + 5];
int A[MAXN + 5], B[MAXN + 5], N, SA, SB;
void read() {
    scanf("%d", &N);
    for(int i=0;i<N;i++)
        scanf("%d%d", &A[i], &B[i]), SA += A[i], SB += B[i];
}
mint tmp[MAXN + 5][MAXN + 5];
void get() {
    coef[0][0] = 1;
    for(int i=0;i<N;i++) {
        for(int j=0;j<=SA;j++)
            for(int k=0;k<=SB;k++)
                tmp[j][k] = coef[j][k], coef[j][k] = 0;
        mint p = mint(A[i]) / SA, f = MOD - 1;
        for(int l=0;l<B[i];l++,f=f/l*p)
            for(int j=0;j<=SA;j++)
                for(int k=l;k<=SB;k++)
                    coef[j][k] = coef[j][k] + f*tmp[j][k-l];
        for(int j=A[i];j<=SA;j++)
            for(int k=0;k<=SB;k++)
                coef[j][k] = coef[j][k] + tmp[j-A[i]][k];
    }
    for(int i=0;i<=SA;i++)
        for(int j=0;j<=SB;j++)
            coef[i][j] = 0 - coef[i][j];
    coef[SA][0] = coef[SA][0] + 1;
}
/*
let t = e^(x/S)
t^S - (t^Ai - (x*Ai/S)^j/j!)
*/
int solve() {
    mint ret = 0, f = 1;
    for(int j=0;j<=SB;j++,f=f*j)
        for(int i=0;i<=SA;i++) {
            mint p = mint(i) / SA;
            p = pow_mod(1 - p, MOD - 2 - j);
            ret = ret + coef[i][j]*p*f;
        }
    return ret.x;
}
int main() {
    init(), read(), get();
    printf("%d\n", solve());
}

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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}
int64_t rll() {
	long long n;
	scanf("%lld", &n);
	return n;
}

int main() {
	std::string s;
	std::cin >> s;
	int n = s.size();
	int used = 0;
	int cnt = 0;
	int cnts[n];
	std::vector<int> changes;
	for (int i = n - 1; i >= 0; i--) {
		used |= 1 << (s[i] - 'a');
		if (used == (1 << 26) - 1) {
			cnt++;
			used = 0;
			changes.push_back(i);
		}
		cnts[i] = cnt;
	}
	std::reverse(changes.begin(), changes.end());
	changes.push_back(n);
	std::string res;
	used = 0;
	for (int i = 0; i < changes[0]; i++) {
		used |= 1 << (s[i] - 'a');
	}
	for (int i = 0; i < 26; i++) {
		if (!(used >> i & 1)) {
			res.push_back(i + 'a');
			break;
		}
	}
	for (int i = 0; i + 1 < (int) changes.size(); i++) {
		int index = -1;
		for (int j = changes[i]; j < changes[i + 1]; j++) {
			if (s[j] == res.back()) {
				index = j;
				break;
			}
		}
		assert(index != -1);
		used = 0;
		for (int j = index + 1; j < changes[i + 1]; j++) used |= 1 << (s[j] - 'a');
		for (int j = 0; j < 26; j++) if (!(used >> j & 1)) {
			res.push_back(j + 'a');
			break;
		}
	}
	std::cout << res << std::endl;
	
	return 0;
}


Measured memory_bytes: 1412
n=int(input())

a=[]
b=[]

for i in range(n):
  A,B=map(int,input().split())
  a.append(A)
  b.append(B)

a=sorted(a)
b=sorted(b)
n-=1

if n%2==1:
  A=(a[n//2]+a[n//2+1])/2
  B=(b[n//2]+b[n//2+1])/2
  print(int(-(A-B)*2+1))
  #print(a)
  #print(b)
  #print(A,B)
else:
  A=a[(n+1)//2]
  B=b[(n+1)//2]
  print(-A+B+1)
  #print([a,b,A,B])

Measured memory_bytes: 26948
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>

#define repeat(i,n) for (long long i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i] << '\n'

using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const ll INF = LLONG_MAX;
const ll MOD = 1e9+7;

struct Trie {
  int depth;
  int children_size;
  Trie *next[0x100];
  Trie():depth(-1),children_size(0) { fill(next, next+0x100, (Trie*)0); }
  Trie(int d):depth(d),children_size(0) { fill(next, next+0x100, (Trie*)0); }
};
Trie *find(string t, Trie *r) {
  for (int i = 0; i<t.length(); ++i) {
    char c = t[i];
    if (!r->next[c]){
      r->next[c] = new Trie(i);
      r->children_size++;
    }
    r = r->next[c];
  }
  return r;
}

ll dfs(ll &L,Trie* node){
  if(node->children_size==0) return 0;
  ll ret=0;
  if(node->children_size==1){
    ll height = L-node->depth-1;
    ret ^= (-height)&height;
  }
  if(node->next['0']!=NULL){
    ret ^= dfs(L,node->next['0']);
  }
  if(node->next['1']!=NULL){
    ret ^= dfs(L,node->next['1']);
  }
  return ret;
}

int main() {
  ll N,L;cin >> N >> L;
  Trie* root = new Trie();
  repeat(i,N){
    string s;
    cin >> s;
    find(s,root);
  }
  cout <<(dfs(L,root)==0? "Bob":"Alice") << endl;
  return 0;
}


Measured memory_bytes: 205184
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using pi = pair<int,int>;
constexpr ll mod = 1000000007;
void pPRINTl(ostream& ost) { ost << endl; }
template <class T>void pPRINTL(ostream& ost,T t){ost<<t<<endl;}
template <class T, class... U>void pPRINTl(ostream& ost, T t, U... u) {ost << t << " ";pPRINTl(ost, u...);}
template <class... T>void PRINTl(T... t) { pPRINTl(cout, t...); }
//#define PRINTl //
void pPRINT(ostream& ost) {}
template <class T>void pPRINT(ostream& ost, T t){ost<<t;}
template <class T, class... U>void pPRINT(ostream& ost, T t, U... u) {ost << t << " ";pPRINT(ost, u...);}
template <class... T>void PRINT(T... t) { pPRINT(cout, t...); }
 
#define DEBUG PRINTl("DEBUG line:",__LINE__)
//#define DEBUG 
 
int main(){
  
  ll n;
  cin>>n;
  ll a[n];
  REP(i,n)cin>>a[i];
  
  vector<int> l;
  l.push_back(a[0]);
  ll min=a[0];
  FOR(i,1,n){
    if(min>=a[i]){
      l.push_back(a[i]);
      min=a[i];
      continue;
    }
    REP(j,l.size()){
      if(l[j]<a[i]){
        l[j]=a[i];
        if(j==l.size()-1){
          min=a[i];
      	}
        break;
      }
    }
  }
  
  PRINT(l.size());
  
  return 0;
}

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

const int INF = 1001001001;

int main() {
    char c;
    cin >> c;
    if (c >= 'A' && c <= 'Z') cout << 'A' << endl;
    else cout << 'a' << endl;
}


Measured memory_bytes: 3616
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;


int main(){
    int n;
    scanf("%d",&n);
    int f[n+1][11];
    int i,k,j;
    for(i=1;i<=n;i++)for(j=1;j<=10;j++)scanf("%d",&f[i][j]);
    int p[n+1][11];
    for(i=1;i<=n;i++)for(j=0;j<=10;j++)scanf("%d",&p[i][j]);
   
    int joi[11];
    long long int max=-1000000003;
    for(int si=1;si<=1023;si++){
        i=si;
        for(j=1;j<=10;j++){
            joi[j]=i%2;
            i=i/2;
        }
       
        long long int ans=0;
        for(j=1;j<=n;j++){
            int same=0;
            for(k=1;k<=10;k++){
                if(joi[k]==1&&f[j][k]==1)same++;
            }
            ans+=p[j][same];
        }
        if(ans>max)max=ans;
   }
    printf("%lld",max);
    return 0;
    
}


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

int main() {
	vector<char> hex = {
		'A',
		'B',
		'C',
		'D',
		'E',
		'F',
	};

	char X, Y;
	int Xi = 0, Yi = 0;

	cin >> X >> Y;

	for (size_t i = 0; i < hex.size(); i++)
	{
		if (hex[i] == X) Xi = i;
		if (hex[i] == Y) Yi = i;
	}

	cout << (Xi == Yi ? '=' : Xi < Yi ? '<' : '>');

	return 0;
}

Measured memory_bytes: 256
from collections import  Counter
from itertools import accumulate

from operator import add, mul
n,m=map(int,input().split())
a=list(map(int,input().split()))
ans=0
b= list(accumulate(a, add))
b=list(map(lambda x:x%m,b))
c=Counter(b)
c[0]=c[0]+1
ans=0
for i in c.values():
    ans+=i*(i-1)//2
print(ans)


Measured memory_bytes: 16996
from collections import defaultdict
N = int(input())
dic = defaultdict(lambda:0)
for _ in range(N):
    key = input()
    dic[key] += 1

maxnum = max(dic.values())
collection = []
for key, value in dic.items():
    if value == maxnum:
        collection.append(key)

collection.sort()
for word in collection:
    print(word)

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

void solve() {
    long long N; cin >> N;
    long long ans = N - 1;
    for(long long i = 1; i * i <= N; ++i) {
        if(N % i) continue;
        long long j = N / i;
        long long t = i + j - 2;
        ans = min(ans, t);
    }
    cout << ans << '\n';
}

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


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


int main() {
  int n, ans=0;
  cin >> n; 
  vector<int> vec; 
  int pre=-10; 
  rep(i,n){
    int a;
    cin >> a;
    if(a == pre+1) vec.push_back(pre-1);
    pre = a;
  }
  
  rep(i,n){
    int b;
    cin >> b;
    ans += b;
  }
  
  vector<int> c(n-1);
  rep(i, n-1) cin >> c.at(i);
  for(int x: vec) ans += c.at(x);
  
  cout << ans << endl;  
  return 0;
  
}


Measured memory_bytes: 256
n, k =map(int, input().split())
d = list(map(int, input().split()))
a = [0]*10
for i in d:
  a[i]=1
  
ans = n
while True:
  flg = False
  temp = str(n)
  l = len(temp)
  for i in range(l):
    if a[int(temp[i])]==1:
      n+=1
      flg = True
      break
  if flg:
    continue
  else:
    print(n)
    quit()
    
  

Measured memory_bytes: 9208
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
    read_all = [tuple(map(int, input().split())) for _ in range(N)]
    return map(list,zip(*read_all))

#################

def is_prime_all(n):
    is_prime = [True]*(n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5+1)):
        if not is_prime[i]:
            continue
        for j in range(i*2,n+1,i):
            is_prime[j] = False
    return is_prime

N = I()
is_prime = is_prime_all(55555)
now = 2
a = []
while now<=55555:
    if is_prime[now]==True:
        a.append(now)
    now += 5

print(*a[:N])

Measured memory_bytes: 40944
import java.util.*;
import java.lang.*;

public class Main {
    
    public static void main (String args[]) {
        
        String ans = "";

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        if (n == 25) {
            ans = "Christmas";
        } else if (n == 24) {
            ans = "Christmas Eve";
        } else if (n == 23) {
            ans = "Christmas Eve Eve";
        } else {
            ans = "Christmas Eve Eve Eve";
        }
	    
        System.out.println(ans);
    }
}


Measured memory_bytes: 21204
#include<iostream>
int main(){int t[31],w=1,n,a,b,c;for(;w<31;)t[w]=w++;for(std::cin>>w>>n;n--;){(std::cin>>a).ignore(1)>>b;c=t[a];t[a]=t[b];t[b]=c;}for(n=1;n<w+1;)std::cout<<t[n++]<<'\n';}

Measured memory_bytes: 0
import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# A = [ int(input()) for _ in range(N) ]
##############################

N, H = map(int, input().split())
A = []
B = []

for i in range(N):
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)

max_a = max(A)

t = B[:]
t.sort(reverse=True)

count = 0
for i in range(N):
    # 先に投げても後で投げても同じなので、最初に全部投げちゃう
    # ただし強いものから投げないと、投げ終わる前に倒すケースで引っかかる
    if t[i] >= max_a:
        H -= t[i]
        count += 1

    if H <= 0:
        print(count)
        exit()


# 近いところまでまとめて引く
x = (H // max_a) - 1
H -= (max_a * x)
count += x

while H > 0:
    H -= max_a
    count += 1


print(count)

Measured memory_bytes: 12064