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

using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define reps(x,c) for(auto x:c)
#define all(x) begin(x), end(x)
#define pb(a) emplace_back(a) 
#define mp(a,b) make_pair((a),(b))
#define pl pair<ll,ll>
#define INF 2147483600
#define fi first
#define se second
#define dbg(x) cout << #x"="<< (x) << endl
int main(){
  ll n,m;cin>>n;
  map<string,int> list;
  string s;
  rep(i,n){
    cin>>s;
    list[s]++;
  }
  cin>>m;
  rep(i,m){
    cin>>s;
    list[s]--;
  }
  int ans=0;
  reps(x,list){
    ans=max(x.se,ans);
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 384
n, k = map(int, input().split())
rules = [map(int, input().split()) for _ in range(k)]

ans = [[0,1,1,1,1,1,1] for _ in range(n+1)]

dic = [0, [0,1,0,0,1,0,0], [0,0,1,0,0,1,0], [0,0,0,1,0,0,1]]
for [d, p] in rules:
    ans[d] = list(dic[p])

ans[1][4] = 0
ans[1][5] = 0
ans[1][6] = 0

for d in range(2, n+1):
    ans[d][1] = ans[d][1] * (ans[d-1][2] + ans[d-1][3] + ans[d-1][5] + ans[d-1][6])
    ans[d][2] = ans[d][2] * (ans[d-1][1] + ans[d-1][3] + ans[d-1][4] + ans[d-1][6])
    ans[d][3] = ans[d][3] * (ans[d-1][1] + ans[d-1][2] + ans[d-1][4] + ans[d-1][5])
    ans[d][4] = ans[d][4] *  ans[d-1][1]
    ans[d][5] = ans[d][5] *  ans[d-1][2]
    ans[d][6] = ans[d][6] *  ans[d-1][3]

print(sum(ans[n]) % 10000)



Measured memory_bytes: 5644
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<< "\n"


int main(){
    int n;
    cin >> n;
    int a[n];
    REP(i,n){
        cin >> a[i];
    }
    REPR(i,n-1){
        if(i!=n-1)cout << " ";
        cout << a[i];
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 3096
letters = 'abcdefghijklmnopqrstuvwxyz'
n = int(input())
n -= 1
bnds = [0]
i = 1
bnd = 1
while bnd <= 1000000000000001:
    bnd = int(26*(1-26**i)/(1-26))
    bnds.append(bnd)
    i += 1
for i in range(len(bnds)-1):
    if bnds[i] <= n < bnds[i+1]:
        j = i
n -= bnds[j]
ans = []
for i in range(j+1):
    x = n // (26**(j-i))
    #print(x)
    ans.append(letters[x])
    n -= x * (26**(j-i))
print(''.join(ans))

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

#define free 1
#define not_free -1
#define model 4

int k,M[10][10];
int gyo[8],retu[8],leftdown[2*8-1],rightdown[2*8-1];


void quee(int i){
  if(i==8){
    for(int i=0;i<8;i++){
      for(int j=0;j<8;j++){
	if(M[i][j]){
	  if(gyo[i]!=j)return;
	}
      }
    }
    for(int i=0;i<8;i++){
      for(int j=0;j<8;j++){
	cout<<((gyo[i]==j)? "Q":".");
      }
      cout<<endl;
    }
    return;
  }
  for(int l=0;l<8;l++){
    if(retu[l]==free||leftdown[i+l]==free||rightdown[i-l+8-1]==free)continue;
    gyo[i]=l;
    retu[l]=leftdown[i+l]=rightdown[i-l+8-1]=free;
    quee(i+1);
    gyo[i]=retu[l]=leftdown[i+l]=rightdown[i-l+8-1]=not_free;
  }
}

int main(){

  for(int i=0;i<8;i++){
    gyo[i]=not_free;
    retu[i]=not_free;
  }
  for(int i=0;i<15;i++){
    leftdown[i]=not_free;
    rightdown[i]=not_free;
  }
  cin>>k;
  int r,c;
  for(int i=0;i<k;i++){
    for(int j=0;j<k;j++){
      M[i][j]=false;
    }
  }
  for(int i=0;i<k;i++){
    cin>>r>>c;
    M[r][c]=true;
  }
  quee(0);
  /*for(int i=0;i<k;i++){
    if(i!=c)M[r][i]=not_free;
    if(i!=r)M[i][c]=not_free;
    if(i!=0){
      M[r+i][c+i]=not_free;
      M[r-i][c-i]=not_free;
    }
  }
  for(int i=0;i<k;i++){
    for(int j=0;j<k;j++){
      if(M[i][j]!=not_free){
	M[i][j]=model;
	for(int l=0;l<k;l++){
	  if(i!=c){
	    
	    M[i][l]=not_free;
	  }
	  if(i!=r)M[l][c]=not_free;
	  if(i!=0){
	    M[r+l][c+l]=not_free;
	    M[r-l][c-l]=not_free;
	  }
	}
      }
    }
  }*/
}



Measured memory_bytes: 3112
#include<vector>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <cmath>
#include<queue>
#include <sstream>
#include <set>

const long long INF = 1000000007;
using namespace std;
typedef long long llong;

//int isalpha(char ch): ch がアルファベットなら true を返す
//int isdigit(char ch): ch が数字なら true を返す
//int islower(char ch): ch が小文字なら true を返す
//int isupper(char ch): ch が大文字なら true を返す
//int tolower(char ch): ch の小文字を返す
//int toupper(char ch): ch の大文字を返す

//string型
//size()	文字数を返す
//Insert()	（指定した場所に）文字・文字列を挿入する
//erase()	（指定した場所の）文字・文字列を削除する
//clear()	すべての文字を削除する
//substr()	文字列の（指定した）部分文字列を返す
//replace()	（指定した）部分文字列を新しい文字列に置換する
//c_str()変換
//文字列の比較は、<=や==などを使え
//replace関数を使い、簡単に文字列を置換
//リバース関数：reverse(str.begin(), str.end());
//map<type, type> dict;で宣言
//グラフ理論用変数
//vector<vector<llong> > graph(N);

//ソート
//降順sort(v.begin(), v.end(), std::greater<Type>());

//大文字から小文字へんかん
//w[i] = w[i]-'A'+'a';

//vector
//assignメソッド　引数：サイズ、値
//与えられたサイズと値でvectorを初期化する

//queueクラス
//find()次に取り出す値の表示をする。
//pop()値を取り出す。戻り値はなし
//push()キューに値をプッシュする

//priority_queueクラス

//切り上げ
//ceil
//floor

int main(){
    llong N;
    double T,A;
    cin >> N;
    cin >> T >> A;
    vector<double> H(N);
    double minv = 100000000000000;
    llong idx;
    for(int i=0; i<N; i++){
        cin >> H[i];
    }
    for(int i=0; i<N; i++){
        if(minv>abs(A-(T-H[i]*0.006))){
            idx = i;
            minv = abs(A-(T-H[i]*0.006));
        }
    }
    cout << idx+1 << endl;
    return 0;
}


Measured memory_bytes: 3168
n = int(input())
M = [[0] * n for i in range(n)]
for i in range(n):
    t = list(map(int, input().split()))
    v = t[0]
    k = t[1]
    for j in range(k):
        M[v - 1][t[2+j] - 1] = 1

for r in M:
    r = map(str, r)
    print(' '.join(r))

Measured memory_bytes: 7672
n = gets.to_i
edges = Array.new(n).map{[]}
(n-1).times do
    a,b,c = gets.split.map{|i|i.to_i-1}
    edges[a] << [b,c+1]
    edges[b] << [a,c+1]
end
p,k = gets.split.map(&:to_i)
dist = Array.new(n,10**15)
dist[k-1] = 0
q = [k-1]
while q.any?
    f = q.shift
    edges[f].each do |v,d|
        if dist[v] > dist[f]+d
            dist[v] = dist[f]+d
            q << v
        end
    end
end
p.times do
    x,y = gets.split.map{|i|i.to_i-1}
    puts dist[x]+dist[y]
end

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

bool isPrime(int x){
    if(x<=1) return false;
    else{
        for(int i=2;i*i<=x;i++){
            if(x%i==0) return false;
        }
    }
    return true;
}


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

    int p=X;
    while(!isPrime(p)) p++;

    cout << p << endl;

    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <functional>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <string>
#define SIZE 405
#define MX 100005
#define INF 1000000000

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int X[MX],Y[MX];
vector <int> tree[SIZE];
bool use[SIZE];
bool reach[SIZE];

int main()
{
	int n,m;
	scanf("%d %d",&n,&m);
	for(int i=0;i<m;i++)
	{
		int x,y;
		scanf("%d %d",&x,&y);x--,y--;
		X[i]=x,Y[i]=y;
	}
	for(int i=0;i<n;i++)
	{
		memset(reach,false,sizeof(reach));
		reach[i]=true;
		use[i]=true;
		for(int j=m-1;j>=0;j--)
		{
			if(reach[X[j]]&&reach[Y[j]])
			{
				use[i]=false;
				break;
			}
			if(reach[X[j]])
			{
				reach[Y[j]]=true;
				tree[i].push_back(j);
			}
			else if(reach[Y[j]])
			{
				reach[X[j]]=true;
				tree[i].push_back(j);
			}
		}
		//printf("%d\n",use[i]);
	}
	int ret=0;
	for(int i=0;i<n;i++)
	{
		for(int j=i+1;j<n;j++)
		{
			if(use[i]&&use[j])
			{
				memset(reach,false,sizeof(reach));
				reach[i]=reach[j]=true;
				int L=0,R=0;
				bool up=true;
				while(L<tree[i].size()||R<tree[j].size())
				{
					int v=-1;
					if(L<tree[i].size()) v=max(v,tree[i][L]);
					if(R<tree[j].size()) v=max(v,tree[j][R]);
					if(reach[X[v]]&&reach[Y[v]])
					{
						//printf("%d %d : %d\n",i,j,v);
						up=false;
						break;
					}
					if(reach[X[v]]||reach[Y[v]])
					{
						reach[X[v]]=reach[Y[v]]=true;
					}
					if(L<tree[i].size()&&tree[i][L]==v) L++;
					if(R<tree[j].size()&&tree[j][R]==v) R++;
				}
				ret+=up;
				//if(up) printf("%d %d\n",i,j);
			}
		}
	}
	printf("%d\n",ret);
	return 0;
}


Measured memory_bytes: 1152
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        a: String,
        b: String
    };
    let arr = [
        "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "1",
    ];
    let ai = arr.iter().position(|&num| num == &a).unwrap();
    let bi = arr.iter().position(|&num| num == &b).unwrap();
    println!(
        "{}",
        if ai > bi {
            "Alice"
        } else if ai < bi {
            "Bob"
        } else {
            "Draw"
        }
    );
}


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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li n;
li x[100100];

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

    string ss;
    li now = 0;
    li x_now = 0;
    rin{
        if (s[i] == 'x') {
            x_now++;
        } else{
            x[now] = x_now;
            ss.pb(s[i]);
            x_now = 0;
            now++;
        }
    }
    x[now] = x_now;
    now++;

    rep(i, sz(ss) / 2 + 1) {
        if (ss[i] != ss[sz(ss) - 1 - i]) {
            puts("-1");
            return 0;
        }
    }
    li res = 0;
    rep(i, now) {
        res += abs(x[i] - x[now - 1 - i]);
    }
    cout << res / 2 << endl;

    return 0;
}

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

int N;

int main(){
    cin >> N;
    
    vector<int> A(N,0);
    int ans;
    for(int i=0;i<N;i++) cin >> A.at(i);

    sort(A.begin(),A.end());
    cout << A[N-1]-A[0] << endl;

}

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

int main()
{
    string s;
    cin >> s;
    int Pnum = 0 ,Gnum = 0;
    int winnum = 0,falsenum = 0;
    for(int i = 0 ; i < s.length() ; i++)
    {
        if(s[i]== 'g')//出石头
        {
            if(Pnum+1<=Gnum) //可以出布出布
            {
                Pnum++;
                winnum++;
            }else{
                Gnum++;
            }

        }
        else{//对方出布
            if(Pnum+1<=Gnum)
            {
               Pnum++;
            }
            else{
                Gnum++;
                falsenum++;
            }
        }
    }
    cout<<winnum-falsenum<<endl;

    return 0;
}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;

string solve() {
    ll n; cin >> n;
    string s = "";
    while (n > 0) {
        ll rem = (n % 26);
        if (rem == 0) rem = 26;
        s = char(rem - 1 + 'a') + s;
        n -= rem;
        n /= 26;
    };

    return s;
}

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

    cout << solve() << endl;
}


Measured memory_bytes: 3644
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        //long start = System.currentTimeMillis();
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if (400 <= n && n <= 599) System.out.println(8);
        else if (600 <= n && n <= 799)System.out.println(7);
        else if (800 <= n && n <= 999)System.out.println(6);
        else if (1000 <= n && n <= 1199)System.out.println(5);
        else if (1200 <= n && n <= 1399)System.out.println(4);
        else if (1400 <= n && n <= 1599)System.out.println(3);
        else if (1600 <= n && n <= 1799)System.out.println(2);
        else if (1800 <= n && n <= 1999)System.out.println(1);
        sc.close();
//        long end = System.currentTimeMillis();
//        System.err.println((end-start)+"ms");
    }
}

Measured memory_bytes: 35672
#include <cstdio>
#include <cstring>
#include <cmath>
const double pi = 3.141592653589793;
int main(){
	double a,b,h,m;
	scanf("%lf%lf%lf%lf",&a,&b,&h,&m);
	double angle1,angle2,ag;
	angle1=(h*60.0+m)*2.0*pi/(12.0*60.0);
	angle2=m*2.0*pi/60.0;
	ag=angle1-angle2;
	if(ag<0)ag=-ag;
	printf("%.15f\n",sqrt(a*a+b*b-2.0*a*b*cos(ag)));
}

Measured memory_bytes: 2600
#include <bits/stdc++.h>
using namespace std;
int main()
{
	char c[5];
	int s=0,i;
	scanf("%s",c);
	for(i=0;i<4;i++)
	{
		if(c[i]=='-')
			s--;
		else
			s++;	
	}
		printf("%d",s);
	return 0; 
} 

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<cmath>
#include<sstream>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<utility>
#include<iomanip>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<map>
#include<list>
#include<set>
#include<stdlib.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define repp(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
const int dx[4] = { 0, 1, 0, -1 }, dy[4] = { 1, 0, -1, 0 };
const int dX[8] = { 0, 1, 1, 1, 0, -1, -1, -1 }, dY[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
vector<long long> Prime;
void SieveOfEratosthenes(long long e) //setup vector<long long>Prime(~x)
{
	bool *x=new bool[e];
	for (long long i = 0; i <= e; i++)x[i] = false;
	for (long long i = 2; i <= e; i++)
	{
		if (x[i]);
		else
		{
			Prime.push_back(i);
			for (long long l = i; l <= e; l += i)x[l] = true;
		}
	}
	return;
}
int StringToInt(string a)
{
	stringstream ss;
	int x;
	ss << a;
	ss >> x;
	return x;
}
string IntToString(int a)
{
	stringstream ss;
	string x;
	ss << a;
	ss >> x;
	return x;
}
struct XY
{
	int x;
	int y;
};
int in()
{
	int x;
	cin >> x;
	return x;
}
/*
(char)'1' - (int)48 = (int)1;
???1111181
*/
////////////////////////////////////////////////////



int main()
{


	int q;
	cin >> q;
	while (q--)
	{
		int rr[1000005] = {};
		string x;
		cin >> x;
		int i=0;
		for (;; i++)
		{
			if (x.size() == 1)
			{
				cout << i << endl;
				break;
			}
			else if (rr[StringToInt(x)]>=2)
			{
				cout << -1 << endl;
				break;
			}
			else
			{
				int mm=-1;
				for (int l = 1; l < x.size(); l++)
				{
					string a, b;
					a = x;
					a.erase(a.begin() + l, a.end());
					repp(m, l, x.size())b += x[m];
					mm = max(mm, StringToInt(a)*StringToInt(b));
				}
				rr[mm]++;
				x = IntToString(mm);
			}

		}

		

	}
}

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

#define ll long long
#define ull unsigned long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(a,b) for(int a=0;a<(b);++a)
#define REP1(i,n) for(int i=1;i<=(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define INF (1<<29)
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}

const int MOD =(int)1e9+7;
const int MAX =510000;

ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0||k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}

ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}
bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second < b.second;
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N=in();
    vector<pair<int,int>>x;
    vector<pair<int,int>>y;
    int a,b;
    REP(i,N){
        cin>>a>>b;
        x.pb(mp(a,b));
    }
    REP(i,N){
        cin>>a>>b;
        y.pb(mp(a,b));
    }
    sort(all(x),compare_by_a);
    sort(all(y),compare_by_a);
    int ans;ans=0;
    bool used[N]={};
    REP(i,N){
        vector<int> koho;
        int max_y;
        max_y=-1;
        REP(j,N){
            if(x[j].first<y[i].first&&x[j].second<y[i].second&&!used[j]){
                koho.pb(j);
                max_y=max(max_y,x[j].second);
            }
        }
        if(max_y>-1){
            REP(k,koho.size()){
                if(x[koho[k]].second==max_y){
                    used[koho[k]]=true;
                    ans++;
                    //cout<<x[i].first<<" "<<y[koho[k]].first<<endl;
                    break;
                }
            }
        }
    }
    print(ans);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
int n,k,d,temp,ans;
int arr[105];
int32_t main(){
    cin>>n>>k;
    for(int i=0;i<k;i++){
        cin>>d;
        for(int j=0;j<d;j++){
            cin>>temp;
            arr[temp] = 1;
        }
    }
    for(int i=1;i<=n;i++){
        if(arr[i]==0){ans++;}
    }
    cout<<ans;
}

Measured memory_bytes: 3620
#include<iostream>
#include<cstdio>
#include<cstring>
typedef long long ll;
const int N=60;
ll f[N][2];
int s[N];
int n,p;
int main()
{
	scanf("%d%d",&n,&p);
	for(int i=1;i<=n;i++)
		scanf("%d",s+i),s[i]&=1;
	f[0][0]=1,f[0][1]=0;
	for(int i=1;i<=n;i++)
		if(s[i]&1)f[i][0]=f[i][1]=f[i-1][1]+f[i-1][0];
		else f[i][0]=f[i-1][0]*2,f[i][1]=f[i-1][1]*2;
	printf("%lld\n",f[n][p]);
	return 0;
}


Measured memory_bytes: 256
// abc115_a
#include <bits/stdc++.h>
#ifdef LOCAL
#include "../cxx-prettyprint/prettyprint.hpp"
#endif
using namespace std;

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

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))
#define ALL(x) x.begin(), x.end()

#define INF ((1 << 29)-1)
#define MOD (1000000007)

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
#define print_line(vec, n) {for(int i=0;i<(n-1);i++) cout << (vec)[i] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain;

int main() {
#ifdef LOCAL
    ifstream in("../arg.txt"); cin.rdbuf(in.rdbuf());
#endif
    int D;
    cin >> D;

    if (D == 25){
        print("Christmas");
    } else if (D == 24){
        print("Christmas Eve");
    } else if (D == 23){
        print("Christmas Eve Eve");
    } else if (D == 22){
        print("Christmas Eve Eve Eve");
    }

    return 0;
}


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

int main(){
    int N;
    cin >> N;
    int h[N];
    for(int i=0;i<N;i++) cin >>h[i];
    int dp[N];
    dp[0]=0;
    dp[1]=abs(h[1]-h[0]);
    for (int i=2;i<N;i++){
        if( (dp[i-2]+abs(h[i]-h[i-2]))>(dp[i-1]+abs(h[i]-h[i-1]))){
            dp[i]=dp[i-1]+abs(h[i]-h[i-1]);
        }else{
            dp[i]=dp[i-2]+abs(h[i]-h[i-2]);
        }
    }
    cout << dp[N-1];
}

Measured memory_bytes: 1024
// È¥°É£¡Æ¤¿¨Çð! °ÑAC´ø»ØÀ´£¡
//      ¤Ø¡¡¡¡¡¡¡¡¡¡£¯|
// ¡¡¡¡/£Ü7¡¡¡¡¡¡ ¡Ï£ß/
// ¡¡ /¡¡©¦¡¡¡¡ £¯¡¡£¯								AC		AC		AC		AC
//    ©¦¡¡Z £ß,£¼¡¡£¯¡¡¡¡ /`©c						AC		AC		AC		AC
//    ©¦¡¡¡¡¡¡¡¡¡¡©c¡¡¡¡ /¡¡¡¡¡µ					AC		AC		AC		AC
// ¡¡Y¡¡¡¡¡¡¡¡¡¡`¡¡ /¡¡¡¡/  /						AC		AC		AC		AC
// ¡¡Øé¡ñ¡¡.¡¡¡ñ¡¡¡¡¡´¡¡/¡¡/						AC		AC		AC		AC
// ¡¡()¡¡ ¤Ø¡¡¡¡¡¡¡¡|¡¡£Ü¡´							AC		AC		AC		AC
// ¡¡¡¡>- ._¡¡ ¥£¡¡ ©¦ £¯£¯							AC		AC		AC		AC
// ¡¡ / ¤Ø¡¡¡¡ /¡¡/£¼| £Ü£Ü							AC		AC		AC		AC
// ¡¡ ©c_/¡¡¡¡(_£¯¡¡ ©¦£¯£¯							AC		AC		AC		AC
// ¡¡¡¡ 7¡¡¡¡¡¡¡¡¡¡¡¡¡¡|£¯							AC		AC		AC		AC
// ¡¡¡¡ £¾¨Dr£þ£þ`-¨D£ß/							AC		AC		AC		AC
//**************************************Accepted*****************************************//

#include<bits/stdc++.h>

#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define Unique(x) x.erase(unique(all(x)),x.end());

#define CIN_FILE "input.txt"
#define COUT_FILE "output.txt"

#define Pig (OO)

using namespace std;

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

const int Days[]={-1,31,28,31,30,31,30,31,31,30,31,30,31};

inline int read()
{
	#define gc getchar
	int ans=0;
	bool f=1;
	char ch=gc();
	
	while(!isdigit(ch))f^=ch=='-',ch=gc();
	
	while(isdigit(ch))ans=((ans<<2)+ans<<1)+(ch^48),ch=gc();
	
	return f?ans:-ans;
	
	#undef gc
}

typedef long long ll;

ll ans;
ll need[3];
ll has[3];
ll a[100010];
vector<ll> maxv;
ll val[100010];

int main(int argc, char const *argv[])
{
	ios::sync_with_stdio(false);
	
	cin>>need[0]>>need[1]>>has[0]>>has[1]>>has[2];
	
	need[2]=has[2];
	
	for(int i=0;i<3;i++)
	{
		for(int j=0;j<has[i];j++)cin>>a[j];
		
		sort(a,a+has[i]);reverse(a,a+has[i]);
		
		for(int j=0;j<min(need[i],has[i]);j++)maxv.pb(a[j]);
	}
	
	sort(all(maxv));reverse(all(maxv));
	
	for(int i=0;i<min(need[0]+need[1],(ll)(maxv.size()));i++)ans+=maxv[i];
	
	cout<<ans;
	
	//printf("Time used = %.12f",(double)(clock())/CLOCKS_PER_SEC);
	return 0;
}

/*  GOD BLESS  */


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

void saiki(int num,int sum);

int term[10000],n,ans;

int main(void)
{
   while(scanf("%d",&n))
   {
      ans = -100000000;
      if(n == 0) break;
      for(int i = 0;i < n;i++) scanf("%d",&term[i]);
      for(int i = 0;i < n;i++) saiki(i+1,term[i]);

      printf("%d\n",ans);
   }
   return 0;
}

void saiki(int num,int sum)
{
   if(ans < sum) ans = sum;
   if(num >= n) return;
   saiki(num+1,sum+term[num]);

}

Measured memory_bytes: 1040
#include<stdio.h>
#include<stdlib.h>
int main(){
  long long int A,V,B,W,T;
  scanf("%lld",&A);
  scanf("%lld",&V);
  scanf("%lld",&B);
  scanf("%lld",&W);
  scanf("%lld",&T);
  
  if(abs(A-B) <= (V-W)*T){
  	printf("YES");
  }else{
    printf("NO");
  }
  
  return 0;
}

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

int bubbleSort(int A[], int N) {
        int sw =0;
        bool flag = 1;
        for ( int i = 0; flag; i++ ) {
                flag = 0;
                for( int j = N -1; j >= i +1; j--){
                        if ( A[j] < A[j-1]) {
                                swap(A[j], A[j-1]);
                                flag=1;
                                sw++;
                        }
                }
        }
        return sw;
}

int main(){
        int A[100], N, sw;
        cin >> N;
        for ( int i = 0; i<N; i++ ) cin >> A[i];

        sw = bubbleSort(A,N);

        for ( int i =0; i<N; i++) {
                if (i) cout << " ";
                cout << A[i];
        }
        cout << endl;
        cout << sw << endl;
        return 0;
}


Measured memory_bytes: 3080
#include<bits/stdc++.h>
namespace csx_std {
	using namespace std;
	typedef long long ll;
	#define FOR(i,a,b) for (register int i=(a);i<=(b);i++)
	#define For(i,a,b) for (register int i=(a);i>=(b);i--)
	#define mem(i,j) memset(i,j,sizeof(i))
	#define pii pair<int,int>
	#define MP make_pair
	#define fi first
	#define se second
	#define GO(u) for (register int j=f[u];j!=-1;j=nxt[j])
	const int N=2e5+5;
	const int mod=1e9+7;
	inline int qpow(int x,int y) {int ret=1;for (;y;y>>=1,x=1LL*x*x%mod) if (y&1) ret=1LL*ret*x%mod;return ret;}
	inline int Inv(int x) {return qpow(x,mod-2);}
	inline void upd(int &x,int y) {x=(1LL*x+y)%mod;return;}
	inline int chkmax(int &x,int y) {return (x<y)?(x=y,1):0;}
	inline int chkmin(int &x,int y) {return (x>y)?(x=y,1):0;}
	inline ll read()
	{
		ll x=0,f=1;
		char c=getchar();
		while (c<'0'||c>'9') {if (c=='-') f=-1;c=getchar();}
		while (c>='0'&&c<='9') {x=(x<<1)+(x<<3)+c-'0';c=getchar();}
		return f*x;
	}
	inline void write(ll x)
	{
		if (x<0) x=-x,putchar('-');
		if (x>9) write(x/10);
		putchar(x%10+'0');
		return;
	}
}
using namespace csx_std;
ll n,k,a[N],f[N],L=0,R=1e18,MID;
bool cmp(const ll x,const ll y) {return x>y;}
inline int check(ll most)
{
	ll cost=0;
	FOR(i,1,n) if (a[i]*f[i]>most)
	{
		ll now=a[i]*f[i],dt=0;
		dt+=(a[i]*f[i]-most)/f[i];
		now-=dt*f[i];
		cost+=dt;
		if (now>most) cost++;
	}
	return (cost<=k);
}
int main()
{
	n=read(),k=read();
	FOR(i,1,n) a[i]=read();
	FOR(i,1,n) f[i]=read();
	sort(a+1,a+n+1);
	sort(f+1,f+n+1,cmp);
	while (L<R)
	{
		MID=(L+R)>>1;
		if (check(MID)) R=MID;
		else L=MID+1;
	}
	write(L);
	return 0;
}

Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,a,b) for(int i=(a),_end_=(b);i<=_end_;i++)
#define DREP(i,a,b) for(int i=(a),_end_=(b);i>=_end_;i--)
#define EREP(i,u) for(int i=start[u];i;i=e[i].next)
#define fi first
#define se second
#define mkr(a,b) make_pair(a,b)
#define SZ(A) ((int)A.size())
template<class T>inline void chkmin(T &a,T b){ if(a>b)a=b;}
template<class T>inline void chkmax(T &a,T b){ if(a<b)a=b;}
inline int read()
{
	int s=0,f=1;char ch=getchar();
	while(!isdigit(ch) && ch!='-')ch=getchar();
	if(ch=='-')ch=getchar(),f=-1;
	while(isdigit(ch))s=s*10+ch-'0',ch=getchar();
	return ~f?s:-s;
}

const int maxn=3e5+20;

int n,a[maxn],sum;

inline void init()
{
	n=read();
	REP(i,1,n)a[i]=read(),sum+=a[i];
}

int x[maxn],y[maxn];

inline bool check(int ck)
{
	int mx=0;
	REP(i,1,n>>1)
	{
		if(x[i]+mx>=ck)chkmax(mx,-y[i]);
	}
	if(x[n+1>>1]+mx>=ck)return 1;
	else return 0;
}

inline void doing()
{
	if(~n&1)
	{
		int B=0,W=0;
		REP(i,1,n)if(i&1)B+=a[i];else W+=a[i];
		if(B<W)swap(B,W);
		printf("%d %d\n",B,W);
	}else
	{
		int W=0;
		REP(i,1,n)if(~i&1)W+=a[i];
		REP(i,1,n+1>>1)x[i]=x[i-1]+a[i*2-1]-a[i*2-2],y[i]=y[i-1]+a[i*2-1]-a[i*2];
		int l=0,r=sum;
		while(l<r)
		{
			int mid=l+r+1>>1;
			if(check(mid))l=mid;
			else r=mid-1;
		}
		printf("%d %d\n",W+l,sum-W-l);
	}
}

int main()
{
	init();
	doing();
	return 0;
}


Measured memory_bytes: 2560
import sys
N, M = map(int, input().split())


sc = dict()
for i in range(M):
  s, c = map(int, input().split())
  if s in sc and sc[s] != c:
    print(-1)
    break
  sc[s] = c
else:
  if N == 1:
    i1 = sc.get(1, -1)
    i2 = -1
    i3 = -1
  elif N == 2:
    i1 = sc.get(2, -1)
    i2 = sc.get(1, -1)
    i3 = -1
  elif N == 3:
    i1 = sc.get(3, -1)
    i2 = sc.get(2, -1)
    i3 = sc.get(1, -1)

  for k in range(0, int(10 ** N)):
    k, k1 = divmod(k, 10)
    k, k2 = divmod(k, 10)
    k, k3 = divmod(k, 10)
    if k == 0 and N == 1 and (i1 == -1 or i1 == 0):
      print(0)
      break
    if (
      (N == 1 and k2 == 0 and k3 == 0 and k1) or
      (N == 2 and k3 == 0 and k2) or
      (N == 3 and k3)
    ):
      if (
        (i1 == -1 or k1 == i1) and
        (i2 == -1 or k2 == i2) and
        (i3 == -1 or k3 == i3)
      ):
        print(int(k3 * 100 + k2 * 10 + k1))
        break
  else:
    print(-1)





Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
using namespace std;

int main() {
	const long long int mod = 1000000007;
	map<long long int, long long int>mp;
	long long int a[200005],b[200005],x,y;
	//cout << fixed << setprecision(10);
	long long int n,k, m, two=0,res = 0, cou[200005]={}, mi = 999999999, ma = -9999999999,d[11];
	long long int ten[20]={1,10,100,1000,10000};
	cin >>n>>k;
	for(int i=0;i<k;i++)
	{
		cin>>d[i];
	}
	for(int i=n;i<100000;i++)
	{
		int tmp;
		for(int p=0;p<=4;p++)
			{
				if((i/ten[p])%10>0)
				{
					tmp=p;
				}
			}
			
		for(int j=0;j<k;j++)
		{
			for(int p=0;p<=tmp;p++)
			{
				if((i/ten[p])%10==d[j])
				{
					goto next;
				}
			}
		}
		cout<<i<<endl;
		return 0;
		next:
		res++;
	}
	
}


Measured memory_bytes: 256
using System;
using System.Linq;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            var WHN = Console.ReadLine().Split(' ').Select(e => int.Parse(e)).ToArray();
            var W = WHN[0];
            var H = WHN[1];
            var N = WHN[2];

            var xList = new int[N];
            var yList = new int[N];
            var aList = new int[N];

            var readCount = 0;
            foreach (var line in Enumerable.Range(0, N).Select(i => Console.ReadLine()))
            {
                var xya = line.Split(' ').Select(e => int.Parse(e)).ToArray();

                xList[readCount] = xya[0];
                yList[readCount] = xya[1];
                aList[readCount] = xya[2];

                readCount++;
            }

            var minX = 0;
            var minY = 0;
            var maxX = W;
            var maxY = H;
            for (var i = 0; i < N; i++)
            {
                switch (aList[i])
                {
                    case 1:
                        minX = Math.Max(minX, xList[i]);
                        break;

                    case 2:
                        maxX = Math.Min(maxX, xList[i]);
                        break;

                    case 3:
                        minY = Math.Max(minY, yList[i]);
                        break;

                    case 4:
                        maxY = Math.Min(maxY, yList[i]);
                        break;
                }
            }

            var whiteW = maxX - minX;
            var whiteH = maxY - minY;
            var result = (whiteW < 0 || whiteH < 0)
                ? 0
                : whiteW * whiteH;

            Console.Write(result);
        }
    }
}


Measured memory_bytes: 3160
N, x = map(int,input().split())
a = list(map(int,input().split()))
ans = 0
if a[0] > x:
    ans += a[1]
    a[1] = 0
    ans += (a[0] - x)
    a[0] = x
elif (a[0] + a[1]) > x:
    ans += (a[0] + a[1] - x)
    a[1] = x - a[0]
for i in range(2,N):
    if (a[i - 1] + a[i]) > x:
        ans += (a[i - 1] + a[i] - x)
        a[i] = x - a[i - 1] 
print(ans)

Measured memory_bytes: 14844
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<utility>
#include<cstdio>
#include<cmath>
#include<vector>
#define d double
using namespace std;
vector < pair<int,d> > a[10];
int c[10][2];
bool b[10];
int n,ans;
d sum;
void dfs(int x,int Ans,d Sum)
{
	if(Ans==n)
	{
		sum+=Sum;
		ans++;
		return;
	}
	for(int i=0;i<a[x].size();i++)
	if(!b[a[x][i].first])
	{
		b[a[x][i].first]=1;
		dfs(a[x][i].first,Ans+1,Sum+a[x][i].second);
		b[a[x][i].first]=0;
	}
}
int main()
{
	int x,y;
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>x>>y;
		c[i][0]=x;
		c[i][1]=y;
	}
	for(int i=1;i<=n;i++)
	for(int j=1;j<=n;j++)
	if(i!=j)
	{
		d dis=(d)sqrt((c[i][0]-c[j][0])*(c[i][0]-c[j][0])+(c[i][1]-c[j][1])*(c[i][1]-c[j][1]));
		a[i].push_back(make_pair(j,dis));
		a[j].push_back(make_pair(i,dis));
	}
	for(int i=1;i<=n;i++)
	{
		memset(b,0,sizeof(b));
		b[i]=1;
		dfs(i,1,0);
	}
	printf("%.10lf",(d)sum/ans);
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

/**
 * atcoder2
 */
public class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        String T = sc.nextLine();
        int count = 0;
        for(int i = 0; i < S.length(); i++){
            if(!((S.charAt(i)+"").equals(T.charAt(i)+"")))
            count++;
        }
        System.out.println(count);
    }
    
}

Measured memory_bytes: 56752
#include <iostream>
#include <cstdio>
using namespace std;
static const int  N = 100;
static const int  INFTY = (1<<21);
int M[N][N], color[N];
int n, d[N], p[N];
int ans = 0;

int prim()
{
    for (int i = 0; i < n; i++)
    {
        color[i] = -1;
        d[i] = INFTY;
        p[i] = -1;
    } 
    d[0] = 0;
    int u = -1;
    while (true)
    { 
        int mincost = INFTY;
        u = -1;
        for (int i = 0; i < n; i++)
        {
            if (color[i] != 2 && d[i] < mincost)
            { 
                mincost = d[i];
                u = i;
            }  
        } 

        if (mincost == INFTY) break;
        color[u] = 2;
        for (int i = 0; i < n; i++)
        {
            if (color[i] != 2 && M[u][i] != INFTY)
            { 
                if (M[u][i] < d[i])
                { 
                    d[i] = M[u][i];
                    p[i] = u;
                    color[i] = 1;
                }  
            }  
        } 
    }

    for (int i = 0; i < n; i++)
    {
        if (color[i] == 2 && p[i] != -1) ans += M[i][p[i]];

    } 
    return ans;
}

int main()
{
    cin>>n;
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < n; j++)
        {
            int a;
            cin>>a;
            if(a != -1) M[i][j] = a;
            else M[i][j] = INFTY;
        }  
    } 
    prim();
    cout<<ans<<endl;    
    return 0;
}

Measured memory_bytes: 3116
#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <vector>
#include <math.h>
using namespace std;

typedef long long ll;

/*
const ll M = 1000000007;
vector<ll> fac(3001);
vector<ll> ifac(3001);
ll mpow(ll x, ll n){
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % M;
        x = x*x % M;
        n = n >> 1;
    }
    return ans;
}
 
ll comb(ll a, ll b){
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0 || b < 0)return 0;
    ll tmp = ifac[a-b]* ifac[b] % M;
    return tmp * fac[a] % M;
}
*/


ll lcm(ll a,ll b){
 
  ll r, x, tmp;
  x = a * b;
  if(a<b){
    tmp = a;
    a = b;
    b = tmp;
  }
 
  r = a % b;
  while(r!=0){
    a = b;
    b = r;
    r = a % b;
  }
  return x/b;
}

ll gcd(ll a ,ll b){
    if(a==0){return b;}
    else if(b==0){return a;}
    else{
    ll tmp,r;
    if(a<b){
        tmp = a;
        a = b;
        b = tmp;
    }
    
    r = a % b;
    while(r!=0){
        a = b;
        b = r;
        r = a % b;
    }
    return b;
    }
}

bool sosu(ll p){
    bool ans = true;
    double psqrtd = pow(p, 0.5);
    ll psqrt = psqrtd;
    for(ll i = 2; i <= psqrt; i++){
        if(p%i==0)ans = false;
    }
    if(p==1)ans = false;
    return ans;
}



int main(void){
    ll n,k;
    ll ans = 0;
    cin >> n >> k;
    for(ll i=0;i<n;i++){
        ll x;
        cin >> x;
        if(x>=k)ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
/*
    Author : Ritesh Singh
*/

#include <bits/stdc++.h>
using namespace std;
#define ld long double
#define pb push_back
#define ff first
#define ss second
#define sz(x) (ll)(x).size()
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define el '\n'
#define IOS ios_base::sync_with_stdio(false), cin.tie(NULL)
const int mod = 1e9+7;
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;

int32_t main()
{
   IOS;
   char c; cin>>c;
   if(c>='A' and c<='Z')
   	cout<<'A';
   else
   	cout<<'a';
}

Measured memory_bytes: 3632
A, B, C = map(int, input().split())

if A < B:
    if A <= C and C <= B:
        print('Yes')
    else:
        print('No')
elif B < A:
    if B <= C and C <= A:
        print('Yes')
    else:
        print('No')
else:
    if A == C and B == C:
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long int lli;

int main() {
	int N, M;
	string s[100];
	string t[100];
	cin >> N;
	rep(i, N) cin >> s[i];
	cin >> M;
	rep(i, M) cin >> t[i];

	int max = 0;
	rep(i, N) {
		int pat = 0;
		rep(j, N) {
			if (s[j] == s[i]) pat += 1;
		}
		rep(k, M) {
			if (t[k] == s[i]) pat -= 1;
		}
		if (max<pat) max = pat;
	}
	cout << max;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <utility>
#include <tuple>
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define PI 4*atan(1.0)
typedef long long ll;
typedef long double ld;
using namespace std;
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	set<int> tes;
	tes.insert(a);
	tes.insert(b);
	tes.insert(c);
	cout<<tes.size()<<endl;
	return 0;
}

Measured memory_bytes: 256
n,a,b = map(int, input().split())

ans_list = []
for i in range(1, n+1):
  if i <= 9:
    if a <= i <= b:
      ans_list.append(i)
  elif 10 <= i <= 99:
    i10 = i // 10
    i1 = i % 10
    if a <= i10+i1 <= b:
      ans_list.append(i)
  elif 100 <= i <= 999:
    i100 = i // 100
    i10 = (i % 100) // 10
    i1 = (i % 100) % 10
    if a <= i100+i10+i1 <= b:
      ans_list.append(i)
  elif 1000 <= i <= 9999:
    i1000 = i // 1000
    i100 = (i % 1000) // 100
    i10 = ((i % 1000) % 100) // 10
    i1 = ((i % 1000) % 100) % 10
    if a <= i1000 +i100 +i10 +i1 <= b:
      ans_list.append(i)
  else:
    if a <= 1 <= b:
      ans_list.append(i) 

print(sum(ans_list))

Measured memory_bytes: 9392
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define MOD 1000000007
#define PI 3.141592653589793

int main(){
    int a, b;
    cin >> a >> b;
    cout << max({a+b, a-b, a*b}) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,s,n) for(int i=s ; i < n ; i++)
#define rep(i,n) REP(i,0,n)
using namespace std;
int main(){
  
  int N,A,B,C,X;
  int Y[10000];
  
  while(1){
    
    cin >>N>>A>>B>>C>>X;
    
    if(N==0 && A==0 && B==0 && C==0 && X==0)break;
    
    rep(i,N){
      cin >>Y[i];
    }
    
    int cnt=0;
    bool check=true;
    
    rep(i,10001){
      
      if(Y[cnt]==X){
	cnt++;
      }
      
      if(cnt == N){
	cout <<i<<endl;
	check=false;
	break;
      }
      
      X=(A*X+B)%C;
    }
    
    if(check)cout <<"-1"<<endl;
    
  }
  
  return 0;
}
  

Measured memory_bytes: 1164
#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;
vector<pint>G[1111];

int ma=0;

void dfs(int v,int p,int d){
	bool f=false;
	for(auto &e:G[v]){
		if(e.fi==p)continue;
		dfs(e.fi,v,d+e.se);
		f=true;
	}
	if(f)chmax(ma,d);
}

signed main(){
	while(cin>>N,N){
		rep(i,N)G[i].clear();
		int ans=0;
		vint p(N),d(N);
		for(int i=1;i<N;i++)cin>>p[i],p[i]--;
		for(int i=1;i<N;i++)cin>>d[i],ans+=3*d[i];

		for(int i=1;i<N;i++){
			G[p[i]].pb(pint(i,d[i]));
			G[i].pb(pint(p[i],d[i]));
		}

		ma=0;
		rep(i,N){
			if(G[i].size()>1)dfs(i,-1,0);
			else ans-=G[i][0].se*2;
		}
		ans-=ma;
		
		cout<<ans<<endl;
	}
	return 0;
}


Measured memory_bytes: 3280
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define DUMP(x)  cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for(ll i = m; i < n; i++)
#define IFOR(i, m, n) for(ll i = n - 1; i >= m; i-- )
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ll(x.size())

int main(){
  vector<string> s(3);
  ll N; cin >> N;
  REP(i,3) cin >> s[i];
  ll ans = 0;
  REP(i,N){
    if(s[0][i] == s[1][i] && s[1][i] == s[2][i]) continue;
    if(s[0][i] == s[1][i] || s[1][i] == s[2][i] 
      || s[2][i] == s[0][i]) ans++;
    else ans += 2;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-12;

//int N, M, K, T, H, W, L, R;
long long int N, M, K, T, H, W, L, R;


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

	cin >> T;
	while (T--) {
		cin >> N >> M;
		int ans = 0;
		for (int i = -150; i <= 150; i++) {
			for (int j = -150; j <= 150; j++) {
				if (!i && !j)continue;
				if ((i*N + j * M) % (i*i + j * j) == 0 && (i*M - j * N) % (i*i + j * j) == 0)ans++;
			}
		}
		if (ans == 8)cout << "P" << endl;
		else cout << "C" << endl;
	}
}


Measured memory_bytes: 3044
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <math.h>
#include <string>
#include <math.h>

using namespace std;

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

const ll mod = 1000000007;
const ll INF = 1000000000000;

ll N, K, dp[55][55][3005];

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

	dp[1][0][0] = 1;
	dp[1][1][0] = 1;
	for (ll i = 1; i < N; i++)
	{
		for (ll j = 0; j <= i; j++)
		{
			for (ll k = 0; k <= K; k++)
			{
				{
					(dp[i + 1][j][k + 2 * j] += dp[i][j][k]) %= mod;
				}
				if (j != 0)
				{
					(dp[i + 1][j - 1][k + 2 * j] += (j * j * dp[i][j][k] % mod)) %= mod;
				}

				{
					(dp[i + 1][j + 1][k + 2 * j] += dp[i][j][k]) %= mod;
				}
				
				{
					(dp[i + 1][j][k + 2 * j] += (2 * j * dp[i][j][k] % mod)) %= mod;
				}
			}
		}
	}

	cout << dp[N][0][K] << endl;

	int www;
	cin >> www;
}

Measured memory_bytes: 65792
//Author: AnandRaj doubleux
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll; 

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define test() int t;cin>>t;while(t--)
#define all(v) v.begin(),v.end()
#define prinp(p) cout<<p.first<<" "<<p.second<<endl
#define prinv(V) for(auto v:V) cout<<v<<" ";cout<<endl
#define take(V,f,n) for(int in=f;in<f+n;in++) cin>>V[in]
#define what(x) cerr<<#x<<" = "<<x<<endl
#define KStest() int t,t1;cin>>t;t1=t;while(t--)
#define KScout cout<<"Case #"<<t1-t<<": "
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int MOD = 1e9+7,MAX = 1e6+5;
const ll INF = 1e18+5;

int main()
{
	int n;
	ll d;
	cin>>n>>d;
	int ans=0;
	for(int i=0;i<n;i++)
	{
		ll x,y;
		cin>>x>>y;
		if(x*x+y*y<=d*d) ans++;
	}
	cout<<ans<<endl;
}	

Measured memory_bytes: 3636
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

def shortest_path(pt,s,t):
    n = len(pt)
    used = [False]*n
    pre = [-1]*n
    q = [s]
    while q:
        q1 = []
        for i in q:
            for j in pt[i]:
                if not used[j]:
                    used[j] = True
                    pre[j] = i
                    q1.append(j)
        q = q1

    if used[t]:
        path = [t]
        p = t
        while True:
            p = pre[p]
            path.append(p)
            if p == s:
                break
        return list(reversed(path))
    else:
        return []

def edges_to_pt(s,t,n,directed=False):
    pt = [[] for _ in range(n)]
    for i in range(len(s)):
        pt[s[i]-1].append(t[i]-1)
        if directed==False:
            pt[t[i]-1].append(s[i]-1)
    return pt

N,M = II()
A,B = Line(M,2)

use_path = []
pt = edges_to_pt(A,B,N,True)
l = N+1
for i in range(N):
    s = shortest_path(pt,i,i)
    if s:
        s.pop()
        if len(s)<l:
            use_path = s
            l = len(s)

if use_path:
    print(len(use_path))
    for v in use_path:
        print(v+1)
else:
    print(-1)

Measured memory_bytes: 46172
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
INF = 10**18

N,M=rl()

if M%N==0:
    print(M//N)
else:
    x = M//N
    ans = 1
    l=[]
    for i in range(1,int(M**0.5)+1):
        if M%i==0:
            l.append(i)
            l.append(M//i)
    l.sort()

    import bisect
    l_i = bisect.bisect_right(l,x)-1
    print(l[l_i])

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

#define rep(i,N) for(int i=0;i<N;i++)
#define rep2(i,N) for(int i=1;i<=N;i++)
using namespace std;
long long  INF=1e18;
long long mod=1e9+7;


int main(){

    double ans=0;

    int n;
    cin>>n;
    long long stair[n];
    stair[0]=1;
    rep2(i,n)stair[i]=stair[i-1]*i;
    double x[n],y[n];
    rep(i,n){
        cin>>x[i]>>y[i];
    }
    for(int i=0;i<n-1;i++){
        for(int k=i+1;k<n;k++){
            ans+=sqrt((x[i]-x[k])*(x[i]-x[k])+(y[i]-y[k])*(y[i]-y[k]));
        }
    }
    printf("%.6lf",2*ans/n);
    //cout<<2*ans/n<<endl;


    return 0;

}
/*


*/


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int d;
	scanf("%d", &d);
	if (d==25)
	{
		printf("Christmas\n");
	}
	else if (d==24)
	{
		printf("Christmas Eve\n");
	}
	else if (d==23)
	{
		printf("Christmas Eve Eve\n");
	}
	else if (d==22)
	{
		printf("Christmas Eve Eve Eve\n");
	}
	return 0;
}

Measured memory_bytes: 128