akhauriyash/Code-Regression huggingface dataset:
#include"bits/stdc++.h"


#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fr(x) freopen(x,"r",stdin)
#define fw(x) freopen(x,"w",stdout)
#define iout(x) printf("%d\n",x)
#define lout(x) printf("%lld\n",x)
#define REP(x,l,u) for(int x = (l);x<=(u);x++)
#define RREP(x,l,u) for(int x = (l);x>=(u);x--)
#define mst(x,a) memset(x,a,sizeof(x))
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair
#define se second
#define fi first
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
#define sz(x) ((int)x.size())
#define cl(x) x.clear()

typedef  long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
using namespace std;

const int maxn = 200010;
const int mod = 1e9+7;
const int MAX = 1000000010;
const double eps = 1e-6;
const double PI = acos(-1);

template<typename T> inline void read(T &x){
x=0;T f=1;char ch;do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');do x=x*10+ch-'0',ch=getchar();while(ch<='9'&&ch>='0');x*=f;
}

template<typename A,typename B> inline void read(A&x,B&y){read(x);read(y);}
template<typename A,typename B,typename C> inline void read(A&x,B&y,C&z){read(x);read(y);read(z);}
template<typename A,typename B,typename C,typename D> inline void read(A&x,B&y,C&z,D&w){read(x);read(y);read(z);read(w);}
template<typename A,typename B> inline A fexp(A x,B p){A ans=1;for(;p;p>>=1,x=1LL*x*x%mod)if(p&1)ans=1LL*ans*x%mod;return ans;}
template<typename A,typename B> inline A fexp(A x,B p,A mo){A ans=1;for(;p;p>>=1,x=1LL*x*x%mo)if(p&1)ans=1LL*ans*x%mo;return ans;}

int n,V,cnt;

int x[maxn];

int v[20];

int l[20][maxn],r[20][maxn];

int mn[1<<20],mx[1<<20];

int f[maxn];

void Work(){
	REP(j,1,cnt){
		l[j][0]=1;r[j][n+1]=n;
		l[j][1]=1;REP(i,2,n)l[j][i]=x[i]-x[i-1]<=v[j]?l[j][i-1]:i;
		r[j][n]=n;RREP(i,n-1,1)r[j][i]=x[i+1]-x[i]<=v[j]?r[j][i+1]:i;
	}
	REP(sta,0,(1<<cnt)-1)mn[sta]=n+1;
	REP(sta,1,(1<<cnt)-1)
		REP(i,0,cnt-1)if((sta>>i)&1){
			mx[sta]=max(mx[sta],r[i+1][mx[sta^(1<<i)]+1]);
			mn[sta]=min(mn[sta],l[i+1][mn[sta^(1<<i)]-1]);
		}
	REP(i,0,n+1)f[i]=n+2;
//	REP(sta,0,(1<<cnt)-1)cout<<sta<<' '<<mx[sta]<<' '<<mn[((1<<cnt)-2)^sta]<<endl;
	REP(sta,0,(1<<cnt)-1)if(!(sta&1))f[mx[sta]]=min(f[mx[sta]],mn[((1<<cnt)-2)^sta]);
//	REP(i,0,n)cout<<f[i]<<' ';cout<<endl;
	RREP(i,n,0)f[i]=min(f[i],f[i+1]);
	REP(i,1,n){
		if(f[l[1][i]-1]<=r[1][i]+1)puts("Possible");else puts("Impossible");
	}
}

void Init(){
	read(n,V);
	REP(i,1,n)read(x[i]);
	for(;;){
		v[++cnt]=V;
		if(!V)break;
		V>>=1;
	}
}

int main(){
	Init();
	Work();
	return 0;
}


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

int main() {
  string s;
  cin>>s;
  int count=0;
  for(int i=0;i<4;i++){
    if(s[i]=='+'){
      count++;
    }
    if(s[i]=='-'){
      count--;
    }
  }
  cout<<count<<endl;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val n = readInputLine().toInt()
    val aList = mutableListOf<Int>()
    
    var max = 0
    var maxNumCount = 0
    var secondNum = 0
    
    for (i in 1..n) {
        val a = readInputLine().toInt()
        
        if (a > max) {
            secondNum = max
            max = a
            maxNumCount = 0
        } else if (a > secondNum) {
            secondNum = a
        }
        if (a == max) {
            maxNumCount++
        }
        
        aList.add(a)
    }
    
    for (a in aList) {
        if (maxNumCount >= 2) {
            println(max)
        } else if (a == max) {
            println(secondNum)
        } else {
            println(max)
        }
    }
}

fun readInputLine(): String {
    return readLine()!!
}


Measured memory_bytes: 53572
#include <iostream>
#include <string>

using namespace std;
int main (){
    int n;
    string s;
    cin >> n >> s;
    int alp = (int)('z'-'a');
    int apperl['z'-'a'+1]={};
    int apperr['z'-'a'+1]={};
    int max =0;
    int count =0;
    for (int i = 0; i < s.size(); i++){
        for (int j = 0; j < i; j++){
            if(apperl[s[j]-'a']==0) apperl[s[j]-'a']++;
        }
        for (int k = i; k < s.size(); k++){
            if(apperr[s[k]-'a']==0) apperr[s[k]-'a']++;
        }
        for (int l = 0; l < 'z'-'a'+1; l++){
            if(apperr[l]==1&&apperl[l]==1) count++;
            apperl[l]=0;
            apperr[l]=0;
        }
        if(count>max) max = count;
        count = 0;
    }
    cout << max << "\n";

}

Measured memory_bytes: 256
//------------------------------------------------------------------------------MANAS UNIYAL---------------------------------------------------------
//																				NEVER GIVE UP
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);	cin.tie(NULL);	cout.tie(NULL);
#define ll long long
#define pb push_back
#define fi first
#define se second
#define pii pair<ll,ll>
#define INF 0x3f3f3f3f
#define mod 1000000007
 //----------------------------------------------------------------------------------------------------------------------------------------------------

int main()
{
	fast;
	ll n;
	cin>>n;
	vector<pii> v(n);
	for(int i=0;i<n;i++)
	{
		cin>>v[i].se;
		cin>>v[i].fi;
	}
	sort(v.begin(),v.end());
	ll sum=0;
	bool flag=true;
	for(int i=0;i<n;i++)
	{
		sum+=v[i].se;
		if(sum>v[i].fi)
		{
			flag=false;
			break;
		}
	}
	if(flag)
		cout<<"Yes";
	else
		cout<<"No";
	return 0;
}

Measured memory_bytes: 3328
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size1,init=nil,size2=1) #size2に二次元配列時の最初の要素数、size1に次の配列の大きさ、initに初期値を投げることでその配列を返す
  if size2==1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

INF=Float::INFINITY
class PriorityQueue
    attr_accessor:heap,:n
    def initialize(n)
        @n=0
        @heap=array(n,INF)
    end

    def push(x)
        i=@n
        @n+=1
        while i>0
            p=(i-1)/2
            break if @heap[p]<=x
            @heap[i]=@heap[p]
            i=p
        end
        @heap[i]=x
    end

    def pop()
        ret=@heap[0]
        @n-=1
        i=0
        x=@heap[@n]
        while i*2+1<@n
            l=i*2+1
            r=i*2+2
            l=r if r<@n and @heap[l]>@heap[r]
            break if @heap[l]>=x
            @heap[i]=@heap[l]
            i=l
        end
        @heap[i]=x
        return ret
    end
end
N,M=get_i
A=get_i
pq=PriorityQueue.new(N)
A.each do|a|
  pq.push(-1*a)
end
m=M
ans=0
until pq.n.zero?
  val=pq.pop
  if m>0
    pq.push((val/2.0).ceil)
    m-=1
  else
    ans-=val
  end
end
puts ans

Measured memory_bytes: 10908
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
  int a[5];
  for (int i = 0; i < 5; i++) {
    cin >> a[i];
  }
  int k;
  cin >> k;
  for (int i = 0; i < 5; i++) {
    for (int j = i + 1; j < 5; j++) {
      if (a[j] - a[i] > k) {
        cout << ":(" << endl;
        return 0;
      }
    }
  }
  cout << "Yay!" << endl;
  return 0;
}


Measured memory_bytes: 256
N = gets.chomp.to_i
txy_array = [[0,0,0]]
N.times do |n|
  txy_array.push(gets.chomp.split(' ').map(&:to_i))
end

ans = true
(0..(N-1)).each do |ind|
  t = txy_array[ind+1][0] - txy_array[ind][0]
  x = txy_array[ind+1][1] - txy_array[ind][1]
  y = txy_array[ind+1][2] - txy_array[ind][2]
  if x + y > t || (t-x-y)%2 != 0
    ans = false
    break
  end
end

print ans ? 'Yes' : 'No'

Measured memory_bytes: 9504
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
using ll = long long;
using P = pair<ll,ll>;
int main(){
ios::sync_with_stdio(false);
std::cin.tie(nullptr);
ll n;
cin >> n;
vector<ll> contl(n),contr(n);
for(ll i = 0; i < n; i++){
    cin >> contl[i] >> contr[i];
}
sort(contl.begin(),contl.end());
sort(contr.begin(),contr.end());
if(n % 2 == 0){
    cout << contr[n / 2] + contr[n/2 - 1] - contl[n / 2] - contl[n / 2 - 1] + 1;
} else{
    cout << contr[n / 2] - contl[n / 2] + 1 << endl;
}
}


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

#define FOR(i,a,b) for(int i = (a);i < (b);++i)
typedef long long ll;

int main(){
    int n;cin >> n;
    vector<int> l(n);
    for(int i = 0;i < n;i++) cin >> l[i];
    sort(l.begin(),l.end());
    int sum = 0;
    for(int i = 0;i < n-1;i++) sum += l[i];
    if(sum > l[n-1]) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0; 
 } 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef map<int,int> mii;
typedef map<ll,ll> mll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll>   vl;
#define f(i,n)  for(i=0;i<n;i++)
#define f1(i,n)  for(i=1;i<n;i++)
#define fr(i,n) for(i=n-1;i>=0;i--)
#define em emplace_back
#define mp make_pair
#define in insert
#define fi first
#define sc second
#define b begin
#define e end
#define er erase
#define l length
#define c clear
#define si size
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);
const double pi=3.141592653;
const ll infi=1000000001;
const ll MOD=1000000007;
const ll mod=998244353;
const string no="NO\n",yes="YES\n";

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

// void dfs(vl v[],ll node,ll hai[]){
//     hai[node]=1;
//     for(auto i:v[node]){
//         if(hai[i]==0){
//             dfs(v,i,hai);
//         }
//     }
// }

// ll con(vl v[],ll hai[],ll sz){
//     ll count=0;
//     for(int i=1;i<sz;i++){
//         if(hai[i]==0){
//             count++;
//             dfs(v,i,hai);
//         }
//     }
    // return count;
// }

// void gcde(int a,int b,int *x,int *y){
//     if(a==0){
//         *x=0;
//         *y=1;
//         return;
//     }    
//     int x1,y1;
//     gcde(b%a,a,&x1,&y1);
    
//     *x=y1-(b/a)*x1;
//     *y=x1;
// }


// ll recur(vl v,ll in,ll m,ll n){
//     if(in==-1)  return 1000000000001;
//     ll d,e,c;
//     d=max(m/v[in],n*v[in]);
//     c=recur(v,in-1,m/v[in],n*v[in]);
//     e=recur(v,in-1,m,n);
//     return min(c,min(e,d));
// }

// ll bexpo(ll a,ll p){
//     ll x=1;
//     while(p){
//     if(p&1){
//         x=(x*a)%mod;
//     }
//     a=(a*a)%mod;
//     p>>=1;
//     }
//     return x;
// }
// int dx[8]{-1,0,0,1,-1,-1,1,1};
// int dy[8]{0,-1,1,0,-1,1,-1,1};


int main() {
    fastio
    int t=1;
    // cin>>t;
    ll n,m,i,l,d,bank,s,k,j,x,y,ans,q;

    while(t--){ans=0;
        string s;
        cin>>s;
        n=s.l();
        if(s[n-1]=='s'){
            s+="es";
        }else
        {
            s+='s';
        }
        cout<<s;
        
    }
    
    
	return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#include <stdarg.h>
#include <assert.h>
#include <ctype.h>
#include <boost/iostreams/filtering_stream.hpp>
#include <boost/iostreams/filter/gzip.hpp>
#include <boost/iostreams/device/file_descriptor.hpp>

using namespace std;
typedef long long int lli;
typedef vector<int> iv;
typedef vector<bool> bv;
typedef vector<string> sv;
typedef vector<long long int> llv;
typedef vector<double> dv;

#define sor_(vec) sort(vec.begin(),vec.end())
#define rev_(vec) reverse(vec.begin(),vec.end())
#define rep(i,n) for(int i=0;i<static_cast<int>(n);i++)
#define reps(i,n,s) for(int i=static_cast<int>(s);i<static_cast<int>(n);i++)
#define isposi(num) if(num>0)
const long long mod = 1000000007;

template<typename TypeInt>
std::string Itoa(const TypeInt v, int base)
{
    static const char table[] = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
    string ret;
    static numeric_limits<TypeInt> t;
    TypeInt n = v;
    if (t.is_signed) {
        if (v < 0) n *= -1;
    }

    while (n >= base) {
        ret += table[n%base];
        n /= base;
    }
    ret += table[n];
    if (t.is_signed) {
        if (v < 0 && base == 10) ret += '-';
    }
    std::reverse(ret.begin(), ret.end());

    return ret;
}

int upf(double num){
    if(num-(int)num>0)return (int)num+1;
    else return num;
}

void printm(char const *format,...){
    va_list arguments;
    va_start(arguments,format);
    unsigned index=0;
    while (format[index]!='\0') {
        if(format[index]=='%'){
            index++;
            if(format[index]=='d')printf("%d",va_arg(arguments, int));
            else if(format[index]=='c')printf("%c",va_arg(arguments, int));
            else if(format[index]=='x')printf("%x",va_arg(arguments,int));
            else if(format[index]=='o')printf("%o",va_arg(arguments,int));
            else if(format[index]=='f')printf("%f",va_arg(arguments, double));
            else if(format[index]=='s')printf("%s",va_arg(arguments, char const *));
            else if(format[index]=='p')printf("%p",va_arg(arguments,void*));
            else if(format[index]=='y')printf("Yes");
            else if(format[index]=='n')printf("No");
            else if(format[index]=='%')printf("%%");
            else assert(!"Unknown format with %.");
        }
        else printf("%c",format[index]);
        index++;
    }
    va_end(arguments);
    return;
}

struct Chara{
    int hp;
    int sp;
};

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int buf,start=0,end=0;
    cin>>buf;
    start+=60*buf;
    cin>>buf;
    start+=buf;
    cin>>buf;
    end+=60*buf;
    cin>>buf;
    end+=buf;
    cin>>buf;
    cout<<end-start-buf;
    return 0;
}


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

int main(){
    int a,b, k;
    cin >> a >> b >> k;

    if(b-a+1 <k*2){
        for(int i=a;i<b+1;i++){
            cout << i << endl;
        }
    }else{
        for(int i = 0; i < k; i++){
            cout << a+i << endl;
        }
        for(int i = k; i > 0; i--){
            cout << b-i+1 << endl;
        }
    }
}

Measured memory_bytes: 256
# 27
N, A, B = map(int, input().split(' '))
 
ans = 0
if (A + B) != 0:
    taple = divmod(N, A + B)
    ans = taple[0] * A
    if B == 0: ans = N
    elif taple[1] > A: ans += A
    else: ans += taple[1]
 
print(ans)

Measured memory_bytes: 9084
#include<iostream>

void swap(int&, int&);
int gcd(int, int);

int main()
{
	int a, b, g, l, a_cpy;
	while (std::cin >> a >> b)
	{
		g = gcd(a, b);
		l = a / g * b;
		std::cout << g << " " << l << std::endl;
	}

	return 0;
}

void swap(int& a, int& b)
{
	int tmp = a;
	a = b;
	b = tmp;

	return;
}

int gcd(int a, int b)
{
	if (a > b)
		swap(a, b);
	while (a > 0)
	{
		b %= a;
		swap(a, b);
	}
	return b;
}


Measured memory_bytes: 2972
import Data.Char
import Control.Monad
import Text.Printf

countAlphabet :: String -> [(Char, Int)]
countAlphabet s = zip ['a' .. 'z'] $ map (countChar (toLowerAll s)) ['a' .. 'z']
    where
        countChar :: String -> Char -> Int
        countChar s c = length [x | x <- s, x == c]
        toLowerAll :: String -> String
        toLowerAll s = map toLower s

main :: IO ()
main = do
    givenstr <- getContents
    mapM_ (\(c, i) -> printf "%c : %d\n" c i ) (countAlphabet givenstr)

Measured memory_bytes: 4060
s = input()
def f(t):
  n = len(t)
  ok = True
  for i in range(n // 2):
    if t[i] != t[n - 1 - i]:
      ok = False
      break
  return ok
N = len(s)
if f(s) and f(s[:(N - 1) // 2]) and f(s[(N + 3) // 2 - 1:]):
  print('Yes')
else:
  print('No')

Measured memory_bytes: 9076
#include <stdio.h>
#include <iostream>
#include <algorithm>

using namespace std;

#define REP(a, i, n) for (int i = a; i < n; ++i)

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

    long h[N];
    REP(0, i, N) {
        cin >> h[i];
    }

    sort(h, h + N);

    // REP(0, i, N - K + 1) {
    //     cout << h[i] << " " << h[i + K - 1] << endl;
    // }

    long ans = 1000000000;
    REP(0, i, N - K + 1) {
        ans = min(ans, h[i + K - 1] - h[i]);
    }

    cout << ans << endl;

    return 0;
}


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

v = list(map(int,input().split()))
v.sort()
v.reverse()
print(sum(v[:a])/a)


def combination(n,r):
    a = 1
    b = 1
    for i in range(1, r+1):
        a *=n-i+1
        b *=i
    return a//b


c = v.count(v[a-1])
d = v[:a].count(v[a-1])
ans = 0
if v[0] != v[a-1]:
    print(combination(c,d))
else:
    for i in range(d,min(c,b-a+d)+1):
        ans += combination(c,i)
    print(ans)

Measured memory_bytes: 3064
import java.util.*;

public class Main{
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int result = 0;
    for(int i = n;i > 0;i--){
      result += i;
    }
    
    System.out.println(result);
  }
}

Measured memory_bytes: 21844
import java.util.*;

class Process {
    String name;
    int time;
    int completedTime;

    public Process(String name, int time) {
        this.name = name;
        this.time = time;
    }

    void execute(int q) {
        this.time = this.time - q;
    }

    void setCompletedTime(int completedTime) {
        this.completedTime = completedTime;
    }

    @Override
    public String toString() {
        return this.name + " " + this.completedTime;
    }
}

class ProcessQueue {

    int head, tail, MAX;
    Process[] arr;

    public ProcessQueue(int max) {
        this.MAX = max;
        arr = new Process[MAX];
    }

    void initialize() {
        head = 0;
        tail = 0;
    }

    boolean isEmpty() {
        return head ==tail;
    }

    boolean isFull() {
        return head == (tail + 1) % MAX;
    }

    void enqueue(Process x) {
        if (isFull()) {
            throw new RuntimeException("オーバーフロー");
        }
        arr[tail] = x;
        if (tail + 1 == MAX) {
            tail = 0;
        } else {
            tail++;
        }
    }

    Process dequeue() {
        if (isEmpty()) {
            throw new RuntimeException("アンダーフロー");
        }
        Process x = arr[head];
        if (head + 1 == MAX) {
            head = 0;
        } else {
            head++;
        }
        return x;
    }
}

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

        ProcessQueue queue = new ProcessQueue(100000);
        ProcessQueue completed = new ProcessQueue(100000);
        queue.initialize();
        completed.initialize();

        for (int i = 0; i < n; i++) {
            queue.enqueue(new Process(sc.next(), sc.nextInt()));
        }

        int consumedTime = 0;

        while (!queue.isEmpty()) {
            Process p = queue.dequeue();

            if (p.time <= q) {
                consumedTime += p.time;
                p.setCompletedTime(consumedTime);
                completed.enqueue(p);
            } else {
                consumedTime += q;
                p.execute(q);
                queue.enqueue(p);
            }
        }

        for (int i = 0; i < n; i++) {
            System.out.println(completed.dequeue());
        }
    }
}



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

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





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


int n, k;
ll ans=1;

vector<int> g[maxn];

void dfs(int at, int p=0) {
    ll ch = g[at].size();
    if (ch>k) {
	//assert(0);
	ans=0;
    }
    ll cur=k-1-(p!=0);
    
    for (int to: g[at]) {
	if (to==p) continue;
	ans *= (cur--);
	ans %= mod;
    }
    
    for (int to: g[at]) {
	if (to == p) continue;
	dfs(to,at);
    }
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
    cin>>n>>k;
    for (int i=0; i<n-1; i++) {
	int u,v; cin>>u>>v;
	g[u].push_back(v);
	g[v].push_back(u);
    }


    ans = k;//root
    dfs(1);

    out(ans);
    return 0;
}


Measured memory_bytes: 30336
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,a,b,ans=0;
    cin>>n>>a>>b;
    for(int i=1;i<=n;i++){
        int atai=i,wa=0,m;
        while(atai){
            m=atai%10;
            wa+=m;
            atai/=10;
        }
        if(a<=wa&&wa<=b)ans+=i;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = (1<<18);



set<int> valeurs;
map<int , int> corr;
int val[MAXN];

vector <int> adj[MAXN];

int sol[MAXN];
bool fini[MAXN];
struct pr_Q
{
	int val , noeud;
	bool operator < (const pr_Q & autre) const
	{
		return val < autre.val;
	}
};

priority_queue<pr_Q> enCours[MAXN];
int arbre[MAXN * 2];

int maxi(int debut , int fin)
{
	debut += MAXN;
	fin += MAXN;
	int m = 0;
	while (debut <= fin)
	{
		if (debut % 2 == 1)
		{
			m = max(m , arbre[debut]);
			debut++;
		}
		if (fin % 2 == 0)
		{
			m = max(m , arbre[fin]);
			fin--;
		}
		debut/=2;
		fin/=2;
	}
	return m;
}

void mettre(int noeud , int val)
{
	noeud += MAXN;
	arbre[noeud] = val;
	noeud/=2;
	while (noeud > 0)
	{
		arbre[noeud] = max(arbre[noeud * 2] , arbre[noeud * 2  + 1]);
		noeud/=2;
	}
}


void parcours(int noeud , int pere , int maxC )
{
	//ajouter noeud
	int finE = maxi(0 , val[noeud] - 1) + 1;
	enCours[val[noeud]].push({finE, noeud});
	mettre(val[noeud] , enCours[val[noeud]].top().val );
	sol[noeud] = max(finE , maxC);
	for (auto voisin : adj[noeud])
	{
		if (voisin != pere)
		{
			parcours(voisin , noeud  , sol[noeud]);
		}
	}
	fini[noeud] = true;
	while (!enCours[val[noeud]].empty() && fini[enCours[val[noeud]].top().noeud]) enCours[val[noeud]].pop();
	if (enCours[val[noeud]].empty())
	{
		mettre(val[noeud] , 0);
	}
	else
	{
		mettre(val[noeud] , enCours[val[noeud]].top().val );
	}
}
int32_t main()
{
	int N;
	cin >> N;
	for (int i = 0 ; i < N ; i++)
	{
		cin >> val[i];
		valeurs.insert(val[i]);
	}
	int in = 0;
	valeurs.insert(0);
	auto it = valeurs.begin();
	while (it != valeurs.end())
	{
		int ac = *it;
		corr[ac] = in;
		in++;
		it++;
	}
	for (int i = 0 ; i < N ; i++)
	{
		val[i] = corr[val[i]];
	}

	for (int i = 0 ; i < N - 1 ; i++)
	{
		int a,b;
		cin >> a >> b;
		a--;b --;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	parcours(0 , 0 , 0);
	for (int i = 0 ; i < N ; i++)
	{
		cout<<sol[i]<<endl;
	}
}

Measured memory_bytes: 72120
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
const ll INF = 1ll<<30;
const ll longINF = 1ll<<60;
const ll MOD = 1000000007;
const bool debug = 0;
//---------------------------------//

int N;
ll A[112345];

int main() {
	cin >> N;
	REP(i, N) scanf("%lld", A + i);
	
	ll xx = 0;
	REP(i, N) xx ^= A[i];
	
	REP(i, 61) if (xx >> i & 1) REP(j, N) if (A[j] >> i & 1) A[j] ^= 1ll << i;
	
	ll ans = xx, cur = 0;
	for (int i = 60; i >= 0; i--) {
		sort(A, A + N, greater<ll>());
		
		if ((cur >> i & 1 ^ 1) && (A[0] >> i & 1)) cur ^= A[0];
		FOR(j, 1, N) if (A[j] >> i & 1) A[j] ^= A[0];
		if (A[0] >> i & 1) A[0] = 0;
	}
	
	ans += cur * 2;
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 1024
r, c = map(int, input().split())

matrix = [list(map(int, input().split())) for _ in range(r)]

for i in range(r):
    matrix[i].append(sum(matrix[i]))

matrix.append([sum(i) for i in zip(*matrix)])

for m in matrix:
    print(' '.join(str(e) for e in m))

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

using namespace std;

using ll = long long;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    ll K;
    cin >> n >> K;
    vector<ll> a(n), f(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) cin >> f[i];
    sort(a.begin(), a.end());
    sort(f.rbegin(), f.rend());

    ll ok = 1e12, ng = -1;
    while (ok - ng > 1) {
        ll mid = (ok + ng) / 2;
        ll cnt = 0;
        for (int i = 0; i < n; i++) {
            cnt += max(a[i] - min(a[i], mid / f[i]), 0LL);
        }
        (cnt <= K ? ok : ng) = mid;
    }
    cout << ok << "\n";
    return 0;
}

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

int n;
char s[5010];
int sn;

ll dp[5010][5010];
const ll mod = int(1e9) + 7;

ll Pow(ll b, ll e){
	ll ret = 1;
	while(e){
		if(e&1) (ret*=b)%=mod;
		(b*=b)%=mod; e>>=1;
	}
	return ret;
}

int main()
{
	int n; scanf("%d%s", &n, s); sn=strlen(s);
	dp[0][0] = 1;
	for(int i=0; i<n; ++i){
		for(int j=0; j<=i; ++j){
			(dp[i+1][max(0, j-1)] += dp[i][j]) %= mod;
			(dp[i+1][j+1] += 2*dp[i][j]) %= mod;
		}
	}
	ll inv2 = Pow(2, mod-2);
	cout << dp[n][sn] * Pow(inv2, sn) % mod << endl;
	return 0;
}


Measured memory_bytes: 194176
N = int(input())
e=[0]*(N+1)
for i in range(2, N+1):
  cur = i
  for j in range(2, i+1):
    while cur % j == 0:
      e[j] += 1
      cur //= j
def num(m): # e の要素のうち m-1 以上のものの個数
  return len(list(filter(lambda x: x >= m-1, e)))
print(num(75) + num(25) * (num(3) - 1) + num(15) * (num(5) - 1)
    + num(5) * (num(5) - 1) * (num(3) - 2) // 2)



Measured memory_bytes: 3060
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main() {
  	int n, i, ok = 1;
  	char palavra[105];
  	scanf("%d\n%s\n", &n, palavra);
  	if(n % 2 == 1){
    	printf("No\n");
    }else{
      n = n >> 1;
      for(i = 0; i < n; i++){
      	if(palavra[i] != palavra[i + n])
          ok = 0;
      }
      if(ok){
      	printf("Yes\n");
      }else{
        printf("No\n");
      }
    }
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define pb push_back
#define x first
#define y second
using namespace std;
typedef long long ll;
const int N = 200005;
int n;
ll le, ri, md;
vector < pair < ll , ll > > Adj[N], dp[N];
void DFS(int v)
{
    dp[v].clear();
    if (!Adj[v].size())
    {
        dp[v].pb({0, 0});
        return ;
    }
    int l = Adj[v][0].x, wl = Adj[v][0].y;
    int r = Adj[v][1].x, wr = Adj[v][1].y;
    DFS(l); DFS(r);
    vector < pair < ll , ll > > vec;
    for (int _ = 0; _ <= 1; _ ++, swap(l, r), swap(wl, wr))
        for (auto xl : dp[l])
        {
            int lb = lower_bound(dp[r].begin(), dp[r].end(), pair < ll , ll > {md - xl.y - wl - wr + 1, -1}) - dp[r].begin() - 1;
            if (lb >= 0) vec.pb({xl.x + wl, dp[r][lb].y + wr});
        }
    sort(vec.begin(), vec.end());
    for (auto X : vec)
        if (!dp[v].size() || dp[v].back().y > X.y)
            dp[v].pb(X);
}
int main()
{
    scanf("%d", &n);
    for (int i = 2, p, w; i <= n; i++)
        scanf("%d%d", &p, &w), Adj[p].pb({i, w});
    le = -1; ri = 28289984284892LL;
    while (ri - le > 1)
    {
        md = (le + ri) >> 1; DFS(1);
        if (dp[1].size()) ri = md;
        else le = md;
    }
    return !printf("%lld\n", ri);
}

Measured memory_bytes: 36556
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main
{
    private static class Item
            implements Comparable {
        int prefecture;
        int year;
        int order;

        Item(int prefecture, int year)
        {
            this.prefecture = prefecture;
            this.year = year;
        }

        @Override
        public int compareTo(Object o)
        {
            return year - ((Item)o).year;
        }
    }

    public static void main(String[] args)
    {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        Map<Integer, List<Item>> map = new HashMap<>(n);
        List<Item> list = new ArrayList<>(m);

        for (int i = 0; i < m; i++) {
            int p = scanner.nextInt();
            int y = scanner.nextInt();
            if (!map.containsKey(p)) {
                map.put(p, new ArrayList<>());
            }
            List<Item> itemList = map.get(p);
            Item item = new Item(p, y);
            itemList.add(item);
            list.add(item);
        }

        for (List<Item> xs : map.values()) {
            Collections.sort(xs);
            for (int i = 0; i < xs.size(); i++) {
                xs.get(i).order = i;
            }
        }

        for (Item yp : list) {
            System.out.println(String.format("%06d%06d", yp.prefecture, yp.order + 1));
        }
    }
}


Measured memory_bytes: 155776
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N, M;
  cin >> N >> M;
  char A[N][N];
  char B[M][M];
  for(int i=0; i<N; i++){
    for(int j=0; j<N; j++){
      cin >> A[i][j];
    }
  }
  for(int i=0; i<M; i++){
    for(int j=0; j<M; j++){
      cin >> B[i][j];
    }
  }
  int cnt;
  for(int i=0; i<N-M+1; i++){
    for(int j=0; j<N-M+1; j++){
      cnt = 0;
      for(int k=0; k<M; k++){
        for(int l=0; l<M; l++){
          if(B[k][l] == A[i+k][j+l]){
            cnt++;
            if(cnt == M*M){
              cout << "Yes" <<endl;
              return 0;
            }
          }
        }
      }
    }
  }
  cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>

using namespace std;

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

	vector<int> x(n, 0);
	for (int i = 0; i < n; i++) {
		cin >> x[i];
	}

	auto sorted = x;
	sort(sorted.begin(), sorted.end());

	int med1 = sorted[n/2 - 1];
	int med2 = sorted[n/2];

	int ans = 0;
	for (auto xx: x) {

		if (med1 == med2) {
			ans = med1;
		} else if (xx <= med1) {
			ans = med2;
		} else {
			ans = med1;
		}

		cout << ans << endl;
	}

	return 0;
}


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

using namespace std;


int main(){
    long long N,A,B,C,D,E;
    cin >> N >> A >> B >> C >> D>> E;
    long long mi = min({A,B,C,D,E});
    if(N%mi != 0)N += mi;
    N /= mi;
    cout<<5+(N-1)<<endl;
}


Measured memory_bytes: 256
/**
 * @brief  : c++ code for AtCoder
 * @author : rk222
 * @created: 2019.05.11 20:50:50
 */

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<int, P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i, x) for (ll i = 0; i < x; i++)
#define rep1(i, x) for (ll i = 1; i <= x; i++)
#define rrep(i, x) for (ll i = x - 1; i >= 0; i--)
#define rrep1(i, x) for (ll i = x; i > 0; i--)
#define sor(v) sort(v.begin(), v.end())
#define rev(s) reverse(s.begin(), s.end())
#define lb(vec, a) lower_bound(vec.begin(), vec.end(), a)
#define ub(vec, a) upper_bound(vec.begin(), vec.end(), a)
#define uniq(vec) vec.erase(unique(vec.begin(), vec.end()), vec.end())
#define mp1(a, b, c) P1(a, P(b, c))

#define disp(x) cout << #x << ": " << x << endl
#define disp_vec(v)                                                                           \
    cout << #v << ":";                                                                        \
    rep(i, v.size()) cout << " " << v[i];                                                     \
    cout << endl

const int INF = 100000000;
const int M = 100000000;
const int dir_4[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
const int dir_8[8][2] = {{1, 0}, {1, 1}, {0, 1}, {-1, 1}, {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};

/* ------------------------------------- */

int main() {
    ll n;
    scanf("%lld", &n);

    ll sqn = sqrt(n);
    ll ret = 0;
    rep1(i, sqn) {
        ll r = i;
        if (n % r != 0)
            continue;
        ll m = n / r - 1;
        if (m <= r)
            break;
        ret += m;
    }

    printf("%lld\n", ret);

    /* --------------------------------- */
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;

int main() {
  int n; cin >> n;
  vector<int> x(n), y(n), h(n);
  REP(i, n) cin >> x[i] >> y[i] >> h[i];

  function<int(int, int, int, int, int)> calc = [](int cx,int cy, int x, int y, int h) {
    int d = abs(cx - x) + abs(cy - y);

    return h + d;
  };

  function<int(int, int, int, int, int)> calch = [](int cx, int cy, int x, int y, int h) {
    int d = abs(cx - x) + abs(cy - y);

    return max(h - d, 0);
  };

  REP(cy, 101)REP(cx, 101){
    set<int> st;
    REP(i, n){
      if(h[i] != 0) st.insert(calc(cx, cy, x[i], y[i], h[i]));
    }

    if((int)st.size() > 1) continue;
    int height = *st.begin();
    bool f = true;

    REP(i, n){
      if(h[i] == 0){
        f = f && calch(cx, cy, x[i], y[i], height) == 0;
      }
    }

    if(f){
      cout << cx << " " << cy << " " << height << endl;
      return 0;
    }
  }

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define intarr(arr, n)  ll arr[n];  for (ll i = 0; i < n; i++)  cin >> arr[i]
#define inpvec(vec,n) for(ll i=0;i<n;i++){ll var;cin>>var;vec.push_back(var);}
#define ff first
#define ss second
#define pb push_back
#define mkp make_pair
#define vec vector<ll>
#define pi pair<ll,ll>
#define changeline cout<<endl
#define loop(i,a,b) for(ll i=a;i<b;i++)
#define rev(i,a,b) for(ll i=a;i>=b;i--)
#define all(v) v.begin(),v.end()
#define mod2 998244353
#define NO cout << "NO" <<endl
#define YES cout << "YES" <<endl
#define mem(arr,val) memset(arr,val,sizeof(arr));
const ll mod=1e9+7;
#define piii 3.14159265358979323846264338327950
#define print(a, n, m)     for (ll i = n; i < m; i++) {  cout << a[i] << " "; }  //cout << endl
#define con continue

bool prime(ll n) 
{ 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (ll i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}
bool isPerfectSquare(ll x) {   
  long double sr = sqrt(x); 
  return ((sr - floor(sr)) == 0); 
} 
bool subsequence_checker(string str1, string str2, ll m, ll n) 
{ 
    if (m == 0) return true; 
    if (n == 0) return false; 
    if (str1[m-1] == str2[n-1]) 
        return subsequence_checker(str1, str2, m-1, n-1); 
    return subsequence_checker(str1, str2, m, n-1); 
}
bool cmp(const pair<int,int> &a,  const pair<int,int> &b) 
{ 
    if(a.ff == b.ff)
        return a.ss < b.ss;
    return (a.ff > b.ff); 
}
ll gcd(ll p, ll q){
if(p % q == 0)return q;
return gcd(q, p % q);
}
ll getSumofdigit(ll n) {

    ll sum = 0; 
    while (n != 0) 
    { 
     sum = sum + n % 10; 
     n = n/10; 
    }  
    return sum; 
} 
ll countDigit(ll n) 
{ 
    return floor(log10(n) + 1); 
}
//////////////////////////////////////////////////// Lets Do It ////////////////////////////////////////////////////////


void solve()
{

    string s;

    cin>>s;


    ll n = s.length();


    if(s[n-1]!='s')
        s+='s';
    else
    {
        s+='e';
        s+='s';
    }

    cout<<s;
    

    return;
}
 
int main()
{
#ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif
    IOS;
    ll t;
    //cin>>t;
    t=1;

    while(t--){
        solve();
        cout<<endl;
    }

    cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    return 0;
} 



Measured memory_bytes: 3700
#include <bits/stdc++.h>
using namespace std;
#define lp(i, x, n) for (int i = x; i < (int)n; ++i)
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()
#define ll long long

ll n;

int calc(ll a) {
        int nm = 0;
        while (a) {
                nm++;
                a /= 10;
        }
        return nm;
}

int main() {
        cin >> n;
        int ans = 1e9;
        for (ll i = 1; i * i <= n; i++) {
                if (n % i == 0) {
                        ans = min(ans, max(calc(i), calc(n / i)));
                }
        }
        cout << ans;
        return 0;
}


Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
a.append(0)
a.insert(0,0)
l=0
for i in range(n+1):
    l+=abs(a[i]-a[i+1])
for i in range(1,n+1):
    print(l-abs(a[i-1]-a[i])-abs(a[i]-a[i+1])+abs(a[i-1]-a[i+1]))


Measured memory_bytes: 85236
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
using namespace std;
int main()
{
  string s,ans;
  cin>>s;

  if((s.at(0)!=s.at(1) && s.at(0)!=s.at(2)) && s.at(1)!=s.at(2))
    ans="Yes";
  else ans="No";

  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<stack>
#include<queue>
#include<algorithm>
#include<set>
#include<iostream>
#define ll long long
using namespace std;
#define max(a,b)    (a)>(b)?(a):(b)
#define min(a,b)    (a)<(b)?(a):(b)
#define s(i)        scanf("%d",&(i))
#define ss(i)       scanf("%s",(i))
#define p(i)        printf("%d",i)
#define ps(i)       printf("%s",(i))
#define pc(i)       printf("%c",(i))
#define end         printf("\n")
#define f(i,n)      for(i=1;i<=n;i++)
#define w(i)        while(i--)
#define m(vis)      memset(vis,0,sizeof vis);
int a[200001];
int b[200001];
int main()
{
	int i,n,j;
	scanf("%d",&n);
	f(i,n)
	{
		scanf("%d",&a[i]);
		b[i]=a[i];
	}
	sort(b+1,b+1+n);
	int x=b[n/2];
	f(i,n)
	{
		if(a[i]>x)
			p(x);
		else
			p(b[n/2+1]);
		end;
	}
    return 0;
}

Measured memory_bytes: 3712
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include <cmath>
//#include <bits/stdc++.h>
using namespace std;

int main(){
    int N,M,X;
    cin>>N>>M>>X;
    int C[N],A[N][M],v[M];
    for (int i=0;i<N;i++){
        cin>>C[i];
        for (int j=0;j<M;j++){
            cin>>A[i][j];
        }
    }
    for (int i=0;i<M;i++){
        v[i]=0;
    }
    long int ans=20000000,sum=0,a=1;
     for (int k= 0; k<(1<<N);k++) {
        for (int i=0;i<N;i++) {
            if (k & (1<<i)){
                for (int l=0;l<M;l++){
                    v[l]+=A[i][l];
                }                
                sum+=C[i];
            }
        }
        for (int p=0;p<M;p++){
            if (v[p]<X) a=0;
            v[p]=0;
        }
        if (a==1) ans=min(sum,ans);
        a=1; 
        sum=0;
    }
    if (ans==20000000) cout<<"-1"<<endl;
    else cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std ;
 
//variable
// none
 
//structure
struct _dice
{
    int num[6] ;
};
 
//type definition
typedef struct _dice dice_t ;
 
//structure declaration
dice_t dice1 ;
dice_t dice2 ;
 
//function
void vertical()
{
    int cmp = dice2.num[0] ;
    dice2.num[0] = dice2.num[4] ;
    dice2.num[4] = dice2.num[5] ;
    dice2.num[5] = dice2.num[1] ;
    dice2.num[1] = cmp ;
}
 
void horizontal()
{
    int cmp = dice2.num[1] ;
    dice2.num[1] = dice2.num[2] ;
    dice2.num[2] = dice2.num[4] ;
    dice2.num[4] = dice2.num[3] ;
    dice2.num[3] = cmp ;
}
 
//main
int main()
{
    for (int i = 0 ;i < 6 ;i++ )
    {
        cin >> dice1.num[i] ;
    }
    for (int i = 0 ;i < 6 ;i++ )
    {
        cin >> dice2.num[i] ;
    }
 
    for (int i = 0 ;i < 5 ;i++ )
    {
        for (int j = 0 ;j < 5 ;j++ )
        {
            if ( dice1.num[0] == dice2.num[0] ) break ;
            vertical() ;
        }
        for (int j = 0 ;j < 5 ;j++ )
        {
            if ( dice1.num[1] == dice2.num[1] ) break ;
            horizontal() ;
        }
    }
 
    if ( dice1.num[0] == dice2.num[0] && dice1.num[1] == dice2.num[1] && dice1.num[2] == dice2.num[2] )
    {
        cout << "Yes" << endl ;
    }
    else cout << "No" << endl ;
 
    return 0 ;
}


Measured memory_bytes: 3124
/*
	Created by Faisal Ahmed
*/

#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long int ll;
typedef long double ld;

bool visited[100010];
int p[100010];

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(NULL);
	
	int n, m;
	
	cin >> n >> m;
	
	if(m >= n){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	
	return 0;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
	int a, b;
  	cin >> a >> b;
  	if((a+b)%2 == 0)
      cout << (a+b)/2 << '\n';
  	else
      cout << "IMPOSSIBLE" << '\n';
  	return 0;
}

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

using namespace std;

int M, N;
char FlagData[1000][1000];
char Emblem[2][2];
const char WhitePaper[] = { 'J','O','I' };

int calculate(int row, int col) {
	int cnt;

	cnt = 0;
	if (row + 1 < M && col + 1 < N) {
		if (FlagData[row][col] == Emblem[0][0] && FlagData[row][col + 1] == Emblem[0][1] && 
			FlagData[row + 1][col] == Emblem[1][0] && FlagData[row + 1][col + 1] == Emblem[1][1]) {
			++cnt;
		}
	}

	if (row + 1 < M && col - 1 >= 0) {
		if (FlagData[row][col - 1] == Emblem[0][0] && FlagData[row][col] == Emblem[0][1] &&
			FlagData[row + 1][col - 1] == Emblem[1][0] && FlagData[row + 1][col] == Emblem[1][1]) {
			++cnt;
		}
	}

	if (row - 1 >= 0 && col + 1 < N) {
		if (FlagData[row - 1][col] == Emblem[0][0] && FlagData[row - 1][col + 1] == Emblem[0][1] &&
			FlagData[row][col] == Emblem[1][0] && FlagData[row][col + 1] == Emblem[1][1]) {
			++cnt;
		}
	}

	if (row - 1 >= 0 && col - 1 >= 0) {
		if (FlagData[row - 1][col - 1] == Emblem[0][0] && FlagData[row - 1][col] == Emblem[0][1] &&
			FlagData[row][col - 1] == Emblem[1][0] && FlagData[row][col] == Emblem[1][1]) {
			++cnt;
		}
	}

	return cnt;
}

int solve() {
	int bCnt, aCnt, maxCnt;;
	char ch;

	maxCnt = 0;
	for (int i = 0; i < M; ++i) {
		for (int j = 0; j < N; ++j) {
			ch = FlagData[i][j];
			bCnt = calculate(i, j);
			for (int k = 0; k < 3; ++k) {
				if (ch == WhitePaper[k]) {
					continue;
				}
				FlagData[i][j] = WhitePaper[k];
				aCnt = calculate(i, j);
				maxCnt = max(maxCnt, aCnt - bCnt);
			}
			FlagData[i][j] = ch;
		}
	}

	return maxCnt;
}

int main() {
	int baseCnt;

	cin >> M >> N;
	for (int i = 0; i < M; ++i) {
		for (int j = 0; j < N; ++j) {
			cin >> FlagData[i][j];
		}
	}
	for (int i = 0; i < 2; ++i) {
		for (int j = 0; j < 2; ++j) {
			cin >> Emblem[i][j];
		}
	}
	baseCnt = 0;
	for (int i = 1; i < M; ++i) {
		for (int j = 1; j < N; ++j) {
			if (FlagData[i][j] == Emblem[1][1] && FlagData[i][j - 1] == Emblem[1][0] &&
				FlagData[i - 1][j] == Emblem[0][1] && FlagData[i - 1][j - 1] == Emblem[0][0]) {
				++baseCnt;
			}
		}
	}
	cout << baseCnt + solve() << endl;

	return 0;
}


Measured memory_bytes: 4108
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N, count = 0;
  cin >> N;
  
  for (int i = 0; i < N; i++){
    int k, l;
    cin >> k >> l;
    
    count += l - k + 1;
    
  }
  
  cout << count << endl;
}


Measured memory_bytes: 256
//confilm 0LL and 1LL
//confilm cornercase such as 0
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPR(i, n, 1)
#define co(n) cout << (n) << endl
#define cosp(n) cout << (n) << ' '
#define setp(n) cout << fixed << setprecision(n);
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fs first
#define sc second
template <typename T> bool chmax(T &a, const T& b){if(a < b){a = b; return true;} return false;}
template <typename T> bool chmin(T &a, const T& b){if(a > b){a = b; return true;} return false;}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const double PI = acos(-1);
const double EPS = 1e-9;

int main(void){
	ll n;
	cin >> n;
	if(n == 1e5) co(90909);
	else if(n/10000) co(9+900+n-9999);
	else if(n/1000) co(909);
	else if(n/100) co(9+n-99);
	else if(n/10) co(9);
	else co(n);

	return 0;
}


Measured memory_bytes: 256
def resolve():
    import numpy as np
    d = int(input())
    C = list(map(int, input().split()))
    S = []
    for _ in range(d):
        _S = list(map(int, input().split()))
        S.append(_S)
    S = np.array(S)

    for i in range(d):
        max_idx = np.argmax(S[i])
        print(max_idx + 1)

resolve()

Measured memory_bytes: 27436
n, m = gets.split(" ").map(&:to_i)
arr1 = []; arr2 = []

n.times { arr1 << gets.split(" ").map(&:to_i) }

m.times { arr2 << gets.to_i }

ans = []

arr1.each do |arr|
  int = 0
  arr.each_with_index do |val, ind|
    int += val * arr2[ind]
  end
  ans << int
end

puts ans

Measured memory_bytes: 6132
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,p;
  cin >> n >> p;
  bool gusu=true;
  int a[n];
  for (int i=0;i<n;i++){
    cin >> a[i];
    if (a[i]%2==1)gusu=false;
  }
  if (p==0 && gusu){
    long long int l=pow(2,n);
    printf("%lld",l);}
  else if (p==1 && gusu) cout << 0 <<endl;
  else {
    long long int k=pow(2,n-1);
    printf("%lld",k);
  }
}


Measured memory_bytes: 256
#include <cstring>
#include <map>
#include <unordered_map>
#include <string>
#include <list>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <iostream>
#include <set>
#include <unordered_set>
using namespace std;

#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> pii;

int gi() {
    int a;
    scanf("%d", &a);
    return a;
}

ll gli() {
    ll a;
    scanf("%lld", &a);
    return a;
}

char s[400][404];
int n, m;
ll nb, nc;

void dfs(int i, int j, char c) {
    if (s[i][j] != c)
        return;
    s[i][j] = ' ';
    if (c == '#')
        nb++;
    else
        nc++;
    for (int k = 0; k < 4; k++) {
        int ii = i + (k/2 ? (k%2)*2-1 : 0);
        int jj = j + (k/2 ? 0 : (k%2)*2-1);
        if (ii < 0 || ii >= n || jj < 0 || jj >= m)
            continue;
        dfs(ii, jj, (c == '#' ? '.' : '#'));
    }
}

int main() {
    n = gi();
    m = gi();

    for (int i = 0; i < n; i++)
        scanf("%s", s[i]);

    ll res = 0;
    for (int i = 0; i < n; i++)
        for (int j = 0; j < m; j++)
            if (s[i][j] == '#') {
                nb = 0;
                nc = 0;
                dfs(i, j, '#');
                res += nb*nc;
            }

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 7936
s = input()
n = len(s)

total = 0
for i in range(2**(n-1)):
  tmp = s[0]
  for j in range(n-1):
    if (i >> j) & 1:
      tmp = tmp + "+" + s[j+1]
    else:
      tmp = tmp + s[j+1]
  
  total = total + eval(tmp)

print(total)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
const int MAXN = 262144;
int N;
int A[101010];
int B[101010];

int idx[2*MAXN];
void setv(int a, int v)
{
  idx[a += MAXN] += v;
  while((a = a/2))
    idx[a] = idx[2*a] + idx[2*a+1];
}
int getv(int a, int b)
{
  int ans = 0;
  a += MAXN; b += MAXN;
  while(a<=b)
  {
    if(a%2==1) ans += idx[a++];
    if(b%2==0) ans += idx[b--];
    a /= 2; b /= 2;
  }
  return ans;
}

long long cnt(int a)
{
  memset(idx, 0, sizeof idx);
  for(int i=0; i<N; ++i)
    if(A[i] >= a) B[i] = 1;
    else B[i] = -1;
  
  int in = N;
  long long ans = 0;
  for(int i=0; i<N; ++i)
  {
    setv(in, 1);
    in += B[i];
    ans += getv(0, in);
  }
  //printf("%d %lld\n", a, ans);
  return ans;
}
int main()
{
  scanf("%d", &N);
  for(int i=0; i<N; ++i) scanf("%d", A+i);
  int lo = 0;
  int hi = (int)1e9+1;
  while(lo+1!=hi)
  {
    int mi = (lo+hi)/2;
    if(cnt(mi) >= (1LL*N*(N+1)/2+1)/2) lo = mi;
    else hi = mi;
  }
  printf("%d\n", lo);
  return 0;
}

Measured memory_bytes: 3072
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define dump(x) cout << (x) << endl
typedef long long ll;
typedef pair<int, int> P;


int main() {
  int n;
  cin >> n;
  if (n < 1200) {
    dump("ABC");
  }
  else if (1200 <= n && n < 2800) {
    dump("ARC");
  }
  else {
    dump("AGC");
  }
  return 0;
}


Measured memory_bytes: 256