akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,n) for(int i=0;i<n;i++)
#define why(n,x) int n;while(cin >>n,n!=x)
#define iFOR(i,x,n)for(int i=x;i<n;i++)
#define unless(flg) if ( !(flg) )
#define read cin<<
#define echo cout<<
#define fin <<'\n'
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
#define SWAP(a,b) ((a != b) && (a += b,b = a - b,a -= b))
#define cinf(n,x) for(int UNCH=0;UNCH<(n);UNCH++) cin >> x[UNCH];
#define fcin(n,x) for(int UNCH=1;UNCH<=(n);UNCH++) cin>> x[UNCH];
#define memmin(x) memset((x),-1,sizeof((x)))
#define memzer(x) memset((x), 0,sizeof((x)))
#define meminf(x) memset((x),0x3f,sizeof((x)))
//#define int long long
typedef long long ll;
typedef pair < int , int >  pii;
typedef vector < int > vit;
typedef map < string , int > mstit;
typedef vector < pii > vpi ;
typedef greater < pii > gpi;
typedef priority_queue < pii , vpi , gpi > dijk ;
static const signed int INF = 0x3f3f3f3f;
static const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static const signed int SMOD = 1000000007;
static const signed int NMOD = 1000000009;
static const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static const signed int dy[]={0,-1,0,1,-1,1,-1,1};

bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>T abs(T &x){return x<0 ? -x : x;}
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}


inline void solve(){
  int n,a,cnt = 0;
  bool zero = false;
  ll sum = 0, mini = INF;
  cin >> n;
  FOR(i,n){
    cin >> a;
    sum += abs(a);
    chmin(mini,(ll)abs(a));
    if( !a )
      zero = true;
    if(a < 0)
      cnt++;
  }
  if(cnt%2==0 || zero)
    mini = 0;
  cout << sum - 2*mini fin;
  
}
struct xyz{ xyz(){ cin.tie(0), ios::sync_with_stdio(false); cout <<fixed<<setprecision(12);};}xyzzy;signed main(){solve();return 0;}


Measured memory_bytes: 256
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 18
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 998244353


class UnionFind:
    def __init__(self, n):
        # 負  : 根であることを示す。絶対値はランクを示す
        # 非負: 根でないことを示す。値は親を示す
        self.table = [-1] * n
        self.size = [1] * n
        self.group_num = n

    def root(self, x):
        if self.table[x] < 0:
            return x
        else:
            self.table[x] = self.root(self.table[x])
            return self.table[x]

    def is_same(self, x, y):
        return self.root(x) == self.root(y)

    def get_size(self, x):
        r = self.root(x)
        return self.size[r]

    def union(self, x, y):
        r1 = self.root(x)
        r2 = self.root(y)
        if r1 == r2:
            return
        # ランクの取得
        d1 = self.table[r1]
        d2 = self.table[r2]
        if d1 <= d2:
            self.table[r2] = r1
            self.size[r1] += self.size[r2]
            if d1 == d2:
                self.table[r1] -= 1
        else:
            self.table[r1] = r2
            self.size[r2] += self.size[r1]
        self.group_num -= 1



n = I()
A = LI()
B = LI()
a_sort_index = sorted(range(n), key=lambda x:A[x])
b_sort_index = sorted(range(n), key=lambda x: B[x])
flag = 0
U = UnionFind(n)
for i in range(n):
    if A[a_sort_index[i]] > B[b_sort_index[i]]:
        print('No')
        break
    elif i != 0 and A[a_sort_index[i]] <= B[b_sort_index[i - 1]]:
        flag = 1
    U.union(a_sort_index[i], b_sort_index[i])
else:
    if U.group_num == 1 and not flag:
        print('No')
    else:
        print('Yes')







Measured memory_bytes: 86472
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

void solve(int n, int x) {
    int cnt = 0;
    for (int i = 1; i < n + 1; ++i) {
        for (int j = i + 1; j < n + 1; ++j) {
            for (int k = j + 1; k < n + 1; ++k) {
                if (i + j + k == x) ++cnt;
            }
        }
    }
    cout << cnt << endl;
    return;
}

int main() {
    while (true) {
        int n, x;
        cin >> n >> x;
        if (n == 0 && x == 0) break;
        solve(n, x);
    }
    return 0;
}



Measured memory_bytes: 3084
#include<bitset>
#include<map>
#include<utility>
#include<iostream>
#include<stdlib.h>
#include<stdio.h>
using namespace std;
int main(){
  int n,q,m,a[25],i,j,ans[2010];
  scanf("%d\n",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<2005;i++){
    ans[i]=0;
  }
  scanf("\n%d\n",&q);
    for(int tmp=0;tmp<(1<<20);tmp++){
      bitset<20> s(tmp);
      int sum=0;
      for(j=0;j<n;j++){
        if(s[j]==1){
          sum=sum+a[j];
        }
      }
      if(sum<=2000){
        ans[sum]=1;
      }
    }
  for(i=0;i<q;i++){
    scanf("%d",&m);
    if(ans[m]==1){
      printf("yes\n");
    }
    else{
      printf("no\n");
    }
  }
  return 0;
}


Measured memory_bytes: 3140
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
#define vector2(a,b,c) vector<vector<int>> a(b/*縦！w*/,vector<int>(c/*横！w*/))
#define INF 1e10
#define MOD 1e9+7
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;
struct edge{int from,to,cost;};
signed main(){
  int a;
  cin>>a;
  vector<int> b(a);
  rep(i,a)
    cin>>b[i];
  vector<int> c(200010,0);
  rep(i,a){
  c[b[i]-1]++;
  }
  int d=0;
  rep(i,200010){
  d+=c[i]*(c[i]-1)/2;
  }
  rep(i,a){
    cout<<d-c[b[i]-1]+1<<endl;
  }
    
}


Measured memory_bytes: 5760
import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
	    String S = sc.nextLine();
		int flagA = 0;
		int flagC = 0;
		int flag = 1;
		for(int i = 0; i < S.length(); i++) {
			//System.out.println("test");
			if(S.charAt(i) == 'A' && i == 0) {
				flagA = 1;
				continue;
			}
			if(i >= 2 && i <= S.length() - 2 && S.charAt(i) == 'C') {
				if(flagC == 0) {
					flagC = 1;
					continue;
				} else {
					flagC = -1;
					continue;
				}
			}
			if(Character.isUpperCase(S.charAt(i))) {
				flag = -1;
			}
		}
		if(flagA == 1 && flagC == 1 && flag == 1) {
			System.out.println("AC");
		} else {
			System.out.println("WA");
		}
	}
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string alp = "abcdefghijklmnopqrstuvwxyz";
vi d1 = {1, 0, -1, 0}, d2 = {0, 1, 0, -1};
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}
void neg() {cout << -1 << endl;}

int main() {
  double n;
  cin >> n;
  cout << floor(n / 3) << endl;
}

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

using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<(int)(n);i++)

int main(){
    ll n;
    cin>>n;
    ll a[200005]={};
    REP(i,n)cin>>a[i];
    ll map[200005]={};
    REP(i,n){
        map[a[i]]++;
    }
    ll sum=0;
    REP(i,n+1){
        sum += map[i]*(map[i]-1)/2;
    }
    //cout<<sum<<endl;
    REP(i,n){
        //cout<<i<<": "<<map[a[i]]*(map[a[i]]-1)/2<<" "<< (map[a[i]]-1)*(map[a[i]]-2)/2<<endl;
        ll ans = sum - map[a[i]]*(map[a[i]]-1)/2;
        ans += (map[a[i]]-1)*(map[a[i]]-2)/2;
        cout << ans <<endl;
    }
    return 0;
}

Measured memory_bytes: 5760
import java.util.*;class Main{public static void main(String[]z){String r;int n,v,i;for(Scanner s=new Scanner(System.in);s.hasNext();System.out.println(r)){char[]c=s.next().toCharArray(),k={46,63,33,32};r="";if((n=c.length)%2>0)r="NA";else for(i=0;i<n;r+=v<26?(char)(97+v):k[v-26])if((v=c[i++]*5+c[i]-294)<0||29<v||c[i]<49||c[i++]>53){r="NA";break;}}}}

Measured memory_bytes: 12000
#include<bits/stdc++.h>
#include<string.h>
#include<vector>
using namespace std;
#define MAX 200005
#define MOD 1000000007
#define EPS 0.00000000001
#define INF 1000000000
int a[MAX];
int main()
{
    int n,i,j,X=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
        X=X^a[i];
    }
    for(i=0;i<n;i++)
    {
        j=a[i];
        j=j^X;
        printf("%d ",j);
    }
    return 0;
}


Measured memory_bytes: 4392
#define MAXSIZE 1000

#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;

char init_str[MAXSIZE]={};


int main()
{
	char str[MAXSIZE];
	int sum;

	while(1){
		strcpy(str,init_str);
		scanf("%s",&str);
		if((int)(str[0]-'0')!=0){
			sum=0;
			for(int i=0;(i<MAXSIZE&&(str[i]!='\0'));i++){
				sum += (int)(str[i]-'0');
			}
			cout << sum << endl;
		}
		else break;
	}
	return 0;
}



Measured memory_bytes: 3148
#include <iostream>
using namespace std;
int main()
{
    int N,J=0;//J为奇数的个数
    cin>>N;
    float P;//概率
    for(int i=1;i<=N;i++){
            if(i%2!=0) J++;
    }
    P=(float)J/N;
    cout<<P<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

#define MOD 1000000007

int main()
{
    long long n,k,a[2000],i,j;
    long long buf[2000][2] = {0},ans;

    scanf("%lld %lld",&n,&k);
    for (long long i = 0; i < n; i++)
    {
        scanf("%lld",&a[i]);
    }
    for (long long i = 0; i < n; i++)
    {
        for (long long j = 0; j < n; j++)
        {
            if(a[i] > a[j])
            {
                buf[i][0]++;
                if(i < j)buf[i][1]++;
            }
        }
    }
    
    long long r = (k * (k - 1) / 2) % MOD;
    ans = 0;
    for (long long i = 0; i < n; i++)
    {
        ans += (buf[i][0] * r + buf[i][1] * k) % MOD;
        ans %= MOD;
    }

    printf("%lld",ans);
}

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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;

#define INF (1LL << 60)
#define MOD 1000000007LL
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ASC(x) sort(ALL((x)))
#define DESC(x) sort(ALL((x)),greater<ll>())
#define pb push_back


ll modpow(ll a, ll n, ll m)
{
    if(n == 0) return 1;
    ll t = modpow(a, n >> 1, m);
    t = t * t % m;
    if(n & 1) t = t * a % m;
    return t; 
}

int main()
{
    ll n, a, b;
    cin >> n >> a >> b;

    vec inv(200010, 0);
    inv[1] = 1;
    REP(i,2,200010) inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;

    ll nCa = 1, nCb = 1, c;
    REP(i,1,a+1) nCa = (nCa * (n-i+1) % MOD) * inv[i] % MOD;
    REP(i,1,b+1) nCb = (nCb * (n-i+1) % MOD) * inv[i] % MOD;
    c = ((modpow(2, n, MOD) - 1 - nCa - nCb) % MOD + MOD) % MOD;
    PR(c); 

    return 0;
}

/*

nC1 + ... + nCn - nCa - nCb
= 2^n - 1 - nCa - nCb

*/

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define mod 1000000007
#define inf 1e18+42
#define pi 3.1415926535897932384626433832795028841971693993751058

#define endl "\n"

#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define fori(it,A) for(auto it=A.begin();it!=A.end();it++)

#define ft first
#define sd second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define zero(x) memset(x,0,sizeof(x));
 
using namespace std;

int binpow(int a, int b) {
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

//START OF CODE ->->->->->->->

void solve()
{
    int a,b;
    cin>>a>>b;

    cout<<max(a*b,max(a+b,a-b))<<endl;
}

//END OF CODE ->->->->->->->->

signed main()
{
    fast;
    int t = 1;
    // cin>>t;

    while(t--)
    {
        solve();
    }
    return 0;
}



Measured memory_bytes: 256
N = int(input())
A = sorted(list(map(int,input().split())))
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
array = []
if N == 1:
    print(A[0])
else:
    t = gcd(A[0],A[1])
    if N ==2:
        print(t)
    else:
        for i in range(2,N):
            t = gcd(t,A[i])
        print(t)

            

Measured memory_bytes: 14224
#include <algorithm>
#include <bitset>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <tuple>
#include <vector>

using namespace std;

#define rep(i, n) for (int64_t i = 0; i < (n); i++)
#define irep(i, n) for (int64_t i = 0; i <= (n); i++)
#define rrep(i, n) for (int64_t i = (n)-1; i >= 0; i--)
#define rirep(i, n) for (int64_t i = n; i >= 0; i--)

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

  vector<int64_t> a(N);
  rep(i, N) { cin >> a[i]; }
  sort(a.begin(), a.end());

  vector<int64_t> acc(a);
  rep(i, N - 1) { acc[i + 1] += acc[i]; }

  vector<int> b(N);
  rrep(i, N) {
    b[i] = i;
    b[i] = b[upper_bound(a.begin(), a.end(), 2 * acc[i]) - a.begin() - 1];
  }

  int result = 0;
  rep(i, N) { result += (b[i] == N - 1 ? 1 : 0); }
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 2176
#include "bits/stdc++.h"
#define ed cout<<"\n";
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define All(obj) (obj).begin(),(obj).end()

using namespace std;


int main() {
	speed;
	string s;
	cin >> s;
	int n = s.size();
	int ans = 1000;
	rep(i, n - 2) {
		int num = (s[i] - '0') * 100 + (s[i+1] - '0') * 10 + (s[i+2] - '0');
		ans = min(ans, abs(num - 753));
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 256
/**
 *    author:  Mohamad Milhem
 *    created: 2020-02-28-10.32.55
**/

#include <bits/stdc++.h>
#include <stdio.h>

using namespace std;
typedef long long ll;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back
#define lp(i,s,f) for(ll i = s; i < ll(f); i++)
#define inF freopen("input.in", "r", stdin);
#define outF freopen("output.in", "w", stdout);
#define MOD ll(1000000007)
#define debug(x) cout << '[' << #x << " is: " << x << "] " <<endl;
#define decimalpoint cout << std::fixed << setprecision(5)


int main(){

    FAST;

    long long n,k;
    cin >> k >> n;

    if (k >= 10){cout << n << endl;return 0;}

    else {
        cout << n + 100 * (10 - k) <<endl;
    }


    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc = new Scanner(System.in);
        String array[][] = new String[3][3];
        
        for(int i = 0; i < 3; i++) {
            array[i] = sc.next().split("");
        }
        
        for(int i = 0; i < 3; i++) {
            System.out.print(array[i][i]);
        }
        
    }
}


Measured memory_bytes: 35520
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define var auto
using namespace std;
using ll = long long;
using P = pair<int, int>;
// sort(A.begin(), A.end(), cmp)
bool cmp(P a, P b) { return a.second < b.second; }
#ifdef DEBUG
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; cout << a << endl; return 1; } cout << a << endl; return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; cout << a << endl; return 1; } cout << a << endl; return 0; }
#else
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
#endif
const ll INF = 1LL << 60;
const int MAX_ITEM = 10e4+10; // 10^5
ll dp[MAX_ITEM] = {0};

int main() {
  int a,b,c; cin >> a >> b >> c;
  if (a == b && b == c) {
    cout << "No" << endl;
    return 0;
  }
  if (a == b) {
    cout << "Yes" << endl;
    return 0;
  }
  if (a == c) {
    cout << "Yes" << endl;
    return 0;
  }
  if (b == c) {
    cout << "Yes" << endl;
    return 0;
  }
  
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
   string str_m,command,str_1,str_2;
   int a,b,q;
   cin >> str_m >> q;

   for(int i=0;i<q;i++){
	cin >> command >> a >> b;
	if(command == "replace"){
		cin >> str_1;
		str_m = str_m.replace(a,b-a+1,str_1);
	}

	if(command == "print"){
		cout << str_m.substr(a,b-a+1) << endl;
	}

	if(command == "reverse"){
			str_1 = str_m.substr(a,b-a+1);
			str_2 = str_1;
			for(int j=0;j<str_1.size();j++){
				str_2[j] = str_1[b-a-j];
			}
			str_m = str_m.replace(a,b-a+1,str_2);
	}

   }

   return 0;
}

Measured memory_bytes: 1228
#include <cstring>
#include <cstdio>
using namespace std;
typedef long long ll;
const int maxn=5010,mod=1e9+7;
template <typename Tp> inline int getmin(Tp &x,Tp y){return y<x?x=y,1:0;}
template <typename Tp> inline int getmax(Tp &x,Tp y){return y>x?x=y,1:0;}
template <typename Tp> inline void read(Tp &x)
{
    x=0;int f=0;char ch=getchar();
    while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
    if(ch=='-') f=1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    if(f) x=-x;
}
struct data{int v,nxt;}edge[maxn<<1];
int n,p,head[maxn],sz[maxn],t[maxn],f[maxn][maxn],g[maxn];
inline int pls(int x,int y){return x+y>=mod?x+y-mod:x+y;}
inline int dec(int x,int y){return x-y<0?x-y+mod:x-y;}
inline void insert(int u,int v)
{
	edge[++p]=(data){v,head[u]};head[u]=p;
	edge[++p]=(data){u,head[v]};head[v]=p;
}
void input()
{
	int u,v;
	read(n);g[0]=1;
	for(int i=1;i<n;i++)
	{
		read(u);read(v);
		insert(u,v);
	}
	for(int i=2;i<=n;i+=2) g[i]=(ll)g[i-2]*(i-1)%mod;
}
void dp(int x,int pre)
{
	int v,tot;f[x][sz[x]=1]=1;
	for(int i=head[x];i;i=edge[i].nxt)
	  if(edge[i].v^pre)
	  {
	  	v=edge[i].v;dp(v,x);tot=sz[x]+sz[v];
	  	for(int j=1;j<=tot;j++) t[j]=0;
	  	for(int j=1;j<=sz[x];j++)
	  	  for(int k=0;k<=sz[v];k++)
	  	    t[j+k]=pls(t[j+k],(ll)f[x][j]*f[v][k]%mod);
	  	for(int j=1;j<=tot;j++) f[x][j]=t[j];
	  	sz[x]+=sz[v];
	  }
	for(int i=1;i<=sz[x];i++) f[x][0]=dec(f[x][0],(ll)f[x][i]*g[i]%mod);
}
int main()
{
	input();
	dp(1,1);
	printf("%d\n",dec(0,f[1][0]));
	return 0;
}

Measured memory_bytes: 97152
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Contest
{
    class Scanner
    {
        private string[] line = new string[0];
        private int index = 0;
        public string Next()
        {
            if (line.Length <= index)
            {
                line = Console.ReadLine().Split(' ');
                index = 0;
            }
            var res = line[index];
            index++;
            return res;
        }
        public int NextInt()
        {
            return int.Parse(Next());
        }
        public long NextLong()
        {
            return long.Parse(Next());
        }
        public string[] Array()
        {
            line = Console.ReadLine().Split(' ');
            index = line.Length;
            return line;
        }
        public int[] IntArray()
        {
            var array = Array();
            var result = new int[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                result[i] = int.Parse(array[i]);
            }

            return result;
        }
        public long[] LongArray()
        {
            var array = Array();
            var result = new long[array.Length];
            for (int i = 0; i < array.Length; i++)
            {
                result[i] = long.Parse(array[i]);
            }

            return result;
        }
    }

    class Program
    {
        private int N, K;

        private void Scan()
        {
            var sc = new Scanner();
            N = sc.NextInt();
            K = sc.NextInt();
        }

        public void Solve()
        {
            Scan();
            long ans = 0;
            for (int b = K + 1; b <= N; b++)
            {
                int n = N / b;
                int plus = 0;
                plus += n * (b - K);
                if (N % b != 0)
                {
                    if (K == 0)
                    {
                        plus += N % b;
                    }
                    else
                    {
                        plus += Math.Max(N % b - K + 1, 0);
                    }
                }

                //Console.WriteLine($"{b} {plus}");
                ans += plus;
            }
            Console.WriteLine(ans);
        }

        static void Main() => new Program().Solve();
    }
}

Measured memory_bytes: 13268
N_M_C = [int(x.strip()) for x in input().split()]
B = [int(x.strip()) for x in input().split()]
A = []
for i in range(0, N_M_C [0]):
    A.append([int(x.strip()) for x in input().split()])
count = 0
for row_A in A:
    result = 0
    for i in range(0, len(B)):
        result += row_A[i]*B[i]
    if result > - N_M_C[2]:
        count += 1
print(count)

Measured memory_bytes: 3064
use proconio::{
   fastout, input,
   marker::{Bytes, Chars, Isize1, Usize1},
};

fn main() {
   input! {
      x:usize,y:usize
   }
   if y >= 2 * x && (y - 2 * x) % 2 == 0 {
      let b = (y - 2 * x) / 2;
      if x >= b {
         println!("Yes");
      } else {
         println!("No");
      }
   } else {
      println!("No");
   }
}


Measured memory_bytes: 2120
#include <iostream>
#include <string>

int main()
{
    std::string deck;
    int times;
    int num;

    while(1)
    {
        std::cin >> deck;

        if (deck == "-") break;

        std::cin >> times;

        for (int t = 0; t < times; t++)
        {
            std::cin >> num;

            deck.append(deck.substr(0, num));
            deck.erase(0, num);
        }

        std::cout << deck << std::endl;
    }
}


Measured memory_bytes: 3156
def resolve():
    '''
    code here
    '''
    import math
    N, K = [int(item) for item in input().split()]
    As = [int(item) for item in input().split()]

    gcd = As[0]
    for item in As[1:]:
        gcd = math.gcd(gcd, item)

        
    res = 'IMPOSSIBLE'
    max_A = max(As)
    if max_A > K:
        if K % gcd == 0:
            res = 'POSSIBLE'
    elif K in set(As):
        res = 'POSSIBLE'
    
    print(res)


if __name__ == "__main__":
    resolve()


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

bool is_valid(const string & S, const string & T, int i){
    int nT = T.size();
    for (int j = 0; j < T.size(); ++j){
        if (S[i - j] != T[nT - j - 1] and S[i - j] != '?'){
            return false;
        }
    }
    return true;
}

string restore(const string & S, const string & T, int i){
    string R = S;
    int nT = T.size();
    for (int j = 0; j < T.size(); ++j){
        R[i - j] = T[nT - j - 1];
    }
    for (int i = 0; i < R.size(); ++i){
        if (R[i] == '?') R[i] = 'a';
    }
    return R;
}

string solve(const string & S, const string & T){
    if (S.size() < T.size()){
        return string("UNRESTORABLE");
    }
    for (int i = S.size() - 1; i >= 0; --i){
        if (is_valid(S, T, i)){
            return restore(S, T, i);
        }
    }
    return string("UNRESTORABLE");
}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string S, T;
    cin >> S >> T;
    cout << solve(S, T) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
using namespace std;
typedef long long ll;
const int maxn=100010,mod=1e9+7;
template <typename Tp> inline int getmin(Tp &x,Tp y){return y<x?x=y,1:0;}
template <typename Tp> inline int getmax(Tp &x,Tp y){return y>x?x=y,1:0;}
template <typename Tp> inline void read(Tp &x)
{
    x=0;int f=0;char ch=getchar();
    while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
    if(ch=='-') f=1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    if(f) x=-x;
}
int n,ans=1,cnt[26];
char s[maxn];
int main()
{
	read(n);
	scanf("%s",s+1);
	for(int i=1;i<=n;i++) ++cnt[s[i]-'a'];
	for(int i=0;i<26;i++) ans=(ll)ans*(cnt[i]+1)%mod;
	if(ans==0) ans=mod-1;
	else --ans;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
const double pi = 3.141592653589793238462643383279;
 
 
using namespace std;
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
 
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
 
//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007
 
 
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
 
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const double EPS = 1E-11;
 
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)

//ここから編集

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

  string s; cin >> s;
  cout << s.substr(0, 3) << endl;
  return 0;
}

Measured memory_bytes: 3644
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s = sc.next();

		if (s.equals("A")) {
			System.out.println("T");
		} else if (s.equals("C")) {
			System.out.println("G");
		} else if (s.equals("G")) {
			System.out.println("C");
		} else {
			System.out.println("A");
		}

		sc.close();

	}
}

Measured memory_bytes: 35528
import java.lang.Long.max
import java.util.*

//

fun main() {
    abc085d()
}

fun abc085d() {
    val (ns, hs) = readLine()!!.split(" ")
    val n = ns.toInt()
    var h = hs.toLong()
    var aMax = 0L
    val thr = mutableListOf<Long>()
    repeat(n) {
        val (a, b) = readLine()!!.split(" ").map { it.toLong() }
        aMax = max(aMax, a)
        thr.add(b)
    }
    var count = 0L
    val sorted = thr.sortedDescending()
    var i = 0
    while (h > 0L) {
        val k = if (i < n) sorted[i] else 0L
        if (k > aMax) {
            h -= k
            i++
            count++
        } else {
            val r = h / aMax
            h -= aMax * r
            count += r
            if (h > 0L) {
                h -= aMax
                count++
            }
        }
    }
    println(count)
}

Measured memory_bytes: 65392
s=input()
d=[[0]*(len(s)+1)for i in range(4)]
d[3][-1]+=1
e="ABC"
for i in range(len(s)-1,-1,-1):
    for j in range(3,-1,-1):
        if j==3:
            if s[i]=="?":
                d[3][i]=(d[3][i+1]*3)%(10**9+7)
            else:
                d[3][i]=d[3][i+1]%(10**9+7)
        else:
            if s[i]=="?":
                d[j][i]=(3*d[j][i+1]+d[j+1][i+1])%(10**9+7)
            else:
                d[j][i]=d[j][i+1]
                if e[j]==s[i]:
                    d[j][i]=(d[j][i]+d[j+1][i])%(10**9+7)
print(d[0][0]%(10**9+7))

Measured memory_bytes: 19004
#include <bits/stdc++.h>
using namespace std;
int main() {
  int A, B, C;
  cin >> A >> B >> C;
  if(A == B) {
    cout << C << endl;
  }
  if(B == C) {
    cout << A << endl;
  }
  if(C == A) {
    cout << B << endl;
  }
}


Measured memory_bytes: 3640
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;
import java.util.Scanner;
public class Main {
	static PrintWriter out = new PrintWriter(System.out);
	static Scanner stdIn = new Scanner(System.in);
	static FastScanner sc = new FastScanner();

	
	public static void main(String[] args) {
		while(true) {
			int n = sc.nextInt();
			if(n == 0) break;
			int max = 0;
			int min = Integer.MAX_VALUE;
			for(int i = 0; i < n; i++) {
				int sum = 0;
				for(int j = 0; j < 5; j++) {
					sum += sc.nextInt();
				}
				if(max < sum) max = sum;
				if(min > sum) min = sum;
			}
			out.println(max + " " + min);
		}
		out.flush();
		
		
	}

}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    public boolean hasNext() { skipUnprintable(); return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
     
    public int nextInt() {
        return (int)nextLong();
    }
     
    public double nextDouble() {
        return Double.parseDouble(next());
    }
     
 
}

Measured memory_bytes: 20516
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する
const int MOD=1000000007;
const int MAX = 1000000;
long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    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;
    }
}

// 二項係数計算
long long 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;
}
int main(){
    int n,k;
    cin>>n>>k;
    //COMinit();
    int64_t sum=0;
    vector<int64_t> l(n+2),r(n+2);
    l[1]=0,r[1]=n;
    for(int i=2;i<=n+1;i++){
        l[i] = l[i-1] + i-1;
        r[i] = r[i-1] + (n-(i-1));
    }
    /*
    for(int i=1;i<=n+1;i++){
        cout<<l[i]<<" "<<r[i]<<endl;
    }
    */
    for(int i=k;i<=n+1;i++){
        sum = (sum + (r[i]-l[i])+1)%MOD;
    }
    cout<<sum<<endl;
}

Measured memory_bytes: 6268
def calcCh(cx, cy, x, y, h):
    return abs(x-cx)+abs(y-cy)+h
def calcH(cx, cy, ch, x, y, h):
    return max(ch - calcCh(cx, cy, x, y, 0), 0)
n = int(input())
xyh = [list(map(int, input().split())) for i in range(n)]
xyh = sorted(xyh, key = lambda x: x[2])[::-1]
lst = [[x, y] for x in range(101) for y in range(101)]
for Cx, Cy in lst:
    Ch = calcCh(Cx, Cy, *xyh[0])
    if all(xyh[i][2] == calcH(Cx, Cy, Ch, *xyh[i]) for i in range(n)):
        break
print(Cx, Cy, Ch)

Measured memory_bytes: 4084
#include <algorithm>
#include <cstdio>
#include <cstring>

const int P = 1e9 + 7;
int pw(int x, int y) {
	int r = 1;
	for (; y; y >>= 1, x = 1ll * x * x % P)
		if (y & 1) r = 1ll * r * x % P;
	return r;
}

int n, a, b, ans, x, y;
int main() {
	scanf("%d%d%d", &n, &a, &b);
	ans = (pw(2, n) + P - 1) % P;
	x = y = 1;
	for (int i = 0; i < a; i++) x = 1ll * x * (n - i) % P, y = y * (i + 1ll) % P;
	ans = (ans + P - 1ll * x * pw(y, P - 2) % P) % P;
	x = y = 1;
	for (int i = 0; i < b; i++) x = 1ll * x * (n - i) % P, y = y * (i + 1ll) % P;
	ans = (ans + P - 1ll * x * pw(y, P - 2) % P) % P;
	printf("%d\n", ans);
}

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

using namespace std;

typedef long long ll;


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

    int x, y, z; cin>> x >> y >> z;
    int dist = x / z; if(x % z)dist += 1;
    if(dist <= y){
        cout << "Yes"<<'\n';
    }else cout <<"No"<<'\n';








}


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

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

    stack<char> st;
    int ans = 0;
    for (int i = 0; i < s.length(); i++){
        if ((int) st.size() == 0)
            st.push(s[i]);
        else{
            if (st.top() == '0' && s[i] == '1'){
                ans += 2;
                st.pop();
            }
            else if (st.top() == '1' && s[i] == '0'){
                ans += 2;
                st.pop();
            }
            else{
                st.push(s[i]);
            }
        }
    }

    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 512
import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class Main {

	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);

	static boolean solve() {
		int n = in.nextInt();
		if (n == 0) return false;

		int[][] a = new int[n+1][n+1];
		for (int i=0; i<n; i++) {
			int sum = 0;
			for (int j=0; j<n; j++) {
				a[i][j] = in.nextInt();
				sum += a[i][j];
			}
			a[i][n] = sum;
		}

		int s = 0;

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

		a[n][n] = s;

		for (int i=0; i<=n; i++) {
			for (int j=0; j<=n; j++) {
				out.printf("%5d",a[i][j]);
			}
			out.println();
		}

		return true;
	}

	public static void main(String[] args) {
		long start = System.currentTimeMillis();

		while(solve());
		out.flush();

		long end = System.currentTimeMillis();
		//trace(end-start + "ms");
		in.close();
		out.close();
	}

	static void trace(Object... o) { System.out.println(Arrays.deepToString(o));}
}

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

long long mpow(long long x, long long y, long long mod){
  if(y==0) return 1;
  long long ret = mpow(x,y/2,mod);
  ret *= ret;
  ret %= mod;
  if(y%2==1) ret *= x;
  ret %= mod;
  return ret;
}

int main(){
  long long N;
  string X;
  cin >> N >> X;
  
  vector<long long> V(N,0);
  long long one=0;
  for(int i=0;i<N;i++){
    if(X[i]=='1'){
      V[N-i-1] = 1;
      one++;
    }
  }
  
  long long A0 = 0, A1 = 0;
  for(long long i=0;i<N;i++){
    if(V[i]==1){
      A0 += mpow(2,i,one+1);
      A0 %= one+1;
    }
  }
  if(one>=2){
    for(long long i=0;i<N;i++){
      if(V[i]==1){
        A1 += mpow(2,i,one-1);
        A1 %= one-1;
      }
    }
  }
  
  for(long long i=N-1;i>=0;i--){
    long long mod,Y;
    if(V[i]==0){
      mod = one+1;
      Y = A0;
      Y += mpow(2,i,mod);
      Y %= mod;
    }
    else{
      mod = one-1;
      if(mod==0){
        cout << 0 << endl;
        continue;
      }
      Y = A1;
      Y += mod;
      Y -= mpow(2,i,mod);
      Y %= mod;
    }
    
    int ans=1;
    while(Y>0){
      bitset<32> now(Y);
      Y %= now.count();
      ans++;
    }
    cout << ans << endl;
  }
   
  return 0;
}


Measured memory_bytes: 5236
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef  long long ll;
typedef  vector<int> vi;
typedef  pair<int,int> pii;
typedef  pair<int,string> pis;
double pi=3.1415926535898;
#define speed      ios::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
#define lop(i,n)   for(int i=0;i<int(n);i++)
#define rep(i,a,b) for(int i=a;i<=int(b);i++)
#define rng(i,a,b) for(int i=a;i>=int(b);i--)
#define ms(x,a)    memset(x,a,sizeof(x))
#define all(x)     (x).begin(),(x).end()
#define sz(x)      int(x.size())
#define pb         push_back
#define r0         return 0;
#define CC         continue;
#define bb(x)      cerr<< x <<endl;
#define F          first
#define S          second       //  __builtin_popcount;
//freopen("output.txt","w",stdout),freopen("input.txt","r",stdin);
const ll M  = 1e9+7 ;
const int N = 100100;
const int inf = INT_MAX;
const double eps = 1e-7;
const ll iinf = -1e18 ;
//////////////////////    Hi    ^_^  hack me if you can :P

int n, a[2000];

int main()
{
    //speed;
    cin >>n ;
    lop(i,n) cin >> a[i];
    int s = 0;
    lop(i,n) s+=a[i];

    sort(a,a+n);

    if (s%10!=0)
    {
        cout << s << endl;
        return 0;
    }
    int ans = 0;
    lop(i,n)
    {
        if ( (s-a[i])%10!=0 )
        {
            ans = max(ans, s-a[i]);
        }
    }
    lop(i,n)
    {
        rep(j,i+1,n-1)
        {
            if (s>a[i]+a[j])
                if ( (s-a[i]-a[j])%10!=0 )
                {
                    ans = max(ans, s-a[i]-a[j]);
                }
        }
    }
    lop(i,n)
    {
        rep(j,i+1,n-1)
        {
            if (s>a[i]+a[j])
                rep(k,j+1,n-1)
            {
                if (s>a[i]+a[j]+a[k])
                    if ( (s-a[i]-a[j]-a[k])%10!=0 )
                    {
                        ans = max(ans, s-a[i]-a[j]-a[k]);
                    }
            }
        }
    }
    cout << ans <<endl;
}



Measured memory_bytes: 256
# Contest No.: ABC171
# Problem No.: C
# Solver:      JEMINI
# Date:        20200621

import sys
import heapq

def main():
    n = int(input())
    ans = ""
    alphabet = "abcdefghijklmnopqrstuvwxyz"
    while n > 0:
        ans = alphabet[(n - 1) % 26] + ans
        n = (n - 1) // 26
    print(ans)
    return

if __name__ == "__main__":
    main()

Measured memory_bytes: 62316
/*
Author: Arham_doshi
@quote "Code like there's no tommorow!"
 ***************************************   UNAUTHORISED COPYING OF CODE PROHIBITED   **********************************
*/
#include <bits/stdc++.h>

#define int         long long
#define double      long double
#define pb          push_back
#define pf          push_front
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        998244353 
#define PI          3.141592653589
#define bs(v,n)     binary_search(all((v)),(n))
#define lb(v,n)     lower_bound(all((v)),(n))
#define ub(v,n)     upper_bound(all((v)),(n))
#define fo(i,l,u)   for(i=l;i<u;i++)
using namespace std;

int gcd(int a, int b) {  if (a == 0)  return b; return gcd(b % a, a); }  
bool mod(double a,double b) {return a/b - floor(a/b);}

int occurs(vi v,int n){
auto it=lb(v,n);auto it1=ub(v,n);int x=it1-it;return x;}

int logb(int base, int x) {
    return (log(x) / log(base));
}





signed main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n,x,i,j,k,c=0;
    
    
    cin>>n>>k;
    fo(i,0,n){
        cin>>x;
        if(x>=k)c++;
    }
    cout<<c;
    return 0;
}

Measured memory_bytes: 256
/*A - Regular Triangle*/
#import<stdio.h>
int main(void){
    int A, B, C;
    scanf("%d", &A);
    scanf("%d", &B);
    scanf("%d", &C);

    if(A == B && B == C && A == C){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 128
#include <iostream>

using namespace std;

int main()
{   
    int a;
    int b;
    cin >> a >>b;
    while (a!=0 && b!=0){
        for (int i = 0; i < a; i++){
            if (i%2== 0 ){
                for (int j =0; j<b; j++){
                    if (j%2==0){
                        cout << "#" ;
                    }else {
                        cout << "." ;
                    }
                
                }
            }else{
                
                for (int j =0; j<b; j++){
                 if (j%2==0){
                        cout << "." ;
                    }else {
                        cout << "#" ;
                    }
                }
            }cout << endl;
            
        }cout << endl;
         cin >> a >>b;
    }
    

    return 0;
}


Measured memory_bytes: 3076
#include<bits/stdc++.h>
#define int long long int
#define pb push_back
#define mp make_pair
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;
int32_t main(){
    string s;
    cin>>s;
    if(s[2]==s[3] && s[4]==s[5]){
        cout<<"Yes";
        return 0;
    }
    cout<<"No";
    return 0;
}


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

#define rep(i, n) REP(i, 0, n)
#define REP(i,k,n) for(int i = k; i < n; i++)
#define mmax(start, end) *max_element(start, end)
#define mmin(start, end) *min_element(start, end)
#define argmax max_element
#define argmin min_element
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef pair<int, int> prii;

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

template<class T = ll> T in() {
    T _in;
    cin >> _in;
    return _in;
}

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

    int A, B, C, D;
    cin >> A >> B >> C >> D;

    // Imos
    int a[102] = {0};

    rep(i, 101) {
        if(i == A) {
            a[i]++;
        }
        if(i == B) {
            a[i]--;
        }
        if(i == C) {
            a[i]++;
        }
        if(i == D) {
            a[i]--;
        }
    }

    REP(i, 1, 101) {
        a[i] += a[i-1];
        // cout << a[i];
    }
    // cout << endl;

    int ans = 0;
    rep(i, 101) {
        if(a[i] == 2) {
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
/**
 * Created by abhishek on 7/31/2016.
 */
import java.util.*;
import java.io.*;
public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int l = Integer.parseInt(st.nextToken());
        int array[] = new int[n + 1];
        int node = -1;
        st = new StringTokenizer(br.readLine());
        for (int i = 1; i <= n; i++) {
            array[i] = Integer.parseInt(st.nextToken());
            if (i == 1) continue;
            if (array[i] + array[i - 1] >= l) {
                node = i;
            }
        }
        if (node == -1) {
            System.out.println("Impossible");
            return;
        }
        System.out.println("Possible");
        StringBuilder sb = new StringBuilder();
        for (int i = 1; i < node - 1; i++) {
            sb.append(i);
            sb.append('\n');
        }
        for(int i = n - 1;i >= node;i--){
            sb.append(i);
            sb.append('\n');
        }
        sb.append(node - 1);
        System.out.println(sb);
    }
}


Measured memory_bytes: 25016
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long> vll;
typedef vector<vll> vvll;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<pair<long long,long long> > vpll;
typedef vector<vector<pair<ll,ll> > > vvpll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
 
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define all(x) x.begin() , x.end()
#define pb push_back
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define mp make_pair
#define F first
#define S second
#define left (node << 1)
#define right (node << 1) + 1
#define pii pair<int,int> 
#define mii map<int,int>
#define vi vector<int>
#define umii unordered_map<int,int>
// #define mod 998244353
#define mod 1000000007 
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<": " <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define FILL(name,val) memset(name , val , sizeof(name))
#define repo(i,o,e) for(int i = o ; i < e ; i++)
#define rep(n) for(int i = 0 ; i < n ; i++)
#define repa(i,sta,end,inc) for(int i = sta ; i <= end ; i += inc)
#define repb(i,sta,end,inc) for(int i = sta ; i >= end ; i -= inc)
const ll sz = 1e5+5;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
 
const ll inf = 1000000000LL * 1000000000LL;

ll power(ll x , ll y){ll res = 1;x %= mod;while(y){if(y&1){res = res * x % mod;}x = x*x % mod;y /= 2;}return res%mod;}

vpll v;
int n;
vector<string> brute;


void build(string s){
    repa(i,0,n-1,1){
        char a = char(48 + i);
        bool flag = true;
        for(auto& j:s){
            if(j == a){
                flag = false;
            }
        }
        if(flag){
            build(s + a);
        }
    }
    if(s.size() == n){
        brute.pb(s);
    }
}


void solve(){
    cin >> n;
    v.resize(n);
    for(auto& i:v){
        cin >> i.first >> i.second;
    }
    double total = 0;
    string s;
    build(s);
    ll fact = 1;
    repa(i,2,n,1){
        fact *= i;
    }
    for(auto& i: brute){
        for(int j = 1 ; j < n ; ++j){
            total += sqrt(pow(v[i[j] - '0'].F - v[i[j-1] - '0'].F,2) + pow(v[i[j] - '0'].S - v[i[j-1] - '0'].S , 2));
        }
    }
    cout << setprecision(10) << total / fact << endl;
    return; 
}


int main(){
    FIO;
    int t = 1;
    // cin >> t;   
    while(t--){
        solve();
    }
    return 0;
}

 

Measured memory_bytes: 2424