akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

int main() {
    int a, b, c;
    int count = 0;

    std::cin >> a >> b >> c;

    if (a > b) {
        return 1;
    }

    for (int i = a; i <= b; ++i) {
        if (c % i == 0) {
            count++;
        }
    }
    std::cout << count << std::endl;
    return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
#define f(i,a,b) for(register int i=a;i!=b;++i)
using namespace std;
template <class T> inline void read(T &n) {
	n=0;register char ch;while(!isdigit(ch=getchar()));
	for(n=ch^48;isdigit(ch=getchar());n=(n<<3)+(n<<1)+(ch^48));
}
int n,m,k;
int main() {
    read(n);read(m);
    f(i,1,n) {
    	read(k);
    	if(m-1>k){cout<<"No";return 0;}
    	if(m+1<k)m=k;
    }
    cout<<"Yes";
    return 0;
}

Measured memory_bytes: 256
//By TheOneYouWant
#pragma GCC optimize ("-O2")
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define memreset(a) memset(a,0,sizeof(a))
#define testcase(t) int t;cin>>t;while(t--)
#define forstl(i,v) for(auto &i: v)
#define forn(i,e) for(int i = 0; i < e; i++)
#define forsn(i,s,e) for(int i = s; i < e; i++)
#define rforn(i,s) for(int i = s; i >= 0; i--)
#define rforsn(i,s,e) for(int i = s; i >= e; i--)
#define leadzero(a) __builtin_clz(a) // count leading zeroes
#define trailzero(a) __builtin_ctz(a) // count trailing zeroes
#define bitcount(a) __builtin_popcount(a) // count set bits (add ll)
#define ln endl
#define dbg(x) cerr<<#x<<" = "<<x<<endl
#define dbg2(x,y) cerr<<#x<<" = "<<x<<" & "<<#y<<" = "<<y<<endl;
#define dbgstl32(v) cerr<<#v<<" = \n"; { int c=0; forstl(it,v) \
cerr<<"    Term "<< ++c <<" = "<<it<<ln;} cerr<<endl
#define dbgstlp32(v) cerr<<#v<<" = \n"; { int c=0; forstl(it,v) \
cerr<<"    Term "<< ++c <<" = "<<it.fi<<" , "<<it.se<<ln;} cerr<<endl
#define dbgarr(v,s,e) cerr<<#v<<" = "; forsn(i,s,e) cerr<<v[i]<<", "; cerr<<endl
#define inp freopen("input.txt", "r", stdin)
#define outp freopen("output.txt", "w", stdout)
#define dbg(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) { cerr<<endl; }
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << "\t"; err(++it, args...);
}
template<typename T1,typename T2>
ostream& operator <<(ostream& c,pair<T1,T2> &v){
	c<<"("<<v.fi<<","<<v.se<<")"; return c;
}
template <template <class...> class TT, class ...T>
ostream& operator<<(ostream& out,TT<T...>& c){
    out<<"{ ";
    forstl(x,c) out<<x<<" ";
    out<<"}"; return out;
}
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair<ll,ll> p64;
typedef pair<int,int> p32;
typedef pair<int,p32> p96;
typedef vector<ll> v64;
typedef vector<int> v32; 
typedef vector<v32> vv32;
typedef vector<v64> vv64;
typedef vector<p32> vp32;
typedef vector<vp32> vvp32;
typedef map<int,int> m32;
const ll MOD = 1e9+7, LIM = 302;
const ld EPS = 1e-9;

ld dp[LIM][LIM][LIM];
int n;

ld answer(int a,int b,int c){
	//cout<<a<<" "<<b<<" "<<c<<ln;
	if(a<0 || b<0 || c<0) return 0;
	if(a==0 && b==0 && c==0) return 0;
	ld ans=0;
	if(dp[a][b][c]+EPS>=0) return dp[a][b][c];
	ans = n+a*answer(a-1,b,c)+b*answer(a+1,b-1,c)+c*answer(a,b+1,c-1);
	//cout<<ans<<ln;
	ans = ans/(a+b+c);
	return dp[a][b][c]=ans;
}

int main(){
	fastio;
	cin>>n;
	int a[3]={0};
	forn(i,LIM){
		forn(j,LIM){
			forn(k,LIM) dp[i][j][k]=-1;
		}
	}
	forn(i,n){
		int x;
		cin>>x;
		a[x-1]++;
	}
	cout<<fixed<<setprecision(12)<<ln;
	ld x = answer(a[0],a[1],a[2]);
	cout<<x<<ln;
	return 0;
}

Measured memory_bytes: 430720
#include<bits/stdc++.h>
using namespace std;
#define ll long long
namespace io{
	const int l=1<<20;
	char buf[l],*s,*t;
	inline char gc(){
		if(s==t){
			t=(s=buf)+fread(buf,1,l,stdin);
			return s==t?EOF:*s++;
		}
		return *s++;
	}
	char c;
	template<class IT>inline void gi(IT &x){
		x=0;c=gc();while(c<'0'||c>'9')c=gc();
		while('0'<=c&&c<='9'){x=(x<<1)+(x<<3)+(c^48);c=gc();}
	}
};
using io::gi;
template<class IT>inline void _int(      IT &a,      IT &b  ){if(a>b)swap(a,b);}
template<class IT>inline void cmin(      IT &a,const IT &b=0){if(a>b)a=b;}
template<class IT>inline void cmax(      IT &a,const IT &b=0){if(a<b)a=b;}
template<class IT>inline IT   _min(const IT &a,const IT &b=0){return a>b? b:a;}
template<class IT>inline IT   _max(const IT &a,const IT &b=0){return a<b? b:a;}
template<class IT>inline IT   _abs(const IT &a              ){return a<0?-a:a;}

const int N=605;
int e[N][N];
double p[N];
int d[N],o[N],n;
double cal(){
	int i,j;double s;
	for(i=n-1;i;--i){
		s=0.0;
		for(j=n;j>i;--j)if(e[i][j])s+=p[j];//printf("CAL %d %d %lf\n",i,j,p[j]);
//		printf("s=%lf d[i]=%d s/d[i]+1.0=%lf",s,d[i],s/d[i]+1.0);
		p[i]=s/d[i]+1.0;
//		printf("CAL p %d %lf\n",i,p[i]);
	}
	return p[1];
}
int main(){
//	freopen("a.in","r",stdin);
//	freopen("a.out","w",stdout);
	int m,a,b,i;double s,mx;
	scanf("%d%d",&n,&m);
	while(m--){
		scanf("%d%d",&a,&b);
		e[a][b]=1;++d[a];
	}
	s=cal();
//	printf("%lf\n",s);
//	for(i=1;i<n;++i)printf("d[%d]=%d\n",i,d[i]);
//	for(i=1;i<n;++i)printf("p[%d]=%lf\n",i,p[i]);
	for(i=1;i<n;++i){
		mx=-1.0;
		for(b=n;b>i;--b)if(e[i][b]&&p[b]>mx){mx=p[b];a=b;}
		o[i]=a;
	}
//	for(i=1;i<n;++i)printf("%d %d\n",i,o[i]);
	for(i=1;i<n;++i)if(d[i]!=1){
		e[i][o[i]]=0;--d[i];
		cmin(s,cal());
		e[i][o[i]]=1;++d[i];
	}
	printf("%.12lf",s);
	return 0;
}

Measured memory_bytes: 1664
/*
C++ のソースコードのテンプレート
特にAOJ-ITP1に使いやすい
*/
#define _USE_MATH_DEFINES

#include <iostream> // 標準入出力
#include <fstream>  // ファイル入出力
#include <string>   // 文字列関係
#include <vector>   // 可変の配列
#include <cmath>    // 数学系
#include <iomanip>  // streamの書式関係
#include <algorithm>// max関数など

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;        // 要素数が可変のベクトル
using std::fixed;         // ストリームの設定をデフォルトにする
using std::setprecision;  // 引数に小数点以下の桁数を指定することが出来る

int main() {
	size_t X, t;
	cin >> X >> t;
	if (X <= t)
	{
		cout << "0" << endl;
	}
	else {
		cout << X - t << endl;
	}


	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <utility>
#include <numeric>
#include <iomanip>

using namespace std;

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

    ans = N / 1.08;
    //cout << ans << endl;
    //cout << int(ans * 1.08) << endl;
    //cout << int((ans+1) * 1.08) << endl;
    if (int(ans*1.08) == N)
    {
        int fin = N / 1.08;
        cout << fin << endl;
    }
    else if (int((ans+1)*1.08) == N)
    {
        int fin = N / 1.08;
        cout << fin + 1 << endl;
    }
    else
    {
        cout << ":(" << endl;
    }
    
    
}


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


int main(){
    char s;
    cin >> s;

    if(s == 'A')
	cout << "T" <<endl;
    else if(s == 'C')
	cout << "G" <<endl;
    else if(s == 'G')
	cout << "C" <<endl;
    else if(s == 'T')
	cout << "A" <<endl;
}



Measured memory_bytes: 256
import java.util.*;

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

        String[] strArray = sc.next().split("");
        String[] akibaArray = "AKIHABARA".split("");
        boolean flag = true;
        int count = 0;
        int i = 0;

        for (; i < akibaArray.length; i++) {
            if (count >= strArray.length) {
                break;
            }
            if (strArray[count].equals(akibaArray[i])) {
                count++;
            } else if (!akibaArray[i].equals("A")) {
                break;
            }
        }

        if (i <= akibaArray.length - 2 || count < strArray.length) {
            flag = false;
        }

        System.out.println(flag ? "YES" : "NO");
    }
}

Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::cerr;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	i64 n, a, b; scanf("%lld%lld%lld", &n, &a, &b);

	i64 dist = b - a - 1;
	if(dist == 0) {
		i64 X = a;
		i64 Y = (n - b + 1);

		printf("%lld\n", std::min(X, Y));
	} else if(dist & 1) {
		printf("%lld\n", (dist + 1) >> 1);
	} else {
		i64 X = a + dist / 2;
		i64 Y = (n - b + 1) + dist / 2;

		printf("%lld\n", std::min(X, Y));
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;

ll dp[1111][1111], H, W;

char map[1111][1111];

int main()
{
    cin >> H >> W;
    for (int i = 0; i < H; i++)
    {
        for (int j = 0; j < W; j++)
        {
            cin >> map[i][j];
        }
    }
    for (int i = 0; i < H; i++)
    {
        if (map[i][0] == '.')
            dp[i][0] = 1;
        else
            break;
    }
    for (int i = 0; i < W; i++)
    {
        if (map[0][i] == '.')
            dp[0][i] = 1;
        else
            break;
    }
    for (int i = 1; i < H; i++)
    {
        for (int j = 1; j < W; j++)
        {
            if (map[i][j] == '.')
                dp[i][j] += dp[i - 1][j] + dp[i][j - 1];
            else
                dp[i][j] = 0;
            dp[i][j] %= mod;
            //cout << dp[i][j] << " ";
        }
        //cout << " " << endl;
    }
    cout << dp[H - 1][W - 1] << endl;
}

Measured memory_bytes: 10368
#include<bits/stdc++.h>
using namespace std;
int n,num1=1,num,ans;
char a[100000];
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
	    cin>>a[i];
	while(num<n)
	{
		if(a[num]==a[num+1])
		{
			num1++;
		} 
		else
		{
			num1=1;
			ans++;
		} 
		num++;
	}
	cout<<ans<<endl;
	return 0;	  
}

Measured memory_bytes: 384
from sys import setrecursionlimit
setrecursionlimit(100000)
n = int(input())
x,q = [[] for i in range(n)],[-1]*n
for i in range(n-1):
	a = int(input())-1
	x[a].append(i+1)
def f(z):
	y = []
	if x[z]:
		for i in x[z]:
			if q[i]+1: y.append(q(i))
			else: y.append(f(i))
		y = sorted(y)[::-1]
		for i in range(len(y)): y[i]+=i+1
		q[z] = max(y)
		return max(y)
	else:
		q[z] = 0
		return 0
print(f(0))

Measured memory_bytes: 119728
#include <bits/stdc++.h>
typedef long long ll;
#define mod 1000000007
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vll vector <ll>
#define vii vector <int>
#define vpii vector <pii>
#define vpll vector <pll>
#define ff first
#define ss second
#define matrix vector <vll>
#define all(v) v.begin(),v.end()
#define PQ priority_queue
using namespace std;
ll pow(ll a, ll b){
	ll res = 1;
	while(b > 0){
		if(b&1) res*=a;
		b/=2;
		a*=a;
	}
	return res;
}
int dp[100005];
bool visited[100005];
vii adj[100005];
int n, m;
void dfs(int node){
	visited[node] = 1;
	for(int u: adj[node]){
		if(!visited[u]) dfs(u);
		dp[node] = max(dp[node],1+dp[u]);
	}
}
int main()
{
	//ios::sync_with_stdio(0);
	//cin.tie(0);
	cin >> n >> m;
	for(int i = 0; i < m; i++){
		int x,y;
		cin >> x >> y;
		adj[x].pb(y);
	}
	for(int i = 1; i <= n; i++){
		if(visited[i] == false) dfs(i);
	}
	int m = 0;
	for(int i = 1; i <= n; i++) m = max(m,dp[i]);
	cout << m;
	return 0;
}


Measured memory_bytes: 8192
#include "bits/stdc++.h"
#include <set>

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}
template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}


signed main(void) {
	int n,k;
	cin >>n >> k;
	vector<int>a(n);
	rep(i, n) {
		cin >> a[i];
	}
	rep(i, n-k) {
		if (a[i] < a[k + i])cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}

Measured memory_bytes: 4836
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;

const int N=100005;
int n,k,q,a[N];

inline int read(){
	int s=0,t=1;
	char c=getchar();
	while((c>'9'||c<'0')&&c!='-')c=getchar();
   	if(c=='-')t=-1,c=getchar();
   	while(c>='0'&&c<='9')s=s*10+c-'0',c=getchar();
   	return s*t;
}

int main(void){
	scanf("%d %d %d",&n,&k,&q);
	for(int i=1;i<=n;i++)
	a[i]=k-q;
	while(q--){
		int x;
		scanf("%d",&x);
		a[x]++;
	}
	for(int i=1;i<=n;i++)
	if(a[i]>0)printf("Yes\n");
	else
	printf("No\n");
}


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

int main() {
    string S, T;
    cin >> S >> T;

    bool flag = true;
    char StoT[26] = {}, TtoS[26] = {};

    for (int i = 0; i < S.length(); i++) {
        int si = S[i] - 'a', ti = T[i] - 'a';
        if (StoT[si] == '\0') StoT[si] = T[i];
        if (TtoS[ti] == '\0') TtoS[ti] = S[i];

        if (StoT[si] != T[i] || TtoS[ti] != S[i]) flag = false;
    }

    cout << (flag ? "Yes" : "No") << endl;
}

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

int main() {
    long long N,min=1e6;
    int a=1,ans=0,b=0;
    cin >> N;
    vector<long long> A(N),B(N+1,0);
    for (int i = 0; i < N; i++) {
        cin >> A.at(i);
        if(min>=A.at(i)){
            B.at(i+1)++;
            min = A.at(i);
        } 

    } 
    
    for (int i = 1; i < N+1; i++){
        if(B.at(i)>0) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3328
#pragma GCC optimize ("O3")
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <stack>
#include <unordered_map>
#define lld long long int
#define dbg1(vari1) cerr<<#vari1<<" = "<<(vari1)<<endl;
#define dbg2(vari1,vari2) cerr<<#vari1<<" = "<<(vari1)<<" "<<#vari2<<" = "<<(vari2)<<endl;
#define dbg3(vari1,vari2,vari3) cerr<<#vari1<<" = "<<(vari1)<<" "<<#vari2<<" = "<<(vari2)<<" "<<#vari3<<" = "<<(vari3)<<endl;
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin >> n;
	int arr[n][3];
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<3;j++)
		{
			cin >> arr[i][j];
		}
	}
	int ans=0;
	int dp[n][3];
	memset(dp,0,sizeof(dp));
	for(int i=0;i<3;i++)
	{
		dp[0][i]=arr[0][i];
	}
	for(int i=1;i<n;i++)
	{
		for(int j=0;j<3;j++)
		{
			if(j==0)
			{
				dp[i][j]+=arr[i][j]+max(dp[i-1][1],dp[i-1][2]);
			}
			else if(j==1)
			{
				dp[i][j]+=arr[i][j]+max(dp[i-1][0],dp[i-1][2]);
			}
			else
			{
				dp[i][j]+=arr[i][j]+max(dp[i-1][0],dp[i-1][1]);
			}
		}
	}
	// for(int i=0;i<n;i++)
	// {
	// 	for(int j=0;j<3;j++)
	// 	{
	// 		cout << dp[i][j] << " ";
	// 	}
	// 	cout << "\n";
	// }
	cout << max(dp[n-1][0],(max(dp[n-1][1],dp[n-1][2])));
}


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

int n,a[200005];

inline bool check(const int &k){
	if((a[n-1]<=k&&a[n]<=k)||(a[n]<=k&&a[n+1]<=k))return 1;
	if((a[n-1]> k&&a[n]> k)||(a[n]> k&&a[n+1]> k))return 0;
	for(int i=1;i<n-1;i++){
		if((a[n+i]<=k&&a[n+i+1]<=k)||(a[n-i]<=k&&a[n-i-1]<=k))return 1;
		if((a[n+i]> k&&a[n+i+1]> k)||(a[n-i]> k&&a[n-i-1]> k))return 0;
	}
	return a[1]<=k;
}

int main(){
	scanf("%d",&n);
	for(int i=1;i<n<<1;i++)scanf("%d",a+i);
	int l=1,r=(n<<1)-1;
	while(l<r){
		int mid=l+r>>1;
		if(check(mid))r=mid;
		else l=mid+1;
	}
	printf("%d",l);
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
    int a, b;
    double a_min, b_min;
    double a_max, b_max;
    int a_min_int, b_min_int;

    cin >> a >> b;
    a_min = a / 0.08;
    b_min = b / 0.1;
    a_max = a_min + 12.5;
    b_max = b_min + 10.0;

    a_min_int = ceil(a_min);
    b_min_int = ceil(b_min);

    for (int i = a_min_int; i < a_max; i++) {
        for (int j = b_min_int; j < b_max; j++) {
            if (i == j) {
                cout << i << endl;
                return 0;
            }
        }
    }

    cout << -1 << endl;

    return 0;
}


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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl





using ll = long long;

const ll mod = 1e9+7;
const int maxn = 1e6 + 5;
const int inf = 1e9;


int n;
vector<int> a[maxn];
int acc[maxn];
int dp[maxn];

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

    cin>>n;
    a[0]={-inf, -inf, 0};
    for (int i=1; i<=n; i++) {
	a[i].resize(3);
	cin>>a[i][1]>>a[i][2];
	a[i][0]=a[i][1]+a[i][2];
	dp[i] = 1;
    }
    
    n++;
    sort(a,a+n);
    // for (int i=0; i<n; i++) {
    // 	cout<<a[i][1]<<" "<<a[i][2]<<endl;
    // }

    for (int i=1; i<n; i++) {
	int lo = 0;
	int hi = i;
	while (hi-lo>1) {
	    int mid=(hi+lo)/2;
	    if (a[mid][0] <= a[i][1]-a[i][2]) {
		lo = mid;
	    } else {
		hi = mid;
	    }
	}
	dp[i] = max(dp[i], 1+acc[lo]);
	acc[i] = max(dp[i], acc[i-1]);
    }
    
    // cout<<endl;
    // for (int i=0; i<n; i++) {
    // 	cout<<dp[i]<<" ";
    // }
    // cout<<endl;


    cout<<*max_element(dp,dp+n)<<endl;
    
    
    
    return 0;
}


Measured memory_bytes: 33024
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007 

ll a[102];
ll gcd(ll A, ll B){
	if(B==0){
		return A;
	}
	gcd(B,A%B);
}

int main() {
	ll n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	ll ans=a[0];
	for(int i=0;i<n;i++){
		ll GCD=gcd(max(ans,a[i]),min(ans,a[i]));
		ans=ans/GCD*a[i];
	}
	cout <<ans;
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <list>
#include <cmath>
#include <stack>
#include <string>
#include <cstring>
#include <numeric>
#include <iomanip>
#include <fstream>
using namespace std;
const long long inf=1e9+7;
const long long mod=1e9+7;
const int64_t CYCLES_PER_SEC=2800000000;
//
inline uint32_t Xor128(){
	static uint32_t x=123456789;
	static uint32_t y=362436069;
	static uint32_t z=521288629;
	static uint32_t w=88675123;
	uint32_t t=x^(x<<11);
	x=y;y=z;z=w;
	return w=(w^(w>>19))^(t^(t>>8));
}
struct Timer{
	int64_t start;
	Timer(){reset();}
	void reset(){start=getcycle();}
	void plus(double a){start-=(a*CYCLES_PER_SEC);}
	inline double get(){return (double)(getcycle()-start)/CYCLES_PER_SEC;}
	inline int64_t getcycle(){
		uint32_t low,high;
		__asm__ volatile ("rdtsc":"=a"(low),"=d"(high));
		return ((int64_t)low)|((int64_t)high<<32);
	}
};
//
int a[100001];
int main(){
	int x;
	cin>>x;
	a[100]=1;
	a[101]=1;
	a[102]=1;
	a[103]=1;
	a[104]=1;
	a[105]=1;
	for(int i=106;i<=100000;i++){
		a[i]=(a[i-100]||a[i-101]||a[i-102]||a[i-103]||a[i-104]||a[i-105]);
	}
	cout<<a[x]<<endl;
	return 0;
}

Measured memory_bytes: 640
//codeforces
//
#include "bits/stdc++.h"
using namespace std;
int main()
{
  string s;
  cin>>s;
  if(s.size()<4)
    cout<<0;
  else{
    int n=s.size();
    int arr[2200]={1};
    int mod[n+3]={0};
    mod[n-1]=1;
    mod[n-2]=10;
    for(int i=n-3; i>=0; i--)
      mod[i] = (mod[i+1]*10)%2019;
    int t=0;
    int p=0;
    for(int i=n-1; i>=0; i--){
      p = (p + (s[i]-'0')*mod[i])%2019;
      arr[p]++;
    }
    for(int i=0; i<2020; i++)
      t += (arr[i]*(arr[i]-1))/2;
    cout<<t;
  }
	return 0;
}


Measured memory_bytes: 4372
#include <bits/stdc++.h>
#define ll long long
#define sz size
#define pb push_back
#define mper make_pair
#define all(x) x.begin(), x.end()
#define fe first
#define se second
#define erba continue
using namespace std;

string s;

int main() {

    cin >> s;

    string ls;
    string to;
    ll ans = 0;

    for(int i = 0; i < s.sz(); ++i) {

        to.pb(s[i]);

        if(!i) {

            ls = to;
            to = "";
            ans++;
        }

        else {

            if(ls != to) {

                ans++;
                ls = to;
                to = "";

            }

            else {

                to.pb(s[i]);

            }

        }

    }

    cout << ans;


return 0;
}




Measured memory_bytes: 640
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    B = [abs(a) for a  in A]
    m = len([a for a in A if a < 0])
    if m % 2 == 0:
        print(sum(B))
    else:
        print(sum(B) - 2*min(B))
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()


Measured memory_bytes: 20212
import numpy as np
import bisect
N,K=map(int,input().split())
X=[int(i) for i in input().split()]
min_=10**10
for i in range(N-K+1):
    #print(i,i+K-1)
    temp=min(abs(X[i])+abs(X[i]-X[i+K-1]),abs(X[i+K-1])+abs(X[i]-X[i+K-1]))
    min_=min(temp,min_)
print(min_)

Measured memory_bytes: 23084
# -*- coding: utf-8 -*-

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

dict_A = {}
for a in A:
    if a not in dict_A:
        dict_A[a] = 1
    else:
        dict_A[a] += 1

if len(dict_A.keys()) <= k:
    print(0)
    exit()

sorted_A = sorted(dict_A.items(), key=lambda x: x[1])

ans = 0
for i in range(len(dict_A.keys())-k):
    ans += sorted_A[i][1]

print(ans)


Measured memory_bytes: 38964
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    r = int(input())
    print(3*r*r)

if __name__ == '__main__':
    main()

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s, t;
  int cnt = 0;
  cin >> s >> t;
  while(s != t){
    for(int i = 0;i < s.size(); i++){
      if(s[i] != t[i]){
        s[i] = t[i];
        cnt++;
      }
    }
  }
  cout << cnt << endl;
}

Measured memory_bytes: 3916
#include<iostream>
using namespace std;
int main()
{
  int n,k;
  cin>>n>>k;
  string s;
  cin>>s;
  int arr[n];
  int i,count;
  i=0;
  arr[0] = 0;
  for(i=0;i<n-1;)
  {
      if(s[i]=='A'&&s[i+1]=='C'){
          count++;
          arr[i+1] = count;
          i+=1;
      }else{
       arr[i+1] = count;
       i++;
      }
  }
//   for(i=0;i<n;i++){
//       cout<<arr[i]<<" ";
//   }
//   cout<<"hello\n";
  while(k--)
  {
      int x,y;
      cin>>x>>y;
      cout<<arr[y-1]-arr[x-1]<<"\n";
  }
 return 0; 
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

using namespace std;
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define MOD (1000000007)
#define vi vector<int>
#define vl vector<ll>
#define vb vector<bool>
#define vvi vector<vi>
#define vvl vector<vl>
#define pii pair<int, int>
#define pli pair<ll, int>a
#define pb push_back
#define sz(x) int(x.size())

#define mp make_pair
#define all(a) (a).begin(),(a).end()

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

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

ll keta(ll n){
  string s = to_string(n);
  ll num = s.size();
  return num;
}

const ll INF = 1LL << 60;

const int dh[4] = {1,0,-1,0};
const int dw[4] = {0,1,0,-1};

struct Edge{
  int to;
  int weight;
  Edge(int t, int w) : to(t), weight(w){}
};
using Graph = vector<vector<Edge>>;
using P = pair<ll, int>;

class UnionFind{
  public:
  vi Parent;
  UnionFind(int n){
    Parent = vi(n,-1);
  }

  int root(int a){
    if(Parent[a] < 0) return a;
    else return Parent[a] = root(Parent[a]);
  }

  int size(int a){
    return -Parent[root(a)];
  }

  bool merge(int a, int b){
    a = root(a);
    b = root(b);
    if(a == b) return false;

    if(size(a) < size(b)) swap(a,b);
    Parent[a] += Parent[b];
    Parent[b] = a;

    return true;
  }
};

class Factrial{
  public:
  vl Fac;
  Factrial(int MAX){
    Fac = vl(MAX+1);
    rep(i,MAX) {
      if(i == 0) Fac[i+1] = 1;
      else Fac[i+1] = ((i+1)*Fac[i])%MOD;
    }
  }
};


int main(){
  string s,t; cin >> s >> t;
  vvi C(26);
  int n = sz(s);
  rep(i, n) C[s[i] - 'a'].pb(i);
  rep(i, n) C[s[i] - 'a'].pb(i+n);

  ll ans = 0;
  int p = -1;
  rep(i,t.size()) {
    int c = t[i] - 'a';
    if(C[c].empty()){
      cout << -1 << endl;
      return 0;
    }
    p = *upper_bound(all(C[c]),p);
    if(p >= n){
      p -= n;
      ans += n;
    }
  }

  cout << ans+p+1 << endl;
}

Measured memory_bytes: 1724
//Ruthless Coding 
#include <bits/stdc++.h>

#define uni(x)      (x).resize(unique(all(x)) - (x).begin())
#define fprint(v)   for(auto x : v) cout << x << ' '
#define ALL(x)      (x).begin(), (x).end()
#define MP(x, y)    make_pair(x, y)
#define PII         pair<int, int>
#define SZ(x)       int((x).size())
#define PB(x)       push_back(x)
#define ll          long long
#define S           second 
#define F           first
#define nl          '\n'

using namespace std;

mt19937_64 rnd;

const int N = 2e5 + 5;

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    ll h, w;
    cin >> h >> w;
    ll hh = h / 2;
    ll ww = w / 2;
    if(h == 1 || w == 1){
        cout << 1 << nl;
    }else{
        ll ans = (hh + (ll)(h & 1)) * (ww + (ll)(w & 1)) + hh * ww;
        cout << ans;
    }
    return 0;
}


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

using namespace std;
using ll = long long;

template <typename K,typename V>
using umap = unordered_map<K,V>;
template <typename V>
using uset = unordered_set<V>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define REP(i,n) for(int i=0;i<n;i++)
#define REPD(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define ALL(v) v.begin(),v.end()

#define INF 1'000'000'000'000 //10^12
#define MOD 1'000'000'007
//グリッドグラフの範囲チェック
bool range_validation(int y,int x,int h,int w){
    return y>=0 && y<h && x>=0 && x < w;
}
//ビットカウント
int popcount(long bits){
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int gcd(ll a, ll b){
  if(b == 0){
    return a;
  }else{
    return gcd(b,a%b);
  }
}

vector<ll> sieve(ll n){
  int p = 0;
  vector<bool> is_prime(n+1,true);
  vector<ll> res;
  for(int i=2;i<=n;i++){
    if(is_prime[i]){
      res.push_back(i);
      for(int j=2*i;j<=n;j+=i){
        is_prime[j] = false;
      }
    }
  }
  return res;
}

vector<ll> divisor(ll n){
  vector<ll> list;
  for(int i=2;i*i<=n;i++){
    if(n%i==0){
      list.push_back(i);
      if(n/i != i){
        list.push_back(n/i);
      }
    }
  }
  return list;
}

umap<int,int> prime_factor(ll n){
  umap<int,int> fac;
  for(int i=2;i*i<=n;i+=2){
    if(n%i == 0){
      int count = 0;
      while(n%i == 0){
        count++;
        n /= i;
      }
      fac[i] = count;
    }
  }
  if(n!=1)fac[n] = 1;
  return fac;
}

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int n;
  string s;
  cin >> n;
  cin >> s;
  int red = 0;
  int white = 0;
  REP(i,n){
    if(s[i]=='W'){
      white++;
    }else{
      red++;
    }
  }
  int count = 0;
  for(int i=red;i<n;i++){
    if(s[i]=='R'){
      count++;
    }
  }
  cout << count << endl;
  return 0;
}


Measured memory_bytes: 3740
import sys
import bisect
import numpy as np
#input = sys.stdin.readline
N,M=map(int,input().split())
A=[int(i) for i in input().split()]
B=[0]*M
C=[0]*M
for i in range(M):
    B[i],C[i]=[int(x) for x in input().split()]
matrix = np.vstack((np.array(B),np.array(C)))
matrix = matrix[:, np.argsort(-matrix[1])]
list2=np.zeros(N)
i=0
for b,c in zip(matrix[0],matrix[1]):
    i += b
    #print(i-b,b)
    if i < N:
        list2[i-b:i] = c
        #print(list2)
    else: 
        list2[i-b:]=c
        #print(list2)
A.extend(list(list2))
A.sort()
print(int(sum(A[N:])))

Measured memory_bytes: 31644
while 1:
    w = int(raw_input())
    if w == 0: break
    minp = 9500
    for c in range(11):
        for b in range(17):
            for a in range(26):
                t = 200 * a + 300 * b + 500 * c
                if t > w: break
                if t == w:
                    p = int(380 * (a - a % 5) * 0.8 + 380 * (a % 5)
                            + 550 * (b - b % 4) * 0.85 + 550 * (b % 4)
                            + 850 * (c - c % 3) * 0.88 + 850 * (c % 3))
                    minp = min(minp, p)
    print minp

Measured memory_bytes: 4260
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    public static bool f = false, t = true;
    static void Main(string[] args)
    {
        char[] a = new char[3];
        for(int i = 0; i < a.Length; i++)
        {
            a[i] = Console.ReadLine()[i];
            
        }
        for (int i = 0; i < a.Length; i++) { Console.Write(a[i]); }
        Console.ReadLine();
       
    }
    public static long gcd(long a, long b)
    {
        while (true)
        {
            if (a == 0) { return b; }
            if (b == 0) { return a; }
            if (a > b) { a -= b; }
            else { b -= a; }
        }
    }
    public static long lcm(long a, long b) { return a / gcd(a, b) * b; }
    public static bool IsPrime(int num)
    {
        if (num < 2) return false;
        else if (num == 2) return true;
        else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

        double sqrtNum = Math.Sqrt(num);
        for (int i = 3; i <= sqrtNum; i += 2)
        {
            if (num % i == 0)
            {
                // 素数ではない
                return false;
            }
        }

        // 素数である
        return true;
    }
}
public static class Read
{
    public static void outl(string n = "") { Console.WriteLine(n); return; }
    public static long Long() { return long.Parse(Console.ReadLine()); }
    public static long[] longs() { return Console.ReadLine().Split().Select(long.Parse).ToArray(); }
    public static int Int() { return int.Parse(Console.ReadLine()); }
    public static int[] ints() { return Console.ReadLine().Split().Select(int.Parse).ToArray(); }
    public static string Str() { return Console.ReadLine(); }
    public static string[] Strs() { return Console.ReadLine().Split(); }
}

Measured memory_bytes: 11092
N = int(input())
A = list(map(int, input().split()))


def is_all_approved(numArry):
    for num in numArry:
        if num % 2 == 0:
            if num % 3 != 0 and num % 5 != 0:
                return False
    return True


if is_all_approved(A):
    print("APPROVED")
else:
    print("DENIED")


Measured memory_bytes: 2940
#include <stdio.h>
#define ll long long
ll max(ll a, ll b)
{
    return (a > b) ? a : b;
}

ll dp[101][100001];

int main()
{
    ll n, w;
    scanf("%lld %lld", &n, &w);
    ll wi[101], vi[101];
    for (ll i = 0; i < n; i++)
    {
        scanf("%lld %lld", &wi[i], &vi[i]);
    }

    for (ll i = 0; i <= n; i++)
    {
        for (ll j = 0; j <= w; j++)
        {
            if (i == 0 || j == 0)
            {
                dp[i][j] = 0;
            }
            else if (wi[i - 1] <= j)
            {
                dp[i][j] = max(vi[i - 1] + dp[i - 1][j - wi[i - 1]], dp[i - 1][j]);
            }
            else
            {
                dp[i][j] = dp[i - 1][j];
            }
        }
    }
    printf("%lld\n", dp[n][w]);
    return 0;
}

Measured memory_bytes: 79104
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
const double PI = 3.14159265358979323846;

int main() {
  char a, b;
  cin >> a >> b;
  if(a == 'D') {
    if(b == 'H') cout << 'D' << endl;
    else cout << 'H' << endl;
  }
  else {
  if(b == 'H') cout << 'H' << endl;
  else cout << 'D' << endl;
  }
}

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

int main() {
	int n, t[100010] = { 0 }, x[100010] = { 0 }, y[100010] = { 0 };
	int check[100010] = { 0 };
	cin >> n;
	for (int i = 1;i < n + 1;i++) {
		cin >> t[i] >> x[i] >> y[i];
		check[i] = abs(x[i] - x[i - 1]) + abs(y[i] - y[i - 1]);
	}
	string res = "Yes";
	for (int i = 1;i < n + 1;i++) {
		if (check[i] > t[i] - t[i - 1] || check[i] % 2 != (t[i] - t[i - 1]) % 2) {
			res = "No";
			break;
		}
	}
	cout << res << endl;
}

Measured memory_bytes: 1920
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();
		
		int x;
		int y;
		int z;
		
		if ((a < b) && (a < c)) {
			x = a;
			if (b < c) {
				y = b;
				z = c;
			}
			else {
				y = c;
				z = b;
			}
		}
		else if (b<c) {
			x = b;
			if (a < c) {
				y = a;
				z = c;
			}
			else {
				y = c;
				z = a;
			}
		}
		else {
			x = c;
			if (a < b){
				y = a;
				z = b;
			}
			else {
				y = b;
				z = a;
			}
		}
		
		System.out.println(x + " " + y + " " + z);

	}

}

Measured memory_bytes: 26320
sosuu=[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]
N=int(input())
L=[0 for i in range(25)]
for i in range(25):
  s=N
  while True:
    if s!=0:
      s=s//sosuu[i]
      L[i]+=s
    else:
      break
#1 75 3 25 5 15 (3 5 5)
a,b,c,d,e=0,0,0,0,0
for i in range(25):
  if L[i]>=74:
    a+=1
  if L[i]>=24:
    b+=1
  if L[i]>=14:
    c+=1
  if L[i]>=4:
    d+=1
  if L[i]>=2:
    e+=1
print(a+b*(e-1)+c*(d-1)+d*(d-1)*(e-2)//2)

Measured memory_bytes: 9208
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
using namespace std;
typedef pair<int, int> P;

const int mod = 1e9 + 7;
int n, m;
int dp[310][310][310];

signed main(){
	cin >> n >> m;
	vector<P> v[310];
	rep(i, 0, m){
		int l, r, x;
		cin >> l >> r >> x;
		v[r]. push_back(P(l, x));
	}
	dp[0][0][0] = 1;
	rep(a, 0, n + 1){
		rep(b, 0, n + 1){
			rep(c, 0, n + 1){
				if(dp[a][b][c] == 0) continue;
				vector<int> tmp = {a, b, c};
				sort(all(tmp));
				bool ok = true;
				for(P x : v[tmp[2]]){
					if(x.second == 1){
						if(tmp[1] < x.first);
						else ok = false;
					}
					if(x.second == 2){
						if(tmp[0] < x.first && x.first <= tmp[1]);
						else ok = false;
					}
					if(x.second == 3){
						if(x.first <= tmp[0]);
						else ok = false;
					}
				}
				if(!ok){
					dp[a][b][c] = 0;
				}else{
					(dp[tmp[2] + 1][b][c] += dp[a][b][c]) %= mod;
					(dp[a][tmp[2] + 1][c] += dp[a][b][c]) %= mod;
					(dp[a][b][tmp[2] + 1] += dp[a][b][c]) %= mod;
				}
			}
		}
	}
	int ans = 0;
	rep(i, 0, n){
		rep(j, 0, n){
			(ans += dp[n][i][j] + dp[i][n][j] + dp[i][j][n]) %= mod;
		}
	}
	cout << ans << endl;
}

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

using namespace std;

int n;

vector<int> arr;

vector<int> res;

int main() {
    cin >> n;

    int num;
    for(int i = 0; i < n; i++) {
        cin >> num;
        arr.push_back(num);
    }

    res.resize(n);
    
    int l_p = 0, r_p = n-1;
    
    for(int i = n-1, c = 0; i >= 0; i--, c++) {
        if (c % 2 == 0) {
            // left
            res[l_p++] = arr[i];
        } else {
            res[r_p--] = arr[i];
        }
    }

    for(int i = 0; i < n; i++) {
        if (i) {
            cout << " ";
        }
        cout << res[i];
    }

    cout << endl;
    
    return 0;
}


Measured memory_bytes: 3828
N = int(input())
AB = [list(map(int, input().split())) for i in range(N)]

def mid(AB, idx):
    if N % 2 == 0:
        return (AB[N//2-1][idx] + AB[N//2][idx]) / 2
    else:
        return AB[(N+1)//2-1][idx]

AB.sort()
amid = mid(AB, 0)
AB.sort(key=lambda x: x[1])
bmid = mid(AB, 1)
tmp = 1 if N % 2 == 1 else 2
print(int(tmp * (bmid - amid) + 1))


Measured memory_bytes: 112564
//----AUTHOR:kkdrummer----/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef    long long   ll;
typedef    long double   ld;
//typedef    unordered_set<ll>   usll;
//typedef    unordered_multiset<ll>   umsll;
typedef    multiset<ll>   msll;
typedef    set<ll>   sll;
typedef    vector<ll>   vll;
typedef    pair<ll,ll>   pll;
typedef    vector<pll>   vpll;
typedef    priority_queue<ll>   pqll;
typedef    vector<int>   vi;
typedef    set<int>   si;
typedef    multiset<int>   msi;
//typedef    unordered_multiset<int>   umsi;
//typedef    unordered_set<int>   usi;
typedef     pair<int,int>   pi;
typedef    vector<pi>   vpi;
typedef    set<pi>   spi;
typedef    priority_queue<int>   pqi;
typedef    tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>   ind_set;
typedef    tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>   ind_setll;
#define    in   insert
#define    fi   first
#define    se   second
#define    pb   push_back
#define    mp   make_pair
#define    be   begin
#define    en   end
#define    itr   iterator
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define    mo   1000000007
#define    inf  9223372036854775807
#define    ninf   -inf
#define    ima   2147483647
#define    imi   -ima
#define    oncnt    __builtin_popcount
#define    zerobegin   __builtin_clz
#define    zeroend   __builtin_ctz
#define    parity   __builtin_parity
#define    all(x)   x.be(),x.en()
#define    eps   1e-9
#define    coutd   cout<<setprecision(10)<<fixed
#define    mems(dp,x)   memset(dp,x,sizeof(dp))
const    ld   PI=3.14159265359;
inline ll modpow(ll x,ll n){if(n==0)return 1;if(n==1)return(x%mo);ll u=(modpow(x,n/2));u=(u*u)%mo;if(n%2!=0)u=(u*x%mo)%mo;return u;}
inline ll modinv(ll x){return modpow(x,mo-2);}
inline ll mmul(ll a,ll b){    if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll madd(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a+b>=mo)return(a+b)%mo;return(a+b);}
inline ll msub(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;return(((a-b)%mo+mo)%mo);}
inline ll mdiv(ll a,ll bb){if(a>=mo)a=a%mo;ll b=modinv(bb);if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll gcd(ll a,ll b){return __gcd(a,b);}


int main()
{
io
int testcases=1;//cin>>testcases;
while(testcases--)
{
	

int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);

int c=a[n/2]-a[n/2-1];
cout<<c;
	
	


}return 0;}

Measured memory_bytes: 640
#include<stdio.h>
#include<string.h>
int main(void)
{
  int i,check=0;
  char a[101];
  gets(a);
  for(i=0;a[i]!=0;i++){
    if((i%2==0&&a[i]=='L')||(i%2==1&&a[i]=='R')){
      check=1;
      break;
    }
    
    
  }
  if(check==0){
    puts("Yes");
  }
  else{
    puts("No");
  }
  return 0;
    
}

Measured memory_bytes: 128
#include <cstdio>
#include <set>
#define M(x,y)std::make_pair(x,y)
typedef std::set<std::pair<int,int> >S;
int n,x,y,x1,y1,x2,y2,dx,dy;main(){for(;scanf("%d",&n),n;){
    S s;
    for(;n;n--)scanf("%d%d",&x,&y),s.insert(M(x,y));
    S::iterator it1,it2;
    for(it1=s.begin();it1!=s.end();it1++){
        x1=it1->first,y1=it1->second;
        for(it2=it1,it2++;it2!=s.end();it2++){
            x2=it2->first,y2=it2->second,dx=x2-x1,dy=y2-y1;
            if(dx*dx+dy*dy>n&&(
                s.find(M(x1-dy,y1+dx))!=s.end()&&s.find(M(x2-dy,y2+dx))!=s.end()
            ))n=dx*dx+dy*dy;
        }
    }
    printf("%d\n",n);
}}

Measured memory_bytes: 1160
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	static void Main(){
		Sc sc=new Sc();
		var s=sc.S;
		var t=sc.S;
		int n=s.Length;
		var h=new int[n][];
		h[n-1]=Enumerable.Repeat(-1,26).ToArray();
		long ans=1;
		for(int i = n-2;i>=0;i--) {
			h[i]=new int[26];
			for(int j = 0;j<26;j++) {
				h[i][j]=h[i+1][j];
			}
			h[i][s[i+1]-97]=i+1;
		}
		for(int i = n-1;i>=0;i--) {
			for(int j = 0;j<26;j++) {
				h[i][j]=h[(i+1)%n][j];
			}
			h[i][s[(i+1)%n]-97]=(i+1)%n;
		}
		for(int i = 0,j=0;i<t.Length;i++) {//i:t j:h
			if(i==0&&t[0]==s[0]){
				continue;
			}
			if(h[j][t[i]-97]==-1){ans=-1;break;}
			int p=(h[j][t[i]-97]+n-j)%n;
			p=p==0?n:p;
			ans+=p;
			j=h[j][t[i]-97];
		}
		Console.WriteLine("{0}",ans);
	}
}

public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}


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

using namespace std;

int main() {

	int n;
	cin >> n;
	double inv = 0.0;
	for(int i = 0; i < n; i++){
		double a;
		cin >> a;
		inv += ( 1.0 / a);
		
	}
	printf("%.9lf\n", 1.0/inv);
	
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  vector <int> N(4);
  for(int i = 0; i < 4; i++){
    cin >> N.at(i);
  }
  sort(N.begin(), N.end());
  if(N.at(0) == 1 && N.at(1) == 4 && N.at(2) == 7 && N.at(3) == 9){
    cout << "YES" << endl;
  }
  else{
    cout << "NO" << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<vector>
#include<string>
using namespace std;
int main(){  
    int n,x,a,d;
    d=0;
    int count=1;
    cin>>n>>x;
    for (int i = 1; i < n+1; i++)
    {
        cin>>a;
        d+=a;
        if(d<=x){
            count++;
        }
        

    }
    cout<<count;
    
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  char s[11] = { '\0' };
  scanf("%s", s);
  if(s[0] == 'Y' && s[1] == 'A' && s[2] == 'K' && s[3] == 'I') printf("Yes\n");
  else printf("No\n");
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
using P = pair<int, int>;
using PL = pair<lint, lint>;
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
constexpr int MOD = 1000000007;
constexpr int INF = 2147483647;
void yes(bool expr) {cout << (expr ? "Yes" : "No") << "\n";}
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  lint N, D;
  cin >> N >> D;
  lint ans = 0;
  REP(i, N) {
    lint X, Y;
    cin >> X >> Y;
    if(X*X + Y*Y <= D*D) ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define st first
#define nd second

using namespace std;

void debug_out() { cerr << endl; }
template<class T> ostream& prnt(ostream& out, T v) { out << v.size() << '\n'; for(auto e : v) out << e << ' '; return out;}
template<class T> ostream& operator<<(ostream& out, vector <T> v) { return prnt(out, v); }
template<class T> ostream& operator<<(ostream& out, set <T> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, map <T1, T2> v) { return prnt(out, v); }
template<class T1, class T2> ostream& operator<<(ostream& out, pair<T1, T2> p) { return out << '(' << p.st << ' ' << p.nd << ')'; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << " " << H; debug_out(T...);}

#define dbg(...) cerr << #__VA_ARGS__ << " ->", debug_out(__VA_ARGS__)
#define dbg_v(x, n) do{cerr<<#x"[]: ";for(long long _=0;_<n;++_)cerr<<x[_]<<" ";cerr<<'\n';}while(0)
#define dbg_ok cerr<<"OK!\n"

const long long N = 200100;
long long n, a[N], b[N], ans;
priority_queue <pair<long long, long long>  > pq;

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

	cin >> n;
	for(long long i = 0; i < n; i++)
		cin >> a[i];

	for(long long i = 0; i < n; i++) {
		cin >> b[i];
		if(b[i] != a[i])
			pq.push({b[i], i});
	}

	while(!pq.empty()) {
		auto p = pq.top();
		pq.pop();
		long long nxt = a[p.nd];
		// dbg(p);
		long long dif = p.st - nxt;
		dif /= (b[(n + p.nd - 1) % n] + b[(p.nd + 1) % n]);
		dif = max(dif, 1LL);
		ans += dif;
		p.st -= dif * (b[(n + p.nd - 1) % n] + b[(p.nd + 1) % n]);
		if(p.st != a[p.nd])
			pq.push(p);
		
		if(p.st < a[p.nd]) return cout << "-1\n", 0;
		b[p.nd] = p.st;
	}
	cout << ans << '\n';
}	


Measured memory_bytes: 9200
#include <iostream>
#include <cstdio>
using namespace std;
string a;
int c, ans;
int main() {
    cin >> a;
    for (int i=0; a[i]; i++) {
        if (a[i]=='S') c++;
        else if (c>0) c--;
        else ans++;
    }
    cout << ans*2;
    return 0;
}

Measured memory_bytes: 640