akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define INF pow(10,9)

int main(void){
    ll n; cin >> n;
    vector<ll>tmp(n);
    for(int i=0;i<n;i++) cin >> tmp[i];
    ll max_a = *max_element(tmp.begin(),tmp.end());
    vector<ll>a(max_a+1,0);
    for(int i=0;i<n;i++){
        a[tmp[i]]++;
    }
    bool flag = true;
    if(n%2==0){
        for(int i=0;i<a.size();i+=2){
            if(a[i]!=0){
                flag = false;
                break;
            }
        }
        for(int i=1;i<a.size();i+=2){
            if(a[i]!=2){
                flag = false;
                break;
            }
        }  
        if(flag == true){
            ll ans = 1;
            for(int i=0;i<n/2;i++){
                ans = (ans*2)%1000000007;
            }
            cout << ans << endl;
            return 0;  
        }
    }else{
        if(a[0]==1){
            for(int i=1;i<a.size();i+=2){
                if(a[i]!=0){
                    flag = false;
                    break;
                }
            }
            for(int i=2;i<a.size();i+=2){
                if(a[i]!=2){
                    flag = false;
                    break;
                }
            }  
            if(flag == true){
                ll ans = 1;
                for(int i=0;i<n/2;i++){
                    ans = (ans*2)%1000000007;
                }
                cout << ans << endl;
                return 0; 
            }
        }
    }
    cout << 0 << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=(b-1);i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main() {
  string s;
  cin>>s;
  string ans = s;
  rep(i,0,s.sz){
    if(s[i]==','){
      ans[i] = ' ';
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<ll, ll> pll;
#define mod 1000000007
#define all(x) (x).begin(), (x).end()
#define call(x) (x).cbegin(), (x).cend()
#define pb push_back
const double PI = acos(-1);
const long long INF = (1LL << 60);
ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}
ll stringcount(string s, char c){return count(s.cbegin(), s.cend(), c);}
bool isInteger(double x){return floor(x) == x;}
ll ceil(const ll a, const ll b){return ((a)+(b)-1)/b;}

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

  ll n, m;
  cin >> n >> m;
  vector<ll> cnt(n, 1);
  vector<pll> xy(m);
  for(ll i = 0; i < m; i++){
    cin >> xy[i].first >> xy[i].second;
    xy[i].first--, xy[i].second--;
  }

  vector<bool> yes(n);
  yes[0] = true;
  for(ll i = 0; i < m; i++){
    //cout << xy[i].first << ' ' << xy[i].second << endl;
    if(yes[xy[i].first]){
      yes[xy[i].second] = true;
      cnt[xy[i].first]--;
      cnt[xy[i].second]++;
    }else{
      if(cnt[xy[i].second] == 0) yes[xy[i].second] = false;
      cnt[xy[i].first]--;
      cnt[xy[i].second]++;
    }
  }

  ll ans = 0;
  for(ll i = 0; i < n; i++){
    if(yes[i] && cnt[i] > 0) ans++;
  }

  //for(auto i : cnt) cout << i << endl;
  //for(auto i : yes) cout << i << endl;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 2688
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
using namespace std;

int main(){
  long n;
  cin >> n;
  long min_mul = 10000000000010;
  
  for(int i = 2; i < round(sqrt(n))+1; i++){
    if(n % i == 0){
      if(min_mul > (n / i) + i){
        min_mul = (n / i) + i;   
      }
    }
  }
    if(min_mul == 10000000000010) cout << n-1;
    else cout << min_mul-2;
}

Measured memory_bytes: 256
// Problem : C - Folia
// Contest : AtCoder - NOMURA Programming Competition 2020
// URL : https://atcoder.jp/contests/nomura2020/tasks/nomura2020_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define db long double
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define mi map<int,int>
#define ml map<ll,ll>
#define mii map<pii,int>
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
#define mod 1000000007
#define MAX 4294967295
#define EPS 1e-9
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define MAXN 15000005
#define inf 1e10
#define PI acos(-1.0)
#define int long long

void solve(){
    int n;
    cin>>n;
    vi a(n+1), suf(n+1);
    for(int i=0;i<n+1;i++) cin>>a[i];
    suf[n] = a[n];
    for(int i=n-1;i>=0;i--) suf[i] = suf[i+1] + a[i];
    if(n==0){
        if(a[0] == 1) {cout<<1<<endl; return ;}
        if(a[0] == -1) {cout<<-1<<endl; return ;}
    }
    bool ok = true;
    if(a[0] != 0){
        cout<<-1<<endl;
        return;
    }
    int cur = 1, ans = 0;
    for(int i=0;i<=n;i++){
        cur = min(cur,suf[i]);
        ok &= (cur-a[i] >= 0);
        ans += cur;
        cur = (cur-a[i])*2;
    }
    if(ok) cout<<ans<<endl;
    else cout<<-1<<endl;
}

signed main(){
    io;
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    int t;
    //cin>>t;
    t = 1;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 4764
#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( void )
{
    int a,b;
    cin >> a >> b;
    
    int ans = a;
    if ( a > b )
        ans--;
        
    cout << ans << endl;
}


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

int sgn(int n) {
    if (n>0) return 1;
    else if (n<0) return -1;
    else return 0;
}

int main() {
    int n; cin >> n;
    int a[100000];
    rep(i,n) cin >> a[i];
    int cnt = 0;
    rep(i,n) {
        if (sgn(a[i]) == -1) cnt ++;
    }
    rep(i,n) a[i] = abs(a[i]);
    sort(a, a+n);
    if (cnt%2 == 0) {
        cout << accumulate(a, a+n, lint(0)) << endl;
    }
    else {
        cout << accumulate(a+1, a+n, lint(0)) - a[0] << endl;
    }
    
}

Measured memory_bytes: 4012
#include <bits/stdc++.h>
using namespace std;
int main () {
	string s;
	cin >> s;
	int sum = 0;
	for (int i = 0; i < 3; ++i)
	{
		if(s[i] == '1'){
			sum++;
		}
	}
	cout << sum << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;
set<int> primes={2,3,5,7,11,13,17,19,23,29,31,37,
                 41,43,47,53,59,61,67,71,73,79,
                 83,89,97,101,103,107,109,113,127,131,
                 137,139,149,151,157,163,167,173,179,181,
                 191,193,197,199,211,223,227};
bool isPrime(int n){
  for(int p:primes){
    if(p*p>n)return true;
    if(n%p==0)return false;
  }
  return true;
}
int main(){
  for(int i=229;i<50040;i+=2)
    if(isPrime(i))
      primes.insert(i);
  int n;
  while(cin>>n){
    auto r=primes.lower_bound(n);
    auto l=r;
    if(primes.count(n)==1){
      r++;l--;
    }
    else{
      l--;
    }
    cout<<(*l)<<" "<<(*r)<<endl;
  }
}

Measured memory_bytes: 1436
#include<bits/stdc++.h>
using namespace std;
int main(){
	int t=1;
	//cin >> t;
	while(t--){
		string str;
      	cin >> str;
      	long long int i=0,n = str.size();
      	for(i=0;i<n;i++){
        	if(str[i]=='P'||str[i]=='D'){cout << str[i];}
          	else cout << 'D';
        }
	}
}

Measured memory_bytes: 3756
#include <iostream>

using namespace std;

#define MN 100
#define INF (1<<28)

int n;
int P[MN][2];
int main() {
    cin >> n;
    for (int i = 0; i < n; i++) {
        int a, b; cin >> a >> b;
        P[i][0] = a;
        P[i][1] = b;
    }
    int dp[n][n]; // from, to, cost
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (i == j) {
                dp[i][j] = 0;
            } else {
                dp[i][j] = INF;
            }
        }
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j + i < n; j++) {
            for (int k = j; k < j + i; k++) {
                dp[j][j+i] = min(dp[j][j+i], dp[j][k] + dp[k+1][j+i] + P[j][0] * P[k][1] * P[k+1][0] * P[j+i][1]);
            }
        }
    }
    cout << dp[0][n-1] << endl;
    return 0;
}

Measured memory_bytes: 1180
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int maxn=1e6+10;
ll dp[maxn],sum[maxn];
inline int Min(int x,int y){
	return x<y?x:y;
}
inline int read(){
	int x=0,flag=1;
	char ch=getchar();
	while(!isdigit(ch) && ch!='-')ch=getchar();
	if(ch=='-')flag=-1,ch=getchar();
	while(isdigit(ch))x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
	return x*flag;
}
inline int Mod(int x){
	if(x>mod)x-=mod;
	return x;
}
int main(){
	int i,n;
	n=read();
	dp[0]=sum[0]=1;dp[1]=n;sum[1]=n+1;
	for(i=2;i<=n;i++){
		dp[i]=Mod(dp[i]+dp[i-1]);
		if(i>=3)dp[i]=(dp[i]+sum[i-3])%mod;
		dp[i]=(dp[i]+1ll*(n-1)*(n-1))%mod;
		dp[i]=(dp[i]+n-i+1)%mod;
		sum[i]=(sum[i-1]+dp[i])%mod;
	}
	printf("%lld\n",dp[n]);
	return 0;
}

Measured memory_bytes: 15872
#include <cstdio>
#include <iostream>

using namespace std;

const int Maxn = 110;
const int INF = 1e5;

int n, m, x, y;
int a = -INF, b = INF;

int main()
{
    scanf("%d%d%d%d", &n, &m, &x, &y);
    for(int i = 1, tmp; i <= n; ++i)
    {
        scanf("%d", &tmp);
        a = max(tmp, a);
    }
    for(int i = 1, tmp; i <= m; ++i)
    {
        scanf("%d", &tmp);
        b = min(tmp, b);
    }
    // (x, y]
    // a < z, b >= z
    if(a < b && x < y && a < y && b > x) puts("No War");
    else puts("War");
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define p_b push_back
#define pl pair<ll,ll>
#define m_p make_pair
#define MOD 1000000007
#define F(i,a,b) for(i=a;i<b;i++)
#define RF(i,a,b) for(i=a;i>=b;i--)
#define nfs ios_base::sync_with_stdio(false);cin.tie(NULL)
int calc (string s)
{

    int n = s.size();
    int i;
    int ans = 0;
    for(i=0;i<n;i++)
    {

        if(i==0)
        {
            if(s[i]=='R' && s[i+1] == 'R')
            {
                ans++;

            }

        }
        else if(i==n-1)
        {
            if(s[i] == 'L' && s[i-1]=='L')
            {
                ans++;


            }

        }
        else
        {

            if(s[i]=='R' && s[i+1] == 'R')
            {
                ans++;

            }
            if(s[i] == 'L' && s[i-1]=='L')
            {
                ans++;


            }
        }
    }

    return ans;

}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin >> n;
    ll k;
    cin >> k;
    int k1 = k;
    string s;
    cin >> s;
    string s1 = s;
    string s2 = s;
    int i;

    for(i=1;i<n;i++)
    {

        if(s1[i]=='L')
        {

            while(i<n&&s1[i]=='L')
            {
                s1[i] = 'R';

                i++;
            }
            k--;
            if(k==0)
            {

                break;
            }
        }
    }
    if(k!=0)
    {

        if(s1[0]=='L')
        {

            s1[0] = 'R';
        }
    }
    //cout << s1 << endl;

    int ans = calc(s1);
    for(i=0;i<n;i++)
    {

        if(s2[i]=='R')
        {

            while(i<n&&s2[i]=='R')
            {
                s2[i] = 'L';

                i++;
            }
            k1--;
            if(k1==0)
            {

                break;
            }
        }
    }
    if(k1!=0)
    {

        if(s2[0]=='R')
        {

            s2[0] = 'L';
        }
    }
    //cout << s2 << endl;

    ans = max(ans,calc(s2));
    cout << ans << endl;
    return 0;

}


Measured memory_bytes: 768
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int n,cnt;
int main()
{
    scanf("%d",&n);long long ans=0;
    for(int i=1,w;i<=n;i++)
    {
        scanf("%d",&w),ans+=w>>1;
        if(!w)ans+=cnt>>1,cnt=0;
        else cnt+=w&1;
    }
    ans+=cnt>>1;
    cout<<ans<<endl;
}

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

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define base 402653189
#define mod 998244353
#define ll long long
#define mem(a,b) memset(a,b,sizeof(a))
#define MX 2000005

int n;
string str;
struct dataa{
	int first;
	int second;
};
dataa pr[MX];

int open = 0;
int close = 0;
vector<int>pvt,nvt;
vector<int>res;

void process(int pos){
	int len = str.size();
	pr[pos].first = 0;
	pr[pos].second = 0;

	for (int i = 0; i < len; i++){
		if (str[i] == '(') pr[pos].first++;
		else if (pr[pos].first) pr[pos].first--;
	}
	for (int i = len - 1; i >= 0; i--){
		if (str[i] == ')') pr[pos].second++;
		else if (pr[pos].second)pr[pos].second--;
	}
	//cout<<"Pos "<<pos<<" "<<pr[pos].first<<" "<<pr[pos].second<<endl;

	if (pr[pos].first >= pr[pos].second) pvt.push_back(pos);
	else nvt.push_back(pos);
}
bool cmp(int tmp, int tpp){
	return (pr[tmp].second < pr[tpp].second);
}
bool comp(int tmp, int tpp){
	return (pr[tmp].first > pr[tpp].first);
}

int main(){
	optimize();
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);

	cin >> n;
	for (int i = 1; i <= n; i++){
		cin >> str;
		process(i);
	}
	sort(pvt.begin(), pvt.end(), cmp);
	sort(nvt.begin(), nvt.end(), comp);
	
	vector<int>res;
	res.reserve(n);
	res.insert(res.end(), pvt.begin(), pvt.end());
	res.insert(res.end(), nvt.begin(), nvt.end());


	for (auto now : res){
		if (pr[now].second <= open) open += (pr[now].first - pr[now].second);
		else{
			cout << "No\n";
			return 0;
		}
	}
	if(open==0){
      	cout << "Yes\n";
		//for (int i = 0; i < n; i++) cout << res[i] << " ";
    }
  	else{
      	cout<<"No\n";
    }
	return 0;
}


Measured memory_bytes: 18824
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
  int N, cnt = 0;
  
  cin >> N;
  vector<int> v1(N, 0);
  for(int h = 0; h < N; ++h) {
	cin >> v1[h];
  }

  int from = 0, flag = 1;
  while(flag) {
	flag = 0;
	for(int to = N - 1; to >= from + 1; --to) {
	  if(v1[to] < v1[to - 1]) {
		swap(v1[to], v1[to - 1]);
		  cnt++;
		  flag = 1;
	  }
	}
	from++;
  }

  for(int k = 0; k < N; ++k) {
	cout << v1[k];
	cout << (k < N - 1 ? ' ' : '\n');
  }
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 3120
#include <bits/stdc++.h>
#define range(i,c,o) for(register int i=(c);i<(o);++i)
using namespace std;

// fast_io BEGIN HERE
namespace IO
{
	static const size_t isize=1000000;
	char *cur,pool[isize];
	inline void clear()
	{
		rewind(stdin),cur=pool+isize;
	}
	inline char getC()
	{
		if(cur==pool+isize)
		{
			int siz=fread(pool,1,isize,stdin);
			if(siz<isize) pool[siz]='\0'; cur=pool;
			if(!siz) return '\0';
		}
		return *(cur++);
	}
	inline unsigned getU()
	{
		char c; unsigned r=0;
		while(!isdigit(c=getC()));
		for(;isdigit(c);c=getC())
		{
			r=(r<<3)+(r<<1)+c-'0';
		}
		return r;
	}
	inline char *getS(char*str)
	{
		char *i=str,c; while(isspace(c=getC()));
		for(;!isspace(c)&&c;c=getC()) *(i++)=c;
		return *i='\0',str;
	}
	static const size_t osize=100;
	char stk[osize];
	template<typename T>
	inline size_t putU(const T&n,const char&c='\n')
	{
		int bot=osize;
		stk[--bot]=c,stk[--bot]=n%10+'0';
		for(T i=n;i/=10;stk[--bot]=i%10+'0');
		return fwrite(stk+bot,osize-bot,1,stdout);
	}
	inline size_t putS(const char*str)
	{
		return fwrite(str,strlen(str),1,stdout);
	}
}
// fast_io END HERE

static int N;

// BIT BEGIN HERE
int bit[1000005];

inline int lowbit(const int&x) {return x&-x;}

inline void modify(const int&x,const int&y)
{
	for(int i=x+1;i;i-=lowbit(i)) bit[i]=min(bit[i],y);
}

inline int query(const int&x)
{
	int ret=0x7FFFFFFF;
	for(int i=x+1;i<N+2;i+=lowbit(i)) ret=min(ret,bit[i]);
	return ret;
}
// BIT END HERE

char S[1000005],T[1000005];
int pre[1000005],las[1000005],rec[1000005];
deque<int> que;
int main()
{
	//freopen("game.in" ,"r",stdin );
	//freopen("game.out","w",stdout);
	IO::clear(),N=IO::getU();
	IO::getS(S),IO::getS(T);
	if(!strcmp(S,T)) return IO::putS("0\n"),0;
	for(int i=N,j=N;i--;pre[i]=j)
	{
		for(j-=j>i;~j&&S[j]!=T[i];--j);
		if(!~j) return IO::putS("-1\n"),0;
	}
	int ans=0,cnt=0;
	for(int i=0;i<N;)
	{
		rec[cnt]=i,las[cnt++]=pre[i];
		for(++i;i<N&&pre[i]==pre[i-1];++i);
	}
	memset(bit,0x7F,sizeof bit);
	modify(N-cnt,cnt+1);
	for(int i=cnt;i--;)
	{
		modify(las[i]-i,i+1);
		ans=max(ans,query(rec[i]-i)-i);
	}
	return IO::putU(ans),0;
}

Measured memory_bytes: 18816
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define puf push_front
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
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 (a>b) { a=b; return 1; } return 0; }

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

    ll x; cin >> x;
    ll ans = 2 * (x / 11);
    if(x % 11 > 0){
        ans++;
    }
    if(x % 11 > 6){
        ans++;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<fstream>
#include<sstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<cstdlib>
#include<climits>
#include<utility>
#include<cctype>
using namespace std;

#define ull unsigned long long
#define ll long long
#define rep(i,j) for(int i=0;i<j;++i)
#define loop(i,a,j) for(int i=a;i<j;++i)
#define mpi(it,table,T,E) for(map<T,E>::iterator it = table.begin();it!=table.end();++it)
#define PI 3.141592654
/*
ifstream fin("input.txt");
ofstream fout("output.txt");
#define cin fin
#define cout fout
*/


int main(){
	int eye[4][2];
	memset(eye,0,sizeof(eye));
	double h,m;
	while(scanf("%lf %lf",&h,&m) != EOF){
		if( h >= 1.1 ){
			eye[0][0]++;
		}else if( 0.6 <= h && h < 1.1){
			eye[1][0]++;
		}else if( 0.2 <= h && h < 0.6){
			eye[2][0]++;
		}else{
			eye[3][0]++;
		}

		if( m >= 1.1 ){
			eye[0][1]++;
		}else if( 0.6 <= m && m < 1.1){
			eye[1][1]++;
		}else if( 0.2 <= m && m < 0.6){
			eye[2][1]++;
		}else{
			eye[3][1]++;
		}

	}
	
	rep(i,4){
		printf("%d %d\n",eye[i][0],eye[i][1]);
	}
	
	return 0;
}

Measured memory_bytes: 1212
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
mod = 10**9+7 #出力の制限
N = 2*(10**5)
def cmb(n, r):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
def p(n,r):
    if ( r<0 or r>n ):
        return 0
    return g1[n] * g2[n-r] % mod

g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )
# a = cmb(n,r)


n,m,k = m()

sx = 0
sy = 0

for i in range(1,n):
    sx += i * (n-i) * (m**2) * cmb(n*m-2,k-2)
    sx %= mod

for i in range(1,m):
    sy += i * (m-i) * (n**2) * cmb(n*m-2,k-2)
    sy %= mod
print((sx+sy)%mod)



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

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n;i++) cin >> a.at(i);
  vector<int> x(200000,0);
  for(int i = 0; i < n; i++){
    x.at(a.at(i))++;
    if(a.at(i) - 1 > 0) x.at(a.at(i) -1 )++;
    x.at(a.at(i)+ 1)++;
  }
  int ans = 0;
  for(int i = 0; i < x.size();i++) ans = max(ans,x.at(i));
  cout << ans << endl;
}

Measured memory_bytes: 1408
#pragma region macro
#include <bits/stdc++.h>
using i64 = int_fast64_t;
#define repeat(i, a, b) for(int i = (a); (i) < (b); ++(i))
#define rep(i, n) repeat(i, 0, n)

namespace std {
template <typename A, typename B>
string to_string(pair<A, B> p);

string to_string(const string &s) {
    return '"' + s + '"';
}

string to_string(const char *s) {
    return to_string((string)s);
}

string to_string(bool b) {
    return (b ? "true" : "false");
}

string to_string(vector<bool> v) {
    bool first = true;
    string res = "{";
    for(int i = 0; i < static_cast<int>(v.size()); i++) {
        if(!first) {
            res += ", ";
        }
        first = false;
        res += to_string(v[i]);
    }
    res += "}";
    return res;
}

template <size_t N>
string to_string(bitset<N> v) {
    string res = "";
    for(size_t i = 0; i < N; i++) {
        res += static_cast<char>('0' + v[i]);
    }
    return res;
}

template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) {
            res += ", ";
        }
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
};  // namespace std
#pragma endregion

void solve() {
    std::string s;
    std::cin >> s;
    if(s == "hi" or s == "hihi" or s == "hihihi" or s == "hihihihi" or s == "hihihihihi") {
        std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No" << std::endl;
    }
}

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

Measured memory_bytes: 256
use std::io;
use std::collections::HashMap;
use std::cmp::max;
use std::cmp::min;

fn main() {
    let mut buffer = String::new();
    io::stdin().read_line(&mut buffer).unwrap();
    let x: u32 = (&buffer[..buffer.len() - 1]).parse().unwrap();

    let mut set = HashMap::new();
    let mut a = 0;
    let (b, negative) = loop {
        let a5 = a * a * a * a * a;
        match set.get(&(max(x, a5) - min(x, a5))) {
            Some(&b) => break (b, a5 < x),
            None => set.insert(a5, a),
        };
        a += 1;
    };

    if negative {
        println!("{} -{}", a, b);
    } else {
        println!("{} {}", a, b);
    }
}


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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define contains(v, t) (find(v.begin(), v.end(), t) != v.end())
#define MOD 1000000007
typedef long long ll;
typedef unsigned long long ull;

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;
}

const long long INF = 1LL << 60;

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

  vector<ll> h(n), dp(n);

  rep(i, n) {
    cin >> h[i];
    dp[i] = INF;
  }
  dp[0] = 0;

  for (int i = 1; i < n; i++) {
    chmin(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]));
    if (i > 1) {
      chmin(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]));
    }
  }

  cout << dp[n - 1] << endl;
}

Measured memory_bytes: 1920
#include <iostream>
#include <vector>
#include <array>
#include <cmath>
#include <string>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <limits>  //std::numeric_limits<long long>::max(), min()

int main (void) {
  long long N, M; std::cin >> N >> M;

  std::vector<long long> A(N);
  for(long long i=0; i<N; i++) std::cin >> A[i];
  std::sort(A.begin(), A.end());

  std::vector<std::pair<long long, long long>> Key(M);
  for(long long i=0; i<M; i++){
    std::cin >> Key[i].first >> Key[i].second;
  }

  std::sort(Key.begin(), Key.end(), [] ( std::pair<long long,long long> &a, std::pair<long long,long long> &b ) { return a.second > b.second; } );


  auto itr = A.begin();
  for(long long i=0; i<M; i++) {
    for(long long j=0; j<Key[i].first; j++) {
      if ( Key[i].second > *itr ) {
        *itr = Key[i].second;
        ++itr;
        if ( itr == A.end() ) {
          long long ans = 0;
          for(long long j=0; j<N; j++) ans +=A[j];
          std::cout << ans << std::endl;
          return 0;
        }
      }
      else {
        long long ans = 0;
        for(long long j=0; j<N; j++) ans +=A[j];
        std::cout << ans << std::endl;
        return 0;
      }
    }
  }

  long long ans = 0;
  for(long long j=0; j<N; j++) ans +=A[j];
  std::cout << ans << std::endl;

  return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include <vector>
#include <string>

using namespace std;

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

	vector<bool> AC(N, false);
	vector<int> WA(N, 0);

	for (int i = 0; i < M; ++i) {
		int p;
		string S;
		cin >> p >> S;
		--p;
		if (S == "AC") {
			AC[p] = true;
		}
		else {
			if (!AC[p]) {
				++WA[p];
			}
		}
	}
	int correct = 0;
	int penalty = 0;
	for (int i = 0; i < N; ++i) {
		if (AC[i]) {
			correct += 1;
			penalty += WA[i];
		}
	}
	cout << correct << " " << penalty << endl;
}


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

int main()
{
  int n;

  while (cin >> n && n != 0){
    int a[10];
    for (int i = 0; i < 10; i++) a[i] = 0;
    for (int i = 0; i < n; i++){
      int s;
      cin >> s;
      a[s]++;
    }
    for (int i = 0; i < 10; i++){
      if (a[i] == 0){
        cout << '-';
      }
      while (a[i]--){
        cout << '*';
      }
      cout << endl;
    }
  }
}

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<int> vec(N,0);
  
  for (int i = 0; i < 2*M; i++){
    int x;
    cin >> x;
    for (int j = 0; j < N; j++){
      if (x == j+1)
        vec.at(j) += 1;
    }
  }
  for (int i = 0; i < N; i++)
    cout << vec.at(i) << endl;
}

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

typedef pair<int, int> pii;
const int N = 2e5 + 100;

int n, u, v;
vector<int> nei[N];

pii dfs(int v, int par = -1, int d = 0) {
	pii res = pii(d, v);
	for (int u: nei[v])
		if(u != par)
			res = max(res, dfs(u, v, d + 1));
	return res;
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0);
	cin >> n;
	for (int i = 0; i < n - 1; i++) {
		cin >> u >> v;
		nei[--u].push_back(--v);
		nei[v].push_back(u);
	}
	pii p = dfs(0);
	p = dfs(p.second);
	cout << (p.first % 3 == 1? "Second": "First");
	return 0;
}

Measured memory_bytes: 26880
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		//????????£?????????????????????
		Scanner sc = new Scanner(System.in);

		//n?????????
		int n = sc.nextInt();

		//n?????????????????????
		for(int i = 1; i <= n; i++){
			//?????¶???3????????°????????¨???
			if(i % 3 == 0 || Integer.toString(i).contains("3")){
				System.out.print(" " + i);
			}
		}
		System.out.println();
	}
}

Measured memory_bytes: 29092
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define For(i,n) for(int i=0;i<n;i++)
#define Fre(i,a,b) for(int i = a; i < b; i++)
#define sf(n) scanf("%d", &n)
#define sff(a,b) scanf("%d %d", &a, &b)
#define sfff(a,b,c) scanf("%d %d %d", &a, &b, &c)
#define pfn(n) printf("%d\n", n)
#define pfs(n) printf("%d ", n)
#define ff first
#define ss second
#define mem(a,b) memset(a,b,sizeof(a))
#define READ freopen("in.txt", "r", stdin)
#define WRITE freopen("out.txt", "w", stdout)
#define sz size()
#define number_of_digit(n) __builtin_ffs(n);
#define ll long long
#define T int
#define ld long double
inline void print(T n)
{
	if (n == 0)
	{
		putchar('0');
		putchar('\n');
	}
	else if (n == -1)
	{
		putchar('-');
		putchar('1');
		putchar('\n');
	}
	else
	{
		char buf[11];
		buf[10] = '\n';
		int i = 9;
		while (n)
		{
			buf[i--] = n % 10 + '0';
			n /= 10;
		}
		while (buf[i] != '\n')
			putchar(buf[++i]);
	}
}
int read()
{
       int cc = getc(stdin);
       for (;cc < '0' || cc > '9';)  cc = getc(stdin);
       int ret = 0;
       for (;cc >= '0' && cc <= '9';)
       {
          ret = ret * 10 + cc - '0';
          cc = getc(stdin);
       }
      return ret;
}
ll power(ll num,ll g)
{
	if(g==0)return 1;

	if(g%2==1)return (num*power((num*num)%mod,g/2))%mod;
	return power((num*num)%mod,g/2);
}
map<pair<int,int>,int> mp1;
bool visit[100005];
vector<int> vec[100005],vec1;
int a[100005];
int b[100005];
int main()
{
	ios_base::sync_with_stdio(false);
  	cin.tie(NULL);
  	cout.tie(NULL);

  	int n,m;
  	memset(visit,false,sizeof(visit));
  	cin>>n>>m;
  	for(int i=1;i<=n;i++)a[i]=-1,visit[i]=false;
  	pair<int,int> pa[n+m-1];
  	
  	memset(b,0,sizeof(b));
  	For(i,n+m-1)
  	{
  		int u,v;
  		cin>>u>>v;
  		visit[v]=true;
  		b[v]++;
  		vec[u].pb(v);
  	}
  	int g;
  	for(int i=1;i<=n;i++)
  	{
	  	if(visit[i]==false)
	  	{
	  		a[i]=0;
			memset(visit,false,sizeof(visit));
			g=i;
			break;
	  	}
	}
	queue<int> q;
	visit[g]=true;
	q.push(g);
	while(!q.empty())
	{
		g=q.front();
		q.pop();
		for(int i=0;i<vec[g].size();i++)
		{
			if(visit[vec[g][i]])continue;
			if(b[vec[g][i]]>1)b[vec[g][i]]--;
			else a[vec[g][i]]=g,visit[vec[g][i]]=true,q.push(vec[g][i]);
		}
	}
	for(int i=1;i<=n;i++)cout<<a[i]<<endl;
 	return 0;
}

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

int main()
{
    string c;
    cin >> c;
    if (c == "a" || c == "e" || c == "i" || c == "u" || c == "o")
    {
        cout << "vowel" << endl;
    }
    else
    {
        cout << "consonant" << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(ll i=0;i<(n);i++)
#define REP2(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(v) (v).begin(),(v).end()
#define INF 2e9
typedef long long ll;

int main()
{
  string s;
  cin>>s;
  const int l=s.size();
  vector<int> n;
  REP(i,l) n.emplace_back(s[i]-'0'+0);

  if(l==1){
    cout<<s<<endl;
    return 0;
  }

  ll ans=0;
  REP(i,pow(2,l-1)){
    bitset<9> b(i);
    ll temp=n[0];
    REP(j,l-1){
      if(b[l-2-j]==0) temp=temp*10+n[j+1];
      if(b[l-2-j]==1){
        ans+=temp;
        temp=n[j+1];
      }
      if(j==l-2) ans+=temp;
    }
  }
  cout<<ans<<endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stack>
using namespace std;
stack<int> r,l;
int m[10],hantei=0;;

void dfs(int i){
  //cout<< i << endl;///////////
  if(i==10)hantei=1;
  if(m[i]>r.top()){
    r.push(m[i]);
    dfs(i+1);
    r.pop();
  }
  if(m[i]>l.top()){
    l.push(m[i]);
    dfs(i+1);
    l.pop();
  }
}

int main(){
  int b,i;
  cin >> b;
  for(int k=0;k<b;k++){
    for(int j=0;j<10;j++)cin>>m[j];  
    r.push(m[0]);
    l.push(0);
    i=1;
    hantei=0;
    dfs(i);
    if(hantei==1)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
   
  }
}

Measured memory_bytes: 1192
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
#include<deque>
#include<iomanip>
#include<utility>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define all(a) a.begin(),a.end()
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
#define S 21 
llfor;
const ll mod=1000000007;
/*pi*/const double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll ans=1;rep(i,0,n){ans*=x;ans%=mod;}return ans;}
/*階乗*/ll fact(ll x){ll ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)*fact(n-r)/fact(r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*Fibonacci数列*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
/*桁数*/ll dig(ll n){ll d=1,tmp=n;while(tmp/10>0){tmp/=10;d++;}return d;}
/*行列のコピー*/void matcpy(ll a[S][S],ll b[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)b[i][j]=a[i][j];/*(aをbに)*/i=t;}
/*行列のリセット*/void matrst(ll a[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)a[i][j]=0;i=t;}
/*行列の2乗*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
/*行列の乗算*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
//ll ans=0;
////////////////////////////////////////////////////////////
int main(){
 ll n,d;
 cin>>n>>d;
 ll a[d+10][n+10];
 rep(i,0,n)rep(j,0,d)cin>>a[i][j];

 ll k,dis,ans=0;
 rep(i,0,n){
  rep(j,i+1,n){
   dis=0;
   rep(k,0,d)dis+=(a[i][k]-a[j][k])*(a[i][k]-a[j][k]);
   if((ll)sqrt(dis)*(ll)sqrt(dis)==dis)ans++;
  }
 }
 pr(ans);
return 0;}


Measured memory_bytes: 3644
#include<bits/stdc++.h>
using namespace std;
int main(){
    int i,ans=0,ansp=0;
    string a;cin>>a;
    for(i=0;i<a.size();i++){
        if(a[i]=='A'||a[i]=='C'||a[i]=='G'||a[i]=='T'){
            ansp++;
        } else {
            ansp=0;
        }
        if(ans<ansp)ans=ansp;
    }
    cout<<ans<<endl;
}

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

const int N = (int) 2e5 + 5;
const long long INF = (long long) 1e18;

int n;
long long s[N];	
long long ans = INF;

void solve() {
	int l = 1, r = 3;
	for (int i = 2; i < n - 1; i++) {
		r = max(r, i + 1);
		while (1) {
			if (l + 1 == i || abs(s[l] - (s[i] - s[l])) <= abs((s[l + 1]) - (s[i] - s[l + 1]))) break;
			l++;
		}
		while (1) {
			if (r + 1 == n || abs((s[r] - s[i]) - (s[n] - s[r])) <= abs((s[r + 1] - s[i]) - (s[n] - s[r + 1]))) break;
			r++;
		}
		ans = min(ans, max({s[l], s[i] - s[l], s[r] - s[i], s[n] - s[r]}) - min({s[l], s[i] - s[l], s[r] - s[i], s[n] - s[r]}));
	}
}

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		int a; scanf("%d", &a);
		s[i] = s[i - 1] + a;
	}
	solve();
	printf("%lld", ans);
	return 0;
}

Measured memory_bytes: 1792
import sys

ordA = ord('a')

ss = input()
ts = input()

lenS, lenT = len(ss), len(ts)

setS = set(ss)
for t in ts:
    if t not in setS:
        print(-1)
        sys.exit()

poss = [-1] * 26
for i, s in enumerate(ss):
    ch = ord(s)-ordA
    if poss[ch] == -1:
        poss[ch] = i + lenS

nextss = [[0]*(26) for _ in range(lenS)]
for i in reversed(range(lenS)):
    ch = ord(ss[i])-ordA
    poss[ch] = i
    for ch, pos in enumerate(poss):
        nextss[i][ch] = pos-i

i = 0
ans = 1
for t in ts:
    ch = ord(t)-ordA
    d = nextss[i][ch]
    ans += d+1
    i = (i+d+1) % lenS

print(ans-1)


Measured memory_bytes: 111604
N, M = map(int, input().split())
A_i_list = list(map(int, input().split()))
A_i_list.sort(reverse=True)
sum_A_i = sum(A_i_list)
if A_i_list[M - 1] < sum_A_i / (4 * M):
    print('No')
else:
    print('Yes')


Measured memory_bytes: 2940
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int a[4] = {};
	string s;
	cin >> s;
	for (int i = 0; i < (int) s.length(); i++) {
		if (s[i] == 'N') a[0] = 1;
		if (s[i] == 'W') a[1] = 1;
		if (s[i] == 'S') a[2] = 1;
		if (s[i] == 'E') a[3] = 1;
	}
	bool ok = true;
	for (int i = 0; i < 2; i++) {
		ok &= a[i] == a[i + 2];
	}
	cout << (ok ? "Yes" : "No") << endl;
	return 0;	
}

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

struct Node{
  Node (int z) : //constracter
    key(z),
    parent(nullptr),
    right(nullptr),
    left(nullptr)
  {}
  int key;
  Node *parent;
  Node *right, *left;
  //right == nullptr && left == nullptr
};

Node *root;

void insert(Node *z){
  Node *y=nullptr;
  Node *x=root;

  while(x!=nullptr){
    y = x;
    x = (z->key < x->key) ? x->left : x->right;
  }
  if(y == nullptr) root = z;
  else (z->key < y->key ? y->left : y->right) = z;
}

void inorder(Node *node){
  if(node->left != nullptr) inorder(node->left);
  std::cout << " " << node->key;
  if(node->right != nullptr) inorder(node->right);
}

void preorder(Node *node){
  std::cout << " " << node->key;
  if(node->left != nullptr) preorder(node->left);
  if(node->right != nullptr) preorder(node->right);
}

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

  int v, m;
  std::string s;
  for(int i=0; i<n; i++){
    std::cin >> s;
    if(s == "insert"){
      std::cin >> v;
      insert(new Node(v));
      m++;
    }else{
      inorder(root);
      std::cout << std::endl;
      preorder(root);
       std::cout << std::endl;
    }
  }
  return 0;
}



Measured memory_bytes: 26540
/* 
    Author - linpaws07 
*/
#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
#define mod 1000000007
#define mp make_pair
#define pb push_back
#define inf (int)1e9
#define f first
#define s second
#define eps 1e-9
#define PI 3.1415926535897932384626433832795
#define scd(t) scanf("%d",&t)
#define sclld(t) scanf("%lld",&t)
#define scc(t) scanf("%c",&t)
#define scs(t) scanf("%s",t)
#define scf(t) scanf("%f",&t)
#define sclf(t) scanf("%lf",&t)
#define memst(a, b) memset(a, (b), sizeof(a))
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<vi> vvi;
typedef map<int,int> mpii;
typedef set<int> seti;
typedef multiset<int> mseti;
typedef long int int32;
typedef unsigned long int uint32;
typedef long long int int64;
typedef unsigned long long int uint64;
#define FAST ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define rp(i,n) for(int i=0;i<(n);i++)
#define fr(i,a,b) for(int i=(a);i<(b);i++)
#define fre(i,a,b) for(int i=(a);i<=(b);i++)
#define frd(i,a,b) for(int i=(a);i>=(b);i--)
inline bool eq(double a, double b) { return fabs(a-b) < 1e-9; }
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n>>b)&1; }
inline void set_bit(int & n, int b) { n |= two(b); }
inline void unset_bit(int & n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) { int res = 0; while(n && ++res) n-=n&(-n); return res; }
auto start = high_resolution_clock::now();
inline void measure();

int a[22][22];
int64 dp[1 << 22];
int main(){
    FAST
    //Do awesome things here
    int n;
    cin >> n;
    rp(i, n){
        rp(j, n){
            cin >> a[i][j];
        }
    }
    dp[0] = 1;
    for(int i = 0; i < (1 << n) - 1; i++){
        int m = __builtin_popcount(i);
        for(int j = 0; j < n; j++){
            if(a[m][j] && (((1 << j) & i) == 0)){
                int mask = (i | (1 << j));
                dp[mask] = (dp[mask] + dp[i]) % mod;
            }
        }
    }
    cout << dp[(1 << n) - 1] << endl;
    return 0;
}


inline void measure(){
    auto stop = high_resolution_clock::now(); 
    auto duration = duration_cast<milliseconds>(stop - start);
    cout << duration.count() << endl;
}

Measured memory_bytes: 18688
N,K=map(int,input().split())
def P(K):
	a=[K]
	b=K
	while b>1:
		b=(b+1)//2
		a.append(b)
	return  a
a=P(K)
#print(a)
for i in range(len(a)):
	if a[i]<=N:
		b=i
		break
#print(b)
ans=(N-a[b]+1)*((1/2)**b)
for j in range(b,len(a)-1):
	ans+=(a[j]-a[j+1])*((1/2)**(j+1))
#	print((a[j]-a[j+1])*((1/2)**(j+1)))
#	print(i)
print(ans/N)

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

int d[15][15][200];
/*
 * d[i][j][k]:
 * i未満の数をj個使って、和をkにする通り数
*/
int main(){
	while(1){
		int n,s;
		cin>>n>>s;
		if(n==0&&s==0)break;
		memset(d,0,sizeof(d));
		d[0][0][0]=1;
		for(int i=0;i<=9;i++){
			for(int j=0;j<=n;j++){
				for(int k=0;k<=s;k++){
					//数iを使わない場合
					d[i+1][j][k]+=d[i][j][k];
					//数iを使う場合
					d[i+1][j+1][k+i]+=d[i][j][k];
				}
			}
		}
		cout<<d[10][n][s]<<endl;
	}
	return 0;
}



Measured memory_bytes: 3232
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;

int main() {
    lint h, n;
    cin >> h >> n;

    vector<lint> a(n);
    for(auto& elem : a)  cin >> elem;

    lint sum = accumulate(begin(a), end(a), 0LL);
    cout << (sum >= h ? "Yes" : "No") << endl;
}

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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()

using namespace std;
using ll = long long;

class UnionFind{
public:
  vector<int> p;		// 親
  vector<int> rank;	// サイズ・各集合の根のみ有効
  UnionFind(int n){
    p.resize(n, -1);
    rank.resize(n, 1);
  }
  int root(int x){
    if(p[x] == -1) return x;
    else return p[x] = root(p[x]); // 深さを 1 にしている
  }
  void unite(int x, int y){
    x = root(x); y = root(y);
    if(x == y)return;
    if(rank[x] > rank[y]) swap(x, y); // rankの小さいものを下につける
    rank[y] += rank[x];
    p[x] = y;
  }
  // グループの数
  ll root_num() {
    ll num = 0;
    for(ll x : p) if (x < 0) num++;
    return num;
  }
  //xが属すグループのサイズ
  int size(int x){ return rank[root(x)]; }
  bool same(int x, int y){ return (root(x) == root(y)); }
};

void solve()
{
  ll n, m, a, b;
  cin >> n >> m;
  UnionFind uf(n);
  for(int i = 0; i < m; ++i)
  {
    cin >> a >> b;
    a--; b--;
    uf.unite(a, b);
  }
  cout << uf.root_num() - 1;
}

int main()
{
  fastio;
  solve();

  return 0;
}

Measured memory_bytes: 3992
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false)
using namespace std;
#define inf (0x3f3f3f3f)
typedef long long int LL;
const int maxn = 1e5 + 20;
int a[maxn];
void work() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; ++i) {
        int x;
        scanf("%d", &x);
        x++;
        a[x]++;
        a[x - 1]++;
        a[x + 1]++;
    }
    int ans = 0;
    for (int i = 0; i <= maxn - 2; ++i) ans = max(ans, a[i]);
    cout << ans << endl;
}

int main() {
#ifdef local
    freopen("data.txt", "r", stdin);
//    freopen("data.txt", "w", stdout);
#endif
    work();
    return 0;
}


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

using namespace std;

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

#define rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=int(a);i<(b);i++)
#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool valid(int lx,int ux,int ly,int uy,int x,int y){
	return lx<=x&&x<ux&&ly<=y&&y<uy; 
}

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

	char now='0';
	string t;
	rep(i,n){
		if(now!=s[i]){
			t += s[i];
			now=s[i];
		}
	}
	cout<<t.length()<<endl;
	return 0;
}

Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		int n;
		int bits = 0;

		try (Scanner scanner = new Scanner(System.in)) {
			n = scanner.nextInt();

			for (int i = 0; i < n; i++) {
				bits |= scanner.nextInt();
			}
		}

		System.out.println(Integer.numberOfTrailingZeros(bits));
	}
}

Measured memory_bytes: 21588
#![allow(non_snake_case, unused_imports)]

// Input
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 $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, bytes) => { read_value!($next, String).into_bytes() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; }

// Module
use std::cmp::{min,max};
use std::collections::{HashSet,HashMap,BTreeMap,VecDeque};

// Functions
fn p(n:usize, c:char){
    for _ in 0..n{
        print!("{}",c);
    }
}

// Main
fn main(){
    input!{
        sx: i64,
        sy: i64,
        tx: i64,
        ty: i64,
    }

    let dx = (tx-sx) as usize;
    let dy = (ty-sy) as usize;

    p(dy,'U');
    p(dx,'R');
    p(dy,'D');
    p(dx,'L');
    p(1,'L');
    p(dy+1,'U');
    p(dx+1,'R');
    p(1,'D');
    p(1,'R');
    p(dy+1,'D');
    p(dx+1,'L');
    p(1,'U');
}

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

int main()
{
    int a,b,c,k;
    cin>>a>>b>>c>>k;
    for(int i=0;i<k;i++)
    {
        if(a>=b)
            b*=2;
        else if(b>=c)
            c*=2;
    }
    if(a<b&&b<c) cout<<"Yes";
    else cout<<"No";
}

Measured memory_bytes: 3588
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
A = []
for i in range(1, int(sqrt(N))+1 ):
  if N%i == 0:
    A.append(i + N//i -2)

print(min(A))      

Measured memory_bytes: 5204
#include<bits/stdc++.h>
#define debug(x) cout << #x << " = " << x << endl
typedef unsigned long long ull;
typedef long long ll;
using namespace std;
const int N=100000;
int a[N],i,n,m,sum,sum1;
int main()
{
	cin >> n;
	for(i=1;i<=n;i++)
	{
		cin >> a[i];
	}
	sort(a+1,a+1+n);
	for(i=n;i>=1;i-=2)
	{
		sum+=a[i];
		
		sum-=a[i-1];
	}
	cout <<sum;
	return 0;
}


Measured memory_bytes: 256