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

#define LL long long
#define fi first
#define se second
#define mp make_pair
#define pb push_back

using namespace std;

LL gcd(LL a,LL b){return b?gcd(b,a%b):a;}
LL lcm(LL a,LL b){return a/gcd(a,b)*b;}
LL powmod(LL a,LL b,LL MOD){LL ans=1;while(b){if(b%2)ans=ans*a%MOD;a=a*a%MOD;b/=2;}return ans;}
const int N = 2e5 +11;
int n,a[N],b[N];
int main(){
	ios::sync_with_stdio(false);
	cin>>n;
	for(int i=1;i<=n+1;i++)cin>>a[i];
	for(int i=1;i<=n;i++)cin>>b[i];
	LL ans=0;
	for(int i=1;i<=n;i++){
		if(a[i]>=b[i]){
			ans+=b[i];
			a[i]-=b[i];
			b[i]=0;
		}else{
			ans+=a[i];
			b[i]-=a[i];
			if(b[i]<=a[i+1]){
				ans+=b[i];
				a[i+1]-=b[i];
			}else{
				ans+=a[i+1];
				a[i+1]=0;
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;
const int mod = 1e9+7;

int main() {
    ll a; cin >> a;
    double b_tmp; cin >> b_tmp;
    b_tmp *= 100;
    int b = b_tmp+0.0001;
    ll ans = a*b;
    ans /= 100;
    cout << ans << endl;
}

Measured memory_bytes: 3720
S = input()
alphabet = "abcdefghijklmnopqrstuvwxyz"
chk_list = []
for a in alphabet:
    chk_list.append(a)

for s in S:
    if s in chk_list:
        chk_list.remove(s)

if len(chk_list) == 0:
    print("None")
else:
    print(chk_list[0])

Measured memory_bytes: 3188
/* Dsingh_24 */

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define ios	    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;

#define N  100005

int main()
{
	ios
	ll l,r,i,j,ans=2019;
	cin>>l>>r;
	if(l/2019!=r/2019)cout<<"0";else{
		for(i=l;i<=r;i++){
			for(j=i+1;j<=r;j++)
				ans=min(ans,(i*j)%2019);
		}
		cout<<ans;
	}
	return 0;
}

Measured memory_bytes: 256
# N = gets.chomp.to_i
X, Y, Z, K = gets.chomp.split.map(&:to_i)
A = gets.chomp.split.map { |e| - e.to_i }
B = gets.chomp.split.map { |e| - e.to_i }
C = gets.chomp.split.map { |e| - e.to_i }

AB = []
A.each.with_index do |a, i|
  B.each.with_index do |b, j|
    AB << a + b
  end
end
AB.sort!

AB = AB.first(K)
C.sort!

arr = []
AB.each do |ab|
  C.each do |c|
    arr << ab + c
  end
end
arr.sort!

arr.first(K).each do |e|
  p(-e)
end

Measured memory_bytes: 71916
#include<stdio.h>
#include<string.h>

#define M 1000033/* your task*/
#define L 14

char H[M][L]; /* Hash Table */

int getChar(char ch){
  if ( ch == 'A') return 1;
  else if ( ch == 'C') return 2;
  else if ( ch == 'G') return 3;
  else if ( ch == 'T') return 4;
}

/* convert a string into an integer value */
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

int h(int key,int i){ return (h1(key) + i*h2(key))%M/* your task */; }
int h1(int key){ return key%M/* your task */; }
int h2(int key){ return 1+key%(M - 1)/* your task */; }

int find(char str[]){
  int i=0,k=getKey(str),m=h(k,i);

  while(H[m][0] != '\0'){
   
    if(strcmp(str, H[m])==0){
  
  return 1;
    }
    i++;
    m=h(k,i);
  }
 return 0;
                 /* your task */

}

int insert(char str[]){

  int i=0,k=getKey(str),m;
  while(1){
    m=h(k,i);
    if( H[m][0] == '\0'){
      strcpy(H[m],str);
      return 1;
    }
    i++;
  }

/* your task */
  
}

int main(){
  int i, n, h;
  char str[L], com[9];
  for ( i = 0; i < M; i++ ) H[i][0] = '\0';
  
    scanf("%d", &n);
    
    for ( i = 0; i < n; i++ ){
      scanf("%s %s", com, str);
      
	if ( com[0] == 'i' ){
	  insert(str);
	} else {
	  if (find(str)){
	    printf("yes\n");
	  } else {
	    printf("no\n");
	  }
	}
    }
    
    return 0;
}

Measured memory_bytes: 14280
// C - Rally
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(int)(n); i++)
using namespace std;
using ll = long long;
using ull = unsigned long long;

int main(){
    int n;
    cin >> n;
    vector<int> x(n);
    rep(i, n) cin >> x[i];
    int ans = 0;
    for(int i=1; i<101; i++){
        int a, b = 0;
        rep(j, n){
            a = x[j]-i;
            a = a*a;
            b += a;
        }
        if(i>=2) ans = min(ans, b);
        else ans = b;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3620
#include<iostream>
using namespace std;
int main(){
    int n,max,min;
    long long sum=0;
    int a[10001];
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        sum=sum+a[i];
        if(i==1){
            max=a[i];
            min=a[i];
        }
        else{
            if(max<a[i]){
                max=a[i];
            }
            if(min>a[i]){
                min=a[i];
            }
        }
    }
    cout<<min<<" "<<max<<" "<<sum<<endl;
}


Measured memory_bytes: 3152
function Main(input) {
	input = input.split("");
	var flag = 0;
	for(var i=0;i<input.length;i++){
		switch(flag){
			case 0:
			if(input[i]=="C")flag++;
			break;
			case 1:
			if(input[i]=="F")flag=2;
		}
	}
	if(flag==2){
		console.log("Yes")
	}else{
		console.log("No")
	}
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());

Measured memory_bytes: 11340
#include <iostream>
#include <string>
using namespace std;
string S;
int main(){
	cin >> S;
	bool w = false,n = false,s = false,e = false;
	for(int i=0;i<S.size();i++){
		if(S[i]=='W') w = true;
		if(S[i]=='N') n = true;
		if(S[i]=='E') e = true;
		if(S[i]=='S') s = true;
	}
	if(!(w xor e) && !(s xor n)) cout << "Yes" << endl;
	else cout << "No" << endl;
}

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

int main(void){
  string s; cin >> s;
  int ans = 0;
  int check = 0;
  for(int i = 0; i < s.size(); i++){
    if((s.at(i) == 'A' || s.at(i) == 'C' || s.at(i) == 'G'||s.at(i) == 'T')){
      check++;
      ans = max(ans,check);
    }
    else check = 0;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fast() ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define lp(i, n) for(int i = 0; i < n; i++)
#define rlp(i, n) for(int i = n-1; i >= 0; i--)
#define loop(i, a, b) for(int i = a; i <= b; i++)
#define rloop(i, a, b) for(int i = a; i >= b; i--)
#define mem(a, val) memset(a, val, sizeof a);
#define test int t; cin>> t; while(t--)
#define all(v) v.begin(),v.end()
#define ll long long
#define ld long double
#define mp_ make_pair
#define pb push_back
#define sz(s) (int)s.size()
const int MAX = 1e5 + 5;
const int inf = 1e9+1;
const ll OO = 1e18;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
int n, a[MAX], dp[MAX];
int solve(int i = 0){
    if(i == n - 1) return 0;

    if(dp[i] < 1e9) return dp[i];

    int choice1 = inf, choice2 = inf;

    if(i + 1 < n)
        choice1 = solve(i + 1) + abs(a[i + 1] - a[i]); // 20 10 20 // 20 10 0

    if(i + 2 < n)
        choice2 = solve(i + 2) + abs(a[i + 2] - a[i]); // 30 20

    return dp[i] = min(choice1, choice2);
}
int main()
{
    cin>> n;
    lp(i, n)
        cin>> a[i];

    mem(dp, 63);
    cout<< solve() <<"\n";

    return 0;
}


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

  ll longer1=0;
  ll longer2=0;

int main() {
  ll n;
  cin>>n;
  ll st[n];
  rep(i, n){
    cin>>st[i];}
  
  sort(st,st+n,greater<ll>());
  
  rep(i, n){
    if(i>=1){
    if(st[i]==st[i-1]){
      if(longer1==0){
      longer1=st[i];
      i++;
      }
      else{
        longer2=st[i];
        break;
      }
    }
    }
  }
  
  cout<<longer1*longer2<<endl;

}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;
const lli INF = 1e9 + 100;
const lli INF64 = (1LL << 61) + 100;
const lli MOD = 1e9 + 7;
const lli MH1 = 1599614977, MH2 = 2034417103, MH3 = 1090250123, MH4 = 2024491871;
lli bpow(lli baseee, lli exponenttt) {
	if(exponenttt < 0) return 0;
	lli res = 1;
	baseee %= MOD;
	while (exponenttt > 0) {
		if ((exponenttt & 1) == 1) res = (res*baseee) % MOD;
		baseee = (baseee*baseee) % MOD;
		exponenttt >>= 1;
	}
	return res;
}
lli multInverse(lli a) {//if_mod_is_prime
	return bpow(a, MOD - 2);
}
lli divm(lli a, lli b) {//if_mod_is_prime
	return (a * multInverse(b)) % MOD;
}
lli multm(lli a, lli b) {
	return (a * b) % MOD;
}
lli subm(lli a, lli b) {
	a += MOD;
	lli r = a - b;
	if(r >= MOD) return r - MOD;
	return r;
}
lli addm(lli a, lli b) {
	lli r = a + b;
	if(r >= MOD) return r - MOD;
	return r;
}
signed main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	//	freopen("input.txt", "r", stdin);
	//	freopen("output.txt", "w", stdout);
    lli x, k, d;
    cin >> x >> k >> d;
    x = abs(x);
    if(ld(d)*k <= x) {
        cout << (x - d*k) << "\n";
        return 0;
    }
    k -= x / d;
    x %= d;
    if(k % 2 == 0) {
        cout << x << "\n";
    } else {
        cout << abs(x - d) << "\n";
    }

	return 0;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define M 1000000007
#define ll long long
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPI(i,a,b) for(ll i=b-1;i>=a;i--)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define G(a,b) get<a>(b)
#define VI vector<int>
#define VLL vector<long long>

#define o_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define o_setll tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
//member functions :
//1. order_of_key(k) : number of elements strictly lesser than k
//2. find_by_order(k) : k-th element in the set

ll modI(ll a, ll m);
ll gcd(ll a, ll b);
ll powM(ll x, unsigned ll y, unsigned ll m);
void pairsort(int a[], int b[], int n);
void pairsortll(ll a[],ll b[],ll n);
ll logint(ll x,ll y);


ll gcd(ll x,ll y)
{
    if(x==0) return y;
    return gcd(y%x,x);
}

ll powM(ll x,ll y,ll m)
{
    if(y==0) return 1;
    ll p=powM(x,y/2,m)%m;
    p=(p*p)%m;
    return (y%2==0)?p:(x*p)%m;
}

ll modI(ll a, ll m)
{
    ll m0=m,y=0,x=1;
    if(m==1) return 0;
    while(a>1)
    {
        ll q=a/m;
        ll t=m;
        m=a%m;
        a=t;
        t=y;
        y=x-q*y;
        x=t;
    }
    if(x<0) x+=m0;
    return x;
}

void pairsort(int a[],int b[],int n)
{
    pair<int,int> v[n];
    REP(i,0,n)
    {
        v[i].F=a[i];
        v[i].S=b[i];
    }
    sort(v,v+n);
    REP(i,0,n)
    {
        a[i]=v[i].F;
        b[i]=v[i].S;
    }
}

void pairsortll(ll a[],ll b[],ll n)
{
    pair<ll,ll> v[n];
    REP(i,0,n)
    {
        v[i].F=a[i];
        v[i].S=b[i];
    }
    sort(v,v+n);
    REP(i,0,n)
    {
        a[i]=v[i].F;
        b[i]=v[i].S;
    }
}

ll logint(ll x,ll y)
{
    ll ans=0;
    ll a=1;
    for(ll i=0;i<=x;i++)
    {
        if(x<a)
        {
            return ans;
        }
        ans++;
        a*=y;
    }
    return -1;
}

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

    /*
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    */

    ll q=1;
    //cin>>q;
    while(q--)
    {
        ll a,b;
        cin>>a>>b;
        ll n=gcd(a,b);
        ll ans=1;
        for(ll i=2;i*i<=n;i++)
        {
            if(n%i==0)
            {
                ans++;
                while(n%i==0)
                {
                    n/=i;
                }
            }
        }
        if(n>1) ans++;
        cout<<ans;
    }

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int A[101][101],B[101];
int main(){
  int N,M,C,x = 0,y = 0;
  cin >> N >> M >> C;
  for(int i = 0; i < M; i ++){
    cin >> B[i];
  }
  for(int i = 0; i < N; i ++){
    for(int j = 0; j < M; j ++){
      cin >> A[i][j];
    }
    for(int j = 0; j < M; j ++){
      x = x + B[j] * A[i][j];
    }
    x = x + C;
    if(x > 0){
      y = y + 1;
    }
    x = 0;
  }
  cout << y << endl;

  return 0;
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    map<int, int> al;
    rep(i, s.size()) {
        al[s[i]-'a']++;
    }
    int num = al.size();

    vector<P> huff(num);
    priority_queue<P, vector<P>, greater<P> > q;
    int j = 0;
    vi aruru(26);
    for(P ne:al) {
        aruru[ne.first] = j;
        huff[j].first = ne.second;
        huff[j].second = -1;
        q.push(P(ne.second, j));
        j++;
    }

    while(q.size() != 1) {
        P n1, n2;
        n1 = q.top();
        q.pop();
        n2 = q.top();
        q.pop();

        int nj = huff.size();
        huff.push_back(P(n1.first+n2.first, -1));
        huff[n1.second].second = nj;
        huff[n2.second].second = nj;
        q.push(P(huff[nj].first, nj));
    }

    vi depth(huff.size(), -1);
    if(al.size() == 1) {
        depth[0] = 1;
    }
    function<int(int)> dfs = [&](int i) {
        if(depth[i] != -1) {
            return depth[i];
        }
        if(huff[i].second == -1) {
            depth[i] = 0;
            return 0;
        }
        return depth[i] = dfs(huff[i].second) + 1;
    };

    int sum = 0;
    rep(i, s.size()) {
        sum += dfs(aruru[s[i]-'a']);
    }
    cout << sum << endl;

}


Measured memory_bytes: 3380
N,K,Q=gets.chomp.split(" ")
n=N.to_i
k=K.to_i
q=Q.to_i
res=Array.new(n,0)
for i in 0..(q-1) do
  a=gets.to_i
  res[a-1]+=1
end
res.each do |res|
  if k-(q-res)>0 then
    puts("Yes")
  else
    puts("No")
  end
end

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

struct Node{
	Node *right;
	Node *left;
	Node *parent;
	int key;
};

Node *root,*NIL;

Node * find(Node *u,int k){
	while(u!=NIL&&k!=u->key) u=(k<u->key?u->left:u->right); 
	return u;
}

void insert(int k){
	Node *x=root,*y=NIL,*z;
	
	z=(Node *)malloc(sizeof(Node));
	z->key=k;
	z->left=NIL;
	z->right=NIL;
	
	while(x!=NIL){
		y=x;
		if(z->key<x->key){
			x=x->left;
		}else{
			x=x->right;
		}
	}
	
	z->parent=y;
	if(y==NIL){
		root=z;
	}else{
		if(z->key<y->key){
			y->left=z;
		}else{
			y->right=z;
		}
	} 
}

void preParse(Node *u){
	if(u==NIL) return;
	cout<<" "<<u->key;
	preParse(u->left);
	preParse(u->right);
}

void inParse(Node *u){
	if(u==NIL) return;
	inParse(u->left);
	cout<<" "<<u->key;
	inParse(u->right);
}

int main(){
	int n,x;
	string com;
	
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>com;
		if(com=="find"){
			cin>>x;
			Node *t=find(root,x);
			if(t!=NIL) cout<<"yes\n";
			else cout<<"no\n";
		}else if(com=="insert"){
			cin>>x;
			insert(x);
		}else{
			inParse(root);
			cout<<endl;
			preParse(root);
			cout<<endl;
		}
	}
	
	return 0;
}




Measured memory_bytes: 21908
a = input()
b = input()
c = input()
card = 'a'
a[1::]
while a != '' or b!= '' or c!= '':
  if card == 'a':
    if a == '':
     print('A')
     break
    card = a[0]
    a = a[1::]
  elif card == 'b':
    if b == '':
     print('B')
     break
    card = b[0]
    b = b[1::]
  elif card == 'c':
    if c == '':
     print('C')
     break
    card = c[0]
    c = c[1::]

Measured memory_bytes: 3064
[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.map f

[<EntryPoint>]
let main argv =
    let xs = List.map (fun _ -> read int) [1..5]
    let k = read int
    if List.last xs - List.head xs <= k
    then printfn "Yay!"
    else printfn ":("
    0

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

int n;
vector<pair<int,int>> a;
ll min(ll a,ll b){
	if(a<b){
		return a;
	}
	else return b;
}


int main(void)
{
	cin>>n;
	for (int i = 0; i < n; i++) {
		int x,y;
		cin>>x>>y;
		a.push_back({x,i});
		a.push_back({y,i});
	}
	sort(a.begin(),a.end());
	unordered_map<int,int> map,cast;
	for (int i = 0; i < a.size(); i++) {
		if(!map.count(a[i].second)){
			map[a[i].second]=i;
		}
		else{
			cast[map[a[i].second]]=i;
			cast[i]=map[a[i].second];
		}
	}
	if(n==1){
		cout<<0<<endl;
		return 0;
	}
	ll ret=0x3f3f3f3f3f3f3f3f;
	if(a[0].second!=a.back().second){
		int gmax=a.size()-1,gmin=0;
		int rmax=cast[0],rmin=cast[gmax];
		if(rmax<rmin)swap(rmax,rmin);
		for(int i=1;i<rmin;i++){
			if(cast[i]<rmin){
				rmin=min(rmin,max(i,cast[i]));
			}
		}
		for(int i=a.size()-2;i>rmax;i--){
			if(cast[i]>rmax){
				rmax=max(rmax,min(i,cast[i]));
			}
		}
		int flag=0;
		int rmax1=rmax;
		for(int i=1;i<rmin;i++){
			if(cast[i]>rmax){
				flag=1;
				ret=min(ret,ll(a[gmax].first-a[gmin].first)*ll(a[rmax1].first-a[i].first));
				rmax1=max(rmax1,cast[i]);
			}
		}
		if(!flag)ret=min(ret,ll(a[gmax].first-a[gmin].first)*ll(a[rmax].first-a[rmin].first));
		int rmin1=rmin;
		for(int i=a.size()-2;i>rmax;i--){
			if(cast[i]<rmin){
				ret=min(ret,ll(a[gmax].first-a[gmin].first)*ll(a[i].first-a[rmin1].first));
				rmin1=min(rmin1,cast[i]);
			}
		}
	}
	int rmin=0,gmax=a.size()-1;
	int gmin=cast[rmin],rmax=cast[gmax];
	for(int i=1;i<gmin;i++){
		if(cast[i]<gmin){
			gmin=min(gmin,max(cast[i],i));
		}
	}
	for(int i=a.size()-2;i>rmax;i--){
		if(cast[i]>rmax){
			rmax=max(rmax,min(cast[i],i));
		}
	}
	ret=min(ret,ll(a[gmax].first-a[gmin].first)*ll(a[rmax].first-a[rmin].first));
	cout<<ret<<endl;
	return 0;
}


Measured memory_bytes: 29164
#include <bits/stdc++.h>
/*#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>*/
 
#define pll              pair <long long,long long>
#define pb(a)            push_back(a)
#define ll               long long
#define ff               first
#define ss               second
#define D(x)             cerr<<#x " = "<<(x)<<endl
#define vll              vector <ll>
#define IOS              ios_base::sync_with_stdio(0); cin.tie(NULL);
using namespace std;


int main()
{
    ll x,a;
    cin>>x>>a;
    if(x<a)
    cout<<0<<endl;
    else
    cout<<10<<endl;
    return 0;
}


Measured memory_bytes: 256
import sys
import copy




N,M = map(int, input().split())

seen = [False]*N
V = []
E = []

def dfs(node):
    global V
    global seen

    if seen[node]==True:
        return
    if not (False in seen):
        return
    seen[node]=True

    for next_node in V[node]:
        dfs(next_node)

    return

for i in range(N):
    V.append(set())
    
for i in range(M):
    *l,  = map(int, input().split())
    V[l[0]-1].add(l[1]-1)
    V[l[1]-1].add(l[0]-1)
    E.append([l[0]-1, l[1]-1])

seen_copy = copy.deepcopy(seen)
V_copy    = copy.deepcopy(V)
count = 0
#各辺取り除いて深さ優先探索
for edge in E:
    V[edge[0]].remove(edge[1])
    V[edge[1]].remove(edge[0])

    dfs(0)

    if (False in seen):
        count = count + 1

    seen = copy.deepcopy(seen_copy)
    V    = copy.deepcopy(V_copy)

print(count)

Measured memory_bytes: 3700
package main

import "fmt"

func sumDigits(n int) (sum int) {
	for i := n; i > 0; i /= 10 {
		sum += i % 10
	}
	return
}

func main() {
	var n int
	fmt.Scan(&n)

	min := int(^uint(0) >> 1)
	for a, b := 1, n-1; a <= b; a, b = a+1, b-1 {
		if t := sumDigits(a) + sumDigits(b); t < min {
			min = t
		}
	}
	fmt.Println(min)
}


Measured memory_bytes: 512
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import itertools
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

N,M,Q = FLI()
a = [0]*Q
b = [0]*Q
c = [0]*Q
d = [0]*Q
for i in range(Q):
    a[i],b[i],c[i],d[i] = FLI()
H = []
for j in range(1, M+1):
    H.append(j)
L = list(itertools.combinations_with_replacement(H,N))
max = 0
for l in L:
  sum = 0
  for q in range(Q):
    if l[b[q]-1] - l[a[q]-1] == c[q]:
        sum += d[q]
  if max < sum:
      max = sum

print(max)

Measured memory_bytes: 39472
import string

s=raw_input()
K=int(raw_input())
ans=''
for c in s:
    ci=string.lowercase.index(c)
    m=(26-ci)%26
    if K>=m:
        K-=m
        ans+='a'
    else:
        ans+=string.lowercase[ci]
K%=26
last=ans[-1]
lasti=string.lowercase.index(last)
nl=string.lowercase[lasti+K]
ans=ans[:-1]+nl
print ans

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

int main(){
    char n;
    cin>>n;
    if(n=='A'){cout<<"T"<<endl;}
    else if(n=='T'){cout<<"A"<<endl;}
    else if(n=='G'){cout<<"C"<<endl;}
    else{cout<<"G"<<endl;
    }
}


Measured memory_bytes: 256
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto i:mp)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll half_inf = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

ll h, w;
ll c[10][10];
ll a[200][200];

void warshall_floyd() {
    rep(k, 10)rep(i, 10)rep(j, 10) c[i][j] = min(c[i][j], c[i][k] + c[k][j]);
}

void solve() {
    warshall_floyd();

    ll ans = 0;
    rep(i, h)rep(j, w) if (a[i][j] != -1) {
                ans += c[a[i][j]][1];
            }
    cout << ans << endl;
}

int main() {
    cin >> h >> w;
    rep(i, 10)rep(j, 10) cin >> c[i][j];
    rep(i, h)rep(j, w) cin >> a[i][j];
    solve();
    return 0;
}

Measured memory_bytes: 512
//https://atcoder.jp/contests/abc123/tasks/abc123_a
#include<bits/stdc++.h>
using namespace std;
int main(){
	int A[5],k;
	cin>>A[0]>>A[1]>>A[2]>>A[3]>>A[4]>>k;
	sort(A,A+5);
	if(A[4]-A[0]>k){
		cout<<":("<<endl;
		return 0;
	}
	if(A[4]-A[0]<=k){
		cout<<"Yay!"<<endl;
		return 0;
	}
}
			



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>
#include <tuple>
#include <stack>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define print(s) cout << s << endl
using namespace std;
const int INF = 1e9;
typedef long long lint;
const lint LINF = 1e18;
const lint MOD = 1e9 + 7;
// const lint MOD = 998244353;
int ctoi(char c) {
	if (c >= '0' && c <= '9') {
		return c - '0';
	}
	return 0;
}
char upper(char c){
	return c-0x20;
}
char lower(char c){
	return c+0x20;
}

int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x%y);
}
 

int ans = 0;
long long int N;
void dfs(long long int x,int a,int b,int c){
	if(x > N) return;
	if(a & b & c) ans++;
	dfs(10*x+3, 1, b, c);
	dfs(10*x+5, a, 1, c);
	dfs(10*x+7, a, b, 1);
}
 
int main() {
	cin >> N;
	dfs(0, 0, 0, 0);
	cout << ans << endl;
}


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

#define mp make_pair
#define pb push_back
#define REP(i,a,n) for(int i = a;i < (n);i++)
#define RREP(i,a) for(int i = a;i >= 0;i--)
#define rep(i,n) for(int i = 0;i < (n);i++)
#define rrep(i,n) for(int i = n - 1;i >= 0;i--)
#define all(s) s.begin(), s.end()
#define rall(s) s.rbegin(), s.rend()
#define range(x,min,max) ((min) <= (x) && (x) <= (max))
#define xyrange(x, minX, maxX, y, minY, maxY) (range(x, minX, maxX) && range(y, minY, maxY))

using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<vector<int> > VVI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef pair<int,int> PII;
typedef vector<PII> VPII;


const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};
const int INF = 0x3f3f3f3f;

string int2str(int num) {
	stringstream ss;
	ss << num;
	return ss.str();
}

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	int ans = INT_MAX;
	REP(i, 1, n) {
		string a = int2str(i);
		string b = int2str(n - i);
		int sum_a = 0;
		int sum_b = 0;
		for (auto &c : a) {
			sum_a += c - '0';
		}
		for (auto &c : b) {
			sum_b += c - '0';
		}
		ans = min(ans, sum_a + sum_b);
	}
	cout << ans << endl;
	return 0;
}




Measured memory_bytes: 256
N = input()
d = {}
for a in map(int, raw_input().split()):
  d[a - 1] = d.get(a - 1, 0) + 1
  d[a] = d.get(a, 0) + 1
  d[a + 1] = d.get(a + 1, 0) + 1
print max(d.values())


Measured memory_bytes: 16360
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;

void dfs(vector<bitset<8000>>& dp, const vector<int>& a, int i, int z) {
    if (dp[i][z]) return; else dp[i][z] = true;
    if (--i >= 0) {
        dfs(dp, a, i, abs(z - a[i]));
        dfs(dp, a, i, z + a[i]);
    }
}

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

    string s;
    cin >> s;

    s.push_back('T');
    int n = s.size();

    int x, y;
    cin >> x >> y;

    vector<int> a[2];
    int c = 0, d = 0, f = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == 'F') {
            c++;
        } else {
            if (f == 0) {
                x -= c;
                f = 1;
            } else {
                a[d].push_back(c);
            }
            c = 0;
            d ^= 1;
        }
    }

    int b = 0;
    for (int d = 0; d < 2; d++) {
        int m = a[d].size();
        vector<bitset<8000>> dp(m + 1);
        dfs(dp, a[d], m, 0);

        if (dp[0][abs(d == 0 ? x : y)]) b++;
    }

    cout << (b == 2 ? "Yes" : "No") << endl;

    return 0;
}

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

// for loop
#define rep(i,a,n) for(int i=(a);i<(n);++i)
#define repe(i,a,n) for(int i=(a);i<=(n);++i)
#define rrep(i,n,a) for(int i=(n);n>(a);--i)
#define rrepe(i,n,a) for(int i=(n);n>=(a);--i)

// abbreviati
#define PB(v) push_back(v)
#define MP make_pair
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define ENDL << "\n"

using ll = long long;
using P = pair<int,int>;
using itn = int;

// constant
const int INF = 1<<30;
const ll INFLL = 1LL << 60;
const ll MOD = 1000000007;
const long double PI =(acos(-1));

/***Snippet***************************************************
ifelse, isprime, torad, todeg, lcm, bfs,chmin,chmax
**************************************************************/

// adjacency list
vector<int> to[100005];

// Graph
using Graph = vector<vector<int>>;

// Grid
int H,W;
vector<vector<int>> field;

// 4方向への移動ベクトル
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};


int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int x,a; cin >> x >> a;
    if(x<a) cout << 0 ENDL;
    else cout << 10 ENDL;
    
    return 0;
}

Measured memory_bytes: 6004
#include<bits/stdc++.h>
#define long long long
using namespace std;
const int N=1e3;
int arr[N+2],ans;
int main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  int n,x;cin>>n>>x;
  for(int i=1;i<=n;i++)
    cin>>arr[i];
  sort(arr+1,arr+n+1);
  for(int i=1;i<=n;i++)
  {
    if(x>=arr[i])
      ans++,x-=arr[i];
  }
  if(ans==n&&x)ans--;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[100005];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n,k,q;
    cin>>n>>k>>q;
    for(int i=1;i<=n;i++)
        a[i]=0;
    for(int i=0;i<q;i++)
    {
        int c;
        cin>>c;
        a[c]++;
    }
    for(int i=1;i<=n;i++)
    {
        if(a[i]>q-k)
            cout<<"Yes"<<'\n';
        else cout<<"No"<<'\n';
    }
}


Measured memory_bytes: 1024
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

score = 0
for i in range(N):
    if i==0:
        continue
    else:
        if A[i] == A[i-1] + 1:
            score += C[A[i-1]-1]
print(sum(B)+score)

Measured memory_bytes: 3064
import java.util.*;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashMap;

public class Main {
	
	public static HashMap<String,String> map = new HashMap<>();


	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		int e = sc.nextInt();
		int y = sc.nextInt();
		if(e == 0) {
			if(y >= 1868 && y <= 1911) System.out.println("M" + (y - 1867));
			else if(y >= 1912 && y <= 1925) System.out.println("T" + (y - 1911));
			else if(y >= 1926 && y <= 1988) System.out.println("S" + (y - 1925));
			else if(y >= 1989 && y <= 2016) System.out.println("H" + (y - 1988));
		} else if(e == 1) {
			System.out.println((y + 1867));
		} else if(e == 2) {
			System.out.println((y + 1911));
		} else if(e == 3) {
			System.out.println((y + 1925));
		} else if(e == 4) {
			System.out.println((y + 1988));
		}
	}
}

Measured memory_bytes: 26300
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <map>
#include <queue>
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;
int main() {
	int n, k;
	cin >> n >> k;
	vector<long long> a(n);
	for (int i = 0;i < n;i++) {
		cin >> a[i];
	}

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

	return 0;
}

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

#define rep(i,n) for(int i=0; i<(int)n; i++)
#define ll long long
#define all(x) (x).begin(), (x).end()

int main(){
    int a,b,c,d;
    int in;
    cin >> in;
    int num[4];
    num[0]=in%10; in/=10;
    num[1]=in%10; in/=10;
    num[2]=in%10; in/=10;
    num[3]=in;
    char op[3];


    for(int tmp=0; tmp<(1<<3); tmp++){
        int sum=num[3]; //aはいずれも加算される
        for(int i=0; i<3; i++){
            if(tmp&(1<<i)){ //+
                sum+=num[i];
                op[i]='+';
            }else{ //-
                sum-=num[i];
                op[i]='-';
            }
            
        }
        if(sum==7){
            cout << num[3];
            for(int i=2; i>=0; i--){
                cout << op[i] << num[i];
            } 
            cout << "=7" << endl;
            break;
        }
    }
}

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

// typedef
// -----------------------------------------------------------------------------
typedef long long ll;
typedef long double ld;

// container util
// -----------------------------------------------------------------------------
#define ALL(c)  (c).begin(),(c).end()
#define SZ(c) ((ll)(c).size())
#define MAX(c) *max_element(ALL(c))
#define MIN(c) *min_element(ALL(c))
#define SORT(c) sort((c).begin(),(c).end())

// repetition
// -----------------------------------------------------------------------------
#define FOR(i, a, b) for(ll i= (a); i < (ll)(b); ++i)
#define REP(i, n) FOR(i, 0, n)

// constant
// -----------------------------------------------------------------------------
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);

// debug
// -----------------------------------------------------------------------------
#define DUMP(x)  cerr << #x << " = " << (x) << endl


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(15);
    string S, T; cin >> S >> T;
    int A, B; cin >> A >> B;
    string U; cin >> U;
    if (U == S) {
        A--;
    }
    if (U == T) {
        B--;
    }
    cout << A << " " << B << "\n";
}

Measured memory_bytes: 3620
import java.util.Scanner;

public class Main {
	
	
	public static void main(String[] args) throws Exception{
		Scanner sc= new Scanner(System.in);
		String n= sc.nextLine();
		
		String n2= sc.nextLine();
		int count=0;
		for(int i=0; i<n.length(); i++) {
			if(n.charAt(i)!=n2.charAt(i))
			count++;
		}
		
		System.out.println(count);
	}
}


Measured memory_bytes: 42560
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,tune=native")
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <tuple>
#include <math.h>
#include <set>
#include <stack>
#include <bitset>
#include <map>
#include <queue>
#include <random>
#include <unordered_set>
#include <unordered_map>
//#define DEBUG
#define fi first
#define se second
#define pqueue priority_queue
#define pb(x) push_back(x)
#define all(x) x.begin(), x.end()
#define int long long
#define  mk(a, b) make_pair(a, b)
//#define x first;
//#define y second;

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ull> vull;
typedef vector<ll> vll;
typedef tuple<int, int, int> tiii;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vpii;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector< vector<int> > vvi;
typedef vector<char> vc;

const int INF = 1e9;
const ll INFLL = 1e12;
const int MOD = 1000000007;
const int MAXN = 3e5;
const ld eps = 1e-6;
const int MOD2 = 998244353;
const int dosz = 5e5;
const int SZ = (1<<18);


void fast_io(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#ifdef DEBUG
    //        freopen("a.in", "r", stdin);
#else
//        freopen("input.txt", "r", stdin);
//        freopen("output.txt", "w", stdout);
#endif
}


void solve(){
    int a, b, m;
    cin >> a >> b >> m;
    vi kek(a);
    vi lol(b);
    for(int &i:kek)
        cin >> i;
    for(int &i:lol)
        cin >> i;
    vi kek2;
    kek2 = kek;
    sort(all(kek2));
    vi lol2;
    lol2 = lol;
    sort(all(lol2));
    int ans = lol2[0] + kek2[0];
    for(int i=0; i<m; i++){
        int x, y, c;
        cin >> x >> y >> c;
        x--, y--;
        ans = min(ans, kek[x] + lol[y] - c);
    }
    cout << ans;

}

signed main() {
    fast_io();
    int q = 1;
//    cin >> q;
    while(q--){
        solve();
    }
    return 0;
}

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

//def
#define debug(x) cout << #x << ": " << x << '\n'
#define out(x) cout << x << '\n'
#define repeat(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define revrepeat(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define foreach(e, v) for (auto &e : v)
#define all(x) (x).begin(), (x).end()
#define CYES cout << "Yes" << endl
#define CNO cout << "No" << endl
#define SPC(x) cout << fixed << setprecision(x)
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, 0xff, sizeof(a))

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<ll> vl;
typedef vector<vector<ll>> vll;
typedef pair<int, int> P;
constexpr int MOD = 1e9 + 7;
constexpr int INF = __INT_MAX__;               // 2^31 - 1
constexpr long long INFLL = __LONG_LONG_MAX__; // 2^61 - 1
constexpr int MAX_N = 1e5 + 5;
constexpr double PI = acos(-1);

template <class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    string s, t;
    cin >> s >> t;
    int ans = INF;
    rep(i, s.size() - t.size() + 1) {
        int cnt = 0;
        rep(j, t.size()) {
            if (s[i + j] != t[j]) cnt++;
        }
        chmin(ans, cnt);
    }
    out(ans);

    return 0;
}


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

typedef struct P {
	int p, d;
	bool operator<(const P &r) {
		return d < r.d;
	}
} P;
int n, d[10001];
vector<P> v;

int main(){
	int p, d1, d2;
	while (cin >> n && n != 0) {
		v = vector<P>();
		for (int i = 0; i < n; i++) {
			cin >> p >> d1 >> d2;
			v.push_back({ p,d1 + d2 });
		}
		P m = v[0];
		for (int i = 1; i < v.size(); i++) {
			if (m < v[i]) {
				m = v[i];
			}
		}
		cout << m.p << " " << m.d << endl;
	}

	return 0;
}

Measured memory_bytes: 3144
#include<stdio.h>

int main(){
  int a, b;
  scanf("%d%d", &a, &b);
  int s = b - a;
  int i, j;
  for(i = 1, j = 1; j < s; i +=(++j)){
  }
  printf("%d\n", i - b);
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <set>
using namespace std;
set<int>s;
int main()
{
	int t,x;
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d",&x);
		if(s.find(x)!=s.end()) s.erase(x);
			else s.insert(x);
	}
	printf("%d\n",s.size());
}

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

using namespace std;

int main()
{
    int N, K;
    cin >> N >> K;
    double p_sum = 0;
    for (int i = 1; i <= N; i++)
    {
        if (i <= K - 1)
        {
            int x = ceil(log2((float)K / i));
            p_sum += pow(2, -x);
        }
        else
        {
            p_sum += 1.0;
        }
    }
    cout << fixed << setprecision(10) << p_sum / N << endl;
}


Measured memory_bytes: 256
#prag\
ma GCC optimize("O3")

#include <bits/stdc++.h>

using namespace std;

int n,m,dist[100005];

bool flag=true,visited[100005];

vector <int > V[100005];

inline void dfs(int x,int d)
{
	if (visited[x])
	{
		if (dist[x]!=d) flag=false;
		return;
	}
	
	visited[x]=true;
	
	dist[x]=d;
	
	for (register int i=0;i<V[x].size();i+=2)
		dfs(V[x][i],d+V[x][i+1]);
	
	return;
}

int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);

	ios::sync_with_stdio(false);

	cin>>n>>m;
	
	int l,r,d;
	 
	for (register int i=1;i<=m;++i)
	{
		cin>>l>>r>>d;
		
		V[l].push_back(r);
		V[l].push_back(d);
		V[r].push_back(l);
		V[r].push_back(-d);
	}
	
	for (register int i=1;i<=n;++i)
		if (!visited[i]) dfs(i,0);
	
	if (flag) cout<<"Yes"<<'\n'; else cout<<"No"<<'\n';
	
	return 0;
}

Measured memory_bytes: 11136
#include<bits/stdc++.h>
using namespace std;
int p[2];
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	int sum=0;
	p[0]=a;p[1]=b;p[2]=c;
	sort(p,p+3);
	cout<<p[0]+p[1]<<endl;
	//cout<<sum<<endl;
	return 0;
} 

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {
	public static void main(String[] args)throws Exception {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader (is);
		String input[] = br.readLine().split(" ");
		int count = Integer.parseInt(input[0]);
		int maxLength =  Integer.parseInt(input[1]);
		String input2[] =br.readLine().split(" ");
		ArrayList<Integer> result = new ArrayList<Integer>();
		for(int i=0; i<count; i++) {
			if(i+1 >= count) {
				break;
			}
			int num =Integer.parseInt(input2[i]);
			int num2 =Integer.parseInt(input2[i+1]);
			if(num+num2 >= maxLength) {
				for(int j=0 ; j<i;j++) {
					result.add(j+1);
				}
				for(int n=count-1 ; n>i+1;n--) {
					result.add(n);
				}
				result.add(i+1);
				System.out.println("Possible");
				for(int re:result) {
					System.out.println(re);
				}
				return;
			}
		}
		System.out.println("Impossible");
	}
}

Measured memory_bytes: 54884
import math

n, h = [int(i) for i in input().split()]
cut = [0 for _ in range(n)]
throw = [0 for _ in range(n)]
for i in range(n):
    cut[i], throw[i] = [int(i) for i in input().split()]
cut = list(reversed(sorted(cut)))
throw = list(reversed(sorted(throw)))
count = 0
for i in range(len(throw)):
    if h > 0 and throw[i] > cut[0]:
        h -= throw[i]
        count += 1
    else:
        break
if h > 0:
    print(math.ceil(h/cut[0])+count)
else:
    print(count)

Measured memory_bytes: 12584
// #include {{{
#include <array>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iterator>
#include <tuple>
#include <utility>
#include <random>
#include <limits>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cstdint>
#include <cassert>
// }}}

using namespace std;

// macros {{{
template<typename T, size_t N>
constexpr size_t NELEMS(T (&)[N]) { return N; }

template<typename InputIt>
void PRINT_RANGE(InputIt first, InputIt last)
{
    for(; first != last; ++first)
        cout << *first << (first==last ? "" : " ");
    cout << "\n";
}

template<typename T>
void PRINT_MATRIX(T mat, size_t nr, size_t nc)
{
    for(size_t r = 0; r < nr; ++r) {
        for(size_t c = 0; c < nc; ++c) {
            cout << mat[r][c] << (c==nc-1 ? "" : " ");
        }
        cout << "\n";
    }
}

#define FOR(i, start, end) for(int i = (start); i < (end); ++i)
#define REP(i, n) FOR(i, 0, n)
// }}}

// types {{{
using ll  = long long;
using ull = unsigned long long;
// }}}

constexpr ll MOD = 1000000007;

int N;
string S1, S2;

vector<int> A;

void trans()
{
    char c = S1[0];
    int len = 1;
    FOR(i, 1, N) {
        if(S1[i] == c) {
            ++len;
        }
        else {
            A.push_back(len);
            c = S1[i];
            len = 1;
        }
    }
    A.push_back(len);
}

void solve()
{
    trans();
#ifdef DEBUG
    PRINT_RANGE(begin(A), end(A));
#endif

    ll a_prev = A[0];
    ll cnt = a_prev==1 ? 3 : 6;
    for(size_t i = 1; i < A.size(); ++i) {
        ll a_curr = A[i];
        if(a_prev==1 && a_curr==1) {
            cnt *= 2;
            cnt %= MOD;
        }
        else if(a_prev==1 && a_curr==2) {
            cnt *= 2;
            cnt %= MOD;
        }
        else if(a_prev==2 && a_curr==1) {
            ;
        }
        else if(a_prev==2 && a_curr==2) {
            cnt *= 3;
            cnt %= MOD;
        }
        a_prev = a_curr;
    }

    cout << cnt << "\n";
}

int main()
{
    cin >> N;
    cin >> S1 >> S2;
    //cout << S1 << "\n" << S2 << "\n";

    solve();

    return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
long long n,k,c,d,cnt=0,hsh[100005];
int main()
{
	scanf("%lld%lld",&n,&k);
	if(k==0)
	{
		printf("%lld",n*n);
	}else
	{
		for(int i=k+1;i<=n;i++)
		{
			c=n/i;
			d=n%i;
			cnt+=(i-k)*c;
			if(d>=k)
			{
				cnt+=(d-k)+1;
			}
			//printf("%d %d\n",cnt,i);
		}
		printf("%lld",cnt);	
	}
}

Measured memory_bytes: 256
n=int(input())
A=list(map(int,input().split()))

flag=0
for a in A:
    if a%2==0:
        b=a//2
        if b%3==0 or b%5==0:
            flag+=0
        else:
            flag+=1
    else:
        flag+=0
print('DENIED' if flag else 'APPROVED')

Measured memory_bytes: 2940
#include "iostream"
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <cstring>
#include <math.h>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iomanip>
using namespace std;
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007
#define INF 1e9
int dx[4]={0,0,-1,1},dy[4]={1,-1,0,0};

int N,A,B,C,l[10];

int rec(int i, int a, int b, int c){
  if(i==N){
    if(!a || !b || !c) return INF;
    return abs(a-A)+abs(b-B)+abs(c-C);
  }

  int res=rec(i+1,a,b,c);
  res=min(res,rec(i+1,a+l[i],b,c)+(a>0 ? 10:0));
  res=min(res,rec(i+1,a,b+l[i],c)+(b>0 ? 10:0));
  res=min(res,rec(i+1,a,b,c+l[i])+(c>0 ? 10:0));

  return res;
}

int main(int argc, char const *argv[]) {

  std::cin >> N >> A >> B >> C;
  for(int i=0; i<N; i++) std::cin >> l[i];
  std::cout << rec(0,0,0,0) << '\n';

  return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
//ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
int main() {
	int H, W;
	char c;
	cin >> H >> W;
	map<char, int> mp;
	rep(i, 0, H * W) {
		c = getc(stdin);
		if (c == '\n')i--;
		else mp[c]++;
	}
	int a[4] = { 0 };
	for (auto m : mp) {
		a[m.second % 4]++;
	}
	if (W % 2 && H % 2) {
		if (a[1])a[1]--;
		else if (a[3] == 1) {
			a[2]++;
			a[3]--;
		}
	}
	if (a[1] + a[3]) {
		puts("No");
		return 0;
	}
	int k = 0;
	if (W % 2)k += H / 2;
	if (H % 2)k += W / 2;
	puts(a[2] > k ? "No" : "Yes");
	return 0;
}


Measured memory_bytes: 256
# include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
typedef long long ll;
ll n,a,b;
ll ans;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n>>a>>b;
    ans=n/(a+b) *a;
    ans+=min(n%(a+b),a);
    cout<<ans<<endl;
}

Measured memory_bytes: 256
import java.io.File;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Deque;
import java.util.Scanner;

public class Main {
 
	public static void main(String[] args) throws IOException {
		//File file = new File("input.txt");
		//Scanner sc = new Scanner(file);
		
		Scanner sc = new Scanner(System.in);
		
		int R = sc.nextInt();
		if(R < 1200) System.out.println("ABC");
		else if(R  < 2800) System.out.println("ARC");
		else System.out.println("AGC");
	}
}

Measured memory_bytes: 23764
import java.util.*;
import java.util.function.*;
import java.lang.*;
import java.io.*;


public class Main {
    static String dogName(long N){
        if(N==0) return "";
        return dogName((N-1)/26)+((char)((N-1)%26 + 'a'));
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextLong();
        System.out.println(dogName(N));
        
    }
}


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

using namespace std;

#define rep(i, n) for(int i = 0; i < (n); i++)
typedef pair<int, int> P;
typedef long long ll;
typedef unsigned long long ull;

int twice(int x){
  return x * x;
}

int tri(int x){
  return x * x * x;
}

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

  cout << a + twice(a) + tri(a) << endl;
}


Measured memory_bytes: 3624