akhauriyash/Code-Regression huggingface dataset:
#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<bitset>
#include<math.h>
#include<vector>
#include<string>
#include<stdio.h>
#include<cstring>
#include<iostream>
#include<algorithm>
#define dbg(x) cout<<(#x)<<"="<<x<<endl
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int N = 100010;
const int mod = 100000000;
const int MOD1 = 1000000007;
const int MOD2 = 1000000009;
const double EPS = 0.00000001;
typedef long long ll;
const ll MOD = 1000000007;
const int INF = 1000000010;
const ll MAX = 1000000000000;
const double pi = acos(-1.0);
typedef double db;
typedef unsigned long long ull;

int n, a[N], b[N], c[N], sum[N], f[2][3 * N + 10];

void add(int rev, int x, int y) {
    if (x <= 0) return ;
    for (; x <= 3 * n + 10; x += x & -x) f[rev][x] += y;
}
int getsum(int rev, int x) {
    if (x <= 0) return 0;
    int ret = 0;
    for (; x; x -= x & -x) ret += f[rev][x];
    return ret;
}
ll stat(int x) {
    ll ret = 0;
    for (int i = 1; i <= n; i++) {
        sum[i] = sum[i - 1] + (a[i] >= x);
        c[i] = 2 * sum[i] - i + n;
    }
    memset(f, 0, sizeof(f));
    add(0, n, 1);
    for (int i = 1; i <= n; i++) {

        // dbg(c[i]);
        ret += (ll)getsum((i + 1) & 1, c[i] - 1);
        // dbg(ret);
        ret += (ll)getsum( i & 1,   c[i]);
        add(i & 1, c[i], 1);
        // dbg(ret);
    }

    // dbg(x);
    // dbg(ret);
    return ret;
}

int main()
{
    int i, l, r, mid;
    ll k;
    scanf("%d", &n);
    ll sum = 1ll*n * (n + 1) / 2;
    // dbg(sum);
    if (sum % 2 == 0) {
        k = sum / 2;
    }
    else {
        k=sum/2+1;
    }


    for (i = 1; i <= n; i++) scanf("%d", &a[i]), b[i] = a[i];
    sort(b + 1, b + n + 1);
    l = 1; r = n + 1; mid = (l + r) >> 1;
    while (l + 1 < r)
        if (stat(b[mid]) >= k) { l = mid; mid = (l + r) >> 1; }
        else { r = mid; mid = (l + r) >> 1; }
    printf("%d\n", b[l]);
    return 0;
}

Measured memory_bytes: 4096
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define poly vector<ll>
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define Rep(i,r,l) for(int i=(int)(r);i>=(int)(l);i--)
#define pb push_back
inline char gc(){
	static char buf[100000],*p1=buf,*p2=buf;
	return p1==p2&&(p2=(p1=buf)+fread(buf,1,100000,stdin),p1==p2)?EOF:*p1++;
}
#define gc getchar
inline ll read(){
	ll x=0;char ch=gc();bool positive=1;
	for(;!isdigit(ch);ch=gc()) if(ch=='-') positive=0;
	for(;isdigit(ch);ch=gc()) x=x*10+ch-'0';
	return positive?x:-x;
}
inline void write(ll x){
	if(x<0){
		x=-x;putchar('-');
	}
	if(x>=10) write(x/10);
	putchar('0'+x%10);
}
inline void writeln(ll x){write(x);puts("");}
inline void writep(ll x){write(x);putchar(' ');}
inline ull rnd(){
	return ((ull)rand()<<30^rand())<<4|rand()%4;
}
const int N=1e5+5;
int head[N],opt;
struct info{
	int to,nxt;
}e[N<<1];
void add(int x,int y){
	e[++opt]=(info){y,head[x]};head[x]=opt;
	e[++opt]=(info){x,head[y]};head[y]=opt;
}
int L[N],R[N],co[N];
bool used[N],d=1;
void dfs(int u,int fa,int c){
	if(used[u]&&c!=co[u]) d=0;
	if(fa&&used[u]&&(L[fa]-1>L[u]||R[fa]+1<R[u])) d=0;
	if(!used[u]) L[u]=L[fa]-1,R[u]=R[fa]+1,co[u]=c;
	for(int i=head[u];i;i=e[i].nxt){
		int k=e[i].to;
		if(k==fa) continue;
		dfs(k,u,c^1);
		L[u]=max(L[u],L[k]-1);
		R[u]=min(R[u],R[k]+1);
	}
	if(L[u]>R[u]) d=0;
}
int ans[N];
void dfs(int u,int fa){
	for(int i=head[u];i;i=e[i].nxt){
		int k=e[i].to;
		if(k==fa) continue;
		if(ans[u]-1>=L[k]) ans[k]=ans[u]-1;
		else if(ans[u]+1<=R[k]) ans[k]=ans[u]+1;
		dfs(k,u);
	}
}
int main(){
	int n=read();
	For(i,1,n-1) add(read(),read());
	int m=read(),rt=1;
	For(i,1,m){
		int x=read(),y=read();rt=x;
		L[x]=R[x]=y;used[x]=1;co[x]=(abs(y)&1);
	}
	dfs(rt,0,co[rt]);
	if(!d) return puts("No"),0;
	ans[rt]=L[rt];dfs(rt,0);
	puts("Yes");
	For(i,1,n) writeln(ans[i]);
}

Measured memory_bytes: 14956
#include <iostream>
using namespace std;
int max(int a,int b)
{
	return a>b?a:b;
}
int min(int a,int b)
{
	return a<b?a:b;
}
int main()
{
	int n;
	cin >> n;
	int r[n];
	for(int i=0;i<n;i++)
	{
		cin >> r[i];
	}
	int minv = r[0];
	int maxv = -2000000000;
	for(int i=1;i<n;i++)
	{
		maxv=max(maxv,r[i]-minv);
		minv=min(minv,r[i]);
	}
	cout << maxv << endl;
	return 0;
}

Measured memory_bytes: 3880
#include<stdio.h>
int main(){
  char s[1000];
  int i;
  char c=getchar(),d;
  while(c!=EOF&&(c!='\n')){
    putchar(c);
    d=c;
    c=getchar();
  }
  if (d=='s') printf("es\n");
  else printf("s\n");
  return 0;
}

Measured memory_bytes: 1492
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        // 標準入力からデータを読み込む準備
        Scanner sc = new Scanner(System.in);
        // 2つの文字の固まりをそれぞれ整数値と想定して読み込む
        int a = sc.nextInt();
        int b = sc.nextInt();
        int area = a * b;
        int length = 2 * a + 2 * b;/* ここを変えて周囲の長さを求めよう */
        System.out.println(area + " " + length);
        sc.close();
    }
}


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

#define         pb         push_back
#define         sf(x)      scanf("%d",&x)
#define         sfl(x)     scanf("%lld",&x)
#define         pf(x)      printf("%d\n",x)
#define         pfl(x)     printf("%lld\n",x)
#define         endl       '\n'
#define         pii        pair<int,int>
#define         mapii      map<int,int>
#define         mapll      map<ll,ll>
#define         mapci      map<char,int>
#define         mapcl      map<char,ll>
#define         mapsi      map<string,int>
#define         mapsl      map<string,ll>
#define         pll        pair<ll,ll>
#define         vi         vector<int>
#define         vl         vector<ll>
#define         vd         vector<double,double>
#define         all(c)     c.begin(),c.end()
#define         F          first
#define         S          second
#define         mp         make_pair
#define        ftc(x)      cerr << #x << ": " << x << " " << endl;
#define         PI         acos(-1)
#define         lcm(a,b)   ((a*b)/__gcd(a,b))
#define        optimize    ios_base::sync_with_stdio(false);cin.tie(NULL);
#define        sqr(a)       ((a)*(a))

int main()
{
string s,tmp="",dt="",mm="";

cin >> s;

tmp += s[0];
tmp += s[1];
tmp += s[2];
tmp += s[3];
if(tmp == "2019")
{
    mm += s[5];
    mm += s[6];

    dt += s[8];
    dt += s[9];

    if(mm.compare("04")>0)cout << "TBD" << endl;
    else if(mm.compare("04") == 0)
    {
        //cout << dt.compare("30") << endl;
        if(dt.compare("30") > 0)cout << "TBD" << endl;
        else cout<<"Heisei"<<endl;
    }
    else cout<<"Heisei"<<endl;
}
else if(tmp.compare("2019") > 0)
{
    cout << "TBD" << endl;
}
else cout<<"Heisei"<<endl;

}


Measured memory_bytes: 3572
#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <iterator>

#define ios ios_base::sync_with_stdio(0), cout.tie(0), cin.tie(0);
#define S second
#define F first
#define pb push_back
#define nl '\n'
#define mp make_pair
#define NL cout << '\n';
#define EX exit(0)
#define all(s) s.begin(), s.end()
#define FOR(i, start, finish, k) for(int i = start; i <= finish; i += k)

const long long MXN = 1e5 + 100;
const long long MNN = 3e2 + 10;
const long long MOD = 998244353;
const long long INF = 1e18;
const long long OO = 1e9 + 500;

typedef long long llong;
typedef unsigned long long ullong;

using namespace std;

llong n, m, a[MNN][MNN], used[MNN], cnt[MNN], ans = INF;
queue<llong> q[MNN];

void rec(int k){
	for(int i = 1; i <= m; i++){
		cnt[i] = 0;
	}
	llong mx = 0, x = 0;
	for(int i = 1; i <= n; i++){
		if(q[i].size() == 0) continue;
		while(used[q[i].front()]){
			q[i].pop();
		}
		cnt[q[i].front()]++;
		if(mx < cnt[q[i].front()]){
			mx = max(cnt[q[i].front()], mx);
			x = q[i].front();
		}
	}
	if(mx == 1){
		cout << 1;
		EX;
	}
	used[x] = 1;
	ans = min(ans, mx);
	if(k == 1) return ;
	return rec(k - 1);
}

int main(){
	ios;
	cin >> n >> m;
	set<int> v;
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= m; j++){
			cin >> a[i][j];
			q[i].push(a[i][j]);
		}
	}
	rec(m);
	cout << ans;
	return 0;
}


Measured memory_bytes: 1792
#include <stdio.h>
int main(void) {
    int num,sum,ans[45],i,j,k,l,m;
    while (1) {
        scanf("%d %d\n",&num,&sum);
        if (num==0&&sum==0) break;
        if (sum>num*(19-num)/2||sum<num*(num-1)/2) {
            printf("0\n");
            continue;
        }
        for (i=0; i<45; i++) ans[i]=0;
        switch (num) {
            case 1:
                for (i=0; i<=9; i++) ans[i]++;
                break;
                
            case 2:
                for (i=0; i<=8; i++) {
                    for (j=i+1; j<=9; j++) ans[i+j]++;
                }
                break;
                
            case 3:
                for (i=0; i<=7; i++) {
                    for (j=i+1; j<=8; j++) {
                        for (k=j+1; k<=9; k++) ans[i+j+k]++;
                    }
                }
                break;
                
            case 4:
                for (i=0; i<=6; i++) {
                    for (j=i+1; j<=7; j++) {
                        for (k=j+1; k<=8; k++) {
                            for (l=k+1; l<=9; l++) ans[i+j+k+l]++;
                        }
                    }
                }
                break;
                
            case 5:
                for (i=0; i<=5; i++) {
                    for (j=i+1; j<=6; j++) {
                        for (k=j+1; k<=7; k++) {
                            for (l=k+1; l<=8; l++) {
                                for (m=l+1; m<=9; m++) ans[i+j+k+l+m]++;
                            }
                        }
                    }
                }
                break;

                
            case 6:
                for (i=0; i<=6; i++) {
                    for (j=i+1; j<=7; j++) {
                        for (k=j+1; k<=8; k++) {
                            for (l=k+1; l<=9; l++) ans[45-(i+j+k+l)]++;
                        }
                    }
                }
                break;
                
            case 7:
                for (i=0; i<=7; i++) {
                    for (j=i+1; j<=8; j++) {
                        for (k=j+1; k<=9; k++) ans[45-(i+j+k)]++;
                    }
                }
                break;
                
            case 8:
                for (i=0; i<=8; i++) {
                    for (j=i+1; j<=9; j++) ans[45-(i+j)]++;
                }
                break;

            case 9:
                for (i=0; i<=9; i++) ans[45-i]++;
                break;
        }
        printf("%d\n",ans[sum]);
    }
    return 0;
}

Measured memory_bytes: 616
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }

int N;
int main() {
  cin >> N;
  int res = 1;
  while (res <= N) res *= 2;
  cout << res/2 << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<string.h>
#include<algorithm>
#include<map>
#include<vector>
#include<string>
#define ll long long
#define For(i,x,y)  for(ll i=x;i<=y;++i)
#define FOr(i,x,y)  for(ll i=x;i>=y;--i)
using namespace std;
inline ll read(){   ll x=0,f=1;char ch=getchar();   while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}  while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}  return x*f; } 
inline void write(ll x){    if (x<0) putchar('-'),x=-x; if (x>=10) write(x/10);   putchar(x%10+'0');  } 
inline void writeln(ll x){ write(x);   puts("");   }
const ll N=100010;
ll n,a[N],ans;
int main(){
	n=read();
	For(i,1,n)	a[read()]++;
	For(i,1,100001)	ans=max(ans,a[i-1]+a[i]+a[i+1]);
	writeln(ans);
}

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

chk=[True]*(10**5+1)
for i in range(M):
    a=int(input())-1
    chk[a]=False

mod=10**9+7

if N==1:
    print(1)
    exit()

f=[0]*(N+1)

if not chk[0]:
    f[0]=0
else:
    f[0]=1

if not chk[1]:
    f[1]=0
else:
    f[1]=f[0]+1

for i in range(2,N):
    if not chk[i]:
        f[i]=0
    else:
        f[i]=f[i-2]+f[i-1]

    f[i]=f[i]%mod

print(f[N-1])


Measured memory_bytes: 7668
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main() {
  string a;
  cin>>a;
  ll b=a.size();
  vector<char>vec(b);
  
  for(ll i=0;i<b;i++){
    vec.at(i)=a.at(i);
  }
  ll c=0;
  ll d=0;
  for(ll i=0;i<b;i++){
    if(i%2==vec.at(i)%2){
      c+=1;
    }
  }
  for(ll i=0;i<b;i++){
    if(i%2!=vec.at(i)%2){
      d+=1;
    }
  }
  cout<<min(c,d)<<endl;
}
   

Measured memory_bytes: 3792
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<iostream>
#include<algorithm>
using namespace std;
long long int re = -1;
void cal(long long int s[3]) {
	sort(s,s+3);
	long long int r = s[2]-s[0];
	if(re==-1)	re = r;
	else	re = min(r,re);
}

int main() {
	long long int h,w,i,j;
	scanf("%lld%lld",&h,&w);
	if(h%3==0||w%3==0) {
		re = 0;
	} else {
//		if(w%2==0||h%2==0){
//
//		}else{
//
//		}
		long long int a[6],b[6];
		a[0]=h/3;
		b[0]=w/3;
		a[1]=a[0]+1;
		b[1]=b[0]+1;
		a[2]=a[0]+2;
		b[2]=b[0]+2;
		a[3] = h/2;
		b[3] = w/2;
		a[4]=a[0]-1;
		b[4]=b[0]-1;
		a[5]=a[0]-2;
		b[5]=b[0]-2;
		for(i=0; i<6; i++) {
			for(j=0; j<6; j++) {
				if(a[i]>=0&&b[j]>=0&&a[i]<=h&&b[j]<=w) {
					long long int s[3];
					s[0]= a[i]*w;
					s[1]=(h-a[i])*b[j];
					s[2] =(h-a[i])*(w-b[j]);
					cal(s);
					s[0]= b[j]*h;
					s[1]=(w-b[j])*a[i];
					s[2] =(w-b[j])*(h-a[i]);
					cal(s);
					s[0]= (h-a[i])*w;
					s[1]=(a[i])*b[j];
					s[2] =(a[i])*(w-b[j]);
					cal(s);
					s[0]= (w-b[j])*h;
					s[1]=(b[j])*a[i];
					s[2] =(b[j])*(h-a[i]);
					cal(s);
				}
			}
		}
		for(i=0; i<6; i++) {
			for(j=i; j<6; j++) {
				if(a[i]>=0&&a[j]>=0&&a[i]+a[j]<=h) {
					long long int s[3];
					s[0]= a[i]*w;
					s[1]=a[j]*w;
					s[2] =(h-a[i]-a[j])*w;
					cal(s);
				}
			}
		}
		for(i=0; i<6; i++) {
			for(j=i; j<6; j++) {
				if(b[i]>=0&&b[j]>=0&&b[i]+b[j]<=w) {
					long long int s[3];
					s[0]= b[i]*h;
					s[1]=b[j]*h;
					s[2] =(w-b[i]-b[j])*h;
					cal(s);
				}
			}
		}
	}
	printf("%lld",re);
	return 0;
}

Measured memory_bytes: 256
n,k = map(int,input().split())
s = input()
s_list = list(s)
if s_list[k-1]  == 'A':
    s_list[k-1] = 'a'
elif s_list[k-1] == 'B':
    s_list[k-1] = 'b'
else:
    s_list[k-1] = 'c'
    
s = ''.join(s_list)
print(s)

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

using std::cin;
using std::cout;
using std::endl;
using std::vector;
using std::sort;

int
main()
{
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++)
  {
    cin >> A[i];
    A[i] -= i + 1;
  }
  sort(A.begin(), A.end());
  int b = A[N / 2];
  long sadness = 0;
  for (int i = 0; i < N; i++)
  {
    sadness += abs(A[i] - b);
  }
  cout << sadness << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define bit_exist(x, n) ((x >> n) & 1)
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) cout << #v << "=" << endl; REP(i, v.size()){ cout << v[i] << ","; } cout << endl;
#define mdebug(m) cout << #m << "=" << endl; REP(i, m.size()){ REP(j, m[i].size()){ cout << m[i][j] << ","; } cout << endl;}
#define pb push_back
#define f first
#define s second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using PiP = pair<int, Pii>;
using PPi = pair<Pii, int>;
using bools = vector<bool>;
using pairs = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

const int mod = 1000000007;
//const int mod = 998244353;
#define Add(x, y) x = (x + (y)) % mod
#define Mult(x, y) x = (x * (y)) % mod



signed main(){

    int M, K; cin >> M >> K;
    if(M == 1){
        if(K == 0){
            Out("0 0 1 1");
        }else{
            Out(-1);
        }
        return 0;
    }
    if(K >= bit(M)){
        Out(-1);
        return 0;
    }
    vec ans;
    REP(i, bit(M)) if(i != K) ans.pb(i);
    ans.pb(K);
    IREP(i, bit(M)) if(i != K) ans.pb(i);
    ans.pb(K);
    REP(i, SZ(ans)) cout << ans[i] << " ";
    cout << endl;

    return 0;
}


Measured memory_bytes: 4080
#include<iostream>
#include<string>
#include <algorithm>
#include<iomanip>
#include<cmath>
using std::cin; using std::string;
using std::cout; using std::endl;
using std::sort;
#define rep(X,Y) for(int (X)=0;(X)<(Y);++(X))
#define rept(X,Y,Z) for(int (X)=(Y);(X)<(Z);++(X))
#define repr(X,Y) for(int (X)=(Y);(X)>=0;--(X))
const double pi=3.141592653589793283462;
int main(){
    int a,b,c;
	while(cin>>a>>b){
	int co=1;
	c=a+b;
	while(1){
		if(c/10>=1){
			co+=1;
			c/=10;
		}
		else
			break;
	}
	cout<<co<<endl;
	co=1;
	}
	return 0;
}     

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

int main() {
	/*
cout<<"Hello World"<<endl;

	int x;
	cin>> x;
	cout<< x*x*x <<endl;

int a;
int b;
cin>>a>>b;
cout<<a*b<<" "<<2*a+2*b<<endl;
*/
	int a;
	int b;
	cin>>a>>b;
	if (a<b){
		cout<< "a < b" <<endl;
	}else if(a>b){
		cout<<"a > b" <<endl;
	}else if(a==b){
		cout<<"a == b"<<endl;
	}else{

	}





	return 0;
}

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

#define rep(i,n) for(ll i = 0; i < n; i++)
#define Rep(i,n) for(ll i = 0; i <= n; i++)
#define REp(i,n) for(ll i = 1; i < n; i++)
#define REP(i,n) for(ll i = 1; i <= n; i++)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
template<class T> using V = vector<T>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { 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; }

int n;

bool f(int v, V<int> &col, V<string> &s) {
  bool res = true;
  rep(i,n) {
    if(v == i) continue;
    if(s[v][i] == '1') {
      if(col[i] == -1) {
        col[i] = ~col[v];
        res = (res && f(i,col,s));
      }
      else {
        if(col[i] == col[v]) {
          res = false;
        }
      }
    }
  }
  return res;
}

void bfs(int st, V<string> &s, V<int> &d) {
  queue<int> q;
  q.push(st);
  while(sz(q)) {
    int v = q.front(); q.pop();
    rep(i,n) {
      if(i == v) continue;
      if(d[i] != -1) continue;
      if(s[v][i] == '1') {
        d[i] = d[v] + 1;
        q.push(i);
      }
    } 
  }
}


int main(){
  cin >> n;
  V<string> s(n);
  rep(i,n) cin >> s[i];
  V<int> col(n,-1);
  col[0] = 0;
  if(!f(0,col,s)) {
    cout << -1 << endl;
    return 0;
  }
  int ans = 0;
  rep(i,n) {
    V<int> d(n,-1);
    d[i] = 1;
    bfs(i,s,d);
    int tmp = 0;
    rep(j,n) chmax(tmp,d[j]);
    chmax(ans,tmp);
  }
  cout << ans << endl;
}

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

const int MAXN = 131083;
typedef long long LL;
typedef std::pair<LL, LL> pi;
typedef std::vector<pi> vec;
int son[MAXN][2], val[MAXN][2], n;
LL mid;

vec dfs(int u) {
	if (!son[u][0]) return vec({pi(0, 0)});
	vec lhs = dfs(son[u][0]), rhs = dfs(son[u][1]), r1, r2, r3, r4;
	for (auto & t : lhs) t.first += val[u][0], t.second += val[u][0];
	for (auto & t : rhs) t.first += val[u][1], t.second += val[u][1];
	if (lhs.size() > rhs.size()) std::swap(lhs, rhs);
	const int rs = rhs.size();
	int cur1 = 0, cur2 = 0;
	for (auto t : lhs) {
		while (cur1 < rs && rhs[cur1].second + t.first > mid) ++cur1;
		while (cur2 < rs && rhs[cur2].first + t.second <= mid) ++cur2;
		if (cur1 < rs) r1.emplace_back(rhs[cur1].first, t.second);
		if (cur2 && rhs[cur2 - 1].first + t.second <= mid)
			r2.emplace_back(t.first, rhs[cur2 - 1].second);
	}
	std::merge(r1.begin(), r1.end(), r2.begin(), r2.end(), std::back_inserter(r3));
	for (auto t : r3) if (r4.empty() || t.second < r4.back().second) r4.push_back(t);
	return r4;
}
int main() {
	std::ios_base::sync_with_stdio(false), std::cin.tie(0);
	std::cin >> n; LL r = 0;
	for (int i = 2, t; i <= n; ++i) {
		std::cin >> t;
		int at = !!son[t][0];
		std::cin >> val[t][at]; r += val[t][at];
		son[t][at] = i;
	}
	LL ans = -1;
	for (LL l = 0; l <= r; mid = l + r >> 1, !dfs(1).empty()
			? (ans = mid, r = mid - 1) : l = mid + 1);
	std::cout << ans << std::endl;
	return 0;
}


Measured memory_bytes: 22784
#include <iostream>
#include <vector>
#include <map>
using namespace std;

const int divisor = 1000000007;

int main(){
	vector<int> ansvec;

	// 100000!までの数をdivisorで割った余りを格納しておく
	long long* factmodary = new long long[100001];
	long long fact = 1;
	for (int i = 1; i <= 100000; i++){
		fact *= i;
		fact %= divisor;
		factmodary[i] = fact;
	}

	for (;;){
		int N, R;
		cin >> N;
		if (N == 0) break;
		cin >> R;

		int* word = new int[N];
		for (int i = 0; i < N; i++) word[i] = i + 1; //まず0番目の単語を入れておく

		for (int i = 0; i < R; i++){
			int s, t;
			cin >> s >> t;
			/* swap */
			int tmp = word[s - 1]; word[s - 1] = word[t - 1]; word[t - 1] = tmp;
		}

		//word[i]をkey, word[i]より小さい数がそれ以前にいくつ使われていたかをvalueとして格納するmap
		map<int, int> bubblehist;
		bubblehist[word[0]] = 0;

		long long ans = factmodary[N-1] * (word[0] - 1);

		for (int i = 1; i < N; i++){
			int facttime = word[i] - 1;
			int bubblenum;
			map<int, int>::iterator it = bubblehist.lower_bound(word[i]);

			if (it != bubblehist.end()){
				bubblenum = it->second;
			}
			else {
				bubblenum = bubblehist.rbegin()->second + 1;
			}
			pair<int, int> p;
			p.first = word[i];
			p.second = bubblenum;
			bubblehist.insert(--it, p);
			//word[i]より大きい数はすべてvalueが1増える
			for (map<int, int>::iterator it2 = bubblehist.upper_bound(word[i]); it2 != bubblehist.end(); it2++) ++(it2->second);

			facttime -= bubblenum;
			ans += factmodary[N - (i + 1)] * facttime;
			ans %= divisor;
		}

		delete[] word;
		ansvec.push_back((int)ans);
	}

	for (vector<int>::iterator it = ansvec.begin(); it != ansvec.end(); it++) cout << *it << "\n";

	delete[] factmodary;
	return 0;
}

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

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

#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define dep(i, a, n) for(int i = a; i >= (n); i--)
#define FOR(i, a, n) for(int i = a; i < (n); i++)
#define mod (ll)(1e9+7)
#define int ll
#define INF 100000000

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
	string s;
  int cnt = 0;
  cin >> s;
  for(int i = 0; i < s.size(); i++) {
    if(s[i] == '+') cnt++;
    else if(s[i] == '-') cnt--;
  }
  cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.Map;
import java.util.Map.Entry;
import java.util.HashMap;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class CGoodSequence {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            HashMap<Integer, Integer> count = new HashMap<>();
            for (int i = 0; i < n; i++) {
                count.merge(in.nextInt(), 1, Integer::sum);
            }
            int answer = 0;

            for (Map.Entry<Integer, Integer> e : count.entrySet()) {
                int key = e.getKey(), value = e.getValue();
                if (value - key >= 0 && value - key < value)
                    answer += value - key;
                else
                    answer += value;
            }

            out.println(answer);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 49176
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main(){
    int h, w;
    cin >> h >> w;
    int cnt = 0;
    rep(i, h) rep(j, w) {
        char tmp_c;
        cin >> tmp_c;
        if ( tmp_c == '#' ) {
            ++cnt;
        }
    }
    if ( cnt == h + w - 1 ) {
        cout << "Possible" << endl;
    }
    else { 
        cout << "Impossible" << endl;
    }
    return 0;
}


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

int main() {
  LL n; cin >> n;
  vector<string> a(n);
  map<string, LL> mp;
  rep(i, n) {
    string t; cin >> t;
    char b[10];
    for (int i = 0; i < 10; i ++) b[i] = t[i];
    sort(b, b + 10);
    string s = "";
    for (int i = 0; i < 10; i ++) s += b[i];
    mp[s] ++;
  }
  
  LL ans = 0;
  for (auto x : mp) {
    //cout << x.second << endl;
    ans += ((x.second - 1) * (x.second)) / 2;
  }
  cout << ans << endl;
}

Measured memory_bytes: 13568
#!/usr/bin/env ruby

include Math

if __FILE__ == $0 then
	a, b, C = gets.split.map(&:to_f)
	S = a * b * sin(C*PI/180) / 2
	L = a + b + sqrt(a**2 + b**2 - 2*a*b*cos(C*PI/180))
	h = b * sin(C*PI/180)

	p S, L, h
end


Measured memory_bytes: 6948
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x,t=0;
    cin>>x;
    vector<int> arr(x);
    for(int i=0;i<x;i++){
        cin>>arr[i];
    }
    sort(arr.begin(),arr.end());
    for(int i=0;i<x;i++){
        t+=arr[i];
    }
    t-=(arr[x-1]/2);
    cout<<t<<endl;



    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

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

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

long long int GCD(long long int a, long long int b){
	long long int dummy1, dummy2, dummy;
	dummy1 = max(a, b);
	dummy2 = min(a, b);
	while(true){
		dummy = dummy1 % dummy2;
		dummy1 = dummy2;
		dummy2 = dummy;
		if(dummy == 0){
			break;
		}
	}
	return dummy1;
}

long long int A[110000];
long long int rem[110000];

int main(){
    int N;
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }
    long long int num = A[N - 1];
    for(int i = N - 1; i >= 0; i--){
        num = GCD(num, A[i]);
        rem[i] = num;
    }
    long long int ans = rem[1];
    num = A[0];
    for(int i = 0; i < N - 2; i++){
        num = GCD(num, A[i]);
        ans = max(ans, GCD(num, rem[i + 2]));
    }
    num = GCD(num, A[N - 2]);
    ans = max(ans, num);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        double p = Math.pow(n, -1);
        double ans = 0;
        for (int i = 0; i < n; i++) {
            if (i + 1 > k) {
                ans += 1;
            } else {
                double pow = Math.log(k / (i + 1.0)) / Math.log(2);
                ans += Math.pow(0.5, Math.ceil(pow));
            }
        }
        System.out.println(ans * p);
    }
}

Measured memory_bytes: 23380
N = int(input())
D = list(map(int,input().split()))
D.sort()

ans = 12
while ans > 1:
  Fix = [0]
  for i in range(N):
    MIN = []
    for dotti in range(2):
      if dotti == 0:
        nxt = D[i]
      else:
        nxt = 24-D[i]
      now = 100
      for t in Fix:
        now = min(now,abs(nxt-t),24-abs(nxt-t))
      MIN.append(now)
    if MIN[0] <= MIN[1]:
      Fix.append(24-D[i])
    else:
      Fix.append(D[i])
  #print(Fix)
  break
ans = 100
for i in range(N+1):
  for j in range(i+1,N+1):
    #print(Fix[i],Fix[j])
    ans = min(ans,abs(Fix[i]-Fix[j]),24-abs(Fix[i]-Fix[j]))
    #print(ans)
print(ans)
        

Measured memory_bytes: 67152
#include<stdio.h>
int main(void){
  int money = 0;
  scanf("%d",&money);
  int big_gold = money / 500;
  money -= 500 * big_gold;
  int small_gold = money / 5;
  int point = big_gold * 1000 + small_gold * 5;
  printf("%d",point);
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
#define endl "\n"
using namespace std;



int32_t main() {

    fast

    int n,k;
    cin>>n>>k;

    vector<int>arr(n);
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    for(int i=k;i<n;i++){
        if(arr[i]>arr[i-k]){
            cout<<"Yes"<<endl;
        }
        else{
            cout<<"No"<<endl;
        }
    }




    return 0;
}



Measured memory_bytes: 4780
#include<stdio.h>
#include<stdlib.h>
long p[111111],a[111111],b[111111];
int compare(const void *c, const void *d) {
    return a[*(long*)c] - a[*(long*)d];
}
int main() {
    int h, w, a, b, ans;
    scanf("%d%d%d%d", &h, &w, &a, &b);
    ans = (h - a)*(w - b);
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int a[100];
void init(int day){
	for(int i = 1; i <= day; i++){
		int d1,d2;
		d1 = i%10;
		d2 = i/10;
		if(d1>=2 && d2>=2){
			a[i] = d1*d2;
		}
		else{
			a[i] = -1;
		}
	}
}
int main(){
	int m,d;
	scanf("%d%d",&m,&d);
	init(d);
	long long ans = 0;
	for(int i = 1; i <= d; i++){
		if(a[i]!=-1 && a[i]<=m)ans++;
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int x,y;
  scanf("%d%d",&x,&y);
  
  if(y%2==1){printf("No");return 0;}
  
  if(y>=2*x && 4*x>=y){printf("Yes");return 0;}
  
  printf("No");return 0;
}


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

int main(){
int a,b;
  cin >>a>>b;
  int a1 = a+b;
  int a2 = a-b;
  int a3 = a*b;
  int b1 = max(a1,a2);
  int ans = max(a3,b1);
  cout << ans <<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <set>
#include <string>
#include <vector>
#include <iomanip>
#include <map>

using namespace std;

#define fastInp cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);

typedef long long ll;
typedef long double ld;

const ll SIZE = 1e6 + 10, S2 = 1e7 * 2, MOD = 1e9 + 7;



int main() {
    fastInp;

    ll n;
    cin >> n;

    ll mn = INT64_MAX, s = 0;
    for (int i = 0; i < n; i++) {
    ll num;
    cin >> num;
    s += num;
    if (num % 10 != 0) mn = min(mn, num);
    }
    
    if (mn == INT64_MAX) {
        cout << "0";
    }
    else {
        if (s % 10 != 0) {
            cout << s;
        }
        else {
            cout << s - mn;
        }
    }
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define maxn 109
#define LL long long
#define mk make_pair
using namespace std;
struct data{
  int nex,to;
}e[maxn*2];
typedef pair<int,LL> P;
int head[maxn],edge=0,Dep=0,dep[maxn],n;
LL f[maxn];
inline void add(int from,int to){
  e[++edge]=(data){head[from],to};
  head[from]=edge;
}
inline void dfs(int x,int fa,int d){
  Dep=max(Dep,d),dep[x]=d;
  for(int i=head[x];i;i=e[i].nex){
    int v=e[i].to;if(v==fa) continue;
    dfs(v,x,d+1);
  }
}
inline P solve(int x){
  Dep=1,dfs(x,0,1);
  memset(f,0,sizeof(f));
  for(int i=Dep;i>0;i--){
    LL Max=0;
    for(int j=1;j<=n;j++)
      if(dep[j]==i){
	LL mx=0,sum=0;
	for(int k=head[j];k;k=e[k].nex){
	  int v=e[k].to;
	  if(dep[v]==dep[j]+1) mx=max(mx,f[v]),sum++;
	}
	if(sum==0) f[j]=1;
	else f[j]=mx*sum;
	Max=max(Max,f[j]);
      }
    for(int j=1;j<=n;j++)
      if(dep[j]==i) f[j]=Max;
      }
  return mk(Dep,f[x]);
}
inline P solve1(int u,int v){
  Dep=1,dfs(u,v,1),dfs(v,u,1);
  memset(f,0,sizeof(f));
  for(int i=Dep;i>0;i--){
    LL Max=0;
    for(int j=1;j<=n;j++)
      if(dep[j]==i){
	LL mx=0,sum=0;
	for(int k=head[j];k;k=e[k].nex){
	  int v=e[k].to;
	  if(dep[v]==dep[j]+1) mx=max(mx,f[v]),sum++;
	}
	if(sum==0) f[j]=1;
	else f[j]=mx*sum;
	Max=max(Max,f[j]);
      }
    for(int j=1;j<=n;j++)
      if(dep[j]==i) f[j]=Max;
  }
  return mk(Dep,2ll*max(f[u],f[v]));
}
inline P Min(P a,P b){
  if(a.first<b.first) return a;
  else if(a.first>b.first) return b;
  else if(a.second<b.second) return a;
  else return b;
}
int main(){
  scanf("%d",&n);
  for(int i=1,x,y;i<n;i++)
    scanf("%d%d",&x,&y),add(x,y),add(y,x);
  P ans=mk(1e9,1ll*1e18);
  for(int i=1;i<=n;i++)
    ans=Min(ans,solve(i));
  for(int i=1;i<=edge;i+=2)
    ans=Min(ans,solve1(e[i].to,e[i+1].to));
  printf("%d %lld",ans.first,ans.second);
  return 0;
}


Measured memory_bytes: 256
// AtCoder-Template.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second
#define FOR(i,N) for(auto i=0; i<N; ++i)
#define FORREV(i,N,_cnt) for(auto i=N-1,cnt=_cnt; cnt > 0; --i, --cnt)
#define ALL(x) x.begin(), x.end()

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T& a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T& a, const T& b) { if (b > a) a = b; }
/* clang-format on */

int main() {
#ifdef DEBUG
	ifstream ifs("in.txt");
	cin.rdbuf(ifs.rdbuf());
#endif
	vector<ll> ANS;
	ll N; cin >> N;
	while (N != 0) {		
		ll shou = N / (-2);
		ll amari = N - (-2) * shou;
		if (amari < 0) {
			shou += 1;
			amari = N - (-2) * shou;
		}
		
		ANS.push_back(amari);
		N = shou;
	}

	while (!ANS.empty() and ANS.back() == 0) {
		ANS.erase(prev(ANS.end()));
	}

	if (ANS.empty()) ANS.push_back(0);
	
	reverse(ALL(ANS));
	for (auto va : ANS)
		cout << va;
	cout << endl;

	return 0;
}


Measured memory_bytes: 256
N, W = map(int, input().split())
w = [0] * N
v = [0] * N
for i in range(N):
    w[i], v[i] = map(int, input().split())
dp = [[0] * (W + 1) for _ in range(N + 1)]
for i in range(N):
    for j in range(W + 1):
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
        if j + w[i] <= W:
            dp[i + 1][j + w[i]] = max(dp[i + 1][j + w[i]], dp[i][j] + v[i])
print(dp[N][W])


Measured memory_bytes: 120300
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use itertools::Itertools;
use proconio::*;
use text_io::*;

const U_INF: usize = 1 << 60;
const I_INF: isize = 1 << 60;

fn main() {
    input! {
        n:usize,
        l:[usize;n],
    }

    let mut ans = 0;

    for i in &l {
        for j in &l {
            for k in &l {
                if can_make_triangle(*i, *j, *k) {
                    ans += 1;
                }
            }
        }
    }

    println!("{}", ans / 6);
}

fn can_make_triangle(a: usize, b: usize, c: usize) -> bool {
    if a == b || a == c || b == c {
        return false;
    }

    let mut path = [a, b, c];
    path.sort();
    let a = path[0];
    let b = path[1];
    let c = path[2];

    c < a + b
}


Measured memory_bytes: 2100
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <iomanip> : 表示桁数

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

int N;
string S;
double ans = 0;

int main() {
	cin >> N;
	vector<int> x(N);
	vector<int> y(N);
	for (int i = 0; i < N; i++) {
		cin >> x[i] >> y[i];
	}
	for (int i = 0; i < N; i++) {
		for (int j = i + 1;j < N;j++) {
			ans += sqrt((x[i] - x[j])*(x[i] - x[j]) + (y[i] - y[j])* (y[i] - y[j]));
		}
	}

	cout << setprecision(20) << ans*2/N << endl;
	return 0;
}


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

int judge_slope(int a, int b){
    if(a==b){return 0;}
    else if(a<b){return 1;}
    else if(a>b){return -1;}
    else{return 99;}
}

int main(void){
    int N;
    int A[100000] = {};
    int i;

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

    int c_slope = 0;
    int p_slope = 0;
    int count = 1;
    for(i=1;i<N;i++){
        c_slope = judge_slope(A[i-1],A[i]);
        if(p_slope == 0){
            if(c_slope == 1){
                p_slope = 1;
            }
            if(c_slope == -1){
                p_slope = -1;
            }
        }
        if(p_slope == 1 && c_slope == -1){
            count++;
            p_slope = 0;
        }
        if(p_slope == -1 && c_slope == 1){
            count++;
            p_slope = 0;
        }
    }
    cout << count << endl;
    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#define LL long long
using namespace std;
int read(){
    char ch=getchar(); int w=1,c=0;
    for (;!isdigit(ch);ch=getchar()) if (ch=='-') w=-1;
    for (;isdigit(ch);ch=getchar()) c=(c<<3)+(c<<1)+(ch^48);
    return w*c;
}
const int mod=998244353,M=1e6+10;
LL f[M],inv_f[M],ans;
int n,m;
LL fast(LL x,LL p){
	LL res=1;
	for (;p;p>>=1,x=x*x%mod) if (p&1) res=res*x%mod;
	return res;
}
LL C(int n,int m){
	if (m>n) return 0;
	return f[n]*inv_f[m]%mod*inv_f[n-m]%mod;
}
LL calc(int x,int y,int t){
//	cout<<x<<" "<<y<<" "<<t<<"\n";
//	cout<<C(x+y,x)<<" "<<C(x+y,x+t)<<"\n";
	return C(x+y,y)-C(x+y,x+t);
}
int main(){
    n=read(); m=read();
    if (m<n) {
    	cout<<0<<"\n";
    	return 0;
	}
    f[0]=1;
    for (int i=1;i<=m+n;i++){
    	f[i]=f[i-1]*i%mod;
	}
	inv_f[m+n]=fast(f[m+n],mod-2);
	for (int i=m+n;i;i--) inv_f[i-1]=inv_f[i]*i%mod;
	
//	cout<<C(4,4)<<" "<<f[4]<<" "<<inv_f[2]<<" "<<"\n";
//
//	cout<<8*inv_f[2]%mod<<"\n";
	
	for (int i=0;i<=m;i++){
		int R=i,B=m-i;
		if (R==B) ans=(ans+calc(R,B-1,R-n+1)+mod)%mod;
		if (R>B) ans=(ans+calc(R,B,R-n+1)+mod)%mod;
	}
	cout<<ans<<"\n";
    return 0;
}



Measured memory_bytes: 15872
N = int(input())
A = [int(_) for _ in input().split()]

i = 0
j = 0
x = 0

result = 0

while i < N or j < N:
    while j < N and x & A[j] == 0:
        x |= A[j]
        j += 1
    result += j - i
    x &= ~A[i]
    i += 1
    
print(result)


Measured memory_bytes: 23560
N, K = map(int, input().split())
A = list(map(int, input().split()))
A.sort()
B = A[::-1]
p = 10 ** 9 + 7

g1 = [1, 1]
g2 = [1, 1]
inverse = [0, 1]

for i in range(2, N + 1):
    g1.append((g1[-1] * i) % p)
    inverse.append((-inverse[p % i] * (p//i)) % p)
    g2.append((g2[-1] * inverse[-1]) % p)


def cmb(n, r, p):
    if (r < 0 or r > n):
        return 0
    return g1[n] * g2[r] * g2[n-r] % p


ans = 0
for n in range(N - K + 1):
    ans -= A[n] * cmb(N - n - 1, K-1, p) % p
    ans += B[n] * cmb(N - n - 1, K-1, p) % p
print(ans % p)


Measured memory_bytes: 22072
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define int long long
constexpr long long INF = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;


#include <random>

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

    int D;
    cin>>D;
    int c[26];
    int q[D];
    rep(i,26){
        cin>>c[i];
    }
    int s[D][26];
    rep(i,D){
        rep(j,26){
            cin>>s[i][j];
        }
    }
    int ans=0;
    map<int,int> m;
    int y=0;
    rep(i,D){

        int an=-INF;
        int x=0;
        rep(k,26){
            int a=ans;
            map<int,int> ma=m;
            a+=s[i][k];
            rep(j,26){
                if(j==k){
                    ma[k]=0;
                }else{
                    ma[j]++;
                    a-=ma[j]*c[j];
                }
            }
            if(an<a){
                x=k;
                an=a;
            }
        }
        y=x;
        ans+=s[i][y];
        rep(j,26){
            if(j==y){
                m[y]=0;
            }else{
                m[j]++;
                ans-=m[j]*c[j];
            }
        }
        y++;
        q[i]=y;
    }

    int tr=0;
    std::random_device rnd; 
    while(tr<=2000){
        int g=rnd()*100%26;
        int h=rnd()*100%26;
        tr++;
        int ansm=0;
        int r[D];
        rep(i,D){
            if(i==g){
                r[i]=h;
            }else{
                r[i]=q[i];
            }
        }
        map<int,int> mx;
        rep(i,D){
            ansm+=s[i][r[i]];
            rep(j,26){
                if(j==r[i]){
                    mx[r[i]]=0;
                }else{
                    mx[j]++;
                    ansm-=mx[j]*c[j];
                }
            }
        }
        if(ansm>ans){
            rep(i,D){
                q[i]=r[i];
            }
        }
    }
    rep(i,D){
        cout << q[i] << endl;
    }

    



}


Measured memory_bytes: 3740
#include<bits/stdc++.h>
#define ll long long
#define M 1000000007

using namespace std;

// Solve function here


// End Solve function

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
    //ifstream cin("input.in");
	//clock_t start, finish;
	int n; cin >> n;
	string s;
	unordered_set<string> m;
	for(int i = 0; i < n; ++i){
		cin >> s;
		if(!m.count(s)){
			m.insert(s);
		}
	}
	cout << m.size() << endl;
	return 0;
}


Measured memory_bytes: 17748
#include <cstdio>
#include <climits>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include <cstdio>
#include <climits>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <cstring>
#include <set>
#include <map>
#define rep(i, n) for (int i = 0; i < int(n); i++)
using namespace std;
long long MOD = 1000000007;
long long INF = 1000000000000000; //10^15
typedef long long ll;
typedef unsigned long long ull;

int main(void) {

  int b, w;
  cin >> w >> b;

  char s[110][30] = {};
  rep(i, 100) rep(j, 21) s[i][j] = '#';
  int wc = w - 1;
  for (int i = 1; i < 20; i++) {
    for (int j = 0; j < 100; j += 2) {
      if (wc > 0 && s[j][i - 1] == '#') {
	wc--;
	s[j][i] = '.';
      }
    }
  }

  char t[110][30] = {};
  rep(i, 100) rep(j, 21) t[i][j] = '.';
  int bc = b - 1;
  for (int i = 1; i < 20; i++) {
    for (int j = 0; j < 100; j += 2) {
      if (bc > 0 && t[j][i - 1] == '.') {
	bc--;
	t[j][i] = '#';
      }
    }
  }

  cout << 100 << " " << 42 << endl;
  rep(i, 100) cout << s[i] << t[i] << endl;

  return 0;
}
  


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<stack>
#include<set>
#include<map>
#include<utility>
#include<algorithm>
#include<cmath>
#include<climits>
using namespace std;

#define MOD 1000000007;

int main(){
	int n, m;
	cin >> n >> m;
	if(n>=m){
		cout << 0 << endl;
		return 0;
	}
	vector<int> x(m);
	for(int i=0; i<m; i++)
		cin >> x[i];
	sort(x.begin(), x.end());
	vector<int> l(m-1);
	for(int i=0; i<m-1; i++)
		l[i] = x[i+1]-x[i];
	sort(l.rbegin(), l.rend());
	int sum=0;
	for(int i=0; i<n-1; i++)
		sum+=l[i];
	int all=x[m-1]-x[0];
	cout << all-sum << endl;
	return 0;
}

Measured memory_bytes: 1024
import sys
n = int(input())
a = list(map(int,input().split()))
f = False;
for i in range(n):
  if a[i] == 0:
    f = True
if f:
  print(0)
  sys.exit(0)
ans = 1
for i in range(n):
  ans *= a[i]
  if ans > 1e18:
    print(-1)
    sys.exit(0)
print(ans)


Measured memory_bytes: 21656
// AOJ 3026 ai1333
// 2018.3.28 bal4u

#include <stdio.h>

char s[110] = "ai1333", *p = s+6;

int main()
{
	int x;

	scanf("%d", &x), x /= 100;
	while (x--) *p++ = '3';	*p = 0;
	puts(s);
	return 0;
}


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

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

int main(){
  double r;
  double pie = 3.14159265358979;
  cin >> r;
  cout << fixed << setprecision(6);
  cout << r*r*pie << ' ' << 2*r*pie << endl;
}



Measured memory_bytes: 3236