akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;


/********************************************************************/
#define M1 1000000007	//Standard primes used in modulo operations
#define M2 998244353
#define PI 3.1415926536
const int INF = INT_MAX;
#define ll long long
#define pll pair<ll,ll>
#define REP(i, a, b) for(ll i=a;i<b;i++)
#define REPR(i, a, b) for(ll i=b-1;i>=a;i--)
#define forr(i, n) for(ll i=0;i<n;i++)
#define ff first
#define ss second
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define MT make_tuple
#define V(a) vector<a>
#define vi vector<ll>
#define endl '\n'
#define ce(ele) cout<<ele<<' '
#define cs(ele) cout<<ele<<'\n'
#define CASE(t) ll t; cin>>t; while(t--)
#define space ' '
#define yes cout<<"Yes"<<endl
#define no cout<<"No"<<endl

void FAST() {	//FAST Input Output, DONT use both scnaf,printf / cin,cout , Use any ONE system
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}
ll gcd(ll x, ll y) {	//returns gcd of two long long ints
	if (x == 0) return y;
	return gcd(y % x, x);
}

ll powM(ll x, ll y, ll m) {	//returns (a^b)%m ( ^ is exponent )
	ll ans = 1, r = 1;
	x %= m;
	while (r > 0 && r <= y)
	{
		if (r & y)
		{
			ans *= x;
			ans %= m;
		}
		r <<= 1;
		x *= x;
		x %= m;
	}
	return ans;
}

map<long long, long long> factorize(long long n) {	//returns map containing factor and multiplicity, Eg: 60 = {{2,2},{3,1},{5,1}}
	map<long long, long long> ans;
	for (long long i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			ans[i]++;
			n /= i;
		}
	}
	if (n > 1) {
		ans[n]++;
		n = 1;
	}
	return ans;
}
/* **********END OF TEMPLATE*********** */

int main() {
	/*  Codeforces #595 Div.3 :)*/
	FAST();
	int d,t,s;
	cin>>d>>t>>s;
	if(s*t>=d){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}

	}
		
	
	

		


Measured memory_bytes: 3620
n = int(input())
mod = 7 + 10 ** 9
def primes(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 [i for i in range(n + 1) if is_prime[i]]
#エラトステネス
P = primes(n)
primes_count = {}
for i in P:
    primes_count[i] = 0
prime_index = 0
for i in range(2,n+1):
    prime_index = 0
    while i > 1:
        if i % P[prime_index] == 0:
            i = i // P[prime_index]
            primes_count[P[prime_index]] += 1
        else:
            prime_index += 1
ans = 1
for i in primes_count.keys():
    ans *= (primes_count[i] + 1)
print(ans % mod)

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

using namespace std;

int main() {
  #ifdef _OFFLINE_
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #endif

  int n, a, k, t = 0, m = numeric_limits<int>::min();
  cin >> n >> k;
  for(int i = 0; i < n; ++i) {
    cin >> a;
    if(t == 0) t = a;
    else t = __gcd(a, t);
    m = max(m, a);
  }
  if(k <= m && k % t == 0) {
    cout << "POSSIBLE";
  }
  else {
    cout << "IMPOSSIBLE";
  }
}

Measured memory_bytes: 256
#include <iostream>

int main()
{
    int s[14]={0},h[14]={0},c[14]={0},d[14]={0};
    int n;
    
    std::cin >> n;
    for(int i=0;i<n;i++)
    {
        int num;
        char kind;
        std::cin >> kind >> num;
        
        if(kind=='S')        s[num]++;
        else if(kind=='H')   h[num]++;
        else if(kind=='C')   c[num]++;
        else if(kind=='D')   d[num]++;
    }
    
    for(int i=1;i<14;i++)
        if(s[i] == 0)
            std::cout << "S" << " " << i << std::endl;
    for(int i=1;i<14;i++)
        if(h[i] == 0)
            std::cout << "H" << " " << i << std::endl;
    for(int i=1;i<14;i++)
        if(c[i] == 0)
            std::cout << "C" << " " << i << std::endl;
    for(int i=1;i<14;i++)
        if(d[i] == 0)
            std::cout << "D" << " " << i << std::endl;
}


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

int main() {
    int n, x;
    cin >> n >> x;
    vector<int> a(n);
    for (int i=0; i<n; i++) cin >> a[i];
    sort(a.begin(), a.end());

    int count = 0;
    for (int i=0; i<n-1; i++) {
        if (x >= a[i]) {
            x -= a[i];
            count++;
        } else {
            break;
        }
    }
    if (x == a[n-1]) count++;

    cout << count << endl;

    return 0;
}


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

#define ll long long
#define ull unsigned long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(a,b) for(int a=0;a<(b);++a)
#define REP1(i,n) for(int i=1;i<=(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define INF (1<<29)
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}

const int MOD =(int)1e9+7;
const int MAX =510000;

ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0||k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}

ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}
const int N_max=51;
const int M_max=N_max*(N_max-1);
vector<int> v[51];
bool isVisited[N_max];
void initialize(){
    REP(i,N_max){
        isVisited[i]=false;
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int Q=in();
    int H=in();
    int S=in();
    int D=in();
    int N=in();
    ll min_1l;
    if(Q*4<S){
        if(H*2<Q*4){
            min_1l=H*2;
        }else{
            min_1l=Q*4;    
        }
    }else{
        if(H*2<S){
            min_1l=H*2;
        }else{
            min_1l=S;    
        }
    }
    if(N==1){
        print(min_1l);
    }else{
        ll min_2l;
        min_2l=min<ll>(D,min_1l*2);
        cout<<min_2l*(N/2)+(N%2)*min_1l<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(){
  int n,a,b,c,d,A[4][3][10]={};
  scanf("%d",&n);
  int i,j,l;
  for(i=0;i<n;i++){
    scanf("%d%d%d%d",&a,&b,&c,&d);
    A[(a-1)][b-1][c-1]+=d;
      }
  for(i=0;i<4;i++){
    for(j=0;j<3;j++){
      for(l=0;l<10;l++){
	printf(" %d",A[i][j][l]);
      }
      printf("\n");
    }
    if(i!=3){ printf("####################");
      printf("\n");}
  }
  return 0;
}
	             
    


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

int main(){
	int A,B,K;
	cin>>A>>B>>K;
	vector<int>arr;
	for(int i=1;i<=min(A,B);++i){
		if(A%i==0 && B%i==0)arr.push_back(i);
	}
	cout<<arr[arr.size()-K]<<endl;
}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC153_b solver = new ABC153_b();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC153_b {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int H = in.nextInt();
            int N = in.nextInt();
            int arr[] = new int[N];

            for (int i = 0; i < N; i++) {
                arr[i] = in.nextInt();
            }
            Arrays.sort(arr);
            for (int j = 0; j < N; j++) {
                H -= arr[j];
                if (H <= 0) {
                    out.println("Yes");
                    return;
                }
            }
            out.println("No");
        }

    }
}



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

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int WWW = 0;WWW < (n);WWW++)cerr << v[WWW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000LL
#define MOD 1000000007

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

ll sd[222][222];
ll ld[222][222];
ll dp[1111][222];

int main(){
	int n,m;
	while(cin >> n >> m,n|m){
		
		REP(i,222){
			REP(j,222){
				sd[i][j] = LLINF;
				ld[i][j] = LLINF;
			}
			REP(j,1111)dp[j][i] = LLINF;
		}
		
		REP(i,222){
			sd[i][i] = 0;
			ld[i][i] = 0;
		}
		
		REP(i,m){
			ll a,b,c;char d;
			cin >> a >> b >> c >> d;
			a--;b--;
			if(d == 'S'){
				sd[a][b] = min(sd[a][b],c);
				sd[b][a] = min(sd[b][a],c);
			}
			else{
				ld[a][b] = min(ld[a][b],c);
				ld[b][a] = min(ld[b][a],c);
			}
		}
		
		ll r;cin >> r;
		vector<ll> v(r);REP(i,r)cin >> v[i],v[i]--;
		
		REP(k,222)REP(i,222)REP(j,222){
			sd[i][j] = min(sd[i][j],sd[i][k]+sd[k][j]);
			ld[i][j] = min(ld[i][j],ld[i][k]+ld[k][j]);
		}
		
		dp[0][v[0]] = 0;
		
		REP(i,r-1){
			REP(j,n){
				if(dp[i][j] != LLINF){
					dp[i+1][j] = min(dp[i+1][j],dp[i][j]+ld[v[i]][v[i+1]]);
					REP(k,n){
						dp[i+1][k] = min(dp[i+1][k],dp[i][j]+ld[v[i]][j]+sd[j][k]+ld[k][v[i+1]]);
					}
				}
			}
		}
		
		DBG(SHOW2d(dp,r,n));
		
		ll ans = LLINF;
		REP(i,n)ans = min(ans,dp[r-1][i]);
		
		cout << ans << endl;
	}
	return 0;
}



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

int main()
{
	string s;
	cin >> s;
	int ans = 0;
	for(auto i = 1; i < (int)s.size() / 2; ++i){
		if(s.substr(0, i) == s.substr(i, i)) ans = i * 2;
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;
int INF = 1001001001;

int main(){
    string str;
    cin >> str;
    reverse(str.begin(), str.end());
    str += "0";
    int len = str.size();
    vector<vector<int>> dp(len + 1, vector<int>(2, INF));
    dp[0][0] = 0;
    for (int i = 0; i < len; i++){
        for (int j = 0; j < 2; j++){
            int x = str[i] - '0';
            x += j;
            dp[i+1][0] = min(dp[i+1][0], dp[i][j] + x);
            dp[i+1][1] = min(dp[i+1][1], dp[i][j] + (10 - x));
        }
    }
    cout << dp[len][0] << endl;
}


Measured memory_bytes: 55940
#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  int a,b,c;
  /*cin>>a>>b>>c;
  if(a>b) cout<<"NO"<<'\n';
  else if(a+b>=c) cout<<"YES"<<'\n';
  else cout<<"NO"<<'\n';*/
  cin>>a;
  cout<<180*(a-2)<<'\n';
  return 0;
}


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

int main(){
    int a, b, c, d, e, na, nb, nc;
    while(cin >> a >> b >> c >> d >> e, a+b+c+d+e){
        cin >> na >> nb >> nc;
        int ans = nc*c + nb*b + na*a;
        if(nc >= d){
            ans = min(ans, nc*e + nb*b + na*a);
        }else if(nc + nb >= d){
            ans = min(ans, d*e + b*(nb-(d-nc)) + na*a);
        }else if(nc + nb + na >= d){
            ans = min(ans, d*e + a*(na-(d-nc-nb)));
        }else if(nc*c+nb*b+na*a > d*e){
            ans = d*e;
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3100
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n;
    cin >> n;
    for (int i = 0; i < n; ++i) {
        int r, t;
        cin >> r >> t;
        bool a = r%100 == 0, b = t%30 == 0;
        r /= 100; t /= 30;
        int x = r+t*5;
        if(!a && !b) printf("%d %d %d %d\n", x, x+1, x+5, x+6);
        else if(!a) printf("%d %d\n", x, x+1);
        else if(!b) printf("%d %d\n", x, x+5);
        else printf("%d\n", x);
    }
    return 0;
}


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

typedef long long ll;
const ll mod = 1e9 + 7;
const int N=2000000;
const int M=2000;

void Run()
{
     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
ll a[N];
int main()
{
    Run();
     int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) cin >> A[i];
 
    long long money = 1000;
    for (int i = 0; i + 1 < N; i++) {
        if (A[i] < A[i + 1]) {
            long long stock = money / A[i];
            money %= A[i];
            money += A[i + 1] * stock;
        }
    }
 
    cout << money << endl;
}

Measured memory_bytes: 3588
"use strict";
function main(input) {
  const checkM = num => {
    if (1 <= num && num <= 12) {
      return true;
    } else {
      return false;
    }
  };

  const checkY = num => {
    if (0 <= num && num <= 99) {
      return true;
    } else {
      return false;
    }
  };

  const args = input.split("\n");
  const S = args[0];

  const first = parseInt(S.slice(0, 2));
  const second = parseInt(S.slice(2, 4));

  let firstIsM = checkM(first);
  let firstIsY = checkY(first);

  let secondIsM = checkM(second);
  let secondIsY = checkY(second);

  if (firstIsY && secondIsM && (firstIsM && secondIsY)) {
    console.log("AMBIGUOUS");
  } else if (firstIsY && secondIsM) {
    console.log("YYMM");
  } else if (firstIsM && secondIsY) {
    console.log("MMYY");
  } else {
    console.log("NA");
  }
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 21064
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if 500*i+100*j+50*k == x:
                ans += 1
print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include <cmath>
#include <iomanip>
#include <ctype.h>

using namespace std;
using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;

#define TR ","
#define fi first
#define se second
#define rep(i,N) for(ll i=0;i<(ll)N;++i)
#define repe(i,a,b) for(ll i=a;i<(ll)b;++i)
#define all(v) v.begin(), v.end()
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define INF 100000000

ll gcd(ll a, ll b) {
    if (a < b) swap(a, b);
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll lcm(ll x, ll y) {
    return x / gcd(x, y) * y;
}

ll waz = 76543217;

ll inv(ll x) {
    if (x == 1) { return 1; }
    if (x == 0) { return 0; }
    else {
        ll a = (waz - inv(waz % x) * (waz / x)) % waz;
        if (a >= 0) { return a; }
        else { return waz + a; }
    }
}

void printVector(const vector<int>& vec) {
    for (int value : vec) {
        cout << value << " ";
    }
    cout << endl;
}

vector<ll> p;

ll phi(ll x) {
    ll a = x;
    ll b = x;
    for (ll k = 0; k != p.size(); ++k) {
        if (a % p[k] == 0) {
            while (a % p[k] == 0) {
                a /= p[k];
            }
            b = b / p[k] * (p[k] - 1);
        }
        if (a == 1) { break; }
    }
    return b;
}

bool my_compare(pair<string, int> a, pair<string, int> b) {
    if (a.first != b.first) {
        return a.first < b.first;
    }

    if (a.second != b.second) {
        return a.second > b.second;
    }
    else {
        return true;
    }
}

int main()
{
    IO;

    ll a, b, c; cin >> a >> b >> c;
    cout << min(a, min(b, c)) << " " << max(a, max(b, c)) << endl;

}


Measured memory_bytes: 3216
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <bitset>

using namespace std;
typedef long long ll;

int main() {
	int N; cin >> N;
	double x = (double)((N + 1) / 2) / N;
	cout << fixed << setprecision(15) << x << endl;	// これで小数点以下15桁まで出力できる
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define POW(n) ((n) * (n))
#define ALL(a) (a).begin(), (a).end()

using namespace std;

namespace Dump {
#define dump(...) Dump::print(#__VA_ARGS__, __VA_ARGS__)
static std::vector<string> dumpKey;
static string dumpKeyBuf;

void print() { cerr << endl; }
template <class Head, class... Tail> void print(Head &&head, Tail &&... tail) {
  if (dumpKey.empty()) {
    dumpKeyBuf = head;
    dumpKeyBuf.erase(std::remove_if(dumpKeyBuf.begin(), dumpKeyBuf.end(),
                                    [](char c) { return c == ' '; }),
                     dumpKeyBuf.end());

    std::istringstream stream(dumpKeyBuf);
    string field;
    while (std::getline(stream, field, ','))
      dumpKey.push_back(field);

    reverse(dumpKey.begin(), dumpKey.end());
  } else {
    cerr << dumpKey.back() << ":" << head << "  ";
    dumpKey.pop_back();
  }
  Dump::print(std::move(tail)...);
}
}

typedef long long ll;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<long long> vll;
typedef vector<unsigned long long> vull;
typedef pair<int, int> pii; // p.first p.second

// ll n = to_T<ll>("114514")
template <class T> T to_T(const string &s) {
  istringstream is(s);
  T res;
  is >> res;
  return res;
}
template <class T> string to_s(const T &a) {
  ostringstream os;
  os << a;
  return os.str();
}

void solve(long long N) {
  ll ans = 0;
  REP(i, N + 1) {
    ll buf = (ll)i * (ll)i;
    if (N >= buf) {
      ans = max(ans, buf);
    } else {
      break;
    }
  }
  cout << ans << endl;
}

int main() {
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  solve(N);
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
	int H, W;
	while (cin >> H >> W) {
		if (H == 0 && W == 0)break;
		for (int i = 1; i <= H; i++)
		{
			for (int j = 1; j <= W; j++)
				cout << "#";
			cout << endl;
		}
		cout << endl;
	}
	return 0;
}


Measured memory_bytes: 3092
#include <iostream>

using namespace std;

int main(){
    string S;
    //Sを定義
    cin >> S;
    //標準入力
    string ans = "yes";
    //出力用の文字列変数ansを定義
    for(int i = 0; i < S.length()-1; i++){
        for(int  j = i + 1; j < S.length(); j++){
        if(S[i] == S[j]){
                ans = "no"; 
            } 
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  char x;
  cin>>x;
  
  if(x=='A'){
    cout<<'T';
  }
  if(x=='T'){
    cout<<'A';
  }
  if(x=='G'){
    cout<<'C';
  }
  if(x=='C'){
    cout<<'G';
  }
}
  

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

int bubblesort(ivector &A){
	int n = A.size(), count=0;
	for (int i=0; i<n; i++)
		for (int j=n-1; j>i; j--)
			if (A[j] < A[j-1]){
				swap(A[j], A[j-1]);
				count++;
			} 
	return count;
}

int nums_out(ivector &A){
    int n=A.size();
    for (int i=0; i<n; i++){
        cout << A[i];
        if (i!= n-1) cout<<" ";
        else cout<<endl;
    }
    return 0;
}

int main(void){
	int n, count;
	cin>>n;
	ivector A(n);
	
	for (int i=0; i<n; i++)
		cin>>A[i];

	count = bubblesort(A);

	nums_out(A);
	cout << count << endl;
	return 0;
}

Measured memory_bytes: 1196
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
typedef unsigned long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)

class Solve
{
	public:

		string str;
		int n, ans;

		void input()
		{
			cin >> n;
		}

		void solve()
		{
			for(int i = 1; i <= n; i++)
			{
				str = to_string(i);
				if(((int)(str.length()) % 2) == 1)
				{
					ans++;
				}
			}
		}

		void output()
		{
			cout << ans << endl;
        }
};

Solve s;
int main()
{
    s.input();
	s.solve();
	s.output();
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
const ll INF = 1e9+100;
const ll MOD = 1e9+7;
const double EPS  = 1e-10;
const bool debug = 0;
//---------------------------//

int N, M;
vector<pii> g[1500], rg[1500];
int d[1500];
bool done[1500];

int dijkstra(int st) {
	priority_queue<pii, vector<pii>, greater<pii> > pq;
	
	fill(d, d + N, INF);
	
	pq.push(pii(0, st));
	d[st] = 0;
	while (!pq.empty()) {
		int c = pq.top().fi, u = pq.top().se;
		pq.pop();
		
		REP(i, g[u].size()) {
			int v = g[u][i].fi;
			int nc = c + g[u][i].se;
			if (chmin(d[v], nc)) pq.push(pii(nc, v));
		}
	}
	
	int res = 0;
	REP(i, N) chmax(res, d[i]);
	return res;
}

int main(){
	cin >> N >> M;
	REP(i, M) {
		int s, t, d;
		scanf("%d %d %d", &s, &t, &d);
		s--; t--;
		g[s].push_back(pii(t, d));
		g[t].push_back(pii(s, d));
	}
	
	int ma = 0;
	REP(i, N) chmax(ma, dijkstra(i));
	
	REP(st, N) {
		if (dijkstra(st) < ma) continue;
		
		REP(i, N) rg[i].clear();
		REP(i, N) {
			REP(j, g[i].size()) {
				int v = g[i][j].fi;
				if (d[i] + g[i][j].se == d[v]) rg[v].push_back(pii(i, g[i][j].se));
			}
		}
		
		queue<int> que;
		REP(i, N) if (d[i] == ma) que.push(i);
		
		while (!que.empty()) {
			int u = que.front(); que.pop();
			done[u] = true;
			
			REP(i, rg[u].size()) {
				int v = rg[u][i].fi;
				if (d[v] + rg[u][i].se == d[u]) que.push(v);
			}
		}
	}
	
	vector<int> ans;
	REP(i, N) if (!done[i]) ans.push_back(i + 1);
	
	cout << ans.size() << endl;
	REP(i, ans.size()) printf("%d\n", ans[i]);
	
	return 0;
}

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

using namespace std;

#define fcout(d) cout << fixed << setprecision(d)
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rep1(i,n) for(int (i) = 1; (i) <= (n); ++(i))
#define repU(i,bottom,ceiling) for(auto (i) = (bottom); (i) <= (ceiling); ++(i))
#define repD(i,ceiling,bottom) for(auto (i) = (ceiling); (i) >= (bottom); --(i))
#define repV(i,v) for(auto (i) = begin(v); (i) < end(v); ++(i))
#define all(v)  begin(v),end(v)
#define clr(v) fill(all(v),0)
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define fir first
#define sec second
#define divceil(n,d) ((n)/(d) + ((n)%(d) > 0))
#define parity(a,b) (((a) & 1LL)^((b) & 1LL)^1LL)

typedef long long ll;
typedef unsigned long long ull;
typedef double db;

const pair<int,int> DIR[] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int INF_32 = -1 + (1 << 30);
const ll INF_64 = -1 + (1LL << 62);
const int MOD = (int)1e9 + 7;

ull next_subset(ull subset){
	ull tem = subset + (subset & -subset);
	ull btm = (~tem & subset) / (subset & -subset) >> 1;
	return btm | tem;
}

int N;

void solve(){

	return;
}

void input(){
	
	cin>>N;
	int p,l = 1,pos[200001]; 
	rep(i,N){
		cin>>p;
		pos[--p] = i;
	}
	int i = 0;
	while(i < N){
		int j = i + 1;
		while(j < N && pos[j] > pos[j-1]) ++j;
		l = max(l,j - i);
		i = j;
	}
	cout<<N-l<<endl;
	
	return;
}

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





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

int main(){
  int N;
  cin>>N;
  vector<int> v(N);
  for(int i=0;i<N;i++){
    cin >> v.at(i);
  }
  sort(v.begin(),v.end());
  int s=0;
  for(int i=0;i<N-1;i++){
    s+=v.at(i);
  }
  if(v.at(N-1) < s){
    cout << "Yes" <<endl;
  }
  else cout<<"No"<<endl;
}

Measured memory_bytes: 256
//
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
//
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

// solution 
#[allow(unused_mut)]
#[allow(non_snake_case)]
fn main() {
    input!{
        N: usize,
        X: [usize; N],
    }
    let xx = X.clone();
    X.sort();
    let x_min = X[N/2 - 1];
    let x_max = X[N/2];

    for i in 0..N {
        if xx[i] > x_min {
            println!("{}", x_min);
        } else {
            println!("{}", x_max);
        }
    }
}


Measured memory_bytes: 10364
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
using namespace std;

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



const int BIG_NUM = 1e9;
const ll INF = 1000000000000000000;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;



ll md(pll a, pll b) {
	return abs(a.first - b.first) + abs(a.second - b.second);
}

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

	
	vector<ll> z(n);
	vector<ll> w(n);
	for (int i = 0; i < n; i++) {
		ll xi, yi;
		cin >> xi >> yi;

		ll zi = xi + yi;
		ll wi = xi - yi;
		z[i] = zi;
		w[i] = wi;
	}

	sort(z.begin(), z.end());
	sort(w.begin(), w.end());

	cout << max(z[n - 1] - z[0], w[n - 1] - w[0]) << endl;

	
}

Measured memory_bytes: 6400
using System;
//using System.Collections;
//using System.Collections.Generic;
using System.Linq;

namespace solution
{
  class Class1
  {
    static void Main()
    {
      string[] s = Console.ReadLine().Split();
      int n = int.Parse(s[0]);
      int m = int.Parse(s[1]);
      int[,] A = new int[n, m];
      int[] b = new int[m];

      for (int i = 0; i < n; i++)
      {
        int[] temp = Console.ReadLine().Split().Select(int.Parse).ToArray();
        for (int j = 0; j < m; j++)
        {
          A[i, j] = temp[j];
        }
      }

      for (int i = 0; i < m; i++)
      {
        b[i] = int.Parse(Console.ReadLine());
      }

      for (int i = 0; i < n; i++)
      {
        int sum = 0;
        for (int j = 0; j < m; j++)
        {
          sum += A[i, j] * b[j];
        }
        Console.WriteLine(sum);
      }
    }
  }
}


Measured memory_bytes: 9768
//raja1999
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 <<endl;prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx


using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

//std::ios::sync_with_stdio(false);
int main(){
	std::ios::sync_with_stdio(false);
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	if(c>b||d<a)
		cout<<0<<endl;
	else{
		if(c>=a&&d<=b)
			cout<<d-c<<endl;
		else if(c<=a&&d>=b)
			cout<<b-a<<endl;
		else if(c<=a&&d<=b)
			cout<<d-a<<endl;
		else 
			cout<<b-c<<endl;

	}
} 


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	string s;
	int c[26]={};
	cin >> s;
	for(int i=0;i<s.length();i++){
		c[s[i]-'a']++;
	}
	int i;
	for(i=0;i<26;i++){
		if(c[i]==0) break;
	}
	if(i==26) cout << "None" << endl;
	else cout << (char)('a'+i) << endl;
}


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

int A,B,C,X,Y,ans;

int main(void){
    cin >> A >> B >> C >> X >> Y;
    if(X<Y){swap(A,B);swap(X,Y);}
    
    if(A+B > 2*C)ans += 2*C*Y;
    else ans +=(A+B)*Y;
    X -=Y;Y=0;
    ans += min(2*C*X,A*X);    

    cout << ans << endl;
}


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


#define f(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define char_f(i,a) for(int i=(int)(a);(char)s[i]!='\0';i++)
#define rf(i,a,b) for(int i=(int)(a);i>=(int)(b);i--)
#define llf(i,a,b) for(long long int i=(long long int)(a);i<=(long long int)(b);i++)
#define llrf(i,a,b) for(long long int i=(long long int)(a);i>=(long long int)(b);i--)



#define ll long long
#define fi first
#define se second
#define pb push_back
#define pop pop_back
#define mem(ara) memset((ara),0,sizeof(ara))
#define memn(ara) memset((ara),-1,sizeof(ara))
#define bb begin()
#define ee end()
#define em emplace
#define eb emplace_back





#define si set<int>
#define sd set<double>
#define sll set<long long int>
#define ss set<string>
#define sc set<char>

#define pii pair<int,int>
#define pli pair<long long int,int>
#define pil pair<int,long long int>
#define pll pair<long long int,long long int>
#define pci pair<char,int>
#define pic pair<int,char>
#define pcl pair<char,long long int>
#define plc pair<long long int,char>

#define pss pair<string,string>
#define pcc pair<char,char>

#define pis pair<int,string>
#define psi pair<string,int>
#define pls pair<long long int,string>
#define psl pair<string,long long int>
#define pdd pair<double,double>
#define pcs pair<char,string>
#define psc pair<string,char>



#define vi  vector<int>
#define vll vector<long long int>
#define vd vector<double>
#define vs vector<string>
#define vc vector<char>
#define vii vector<pii>



#define mod 1000000007
#define mx (1<<30)-1
#define llmx (1ll<<62)
#define n_size 100005
#define g_size 10000005
double PI=acos(-1);



///unsigned int uMAX=4294967295;
///unsigned ll int ullMAX=18446744073709551615;





int arr[g_size];



int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int n,m,T,res;

	int maxi=-mx,mini=mx,count=0;

	int i,j,k;

	bool flag;

	string s1,s2;

	char s[100000];

	int ara[n_size],ara2[n_size];

	cin>>n>>k;

	cout<<(n*n)-k<<endl;



}


Measured memory_bytes: 256
N ,M ,Q = map(int, input().split())

Q_list = [[0 for i in range(4)] for j in range(Q)]
for i in range(Q):
    Q_list[i] = list(map(int, input().split()))


ans = 0
for i1 in range(1,M+1):
    for i2 in range(i1,M+1):
        for i3 in range(i2,M+1):
            for i4 in range(i3,M+1):
                for i5 in range(i4,M+1):
                    for i6 in range(i5,M+1):
                        for i7 in range(i6,M+1):
                            for i8 in range(i7,M+1):
                                for i9 in range(i8,M+1):
                                    for i10 in range(i9,M+1):
                                        tmp = 0
                                        A_list = [0,i1,i2,i3,i4,i5,i6,i7,i8,i9,i10]
                                        for a,b,c,d in Q_list:
                                            if A_list[b]-A_list[a]==c:
                                                tmp+=d
                                        ans = max(ans,tmp)
print(ans)


Measured memory_bytes: 9156
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<(n); i++)
vector<int> num(1000);
void divisor(int n){
  for(int i=2; i<=n; i++){
    int cnt = 0;
    while(n%i==0){
      cnt++;
      n /= i;
    }
    num[i] += cnt;
  }
  return;
}
int main() {
  int n;
  cin >> n;
  for(int i=1; i<=n; i++){
    divisor(i);
  }
  //cout << num[5] << endl;
  ll ans = 1;
  rep(i,1000) {
    if(num[i]>0) {
      ans *= num[i]+1;
      ans %= 1000000007;
      //cout << ans << endl;
    } 
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define ignore() cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n')
#define optimize() ios::sync_with_stdio(0); cin.tie(0);
#define endl "\n"
#define it {0}
int main()
{
    optimize();
    int n it, k it;
    cin>>n>>k;
    int fr[n];
    for(int i=0;i<n;i++){
        cin>>fr[i];
    }
    sort(fr, fr+n);
    int sum it;
    for(int i=0;i<k;i++){
        sum+=fr[i];
    }
    cout<<sum<<endl;
    return 0;
}


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

int main(){
    int64_t a;
    string b;
    cin >> a >> b;
    int p;
    int64_t o;
    if(b.find(".")>0){
        p = b.size()-b.find(".")-1;
        
        b.erase(b.find("."),1);
        o = stoi(b);
        
      }

    
    if(p==1){
            cout << a * o / 10 << endl;
    }
    else{
        if(p==2){
            cout << a * o / 100 << endl;
        }else
        {
            cout << a * o << endl;
        }
    }
        
}


Measured memory_bytes: 3616
import std.functional,
       std.algorithm,
       std.bigint,
       std.string,
       std.traits,
       std.array,
       std.range,
       std.stdio,
       std.conv;

bool isNumeric(char c) {
  return '0' <= c && c <= '9';
}

void main() {
  int[] AB = readln.chomp.split.to!(int[]);
  int A = AB[0],
      B = AB[1];
  string S = readln.chomp;

  foreach (i, c; S) {
    if (i == A) {
      if (!(c == '-')) {
        return writeln("No");
      }
    } else {
      if (!isNumeric(c)) {
        return writeln("No");
      }
    }
  }

  writeln("Yes");
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	static int N, X, M;
	static int[] L, R, S;
	static int[] ans;
	static int max = -1;

	public static void main(String[] args) {
		N = sc.nextInt();
		X = sc.nextInt();
		M = sc.nextInt();
		L = new int[M];
		R = new int[M];
		S = new int[M];
		for (int i = 0; i < M; ++i) {
			L[i] = sc.nextInt();
			R[i] = sc.nextInt();
			S[i] = sc.nextInt();
		}
		int[] c = new int[N];
		rec(0, c);
		if (max == -1) {
			System.out.println(-1);
		} else {
			System.out.print(ans[0]);
			for (int i = 1; i < N; ++i) {
				System.out.print(" " + ans[i]);
			}
			System.out.println();
		}
	}

	static void rec(int idx, int[] c) {
		if (idx == N) {
			int[] sum = new int[N + 1];
			for (int i = 1; i <= N; ++i) {
				sum[i] = sum[i - 1] + c[i-1];
			}
			if (sum[N] > max) {
				for (int i = 0; i < M; ++i) {
					if (sum[R[i]] - sum[L[i] - 1] != S[i]) {
						return;
					}
				}
				max = sum[N];
				ans = c.clone();
			}
			return;
		}
		for (int i = 0; i <= X; ++i) {
			c[idx] = i;
			rec(idx + 1, c);
		}
	}
}

Measured memory_bytes: 60484
#include <bits/stdc++.h>
using namespace std;
int main(){
  int s;
  int answer;
  answer = 1;
  cin >> s;
  while(true){
    if(s == 1 || s == 2 || s== 4) break;
    if(s % 2 == 0){
      s /= 2;
      answer++;
    }else{
      s = 3*s + 1;
      answer++;
    }
  }
  cout << answer + 3 << endl;
}


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

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

int K, S;
vector<int> vec;

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

	cin >> K >> S;
	rep(i, 0, K + 1)
	{
		vec.push_back(i);
	}

	sort(all(vec));

	int ans = 0;
	rep(i, 0, K + 1)rep(j, 0, K + 1)
	{
		if (binary_search(all(vec), S - (i+j)))
		{
			ans++;
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include<queue>
#include<math.h>
using namespace std;
#define mod (1000000000+7)
#define N (10007)
#define INF 1e16
typedef long long ll;
typedef pair<ll,ll> P;



int main(void){
    string A;
    cin>>A;
    ll n=A.length();
    ll ans=n*(n-1)/2;
    map<char,ll>a;
    for(int i=0;i<n;i++){
        a[A[i]]++;
    }
    ll num=0;
    for(char x='a';x<='z';++x){
        if(a[x]==0)continue;
        else{
            num+=a[x]*(a[x]-1)/2;
        }
    }
    cout<<ans-num+1<<endl;
    return 0;
}


Measured memory_bytes: 640
#include<cstdio>
#include<string>
#include<cstring>
#include<utility>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<algorithm>
#include<vector>
#include<iostream>
#define ll long long
#define pii pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define inf 0x7fffffff
using namespace std;
int main()
{
	int i,j,k,n,m,x,y,anx=-1,any=inf;
	scanf("%d%d",&n,&m);
	for(i=0;i<m;i++)
	{
		scanf("%d%d",&x,&y);
		anx=max(x,anx);
		any=min(any,y);
	}
	printf("%d",any-anx+1>0?any-anx+1:0);
	return 0;
}

Measured memory_bytes: 256
#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];
	}

	ll res = 0;
	for (int  i = 0; i < N; i++){
		while (a[i]%2 == 0){
			res++;
			a[i] /= 2;
		}
	}

	cout << res << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MOD = 1e9+7;

int dp[100000][4];

signed main(){

  string s; cin >> s;
  dp[0][0] = 1;
  for(int i = 0; i < s.size(); i++){
    //カウントする場合
    if(s[i] == 'A') dp[i+1][1] += dp[i][0];
    if(s[i] == 'B') dp[i+1][2] += dp[i][1];
    if(s[i] == 'C') dp[i+1][3] += dp[i][2];
    if(s[i] == '?'){
      dp[i+1][1] += dp[i][0];
      dp[i+1][2] += dp[i][1];
      dp[i+1][3] += dp[i][2];
    }
    //カウントしない場合(引継ぎ)
    for(int j = 0; j < 4; j++){
      if(s[i] == '?') (dp[i+1][j] += dp[i][j] * 3) %= MOD;
      else (dp[i+1][j] += dp[i][j]) %= MOD;
    }
  }

  cout << dp[s.size()][3] << endl;
  return 0;
}


Measured memory_bytes: 3584
while True:
    n = int(input())
    max = 0
    min = 1000
    sum = 0
    ave = 0
    if n == 0:
        break
    for i in range(n):
        s = int(input())
        sum += s
        if s < min:
            min = s
        if max < s:
            max = s
    ave = (sum - min - max) // (n - 2)
    print(ave)


Measured memory_bytes: 5588
n = int(input())
w = list(map(int,input().split()))
left = [0 for i in range(n)]
right = [0 for i in range(n)]
left[0] = w[0]
right[n-1] = w[n-1]
for i in range(1,n):
    left[i] += left[i-1] + w[i]
    right[n-1-i] += right[n-i] + w[n-1-i]
lis = [abs(left[i]-right[i+1]) for i in range(n-1)]
print(min(lis))

    

Measured memory_bytes: 3064
#include <iostream>
#include <cmath>

int main (){
  int x, a, b;
  char ans = 'A';
  std::cin >> x >> a >> b;
  a = std::abs(x - a) - std::abs(x-b);
  if(a > 0) ans = 'B';
  std::cout << ans << std::endl;
}


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

int main() {
  int K;
  cin >> K;
  vector<int> A{1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  cout << A.at(K-1) << endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python3

from collections import defaultdict
from heapq import heappush, heappop
import sys

sys.setrecursionlimit(10**6)
input = sys.stdin.buffer.readline
INF = 10 ** 9 + 1  # sys.maxsize # float("inf")


def debug(*x):
    print(*x)


def solve(N, K, heights):
    heights += [INF] * K
    costs = [INF] * (N + K)
    costs[0] = 0
    for i in range(N - 1):
        for k in range(1, K + 1):
            newcost = costs[i] + abs(heights[i + k] - heights[i])
            if newcost < costs[i + k]:
                costs[i + k] = newcost
    return costs[N - 1]


def solve2(N, K, heights):
    costs = [0] * N
    costs[0] = 0
    costs[1] = abs(heights[1] - heights[0])
    for i in range(1, N):
        costs[i] = min(
            costs[j] + abs(heights[i] - heights[j])
            for j in range(max(i - K, 0), i)
        )

    return costs[-1]


def solve3(N, heights):
    costs = [None] * N
    costs[0] = 0
    costs[1] = abs(heights[1] - heights[0])

    def get_cost(i):
        if costs[i] != None:
            return costs[i]

        c = min(
            get_cost(i - 2) + abs(heights[i] - heights[i - 2]),
            get_cost(i - 1) + abs(heights[i] - heights
                                  [i - 1]),
        )
        costs[i] = c
        return c

    return get_cost(N - 1)


def main():
    N, K = map(int, input().split())
    heights = list(map(int, input().split()))
    print(solve(N, K, heights))


def _test():
    """
    >>> solve(5, 3, [10, 30, 40, 50, 20])
    30
    >>> solve(3, 1, [10, 20, 10])
    20
    >>> solve(2, 100, [10, 10])
    0
    >>> solve(10, 4, [40, 10, 20, 70, 80, 10, 20, 70, 80, 60])
    40
    """
    import doctest
    doctest.testmod()


def as_input(s):
    "use in test, use given string as input file"
    import io
    global read, input
    f = io.StringIO(s.strip())
    input = f.readline
    read = f.read


USE_NUMBA = False
if (USE_NUMBA and sys.argv[-1] == 'ONLINE_JUDGE') or sys.argv[-1] == '-c':
    print("compiling")
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('solve', solve.__doc__.strip().split()[0])(solve)
    cc.compile()
    exit()
else:
    input = sys.stdin.buffer.readline
    read = sys.stdin.buffer.read

    if (USE_NUMBA and sys.argv[-1] != '-p') or sys.argv[-1] == "--numba":
        # -p: pure python mode
        # if not -p, import compiled module
        from my_module import solve  # pylint: disable=all
    elif sys.argv[-1] == "-t":
        _test()
        sys.exit()
    elif sys.argv[-1] != '-p' and len(sys.argv) == 2:
        # input given as file
        input_as_file = open(sys.argv[1])
        input = input_as_file.buffer.readline
        read = input_as_file.buffer.read

    main()


Measured memory_bytes: 85704
import math

def dist(p1, p2):
    return math.sqrt((p1[0] - p2[0])**2 + (p1[1] - p2[1])**2)

def intersection(o1,o2):
    if dist(o1,o2) > 2:
        p1, p2 =  [None, None], [None, None]
    elif dist(o1,o2) == 2:
        p1, p2 =  [(o1[0] + o2[0])/2, (o1[1] + o2[1])/2], [None, None]
    else:
        m = [(o1[0] + o2[0])/2, (o1[1] + o2[1])/2]
        v = [m[0] - o1[0], m[1] - o1[1]]
        v_abs = dist(v,[0,0])
        w = [v[1], -v[0]]
        w_abs = dist(w,[0,0])
        n = [w[0]/w_abs, w[1]/w_abs]
        l = math.sqrt(1 - v_abs**2)
        p1 = [m[0] + l*n[0], m[1] + l*n[1]]
        p2 = [m[0] - l*n[0], m[1] - l*n[1]]
    return p1, p2
err = 1.0e-6
while True:
    n = int(input())
    if n == 0:
        break
    p = []
    for i in range(n):
        p.append(list(map(float, input().split(","))))
    ans = 1
    for i in range(n - 1):
        for j in range(i + 1, n):
            p1, p2 = intersection(p[i], p[j])
            cnt1 = 0
            cnt2 = 0
            for k in range(n):
                if p1[0] and dist(p1, p[k]) <= 1 + err:
                    cnt1 += 1
                if p2[0] and dist(p2, p[k]) <= 1 + err:
                    cnt2 += 1
            ans = max([ans, cnt1, cnt2])
    print(ans)



Measured memory_bytes: 5704
"use strict";
main(require("fs").readFileSync("/dev/stdin", "UTF-8"));

function main(arg) {
    arg=arg.split("\n")[0].split("")
    let n = arg.length;
    let ijougen = Math.floor(n/2);
    let kekka = 0;
    let honbun = arg;
    for(let i=0;i<ijougen;i++){
    	if(honbun[i]!=honbun[n-i-1])
        {kekka += 1;
        }
    }
    console.log(kekka);
}



Measured memory_bytes: 21064
#include <stdio.h>

int main(void){

  int n,k,q,i,j;
  scanf("%d %d %d",&n,&k,&q );
  int s[n];
  int c;

  for(i=0;i<n;i++){
    s[i]=k;
  }
  for(i=0;i<q;i++){
    scanf("%d", &c);
    s[c-1]++;
    
  }

  for(i=0;i<n;i++){
    s[i]-= q;
    if(s[i]>0){
      printf("Yes\n");
    }else{
      printf("No\n" );
    }
  }

  return 0;
}


Measured memory_bytes: 896