akhauriyash/Code-Regression huggingface dataset:
/*
 A Submission by $%U%$
 at time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
*/
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define FILE_IN "nim.in"
#define FILE_OUT "nim.out"
#define ofile freopen(FILE_IN,"r",stdin);freopen(FILE_OUT,"w",stdout)
#define fio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define nfio cin.tie(0);cout.tie(0)
#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))
#define ord(a,b,c) ((a>=b)and(b>=c))
#define MOD (ll(1000000007))
#define MAX 300001
#define mag 320
#define p1 first
#define p2 second.first
#define p3 second.second
#define fi first
#define se second
#define pow2(x) (ll(1)<<x)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define piii pair<int,pii>
#define For(i,__,___) for(int i=__;i<=___;i++)
#define Rep(i,__,___) for(int i=__;i>=___;i--)
#define ordered_set tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update>
#define bi BigInt
#define pi 3.1415926535897
typedef long long ll;
//------------xúc xích normie tám muoi tám phan tram não----------//
ll n,m,k,t,t1,i,j,minn,maxx,cur,lu,lv;
pll res[65];
ll fac[200001];
ll bow (ll a, ll x)
{
	if (!x) return 1;
	ll res=bow(a,x/2);
	res*=res;res%=MOD;
	if (x%2) res*=a;
	return res%MOD;
}
ll c (ll n  , ll k)
{
	ll res=1;
	res*=fac[n];res%=MOD;
	res*=bow(fac[k],MOD-2);res%=MOD;
	res*=bow(fac[n-k],MOD-2);res%=MOD;
	return res;
}
int main() {
//	ofile;
	fio;
	fac[0]=1;
	for (i=1;i<=2*100000;i++)
	{
		fac[i]=fac[i-1]*i;
		fac[i]%=MOD;
	}
	ll h,w,a,b,res=0;
	cin>>h>>w>>a>>b;
	for (i=1;i<=h-a;i++)
	{
//		cout<<i+b-2<<' '<<b-1<<endl<<h-i+1+(w-b)-2<<' '<<w-b-1<<endl;
	res+=c(i+b-2,b-1)*c(h-i+1+(w-b)-2,w-b-1);
	res%=MOD;
	}
	cout<<res;
}


Measured memory_bytes: 5220
#include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <string>
#include <cstring>
#include <cassert>
#include <utility>
#include <iomanip>
#include <chrono>
#include <random>
#include <bitset>

using namespace std;

#define sz(x) (int) x.size()
#define unique(x) x.erase(unique(x.begin(), x.end()), x.end())
#define all(a) a.begin(), a.end()
#define sqr(x) ((x) * (x)) 
#define y1 aksjdaskdjksjfksdjf
#define left kdnvldvoiwejifejg
#define right lkdsjflksdjfdjfk
#define prev asdasfsadjkjsdfjs
#define tm aklsjdasjdasjdkdjjf
#define lcm hddalkwjeidjjhasda
#define random_shuffle asdasdd

const int MAXN = 3050;
const int mod = (int) 1e9 + 7;

long long f[2 * 105000];

long long binpow(long long x, long long p) {
  long long res = 1;
  while (p) {
    if (p & 1) {
      res = (res * x) % mod;
      p--;
    } else {
      x = (x * x) % mod;
      p /= 2;
    }
  }
  return res % mod;
}

long long inv(long long x) {
  return binpow(x, mod - 2);
}

long long getCnk(long long n, long long k) {
  long long res = f[n];
  res = res * inv(f[k]) % mod;
  res = res * inv(f[n - k]) % mod;
  // cerr << "cnk " << n << " " << k << endl;
  return res;
}

int h, w, n;
vector < pair<int, int> > v;
long long dp[MAXN];

int main() { 

  scanf("%d %d %d", &h, &w, &n);
  for (int i = 0; i < n; i++) {
    int r, c;
    scanf("%d %d", &r, &c);
    v.push_back({r, c});
  }
  v.push_back({h, w});
  sort(all(v));

  f[0] = 1;
  for (int i = 1; i <= h + w; i++) {
    f[i] = f[i - 1] * i % mod;
  }

  for (int i = 0; i <= n; i++) {
    int r = v[i].first, c = v[i].second;
    // cerr << r << " " << c << endl;
    dp[i] = getCnk(r + c - 2, r - 1);
    for (int j = i - 1; j >= 0; j--) {
      if (v[j].second > c) {
        continue;
      }
      long long rem = dp[j];
      rem = rem * getCnk(r + c - v[j].first - v[j].second, r - v[j].first) % mod;
      dp[i] = (dp[i] - rem) % mod;
      if (dp[i] < 0) {
        dp[i] += mod;
      }
    }
    // cerr << dp[i] << endl;
  }

  cout << dp[n] << endl;

  return 0;
}


Measured memory_bytes: 1920
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;

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

	auto rightCount = 0;
	for (auto i = 0; i < S.length(); ++i)
	{
		if (S[i] == '(')
		{
			++rightCount;
		}
		else
		{
			rightCount = max(0, rightCount - 1);
		}
	}

	auto leftCount = 0;
	for (auto i = (int)S.length() - 1; i >= 0; --i)
	{
		if (S[i] == ')')
		{
			++leftCount;
		}
		else
		{
			leftCount = max(0, leftCount - 1);
		}
	}

	for (auto i = 0; i < leftCount; ++i)
	{
		cout << "(";
	}
	cout << S;
	for (auto i = 0; i < rightCount; ++i)
	{
		cout << ")";
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fi(a) scanf("%d",&a);
#define fli(a) scanf("%ld",&a);
#define fll(a) scanf("%lld",&a);
#define pi(a) printf("%d\n",a);
#define ppi(i,a) printf("Case %d: %d\n",i,a);
#define ll long long
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

int main()
{
    fast
    double h,m,a,b;
    cin >> a >> b >> h >> m;
    double hour_angle = 0.5 * (h * 60 + m);
    double minute_angle = 6 * m;

    double angle = abs(hour_angle - minute_angle);
    angle = min(360 - angle, angle);
    double c = sqrt(b*b + a*a - 2*a*b*cos(angle*acos(-1)/180)) ;
    cout << setprecision(20) << fixed << c << endl;
    return 0;
}



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

typedef struct{
  int A[1000];
  int ans;
  bool c;
}node;
node T[1000];
int Q[10000000];
int head=0;
int tail=1;
int n;

void function(int num){
  while(true){
    if(head==tail)break;
    num=Q[head++];
    T[num].c=true;
    for(int i=0;i<n;i++){
      if(T[num].A[i]!=0){
	if(T[i].ans>T[num].ans+T[num].A[i]){
	  T[i].ans=T[num].ans+T[num].A[i];
	Q[tail++]=i;
	}
      }
    }
  }
}

int main(){
  int num,son,z,w;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>num>>son;
    T[num].ans=INT_MAX;
    for(int j=0;j<son;j++){
      cin>>z>>w;
      T[num].A[z]=w;
      }
  }
  Q[0]=0;
  T[0].ans=0;
  function(0);
 
  for(int i=0;i<n;i++){
      cout<<i<<" "<<T[i].ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
    char n[100000];
    int jsq=0,len;
    scanf("%s",&n);
    len=strlen(n);
    for(int i=1;i<len;i++)
    {
        if(n[i]!=n[i-1])jsq++;
    }
    printf("%d",jsq);
}

Measured memory_bytes: 256
/*
        Author: Prokash
                CSE48, JU

*/

#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
#define FAST ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
int ara[2005];
int main()
{
    FAST;
    map<int,int>mp;
    int n;
    cin>>n;
    int gcd;
    bool flag=true;
    while(n--)
    {
        int a;
        cin>>a;
        if(flag)
        {
            gcd=a;
            flag=false;
        }
        else
        {
            gcd=(__gcd(gcd,a));
        }
    }
    cout<<gcd<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main(void){
    int redbox,greenbox,bluebox;
    int sum;
    int numred,numgreen,numblue;
    int num_group=0;

    scanf("%d %d %d %d",&redbox,&greenbox,&bluebox,&sum);
    int i,j;
    for(i=0;i<=(sum/redbox)+1;i++){
        for(j=0;j<=(sum/greenbox)+1;j++){
            if(((sum-(redbox*i)-(greenbox*j))/bluebox)>=0){
                if((sum-(redbox*i)-(greenbox*j))%bluebox==0){
                    num_group++;
                    //printf("(%d,%d,%d)\n",i,j,(sum-(redbox*i)-(greenbox*j))/bluebox);
                }
            }
        }
    }
    printf("%d",num_group);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
bool yymm(int a, int b){
	if (b>=1 && b<=12) return true;
	return false;
}
bool mmyy(int a, int b){
	if (a>=1 && a<=12) return true;
	return false;
}
int main(){
	int a,b;
	string s;
	cin>>s;
	a=(s[0]-48)*10+(s[1]-48);
	b=(s[2]-48)*10+(s[3]-48);
	if (yymm(a,b) && mmyy(a,b)) cout<<"AMBIGUOUS";
	else if (yymm(a,b)) cout<<"YYMM";
	else if (mmyy(a,b)) cout<<"MMYY";
	else cout<<"NA";
	return 0;
}

Measured memory_bytes: 256
require 'set'; require 'prime'
INF=Float::INFINITY; MOD=10**9+7
n = gets.chomp.to_i
a = gets.chomp.split.map(&:to_i)
b = gets.chomp.split.map(&:to_i)

aremain = 0
bremain = 0
n.times do |i|
  if a[i] < b[i] && (b[i] - a[i]).odd?
    a[i] += 2
    b[i] += 1
  end

  if a[i] < b[i]
    aremain += b[i] - a[i]
  else
    bremain += a[i] - b[i]
  end
end

#p [aremain, bremain]
if aremain >= bremain * 2
  puts 'Yes'
else
  puts 'No'
end

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

vl fact,finv;
ll mdpow(ll x,ll k){
	ll res=1;
	while(k!=0){
		if(k&1)res=res*x%MOD;
		x=x*x%MOD;
		k=k>>1;
	}
	return res;
}

ll comb(ll n,ll k) {
	if(n==0&&k==0)return 1;
	if(n<k||n<0)return 0;
	return fact[n]*finv[n-k]%MOD*finv[k]%MOD;
}

struct ferm{
	ferm(ll n){
		fact.resize(n);
		finv.resize(n);
		fact[0]=1;
		finv[0]=1;
		rep(i,n-1){
			fact[i+1]=(fact[i]*(i+1))%MOD;
			finv[i+1]=mdpow(fact[i+1],MOD-2);
		}
	}
};
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll x,y,z,ans=1;
	ferm(1000010);
	cin>>x>>y;
	z=x+y;
	if(z%3!=0)ans=0;
	else{
		if(x>=(z/3)&&y>=(z/3)){
			ans=comb((z/3),(x-z/3));
		}
		else ans=0;
	}
	cout<<ans<<endl;

}


Measured memory_bytes: 15872
#include <iostream>
#include<bits/stdc++.h>
#include<vector>
#define fo(i,n) for(long long i=0;i<n;i++)
#define ll long long int
#define inf 999999999999999999
#define pb push_back
#define fi first
#define se second
#define vi vector<ll>
#define vii vector<vector<ll>>
#define pi pair<ll,ll>
#define mp make_pair
#define MOD 998244353
#define tr(c,it) for(auto it = (c).begin(); it != (c).end(); ++it)
#define fio ios_base::sync_with_stdio(false);cin.tie(0);
using namespace std;
//cerr<< '\n' << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms\n" ;
//freopen("explicit.in", "r", stdin);
//freopen("explicit.out", "w", stdout);
 
void SieveOfEratosthenes() 
{ 
    bool prime[10000001];
    memset(prime, true, sizeof(prime)); 
  
    for (ll p=2; p*p<=10000000; p++) 
    { 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (ll i=p*p; i<=10000000; i += p) {
                prime[i] = false; 
            }
        } 
    }  
} 
ll binpow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = (res * a);
        a = (a * a);
        b >>= 1;
    }
    return res;
}
ll gcd(ll a,ll b)
{
	if(b%a==0)
	   return a;
	return gcd(b%a,a);
}
ll power(ll x,ll y,ll p) 
{ 
    ll r = 1;
  
    x = x % p;
    while (y > 0) {
        if (y & 1) 
            r = (r * x) % p;
        y = y >> 1; 
        x = (x * x) % p; 
    } 
    return r; 
}  
ll modInverse(ll n, ll p) 
{ 
    return power(n, p - 2, p); 
} 
 
ll nCrModP(ll n,ll r, ll p) 
{ 
    ll fac[100005];
    if (r == 0) 
        return 1; 
  
    return (fac[n] * modInverse(fac[r], p) % p * modInverse(fac[n - r], p) % p) % p; 
}
ll a[200006]={0};
ll pre[200007]={0};
int32_t main() 
{
    fio
	ll j,i,n,t,l,r,c,h,k,m,maxi,d,x;
	cin>>n>>k;
	ll a[n],b[n];	
	vector<ll> v;
	pre[0]=0;
	for(j=0;j<k;j++)
	{
		cin>>a[j]>>b[j];	
	}
	pre[1]=1;
	for(i=2;i<=n;i++)
	{
		for(j=0;j<k;j++)
		{
			if(i-a[j]<1)
			continue;
			if(i-b[j]<1)
		    	pre[i]+=pre[i-a[j]];
			else
			{
				pre[i]+=pre[i-a[j]]-pre[i-b[j]-1];
			}			
		}
		pre[i]%=MOD;
		if(i!=n)
			pre[i]+=pre[i-1];
	}
	cout<<pre[n];
}


	

		

Measured memory_bytes: 5148
#include <iostream>
#include <stdio.h>
#include <math.h>
#include <algorithm>
using namespace std;
#define LL long long
const int N = 1e5+5;

int a[N],sum[N],n;
int temp[N];

LL mergesort(int l,int r)
{
	if(l>=r) return 0;
	int mid=(l+r)>>1;
	LL ans=mergesort(l,mid)+mergesort(mid+1, r);
	int ll=l,rr=mid+1;
	int cnt=0;
	while(ll<=mid&&rr<=r){
		if(sum[rr]>=sum[ll]){
			temp[++cnt]=sum[ll++];
		}else{
			ans+=ll-l;
			temp[++cnt]=sum[rr++];
		}
	}
	while(ll<=mid){
		temp[++cnt]=sum[ll++];;
	}
	while(rr<=r){
		ans+=mid-l+1;
		temp[++cnt]=sum[rr++];
	}
	for(int i=1;i<=cnt;i++){
		sum[l+i-1]=temp[i];
	}
	return ans;
}

LL check(int x)
{
	LL ans=0;
	for(int i=1;i<=n;i++){
		sum[i]=sum[i-1]+(a[i]>=x?1:-1);
		if(sum[i]>=0)
			ans++;
	}
	return ans+mergesort(1,n);
}


int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	int l=1,r=1e9;
	LL aim=(1LL+n)*n/2;
	while(l<r){
		int mid=(l+r+1)/2;
		if(check(mid)>=(aim+1)/2){
			l=mid;
		}else{
			r=mid-1;
		}
	}
	cout<<l<<endl;
	return 0;
}


Measured memory_bytes: 1408
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
//#include <bits/stdc++.h>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())

//const int MOD = 1000000007;
//const int INF = 1<<30;
using namespace std;

string yn(bool x){
    return x ? "Yes" : "No";
}


int main(){
    string s; cin >> s;
    bool ans = 0;
    if((s[0]==s[1] and s[1]==s[2])or (s[1]==s[2] and s[2]==s[3])) ans = 1;
    
    cout <<yn(ans) << endl;
    
}



Measured memory_bytes: 256
'use strict';

const main=(input)=>{
  let count = 0;
  const args = input.trim().split('');
  const num1 = args[0];
  const num2 = args[1];
  const num3 = args[2];
  
  if(num1 ==='1' ){
    count += 1;
  };
  if(num2 ==='1'){
    count += 1;
  };
  if(num3 ==='1'){
    count += 1;
  };
  console.log(count); 
};

main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7372
import sys
sys.setrecursionlimit(10**6)

#a = int(input())
#b = list(map(int, input().split()))
n, d = map(int, input().split())
#s = input()
#s,t = input().split()
#
readline = sys.stdin.readline
#n,m = [int(i) for i in readline().split()]
x = [[int(i) for i in readline().split()] for _ in range(n)]

import itertools
import math

ans = 0

for v in itertools.combinations(x, 2):
    dist = math.sqrt(sum([(i-j)**2 for i,j in zip(v[0], v[1])]))
    if dist == int(dist):
        ans += 1
        
print(ans)

Measured memory_bytes: 3064
stack = []
pond = []
x = 0

str = gets.chomp
str.each_char{|c|
    case c
    when "\\"
        stack.push x
    when "/"
        if start = stack.pop
            pond[stack.length] = [] if pond[stack.length].nil?
            pond[stack.length] << x - start
            if pond[stack.length + 1]
                dum = 0
                dum += pond[stack.length + 1].pop until pond[stack.length + 1].empty?
                pond.delete_at stack.length + 1
                pond[stack.length][-1] += dum
            end
        end
    end
    x += 1
}

pond.flatten!
pond.compact!
if pond.empty?
    puts "0"
    puts "0"
else
    puts pond.inject(:+)
    puts "#{pond.length} #{pond.join(" ")}"
end

Measured memory_bytes: 9096
use std::cmp::*;
use std::collections::HashSet;
use std::io::*;
use std::num::*;
use std::str::*;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let s = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok().unwrap()
}

fn string() -> String {
    read()
}

fn int() -> i64 {
    read()
}

fn char() -> char {
    read::<String>().pop().unwrap()
}

fn vecchar() -> Vec<char> {
    string().chars().collect()
}

fn vecint(n: i64) -> Vec<i64> {
    let mut vec = Vec::new();
    for i in 0..n {
        vec.push(int())
    }
    vec
}

fn main() {
    let (a, b) = (int(), int());
    let (adiv, bdiv) = (div(a), div(b));

    let mut ans = 0;
    for ad in adiv {
        if bdiv.contains(&ad) {
            ans += 1;
        }
    }
    println!("{}", ans)
}

fn div(n: i64) -> HashSet<i64> {
    let mut div = HashSet::new();
    let mut l = 2;
    let mut k = n;
    while l * l <= k {
        if k % l == 0 {
            div.insert(l);
            k /= l;
            continue;
        }
        l += 1
    }
    div.insert(k);
    div.insert(1);
    div
}


Measured memory_bytes: 4352
#include<stdio.h>
#include<iostream>

using namespace std;



int main(){
	char a[21];
	char b[21];
	cin>>a;
	int pos=0;
	for(int i=0;i<21;i++){
		if(a[i]=='\0')
			break;
		pos++;
	}
	int pos2=pos;
	b[pos]='\0';
	pos--;
	for(int n=0;n<pos2;n++){
		b[n]=a[pos];
		//cout << a[pos];
		pos--;
	}
	cout<<b<<"\n";
	return 0;
}

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

using namespace std;
int main() {
    int a,b,c,temp;
    cin>>a>>b>>c;
    temp=a;
    a=b;
    b=temp;

    temp=a;
    a=c;
    c=temp;

    cout<<a<<" "<<b<<" "<<c;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <unordered_map>

int main(int argc, char *argv[]) {
  std::string w;
  std::cin >> w;
  std::unordered_map<char, int> m;
  for (auto &c : w) {
    ++m[c];
  }
  for (auto &c : m) {
    if (c.second % 2 != 0) {
      std::cout << "No" << std::endl;
      return 0;
    }
  }
  std::cout << "Yes" << std::endl;
}


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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

int N,M,X,Y;

int A[6000],B[6000][6000];

vint G[6000];

int sum[6666];

int memo[5][5][5][5][5][5];

int calc(int a,int b,int c,int ab,int bc,int ca){
    chmin(a,4);chmin(b,4);chmin(c,4);chmin(ab,4);chmin(bc,4);chmin(ca,4);

    int &ret=memo[a][b][c][ab][bc][ca];
    if(ret!=-1)return ret;

    ret=0;
    rep(i,ab+1)rep(j,bc+1)rep(k,ca+1){
        if(i+j+k!=X)continue;
        if(4-i-k<=a&&4-i-j<=b&&4-j-k<=c&&i+k<=4&&i+j<=4&&j+k<=4)ret=1;
    }
    return ret;
}

signed main(){
    memset(memo,-1,sizeof(memo));

    cin>>N>>M>>X>>Y;
    vint a(N);
    rep(i,N)cin>>a[i];
    rep(i,M){
        int b;cin>>b;
        int c=a[i]-b;
        b--;c--;
        B[b][c]++;
        if(b!=c){
            if(B[c][b]==0)G[min(b,c)].pb(max(b,c));
            B[c][b]++;
        }
    }

    for(int i=M;i<N;i++)A[a[i]-1]++;

    rep(i,6000){
        sum[i]+=A[i]>=4;
        sum[i+1]=sum[i];
    }

    int ans=0;
    rep(i,6000){
       if(B[i][i]>=X&&A[i]>=Y)ans++;
    }

    rep(i,6000)rep(j,6000){
        if(i==j)continue;
        bool ok=false;
        for(int k=0;k<=4&&k<=B[i][i]&&k<=X;k++){
            int l=X-k;
            if(l>4||k*2+l>8||l>B[i][j])continue;

            int x=8-2*k-l;
            int y=4-l;
            if(x<=A[i]&&y<=A[j])ok=true;
        }
        ans+=ok;
    }



    rep(i,6000){
        for(int j=i+1;j<6000;j++){
            int tmp=sum[6000]-sum[j];



            for(auto k:G[i]){
                if(k<=j)continue;

                ans+=calc(A[i],A[j],A[k],B[i][j],B[j][k],B[k][i]);
                if(A[k]>=4)tmp--;
            }
            for(auto k:G[j]){
                if(B[i][k])continue;
                ans+=calc(A[i],A[j],A[k],B[i][j],B[j][k],B[k][i]);
                if(A[k]>=4)tmp--;
            }

            if(B[i][j]>=X&&X<=4&&4-X<=A[i]&&4-X<=A[j])ans+=tmp;
        }
    }

    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 19476
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
using namespace std;
int main()
{
	string s;
	cin >> s;
	reverse(s.begin(), s.end());
	vector<int>v;
	int t = 0;
	for (int i = 0; i < s.size(); i++)
	{
		v.push_back(((s[i] - '0') * 9 + t) % 10);
		t = ((s[i] - '0') * 9 + t) / 10;
	}
	if (t > 0)v.push_back(t);
	reverse(v.begin(), v.end());
	int sum = 0;
	for (int i = 0; i < v.size(); i++)sum += v[i];
	for (int p = 0;; p++)
	{
		if (sum <= 0)
		{
			printf("%d\n", (p + 8) / 9);
			break;
		}
		int cnt = 0;
		for (;;)
		{
			if (v.empty())
			{
				v.push_back(1);
				sum++;
				break;
			}
			if (v[v.size() - 1] == 9)
			{
				v.pop_back();
				sum -= 9;
				cnt++;
			}
			else
			{
				v[v.size() - 1]++;
				sum++;
				break;
			}
		}
		for (int i = 0; i < cnt; i++)v.push_back(0);
		sum--;
	}
}

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

using namespace std;

const int MX = 300000, md = 998244353;

char s[MX + 1];

int f[MX];

int main() {
	int n;
	ignore = scanf("%d %s", &n, s);
	
	for (int r = 0, g = 0, b = 0, i = 0; i < n; i++, r++, g++, b++) {
		while (s[r] != 'R') r++;
		while (s[g] != 'G') g++;
		while (s[b] != 'B') b++;
		
		int L = min({r, g, b});
		int R = max({r, g, b});
		int C = r + g + b - L - R;
		
		f[L] = -1;
		f[C] = 0;
		f[R] = 1;
	}
	
	int ans = 1;
	for (int i = 1; i <= n; i++) ans = ans * 1ll * i % md;
	
	for (int i = 0, x = 0; i < 3 * n; i++) {
		if (f[i] == -1) x++;
		if (f[i] == 0) {
			ans = ans * 1ll * x % md;
			x--;
		}
	}
	
	for (int i = 3 * n - 1, x = 0; i >= 0; i--) {
		if (f[i] == 1) x++;
		if (f[i] == 0) {
			ans = ans * 1ll * x % md;
			x--;
		}
	}
	
	printf("%d\n", ans);
	
	return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include<iomanip>
#include <functional>
#include <cassert>
using namespace std;


main(){
	int n;
	cin >> n;
	int a[n];
	double ans=0;
	
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	sort(a,a+n);

	ans=a[0]+a[1];
	ans/=2;
	for(int i=2;i<n;i++){
		ans=ans+a[i];
		ans/=2;
	}
	cout << setprecision(10) << ans << endl;

}


Measured memory_bytes: 256
n, m = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
diff = []
if m <= n:
    print(0)
    exit()
for i in range(1, m):
    diff.append(x[i] - x[i - 1])
diff.sort()
print(sum(diff[:m-n]))


Measured memory_bytes: 13960
#include<bits/stdc++.h>
using namespace std;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    int a , b ;
    cin >> a >> b ;
    for(int i = 1; i <= 1250; i++)
    {
       if( floor( i * 0.08) == a and floor(i * 0.1) == b )
       {
         cout << i << endl ;
         return 0;
       }
    }
    cout << -1 << endl ;
}

Measured memory_bytes: 256
s=input()
for i in range(1<<3):
    su=0
    ans=[]
  #  print(i)
    for j in range(3):
        if (i>>j)&1:
            ans.append('+')
        else: 
            ans.append('-')
    ans=ans[::-1]
    ss=[ int(i) for i in s]
    su+=ss[0]
 #   print(ans)
#    print(ss)
  #  continue
    for k in range(1,4):
        if ans[k-1]=='+':
   #         print(ss[k],end=' + \n')
            su+=ss[k]
        else:
    #        print(ss[k],end=' -\n')
            su-=ss[k]
    #print(su)
    if su==7:
        for i in range(0,3):
            print(s[i],end='')
            print(ans[i],end='')
        print(s[3],end='')
        print('=7')
        import sys
        sys.exit()



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

using i64 = int64_t;

int main(){
    int n, m;
    cin >> n >> m;
    vector<int> v;
    for(int i=0;i<n;++i){
        int a;
        cin >> a;
        v.push_back(a);
    }
    vector<int> vote(n);
    for(int i=0;i<m;++i){
        int b;
        cin >> b;
        for(int j=0;j<n;++j){
            if(v[j] <= b){
                vote[j]++;
                break;
            }
        }
    }
    int ans = 0, maxi = 0;
    for(int i=0;i<n;++i){
        if(maxi < vote[i]){
            ans = i;
            maxi = vote[i];
        }
    }

    cout << ans + 1 << endl;

    return 0;
}


Measured memory_bytes: 3148
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Math;

class P
{
  static int[] Input(){
    return Console.ReadLine().Split().Select(int.Parse).ToArray();
  }

  static int[][] Input2(int n){
    int[][] X = new int[n][];
    for(int i = 0; i < n; i++){
      X[i] = Input();
    }
    return X;
  }

  static void Main()
  {
    int[] NH = Input();
    List<int> X = new List<int>();
    List<int> Y = new List<int>();
    for(int i = 0; i < NH[0]; i++){
      int[] XY = Input();
      X.Add(XY[0]);
      Y.Add(XY[1]);
    }
    Y.Sort();
    Y.Reverse();
    X.Sort();
    int mx = X[NH[0]-1];
    int r = 0;
    foreach(int y in Y){
      if (y < mx)break;
      NH[1] -= y;
      r += 1;
      if (NH[1] <= 0) break;
    }
    if (NH[1] > 0)r += (NH[1] + mx -1) / mx;
    Console.WriteLine(r);
  }
}


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

#define rep(i,n) for( (i)=0;(i)<(n);++(i) )
#define repr(i,n) for( (i)=(n);(i)>0;==(i) )
#define FOR(i,j,n) for( (i)=(j);(i)<(n);++(i) )
#define forr(i,j,n) for( (i)=(j);(i)>(n);--(i) )
#define debg(a) cout<<(a)<<endl;
#define INF 9999999
#define int long long 
#define str string
#define elif else if

int i,j,k;
int dx,dy;
int a,b,c,x,y,n,m,cnt=0,ans=0;
str s,t;

signed main(){ 
  cin>>s;
  rep(i,4){
    if(s[i]=='2')cnt++;
  }
  debg(cnt);

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using ll=long long;
const ll MOD=1e9+7;
const int INF=1<<30;

int main(){
  int N,M;
  cin >> N >> M;
  vector<ll> a(N);
  ll ans=0;
  rep(i,N)
    cin >> a[i];
  vector<ll> S(N+1);
  rep(i,N)
    S[i+1]=(S[i]+a[i])%M;
  map<int,ll> mp;
  for(int i=1;i<N+1;i++)
    mp[S[i]]++;
  for(auto c:mp){
    ans+=c.second*(c.second-1)/2;
  }
  ans+=mp[0];
  cout << ans << endl;
  
}

Measured memory_bytes: 5760
X = int(input())

# Xは1000以下なので、pは2**10=1024より10まで探索すれば十分
# 同様にbは40程度まで考えれば十分
max_ex = 1
for p in range(2, 10):
  for b in range(1, 40):
    if max_ex < b**p <= X:
      max_ex = b**p
      
print(max_ex)

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

using namespace std;
typedef long long ll;
#define pb push_back

const int N = 200007;

ll f[N];
int h[N], a[N];

ll seg[N + N];

void update(int p, ll val) {
    p += N;
    for(seg[p] = max(seg[p], val); p > 1; p >>= 1) {
        seg[p >> 1] = max(seg[p], seg[p^1]);
    }
}

ll query(int l, int r) {
    ll ans = 0;
    for(l += N, r += N; l < r; l >>= 1, r >>= 1) {
        if(l&1) ans = max(ans, seg[l++]);
        if(r&1) ans = max(ans, seg[--r]);
    }
    return ans;
}

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

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

    ll ans = 0;
    for(int i = 0; i < n; ++i) {
        ll x = query(1, h[i]);
        f[i] = x + a[i];
        update(h[i], f[i]);
        ans = max(ans, f[i]);
    }

    cout << ans << endl;


}

Measured memory_bytes: 6528
#include <bits/stdc++.h>
#define SIZE 10
#define PI 3.141592653589793

using namespace std;
typedef long long ll;

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

	int S,W;
	int i,j;
	int tmp;
	int answer=0;
	int counter=0;
	vector<int> given;

	cin >> S >> W;

	if(S>W)
		cout << "safe" << endl;
	else
		cout << "unsafe" << endl;

	return 0;
}



Measured memory_bytes: 3596
def left(i):
    return 2*i

def right(i):
    return 2*i+1

def parent(i):
    return int(i/2)

def maxHapify(A, i):
    l = left(i)
    r = right(i)
    largest = None
    if l <= H and A[l] > A[i]:
        largest = l
    else:
        largest = i
    if r <= H and A[r] > A[largest]:
        largest = r
    
    if largest != i:
        A[i], A[largest] = A[largest], A[i]
        maxHapify(A,largest)

def buildMaxHeap(A):
    for i in range(int(H/2),0, -1):
        maxHapify(A,i)
    

def printHeap(H,Q,n):
    if H+1 == n:
        return
    print("node",n,end=": ")
    print("key =",Q[n],end=", ")
    print("parent key =",Q[int(n/2)],end=", ") if 1<n else None
    print("left key =",Q[2*n],end=", ") if 2*n<=H else None
    print("right key =",Q[2*n+1],end=", ") if 2*n+1<=H else None
    print()
    printHeap(H,Q,n+1)
    



H = int(input())
Q = list(map(int, input().split()))
Q.insert(0,-1)
buildMaxHeap(Q)
print(end=" ")
print(" ".join(map(str,Q[1:])))




Measured memory_bytes: 64208
#include <fstream>
#include <iostream>
#include <cmath>
#include <vector>
#include <queue>
#include <utility>
#include <algorithm>
using namespace std;

int main() {
  // ifstream cin("../test.txt");
  int w,n;
  int a[30],b[30],c[30];
  cin >> w >> n;
  for (int i = 0; i < w; i++) {
    c[i] = i+1;
  }
  char x;
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> x >> b[i];
    // cout << a[i] << " " << b[i] << endl;
  }
  for (int i = 0; i < n; i++) {
    // swap(c[a[i]-1], c[b[i]-1]);
    int k = a[i] - 1;
    int j = b[i] - 1;
    int tmp = c[k];
    c[k] = c[j];
    c[j] = tmp;
  }
  for (int i = 0; i < w; i++) {
    cout << c[i] << endl;
  }
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;

#define ll long long
const long long llINF = 1LL << 60;
const int iINF = 0x20000000;
template<class T> inline bool chmin(T& a, T b) { if (b < a) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

void execute();
int main() 
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);// cin と scanfの併用禁止
    cout << fixed << setprecision(15);
    execute();
    return 0;
}


int N, M;
int frm[200001]={};
multimap<int, int> route;
int find_num = 1;
queue<int> que;;

void execute()
{
    cin >> N >> M;
    for(int i = 0; i < M; i++){
        int A, B;
        cin >> A >> B;
         route.insert(multimap<int, int>::value_type(A, B));
         route.insert(multimap<int, int>::value_type(B, A));
    }

    frm[1] = 1;
    que.push(1);
    while (!que.empty()) {
        int v = que.front();
        que.pop();

        auto p = route.equal_range(v);
        for (auto it = p.first; it != p.second; ++it) 
        {
            int idx = it->second;
            if(frm[idx] == 0){
                frm[idx] = v;
                que.push(idx);
                if(++find_num == N) {
                    cout << "Yes" << endl;
                    for(int i = 2; i <= N; i++){
                        cout << frm[i] << endl;
                    }
                    return;
                }
            }
        }
    }

write:

    cout << "No" << endl;
}


Measured memory_bytes: 22944
from collections import defaultdict,deque
from sys import stdin,setrecursionlimit
import heapq,bisect,math,itertools,string,queue,copy
setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, stdin.readline().split()))

N = int(input())
Sls = []
for _ in range(N):
    s = str(input())
    Sls.append(s)

Cls = [0]*4

for item in Sls:
    if item=='AC':
        Cls[0] += 1
    if item =='WA':
        Cls[1] += 1
    if item=='TLE':
        Cls[2] += 1
    if item=='RE':
        Cls[3] += 1

print('AC x {0}'.format(Cls[0]))
print('WA x {0}'.format(Cls[1]))
print('TLE x {0}'.format(Cls[2]))
print('RE x {0}'.format(Cls[3]))


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

using namespace std;

int main(){
  int n,m;
  vector<string> u(257);
  string t;
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> u[i];
  }
  cin >> m;
  bool open=false;//opened : true //closed : false
  for(int i=0;i<m;i++){
    cin >> t;
    if(find(u.begin(),u.end(),t)!=u.end()){
      if(open){
        cout << "Closed by " << t << endl;
        open = false;
      }else{
        cout << "Opened by " << t << endl;
        open = true;
      }
    }else{
      cout << "Unknown " << t << endl;
    }
  }
}

Measured memory_bytes: 3216
#include <bits/stdc++.h>
#define R register
#define mp make_pair
#define ll long long
#define pii pair<int, int>
using namespace std;
const int N = 310;

int n, m, k, tab[N][N], col[N][N], cnt, cut[N], bel[N], num;
char s[N];

template <class T>
inline void read(T &x) {
    x = 0;
    char ch = getchar(), w = 0;
    while (!isdigit(ch)) w = (ch == '-'), ch = getchar();
    while (isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48), ch = getchar();
    x = w ? -x : x;
    return;
}

inline void solve(int u, int d) {
    ++cnt;
    int flag = 1;
    for (R int i = 1; i <= m; ++i) {
        int t = 0;
        for (R int j = u; j <= d; ++j)
            t |= tab[j][i];
        if (flag && t) flag = t = 0;
        cnt += t, bel[i] = cnt;
    }
    for (R int i = u; i <= d; ++i) {
        for (R int j = 1; j <= m; ++j)
            printf("%d ", bel[j]);
        printf("\n");
    }
    return;
}

int main() {
    read(n), read(m), read(k);
    for (R int i = 1; i <= n; ++i) {
        scanf("%s", s + 1);
        int flag = 0;
        for (R int j = 1; j <= m; ++j)
            tab[i][j] = s[j] == '#', flag |= tab[i][j];
        if (flag) cut[++num] = i;
    }
    cut[++num] = n + 1;
    solve(1, cut[2] - 1);
    for (R int i = 2; i < num; ++i)
        solve(cut[i], cut[i + 1] - 1);
    return 0;
}

Measured memory_bytes: 1152
#include<iostream>
#include <algorithm>
#include<string>
using namespace std;
int main()
{
	//unsigned long long int a, b, c, d, e, ans = 0,n,x[19],c[19],v[19];
	int a,  c, d, e, f = 0, ans = 0, n,m;
	char b;
	// 整数の入力
	int num[100000];
	unsigned long long x, y;
	// 文字列の入力
	//	string s;
	cin >> n ;
	c = 0;
	for ( a = 0; a < n; a++)
	{
		cin >> b;
		if (b=='Y')
		{
			c =1;
		}

	}
	if (c==0)
	{
		cout << "Three" << endl;

	}
	else
	{
		cout << "Four" << endl;

	}


	
	// 出力
	return 0;
}

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

void resolve()
{
    string S;
    cin >> S;

    string ans = (S[2] == S[3] && S[4] == S[5]) ? "Yes" : "No";
    cout << ans << endl;
}

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  vector<int> answer(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  for (int i = 0; i < N; i++) {
    answer.at(A.at(i) - 1) = i + 1;
  }
  for (int i = 0; i < N; i++) {
    cout << answer.at(i);
    if (i < N - 1) cout << " ";
    else cout << endl;
  }
}

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

#define rep2(x,fr,to) for(int x=(fr);x<(to);x++)
#define rep(x,to) for(int x=0;x<(to);x++)
#define repr(x,fr,to) for(int x=(fr);x>=(to);x--)
#define all(c) c.begin(),c.end()
#define sz(v) (int)v.size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
typedef vector<ll> VL; const int MD = 1e9 + 7;
void dbg(){cerr<<"\n";} template <typename T,typename ...T2> void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }
typedef double D;      // 座標値の型。doubleかlong doubleを想定
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;
const D EPS = 1e-9;    // 許容誤差。問題によって変える
#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

// 内積　dot(a,b) = |a||b|cosθ
D dot(P a, P b) {
  return (conj(a)*b).X;
}
// 外積　cross(a,b) = |a||b|sinθ
D cross(P a, P b) {
  return (conj(a)*b).Y;
}

// 点の進行方向
int ccw(P a, P b, P c) {
  b -= a;  c -= a;
  if (cross(b,c) >  EPS) return +1;  // counter clockwise
  if (cross(b,c) < -EPS) return -1;  // clockwise
  if (dot(b,c)   < -EPS) return +2;  // c--a--b on line
  if (norm(b) < norm(c)) return -2;  // a--b--c on line or a==b
  return 0;                          // a--c--b on line or a==c or b==c
}

// 点集合を含む最小の円の中心  最小包含円
P minEnclosingCircle(const VP& ps) {
  P c;
  double move = 0.5;
  rep(i,120) {  // 2^(-39-1) \approx 0.9e-12
    rep(t,120) {
      D max = 0;
      int k = 0;
      rep (j, ps.size()) if (max < norm(ps[j]-c)) {
        max = norm(ps[j]-c);
        k = j;
      }
      c += (ps[k]-c) * move;
    }
    move /= 2;
  }
  return c;
}


int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	vector<P> a(n);
	rep(i, n){
		D xx, yy; cin >>xx >>yy;
		a[i] = P(xx, yy);
	}
	auto cp = minEnclosingCircle(a);
	D ans = 0;
	rep(i, n) ans = max(ans, abs(a[i] - cp));
	printf("%.14f\n", ans);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
int main(void){
    double a,b,x;
    cin>>a>>b>>x;
    x/=a;
    double ans;
    if(a*b/2<=x){
        double z=a*b-x;
        ans=atan(2*z/(a*a))*180/M_PI;
    }
    else{
        ans=90-atan(2*x/(b*b))*180/M_PI;
    }
    printf("%.20lf\n",ans);
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main(){
	int x,count=0,MAX=0;
	cin>>x;
	char s[x];
	for(int i=0;i<x;i++){
	cin>>s[i];
	if(s[i]=='I')
	count++;
	else
	count--;
	if(count>MAX)
	MAX=count;
	}
	
cout<<MAX;	
}

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

int main(){
    int N;
    cin>>N;
    map<string,int>ans;
    string S;
    for(int i=0; i<N; i++){
        cin>>S;
        ans[S]=1;
    }
    cout<< ans.size() <<endl;

}

Measured memory_bytes: 19100
#include <stdio.h>
 
int main() {
 
  int n,y1,y3,mb,ms,y1000;
  int i,j,k;
  int a,b,c,e;
  int y[102] = {0};
  int m[102] = {0};
  int d[102] = {0};
  int sum[102] = {0};
 
  scanf("%d",&n);
 
  y1 = 20 + 19 + 20 + 19 + 20+ 19 + 20 + 19 + 20 +19;
  y3 = 20 * 10;
  a  = 1000 /3;
  b = 1000 - a -1;
 
  y1000 = a * y3 + b*y1;
  // printf("y1000 = %d\n" ,y1000); 
 
 
  for(i=0;i<n;i++) {
    a = b = c= e= 0;
 
    scanf("%d %d %d" ,&y[i],&m[i],&d[i]);
 
    a = y[i] / 3;
    b = y[i] - a - 1;
 
    sum[i] = a * y3 + b * y1;
    //   printf("sumy = %d\n",sum[i]);
 
    c = m[i] / 2;
    e = m[i] - c-1;
 
    if(y[i] % 3 != 0) {
    sum[i] = sum[i] + 20*c + 19 * e;
 
    } else sum[i] = sum[i] + 20 *(m[i] - 1)-5;
 
    //    printf("summ = %d\n",sum[i]);
 
    sum[i] = sum[i] + d[i]- 1;
    
 
    printf("%d\n",y1000 - sum[i]);
 
  }
 
  return 0;
 
}

Measured memory_bytes: 2688
n,m=map(int,input().split())
ks=[list(map(int,input().split())) for _ in range(m)]
p=list(map(int,input().split()))

res1=0
for i in range(2**n):
	res2=0
	for j in range(m):
		cnt=0
		for s in range(ks[j][0]):
			if (i>>(ks[j][s+1]-1))&1:
				cnt+=1
		if cnt%2==p[j]:
			res2+=1
	if res2==m:
		res1+=1

print(res1)	

Measured memory_bytes: 3064
from collections import deque
N = int(input())
q = deque()
q.append(0)
memo = []
while q:
    x = q.pop()
    if x < 10**9:
        if len(set(str(x))) == 3:
            memo.append(x)
        q.append(10*x+3)
        q.append(10*x+5)
        q.append(10*x+7)

print(len([num for num in memo if num <= N]))


Measured memory_bytes: 4724
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    B = [0]*N
    for i in range(N)[::-1]:
        cur_sum = -B[i]
        for j in range(i, N, i+1):
            cur_sum += B[j]
        if cur_sum % 2 != A[i] % 2:
            B[i] = 1
    # print(B)
    ans = [i+1 for i, b in enumerate(B) if b]
    print(len(ans))
    if ans:
        print(*ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 69724
S = input()

alpha = 'abcdefghijklmnopqrstuvwxyz'
# len(S)が26未満の場合
if len(S) < 26:
    for char in alpha:
        # Sに入っていない文字の中で最小のものを末尾に足す
        if char not in S:
            print(S + char)
            exit()

# len(S)が26の場合
else:
    arr = [S[-1]]

    for i in range(1, 26):
        l = 25 - i
        if max(arr) > S[l]:
            chars = []

            for c in arr:
                if c > S[l]:
                    chars.append(c)
            char = min(chars)

            # for c in arr:
            #     chars.append(c)
            # char = min(chars)

            print(S[:l] + char)
            exit()
        else:  # max(sr)>S[l]　の場合
            arr.append(S[l])

    print(-1)


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

int main() {
    int N, x;
    cin >> N >> x;
    vector<int> a(N);
    for (int i = 0; i < N; i++) {
        cin >> a.at(i);
    }

    sort(a.begin(), a.end());
    int i = 0;
    for (i = 0; i < N - 1; i++) {
        x -= a.at(i);
        if (x < 0) {
            break;
        }
    }
    if (x == a.at(N - 1)) i++;
    cout << i << endl;
}


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


int main() {
    int N;

    cin >> N;

    int A[2][110];

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

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

    int ans = 0;
    
    for(int k=0;k<N;k++){
        int count = 0;
        for(int j=0;j<=k;j++){
            count+=A[0][j];
        }
        for(int j=k;j<N;j++){
            count+=A[1][j];
        }
        ans = max(ans,count);
    }

    cout << ans << endl;




}



Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int A,B;
    cin>>A>>B;
    if(1<=A && A<=9 && 1<=B && B<=9){
        cout<<A*B<<endl;
    }
    else{
        cout<<"-1"<<endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<bits/stdc++.h>
#define int long long
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int32_t main()
{
	int n,m,k;
	string res;
	cin >> n >> m;
	map<int,int>mp1,mp2;
	int sum = 0;
	for(int i = 0 ; i < m ; i++ ){
		cin >> k >> res;
		if(res=="AC")
		{
			if(mp1[k]==0)
			mp1[k]++;
		}
		else
		{
			if(mp1[k]==0){
				mp2[k]++;
			}
		}
	}
	int c = 0,w=0;
	for(auto p : mp1){
		c+=p.second;
	}
	for(auto p : mp2){
		if(mp1[p.first]!=0){
			w+=p.second;
		}
	}
	
	cout<<c<<' '<<w;
}


Measured memory_bytes: 8064
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;
int main()
{
  string N;
  cin >> N;
  string tmp;
  tmp += N.at(0);
  rep(i, N.size() - 1)
  {
    tmp += "9";
  }
  ll ans;
  if (tmp == N)
  {
    ans = ((N.at(0) - '0') + (N.size() - 1) * 9);
  }
  else
  {
    ans = ((N.at(0) - '0') + (N.size() - 1) * 9 - 1);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
//
template<class T>struct mow{
	T pow(T x,T n,T mod){
		T ret=1;
		if(n>0){
			ret=pow(x,n/2,mod);
			if(n%2==0){
				(ret=(ret*ret))%=mod;
			}else{
				(ret=((ret*ret)%mod)*x)%=mod;
			}
		}
		return ret;
	}
};
long long mem[222222][2]={};
void solve(long long n,string x,long long cnt,long long hoge){
	long long ans=1;
	if(cnt==0){
		cout<<0<<endl;
		return;
	}
	if(cnt==1){
		cout<<1<<endl;
		return;
	}
	while(hoge>0){
		ans++;
		long long ji=0;
		for(int i=0;i<20;i++){
			if((1LL<<i)&hoge){
				ji++;
			}
		}
		hoge%=ji;
	}
	cout<<ans<<endl;
	return;
}
int main(){
	mow<long long> nii;
	long long n;
	string x;
	cin>>n>>x;
	long long cnt=0;
	for(int i=0;i<n;i++){
		if(x[i]=='1'){
			cnt++;
		}
	}
	for(int i=0;i<n;i++){
		if(cnt>1){
			mem[i][0]=nii.pow(2,i,cnt-1);
		}
		mem[i][1]=nii.pow(2,i,cnt+1);
	}
	long long mema=0;
	long long memb=0;
	for(int i=0;i<n;i++){
		if(x[i]=='1'){
			if(cnt>1){
				(mema+=mem[n-1-i][0])%=(cnt-1);
			}
			(memb+=mem[n-1-i][1])%=(cnt+1);
		}
	}
	for(int i=0;i<n;i++){
		if(x[i]=='0'){
			x[i]='1';
			solve(n,x,cnt+1,(memb+mem[n-1-i][1])%(cnt+1));
			x[i]='0';
		}else{
			x[i]='0';
			if(cnt>1){
				solve(n,x,cnt-1,(mema-mem[n-1-i][0]+(cnt-1)*222222)%(cnt-1));			
			}else{
				if(cnt==1){
					cout<<0<<endl;
				}
			}
			x[i]='1';
		}
	}
	return 0;
}


Measured memory_bytes: 6948
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
using namespace std;
int N;
char S[200005];
vector <int> V[30];
int let;
pair <int, int> Event[400005];
int Left[400005], Curr[400005], Partial[400005];
int Arb[200005];
int ind;
int nb = 0;
void Update(int pos, int val)
{
    while(pos <= N)
    {
        Arb[pos] += val;
        pos += (pos & (-pos));
    }
}
int Sum(int pos)
{
    int ret = 0;
    while(pos >= 1)
    {
        ret += Arb[pos];
        pos -= (pos & (-pos));
    }
    return ret;
}
void Read()
{
    cin.getline(S + 1, 200005);
    N = strlen(S + 1);
    for(int i = 1; i <= N; i++)
    {
        V[S[i] - 'a' + 1].push_back(i);
    }
}
inline bool cmp(pair <int, int> a, pair <int, int> b)
{
    return a.second < b.second;
}
void precalcEvent()
{
    for(int i = 1; i <= 26; i++)
    {
        int left = 0, right = V[i].size() - 1;
        while(left < right)
        {
            Event[++ind] = make_pair(V[i][left], V[i][right]);
            Update(V[i][left], 1);
            Left[V[i][right]] = V[i][left];
            ++left;
            --right;
        }
        if(left == right)
            let = V[i][left];
    }
    sort(Event + 1, Event + ind + 1, cmp);
}

void Solve()
{
    bool add = 0;
    long long ans = 0;
    for(int i = 1; i <= ind; i++)
    {
        int x = Event[i].first, y = Event[i].second;
        int s = Sum(y) - Sum(x);
        ans += s;
        s = Sum(N) - Sum(y);
        ans += 2 * s;
        if(N % 2 == 1 && (let < x || let > y))
            ans++;
        Update(x, -1);
    }
    /*if(N % 2 == 1)
        add = 1;
    int finished = 0, curr = 0;
    long long ans = 0;
    for(int i = 1; i <= ind; i++)
    {
        int pos = Event[i].first, type = Event[i].second;
        if(type == 0)
        {
            ans += 2 * finished;
            Curr[pos] = curr;
            curr++;
            if(add == 1 && let < pos)
                ans++;
        }
        else
        {
            finished++;
            curr--;
            ans += Curr[Left[pos]];
            if(add == 1 && let > pos)
                ans++;
        }
    }*/
    cout << ans << "\n";
}
int main()
{
    Read();
    for(int i = 1; i <= 26; i++)
        if(V[i].size() % 2 == 1)
            nb++;
    if(nb > 1)
    {
        cout << "-1\n";
        return 0;
    }
    precalcEvent();
    Solve();
    return 0;
}


Measured memory_bytes: 8056
#include<stdio.h>
int main(void)
{
	int n,a[21],b[101],i,z,zz,max;
	max=-1;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d %d",&a[n],&b[n]);
		if(b[n]>max){
			max=b[n];
			z=a[n];
		}
		if(max==b[n]){
			if(z<a[n]){
			z=z;
			}
			else if(z>a[n]){
			z=a[n];
			}
		}
	}
	printf("%d %d\n",z,max);
	return 0;
}	

Measured memory_bytes: 1032
fun main(arr: Array<String>) {
    val n = readLine()!!.toInt()
    val d = readLine()!!.split(" ").map { it.toInt() }
    val ans = (0 until n-1).map {idx-> (idx+1 until n).map { d[idx]*d[it] }.sum() }.sum()
    println(ans)
}


Measured memory_bytes: 36876