akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main() {
	int x, a, b;
	cin >> x;
	int flag = 1;
	for (int i = -120; i <= 120; i++) {
		if (!flag) break;
		for (int j = -120; j <= 120; j++) {
			if (pow(i, 5) - pow(j, 5) == x && flag) {
				cout << i << " " << j << endl;
				flag = 0;
				break; 
			}
		}
	}
	return 0;
} 

Measured memory_bytes: 4008
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
vector<int> i;
vector<int> u;
vector<int> o;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long a=0,b,c,d=0,e=0,f=0,g;
  string s;
  cin >>a;
  b=a;
  while(1){
    d+=a%10;
    if(a<=9) break;
    a=a/10;
    f++;
  }
  e=a-1+9*f;
  cout <<max(e,d)<<'\n';
  return (0);
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <bitset>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath> // 変数名にy1が使えなくなるかも…。
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <limits>
#include <string>

typedef __int128_t int128_t;
std::istream &operator>>(std::istream& input, int128_t& value) { // int128_tの入力。入力が64bitに収まる前提。
    long long tmp; input >> tmp; value = tmp;
    return input;
}
std::ostream &operator<<(std::ostream& output, const int128_t value) { // int128_tの出力。出力が64bitに収まる前提。
    output << (long long)value;
    return output;
}

const int MAX_N = 100050;
const int MAX_M = 100050;
int N, M;
int128_t X[MAX_N];

main(int argc, char **argv) {
    std::cin >> N >> M;
    for (int i = 1; i <= M; i++) {
        std::cin >> X[i];
    }

    std::sort(X + 1, X + 1 + M);

    std::vector<int128_t> vec;

    for (int i = 1; i < M; i++) {
        vec.push_back(X[i+1] - X[i]);
    }

    std::sort(vec.begin(), vec.end());

    int128_t ret = 0;
    for (int i = 0; i < M - N; i++) {
        ret += vec[i];
    }

    std::cout << ret << std::endl;

}

Measured memory_bytes: 3956
#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);


int n = 0, max_h = 0;
vector<int> h;

void solve() {
    ll ans = 0;
    while (max_h != 0) {
        int max_h_n = 0;
        rep(i, h.size()) {
            bool has_h = false;
            while (i < h.size() && h[i] == max_h) {
                has_h = true;
                h[i]--;
                max_h_n = max(h[i], max_h_n);
                i++;
            }
            max_h_n = max(h[i], max_h_n);
            if (has_h) ans++;
        }
        max_h = max_h_n;
    }
    cout << ans << endl;
}

int main() {
    cin >> n;
    h.resize(n);
    rep(i, n) {
        cin >> h[i];
        max_h = max(h[i], max_h);
    }
    solve();
    return 0;
}

Measured memory_bytes: 256
#define NDEBUG

#include <unordered_map>
#include <functional>
#include <algorithm>
#include <iostream>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <utility>
#include <random>
#include <string>
#include <vector>
#include <cmath>
#include <stack>
#include <queue>
#include <tuple>
#include <set>
#include <map>

// [0, max)
#define FOR0(var, max) for (sl (var) = 0; (var) < (max); ++(var))
// [min, max)
#define FORi(var, min, max) for (sl (var) = (min); (var) < (max); ++(var))
// [min, max)
#define FORi_INV(var, min, max) for (sl (var) = (max) - 1; (var) + 1 > (min); --(var))

#define FORITER(var, iter) for (auto (iter) = (var).begin(); (iter) != (var).end(); (iter)++)
#define FORITER_INV(var, iter) for (auto (iter) = (var).rbegin(); (iter) != (var).rend(); (iter)++)

// a < b < c
#define LTLT(a, b, c) (((a) < (b)) && ((b) < (c)))
// a <= b < c
#define LELT(a, b, c) (((a) <= (b)) && ((b) < (c)))
// a < b <= c
#define LTLE(a, b, c) (((a) < (b)) && ((b) <= (c)))
// a <= b <= c
#define LELE(a, b, c) (((a) <= (b)) && ((b) <= (c)))

#ifndef NDEBUG
#  define MASSERT(cond) m_assert(cond, __LINE__, #cond);
#else
#  define MASSERT(...)
#endif

using namespace std;

using uc = unsigned char;
using ui = unsigned int;
using ul = unsigned long long int;
using ull = __uint128_t;

using sc = signed char;
using si = signed int;
using sl = signed long long int;
using sll = __int128_t;

using ld = long double;

void m_assert(const bool& cond, const sl& line, const char *condstr) {
  if (!cond) {
    cerr << "Assertion Failed: " << condstr << " at line " << line << endl;
    exit(1);
  }
}

namespace std {
  template <>
  struct is_integral<__int128_t> {
    constexpr static bool value = true;
  };
};

static sl A, B, C;

void solve(void) {
  vector<sl> x {A, B, C};
  sort(x.begin(), x.end());
  if (x[0] == x[2]) {
    cout << "No" << endl;
  } else if (x[0] == x[1] || x[1] == x[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

int main(void) {
  cin >> A >> B >> C;
  solve();
  return 0;
}

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

typedef long long int ll;
typedef pair<ll, ll> p_ll;
typedef vector<pair<ll, ll>> vec_p; //vector<pair<ll, ll>> pairs(n) ,pairs.at(i) = make_pair(i*i, i)

const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;
const int INF = pow(2, 30) - 1;

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

    ll A,B;
    cin >> A >> B;

    ll tmp = 0;
    for (ll i = 1; i < 100; i++)
    {
        if(i==1){
            tmp = A;
        }
        else{
            tmp += A - 1;
        }

        if(B==1){
            cout << 0 << endl;
            break;
        }
        else if(tmp>=B){
            cout << i << endl;
            break;
        }
    }
}


Measured memory_bytes: 256
/*																													   
 Templatka c++ Kacper Fis																							   																											   //
*/																													  
																								   
#include <bits/stdc++.h>																							   
																													   
using namespace std; 																								   
																													   
const int INF = 1000000001;																						   
const float PI = 3.14;																								   
typedef long long LL;																								   
																													   
typedef vector<int> vi;																								   
typedef list<int> li;																								   
typedef queue<int> qi; 																								   
typedef pair<int,int> ii; 																							   
typedef map<string,int> msi; //np msi['nazwa'] = 'liczba'															   
typedef vector<ii> vii; //vector par<int>, do tworzenia tablicy dla grafów wagowych #dijkstra #Bellman_Ford			   
typedef priority_queue< ii, vector<ii>, greater<ii> > pq; //kolejka priorytetowa vectorów par(top()=min) #dijkstra	   
																													   																				   
vector<ii>::iterator iter;																							   
																													   																				   
#define print_list(x) for(it = (x).begin(); it != (x).end(); it++) {cout << *it << " ";}							   
#define print_vector(x) for(it2 = (x).begin(); it2 != (x).end(); it2++) {cout << *it2 << " ";}						   
#define search_list(x) for(it = (x).begin(); it != (x).end(); it++)													   
#define search_vector(x) for(it2 = (x).begin(); it2 != (x).end(); it2++);											   
#define pb(x) push_back(x) 																							   
#define pf(x) push_front(x)																							   
#define mp(x, y) make_pair(x, y)                                                                                       
///////////////////////////////////////////////GLOBAL DEFINITIONS////////////////////////////////////////////////////////



///////////////////////////////////////////////////FUNCTIONS/////////////////////////////////////////////////////////////



/////////////////////////////////////////////////////MAIN////////////////////////////////////////////////////////////////
int main(int argc, char* argv[])																					 
{ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);                  												       
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    
   int p, q, r;
   cin >> p >> q >> r;
   
   int one = p + q;
   int two = p + r;
   int three = q + r; 
   
   cout << min(one, min(two, three));
   
   
   
   
	
	
	
    
 
 
 
	
	
	
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = s, i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = s, i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = s; i < (n); ++i)
#define VFORS(i, s, n) for(int i = s; i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = s, i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = s, i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end());

using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;
using VD = vector<double>;
using VLL = vector<ll>;
using VS = vector<string>;

const int MOD = 1000000007;
const int INF = 1000000000;

template<class T>
bool chmax(T &a, const T &b){
    if(a < b){
        a = b; return true;
    }
    return false;
}
template<class T>
bool chmin(T &a, const T &b){
    if(b < a){
        a = b; return true;
    }
    return false;
}


int main(){
    int n; cin >> n;
    vector<int> num(3);
    ll ans = 1;
    REP(i, n){
        int a; cin >> a;
        int cnt = 0;
        int id = -1;
        REP(j, 3){
            if(a == num[j]){
                ++cnt;
                if(id < 0) id = j;
            }
        }
        if(!cnt){
            cout << 0 << "\n";
            return 0;
        }
        ans = ans * cnt % MOD;
        ++num[id];
    }

    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<string>
using namespace std;
int main(){
    string str;
    string name;
    string new_str;
    int m =0;
    int h =0;
    cin >> str;
    while(str != "-"){
   
    cin >> m;
    for(int i=0;i<m;i++){
        cin >> h;
        
        str = str.substr(h,str.size()-h)+str.substr(0,h);
        }
        cout << str << endl;
        cin >> str;
    }
    return 0;
}


Measured memory_bytes: 3224
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine().Split().Select(z => int.Parse(z)).ToArray();
            int n = line[0], k = line[1];

            var cArray = Console.ReadLine().ToCharArray();

            cArray[k - 1] = Convert.ToChar(cArray[k - 1].ToString().ToLower());

            Console.WriteLine(new string(cArray));
        }

    }
}


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

const long long INF = 1e7 + 1;
const long long MOD = 1000000007;
const long double PI = 3.14159265;

#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); ++i)
#define RFOR(i,n,r) for(ll i = (ll)(n-1); i >= r; --i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,n,0)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()

#define cout cout << setprecision(12)

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using vi = vector<ll>;
using vvi = vector<vi>;
using vp = vector<pair<ll, ll>>;
using vs = vector<string>;
using vc = vector<char>;
using lst = list<ll>;
using pq = priority_queue<ll>;

template < typename T >
inline void dbg(T a) { cout << a << ' '; }

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

/*--------------------template--------------------*/

int main() {
    cin >> s;
	if(s=="AAA"||s=="BBB"){
    cout << "No" << endl;
    }else{
    dbg("Yes");
    }
}


Measured memory_bytes: 256
#include <string>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
int n,h[100005];
ll dp[100005];
#define ALL(v)  (v).begin(),(v).end()
std::set<int> st;
//#define MAX(a,b) if(a>b)
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))

    /*  ペア関連
    //vector<pair<long long, long long> > pairs(N);
    for(long long i=0; i<N; i++){
        long long a, b;
        cin >> a >> b;
        pairs[i] = make_pair(a, b);
    }
    
    //sort(pairs.begin(), pairs.end(),greater<pair<int,int> >());
	sort(pairs.begin(), pairs.end());
    */

 	//stack<int> sta;   
    //queue<int> que;


int main(){
	
	long long N,M,K;
	string s;
    long long sum,sum1;
	sum=0;
	sum1=0;
	int flg,flg1,cnt,cnt1;
	flg=0;
	flg1=0;
	cnt=0;
	cnt1=0;
	long long max;
	int max1;
	max=0;
	max1=0;
	int min;
	int min1;
	min=INF;
	min1=INF;

	int work1,work2,work3,work4;
	work1=0;
	work2=0;
	work3=0;
	work4=0;
    
	std::cin >> N;
    //std::cin >> N >> M;
    //std::cin >> N >> M >> K;
    
	std::vector<long long> v(N);
	//std::vector<long long> w(N);
    //std::cin >> s;
    
    
    // 配列入力1
    
    for(long long i=0; i<N; i++){
		std::cin >> v[i];
	}
	
	// 配列入力2
	/*
	for(long long i=0; i<N; i++){
		std::cin >> w[i];
	}
	*/
    
	//min=1000007;
	//通常
	for(long long j=1; j<N; j++){
    for(long long i=0; i<N; i++){
		if(i<j){
			sum+=v[i];
		}
		else{
			sum1+=v[i];
		}
		
		
	}
	if(min>abs(sum-sum1)){
		min=abs(sum-sum1);
	}
	sum=0;
	sum1=0;
	}
	

	//文字列入力
	/*
	for(long long i=0; i<s.length(); i++){
		
		if(s[i]!='1'){
	}
	*/

	
	
	//ソート
    //std::sort(v.begin(),v.end());//昇順ソート
    //std::sort(v.begin(),v.end(),std::greater<long long>());//降順ソート
    //std::sort(w.begin(),w.end());//昇順ソート
    //std::sort(w.begin(),w.end(),std::greater<long long>());//降順ソート
    /*
    
    //S.substr(i, 5);
    //S.size();
    
    for(long long i=0; i<N; i++){
		std::cin >> v[i];
		if(st.find(v[i])==st.end()){
			st.insert(v[i]);
		}
		else{
			st.erase(v[i]);
		}
	}
	*/


	/*
	int a[4];
	int value;
	value=0;
	
	a[0] = (value % 10); 
	value /= 10;// 1桁目を取り出す
	a[1] = (value % 10); 
	value /= 10;// 2桁目を取り出す
	a[2] = (value % 10); 
	value /= 10;// 3桁目を取り出す
	a[3] = (value % 10); 
	value /= 10;// 4桁目を取り出す
    work1=a[0]+10*a[1];
    work2=a[2]+10*a[3];
    */
	
	
    if(1){
    	printf("%d",min);
    	//printf("%lld",N);
    	//puts("Yes");
    	//printf("%d",st.size());
    	//文字列の出力
    	//std::cout << s << std::endl;
    	//printf("%.12f\n",ret);
    	//cout << sum << endl;
	}
	else{
		//puts("No");
	}
	return 0;
}


Measured memory_bytes: 256
A,B,K = map(int,input().split())

sub1 = [i for i in range(A,A+K)]
sub2 = [i for i in range(B-K+1,B+1)]
sub = set(sub1) | set(sub2)
sub = sorted(sub)
for i in sub:
    if A<= i <= B:
        print(i)

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

using namespace std;

#define _int64 long long

vector<pair<int,int> > a[110000];
int p[110000];
int used[110000];
int v[110000];
int sz[110000];

int main()
{
  int i,j,n,x,y,z,r,mi,b1;
  vector<int> q;
  _int64 ans;
  scanf("%d",&n);
  for (i=0;i<n;i++)
    a[i].clear();
  for (i=0;i+1<n;i++)
  {
    scanf("%d%d%d",&x,&y,&z);
    x--;y--;
    a[x].push_back(make_pair(y,z));
    a[y].push_back(make_pair(x,z));
  }
  memset(used,0,sizeof(used));
  q.clear();
  q.push_back(0);
  used[0]=1;
  p[0]=-1;
  for (i=0;i<q.size();i++)
  {
    x=q[i];
    for (j=0;j<a[x].size();j++)
    {
      y=a[x][j].first;
      if (used[y]==0)
      {
        used[y]=1;
        p[y]=x;
        q.push_back(y);
        v[y]=a[x][j].second;
      }
    }
  }
  for (i=q.size()-1;i>=0;i--)
  {
    x=q[i];
    sz[x]=1;
    for (j=0;j<a[x].size();j++)
    {
      y=a[x][j].first;
      if (y!=p[x])
        sz[x]+=sz[y];
    }
  }
  r=0;
  b1=1;
  while (b1==1)
  {
    b1=0;
    for (i=0;i<a[r].size();i++)
    {
      y=a[r][i].first;
      if (sz[y]+sz[y]-1>=n)
      {
        //cout<<sz[y]<<" "<<n<<endl;
        b1=1;
        p[r]=y;
        v[r]=v[y];
        p[y]=-1;
        v[y]=0;
        sz[r]-=sz[y];
        sz[y]=n;
        r=y;
        break;
      }
    }
    //if (i==a[r].size()) break;
  }
  //cout<<r<<endl;
  ans=0;
  for (i=0;i<n;i++)
  {
    if (i==r) continue;
    ans+=(_int64)sz[i]*v[i]*2;
  }
  //cout<<ans<<endl;
  mi=2000000000;
  for (i=0;i<a[r].size();i++)
  {
    if (sz[a[r][i].first]+sz[a[r][i].first]==n)
    {
      mi=a[r][i].second;
      break;
    }
    if (a[r][i].second<mi) mi=a[r][i].second;
  }
  //cout<<mi<<endl;
  ans-=mi;
  printf("%lld\n",ans);
  return 0;
}

Measured memory_bytes: 9204
import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args) throws IOException{
        Reader r = new Reader();
        String S = r.s();
        HashSet<Character> hs = new HashSet<>();
        for(char c : S.toCharArray())
            hs.add(c);
        for(char c = 'a'; c < 'z'+1; c++){
            if(!hs.contains(c)){
                println(c);
                return;
            }
        }
        println("None");
    }
    static void print(Object o){
        System.out.print(o.toString());
    }
    static void println(Object o){
        System.out.println(o.toString());
    }
    static int Int(String s){
        return Integer.parseInt(s);
    }
    static long Long(String s){
        return Long.parseLong(s);
    }
    static class Reader extends BufferedReader{
        Reader(){
            super(new InputStreamReader(System.in));
        }
        String s() throws IOException{
            return readLine();
        }
        String[] ss() throws IOException{
            return s().split(" ");
        }
        int i() throws IOException{
            return Int(s());
        }
        int[] ii() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            int[] ii = new int[size];
            for(int j = 0; j < size; j++) ii[j] = Int(ss[j]);
            return ii;
        }
        long l() throws IOException{
            return Long(s());
        }
        long[] ll() throws IOException{
            String[] ss = ss();
            int size = ss.length;
            long[] ll = new long[size];
            for(int j = 0; j < size; j++) ll[j] = Long(ss[j]);            
            return ll;
        }
    }
}

Measured memory_bytes: 25044
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    string s;
    cin >> s;
    int min = 1000;
    for(int i = 0; i <= s.size()-3; i++){
        int x = 100 * (s.at(i) - '0') + 10 * (s.at(i+1) - '0') + (s.at(i+2) - '0');
        if(abs(x - 753) < min){
            min = abs(x - 753);
        }
    }
    cout << min << endl;
    return 0;
}







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

#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;


//x^nをmodのもとで計算する
ll mod_pow(ll x, ll n, ll mod) {
  if (n == 0) return 1;
  ll res = mod_pow((x*x) % mod, n/2, mod);
  if (n & 1) res = (res*x) % mod;
  return res;
}

ll my_pow(ll x, ll n) {
  if (n == 0) return 1;
  ll res = pow(x*x, n/2);
  if (n & 1) res *= x;
  return res;
}

int main() {
  ll a, b ,c;
  cin >> a >> b >> c;
  ll K;
  cin >> K;

  ll ans = 0;
  for (int i = 0; i <= K; ++i) {
    for (int j = 0; j <= K; ++j) {
      for (int k = 0; k <= K; ++k) {
        if (i+j+k == K) {
          ans = max(ans, a*my_pow(2, i) + b*my_pow(2,j) + c*my_pow(2,k));
        }
      }
    }
  }
  
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,N) for(int i = 0; i < (N); i++)
#define erep(i,N) for(int i = N - 1; i >= 0; i--)
const ll INF = 1000000000;
const ll MOD = 1000000007;
const ld PI = (acos(-1));
using Graph = vector<vector<int>>;
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;}
typedef pair<int, int> P;
typedef pair<ll,ll> PLL;
double rad(double a) {return a * 180 / PI;}

struct UnionFind {
    //自身が親であれば、その集合に属する頂点数に-1を掛けたもの
    //そうでなければ親のid
    vector<int> r;
 
    UnionFind(int N) {
        r = vector<int>(N, -1);
    }
 
    int root(int x) {
        if (r[x] < 0) return x;
        return r[x] = root(r[x]);
    }
 
    bool unite(int x, int y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (r[x] > r[y]) swap(x, y);
        r[x] += r[y];
        r[y] = x;
        return true;
    }
 
    int size(int x) {
        return -r[root(x)];
    }
};

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

//dpTable
int dp[100050];

int main(){
    int N,M;
    cin >> N >> M;
    UnionFind UF(N);
    for (int i = 0; i < M; i++) {
        int A,B;
        cin >> A >> B;
        UF.unite(A - 1,B - 1);
    }

    int ans = 0;
    for (int i = 0; i < N; i++) {
        ans = max(ans,UF.size(i));
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4064
#include <bits/stdc++.h>
using namespace std;
#pragma region
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << (#x) << "] = [", _print(x)
#else
#define debug(x...)
#endif
#pragma endregion
typedef long long ll;
#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define sz(v) int((v).size())
#define int ll
#define f first
#define s second
#define mp make_pair
#define mt make_tuple
#define pb push_back

int MOD = 1e9+7;
int power(int a, int n)
{
    int res = 1;
    int now = a;
    while(n)
    {
        if (n&1)
        {
            res  = (res*now) %MOD;
        }
        n>>=1;
        now = (now*now)%MOD;
    }
    return res;
}
int inv(int a)
{
    return power(a, MOD-2);
}
int n;
vector<pair<int,int>> vp;
map<pair<int,int>, pair<int,int>> cnt;
void solve()
{
    cin>>n;
    vp.resize(n);
    forn(i, n) cin>>vp[i].f>>vp[i].s;
    int z = 0, x = 0, y = 0;
    forn(i, n)
    {
        if (!vp[i].f && !vp[i].s) ++z;
        else if (!vp[i].f) ++x;
        else if (!vp[i].s) ++y;
        else
        {
            int g = abs(__gcd(vp[i].f, vp[i].s));
            vp[i].f /= g;
            vp[i].s /= g;
            if (vp[i].f < 0)
            {
                vp[i].f *= -1;
                vp[i].s *= -1;
            }
            if (vp[i].s < 0) cnt[mp(-vp[i].s, vp[i].f)].s++;
            else cnt[vp[i]].f++;
        }
    }
    int ans = ((power(2, x) + power(2, y))%MOD - 1+MOD)%MOD;
    for(auto& it: cnt)
    {
        ans = ans * ( (power(2, it.s.f) + power(2, it.s.s))%MOD - 1+MOD) % MOD;
    }
    cout << ((ans + z - 1)% MOD + MOD)%MOD << endl;

}



signed main()
{
    int T = 1;
    ios_base::sync_with_stdio(0); cin.tie(0);
    //cin >> T;
    for(int i=1;i<=T;++i)
    {
        //cout << "Case #" << i << ": ";
        solve();
    }
    return 0;
}

Measured memory_bytes: 21776
from collections import*
n,*a=map(int,open(0).read().split())
dp=[defaultdict(lambda:-10**18)for _ in range(n)]
for i in range(n):dp[i][0]=0
for i,a in enumerate(a):
    for j in range(n//2-(n-i)//2,i//2+2):
        dp[i][j]=max(dp[i-2][j],dp[i-2][j-1]+a,dp[i-1][j])
print(dp[-1][n//2])

Measured memory_bytes: 130108
import sys
input = sys.stdin.readline

#n = int(input())
#l = list(map(int, input().split()))

'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)   
    b.append(B)'''


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n,m=map(int, input().split())


aaa=UnionFind(n)

for i in range(m):
    A, B = map(int, input().split())
    aaa.union(A-1,B-1)

#print(a)
#print(aaa)
ans=0
for i in range(n):
    if ans<aaa.size(i):
        ans=aaa.size(i)
print(ans)

Measured memory_bytes: 14640
import java.util.Arrays;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		
		int n = stdIn.nextInt();
		
		int[] dp = new int[n];
		Arrays.fill(dp, Integer.MAX_VALUE);
		
		int []h = new int[n];
		
		for(int i = 0; i < n; i++) {
			h[i] = stdIn.nextInt();
		}
		
		dp[0] = 0;
		
		for(int i = 0; i < n; i++) {
			if(i == n-2) {
				dp[i+1] = Math.min(dp[i] + Math.abs(h[i+1]-h[i]), dp[i+1]);
				break;
			}
			
			dp[i+1] = Math.min(dp[i]+Math.abs(h[i+1]-h[i]),dp[i+1]);
			dp[i+2] = Math.min(dp[i]+Math.abs(h[i+2]-h[i]),dp[i+2]);
			
		}
		System.out.println(dp[n-1]);
		
	}

}


Measured memory_bytes: 48708
#include <bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9 + 7/*998244353*/;
const ll INF = 1LL << 60;
ll mod_pow(ll, ll, ll); ll mod_fact(ll, ll); ll mod_inv(ll, ll); ll gcd(ll, ll); ll lcm(ll, ll);
//
using P = pair<ll, ll>;
int main(){
    int x;
    cin >> x;
    if(x>=30) cout <<"Yes";
    else cout << "No";
}


Measured memory_bytes: 3636
#include <iostream>
using namespace std;
int main()
{
	long long n,i,a[101];
	cin>>n;
	a[0]=2;
	a[1]=1;
	for (i=2;i<=n;i++) a[i]=a[i-1]+a[i-2];
	cout<<a[n];
	return 0;
}

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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define ALL(a) a.begin(),a.end()
#define INIT(a,b) memset(a,b,sizeof(a))
using lint = long long int;

class Combination {
private:
    const int N;
    const lint MOD;
    std::vector<lint> fact, inv;
    
    lint powmod(lint x, lint k) {
        lint res = 1;
        while (k) {
            if (k & 1) res = (res * x) % MOD;
            x = (x * x) % MOD;
            k >>= 1;
        }
        return res;
    }
    
    void precomputation() {
        fact[0] = fact[1] = 1;
        for (int i=2; i<=N; ++i) fact[i] = (fact[i-1] * i) % MOD;
        for (int i=0; i<=N; ++i) inv[i] = powmod(fact[i], MOD-2);
    }
    
public:
    Combination(int N, lint MOD) : N(N), MOD(MOD), fact(N + 1), inv(N + 1) {
        precomputation();
    }
    
    lint compute(int n, int k, bool duplicate = false) {
        if (duplicate) return compute(n+k-1, k);
        if (n < k) return 0;
        lint res = fact[n];
        res = (res * inv[n-k]) % MOD;
        res = (res * inv[k]) % MOD;
        return res;
    }
};

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

    const lint MOD = lint(1e9) + 7;
    Combination comb(N * M, MOD);

    auto func = [&](int X, int Y) {
        lint ret = 0;
        for_(d,1,X) {
            lint add = ((X - d) * Y * Y) % MOD;
            add = (d * add) % MOD;
            ret = (ret + add) % MOD;
        }
        return ret;
    };

    lint ans = (func(N, M) + func(M, N)) % MOD;
    ans = (ans * comb.compute(N * M - 2, K - 2)) % MOD;
    cout << ans << endl;
}

Measured memory_bytes: 3328
#pragma region _head

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<iomanip>
#include<queue>
#include<stack>
#include<numeric>
#include<utility>
#include<regex>

#pragma region _define

#define f(i,a,b) for(int i=a;i<b;i++)
#define f_vI(v,n) f(i,0,n)cin>>v[i]
#define f_v2I(v1,v2,n) f(i,0,n)cin>>v1[i]>>v2[i]
#define f_v3I(v1,v2,v3,n) f(i,0,n)cin>>v1[i]>>v2[i]>>v3[i]
#define f_vO(v,n) f(i,0,n)cout<<v[i]<<endl
#define all(a) a.begin(),a.end()
#define size(s) s.size()
#define check() cout<<"! ! !"
#define endl "\n"
#define _y() cout<<"Yes"<<endl
#define _Y() cout<<"YES"<<endl
#define _n() cout<<"No"<<endl
#define _N() cout<<"NO"<<endl

#pragma endregion

#pragma region _using

using namespace std;

using LL = long long;
using st = string;
using vi = vector<LL>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vc = vector<char>;
using vs = vector<st>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using si = stack<LL>;
using ss = stack<st>;
using pi = pair<LL, LL>;
using v_pi = vector<pi>;

#pragma endregion

#pragma region _graph

#define node 50  //グラフの最大位数　適宜変更
//bool graph[node][node]; bool visited[node] = { false };
#define link(a,b,m) f(i,0,m){cin>>a[i]>>b[i]; a[i]--; b[i]--; graph[a[i]][b[i]]=graph[b[i]][a[i]]=true;}

#pragma endregion

LL gcd(LL a, LL b) {
	LL r;
	while ((r = a % b) != 0) {
		a = b;
		b = r;
	}
	return b;
}
LL lcm(LL a, LL b) {
	return (a / gcd(a, b) * b);
}

//階乗計算
LL factorial(LL n) {
	LL a = 1, ret = 1;
	while (a < n) {
		a++;
		ret *= a;
		//ret %= 1000000007;
	}
	return ret;
}

#pragma endregion 

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

	int n, k;
	cin >> n >> k;
	vi a(n), b(n, 0);
	f(i, 0, n) {
		cin >> a[i];
		b[a[i] - 1]++;
	}
	int c = size(b);
	sort(all(b));
	int i = 0;
	LL ans = 0;
	while (c > k) {
		ans += b[i];
		b[i] = 0;
		c--;
		i++;
	}
	cout << ans;
	return 0;
}

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

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

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

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

const int MOD =(int)1e9+7;
const int MAX =510000;
ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0||k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}
bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second < b.second;
    }
}

vector<pair<int,ll>> vec[100000];
ll cost[100000];
void dfs(int now,ll COST){
    cost[now]=COST;
    int next;
    REP(i,vec[now].size()){
        next=vec[now][i].first;
        if(cost[next]<0){
            dfs(next,COST+vec[now][i].second);
        }
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll N=in<ll>();
    ll n;n=0;
    n=sqrt(N);
    for(ll i=n+1;i--;i>0){
        if(N%i==0){
            ll ans;ans=(i-1)+(N/i-1);
            cout<<ans<<endl;
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 3584
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main(void){
  long l0 = 2;
  long l1 = 1;
  long l2 = 3;
  int n;
  cin >> n;
  if(n == 0){
    cout << l0;
    return 0;
  }
  if(n==1){
    cout << l1;
    return 0;
  }
  for(int i=2;i<n;i++){
    l0 = l1;
    l1 = l2;
    l2 = l0 + l1;
  }

  cout << l2;
  return 0;
}

Measured memory_bytes: 256
// Author: 23forever
#include <bits/stdc++.h>
#define pii pair<int, int>
#define mp make_pair
#define fi first
#define se second
typedef long long LL;
const int MAXN = 100;
const int MAXM = 100000;
using namespace std;

inline int read() {
  int x = 0, w = 1;
  char c = ' ';

  while (c < '0' || c > '9') {
    c = getchar();
    if (c == '-') w = -1;
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }

  return x * w;
}

int n, m, w[MAXN + 5], v[MAXN + 5]; 
LL dp[MAXM + 5];

void init() {
  n = read();
  m = read();
  for (int i = 1; i <= n; ++i) {
    w[i] = read();
    v[i] = read();
  }
}

int main() {
#ifdef forever23
  freopen("test.in", "r", stdin);
  //freopen("test.out", "w", stdout);
#endif
  init();

  for (int i = 1; i <= n; ++i) {
    for (int j = m; j >= w[i]; --j) {
      dp[j] = max(dp[j], dp[j - w[i]] + v[i]);
    }
  }
  
  printf("%lld\n", dp[m]);
  return 0;
}

Measured memory_bytes: 1024
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let m = get!(i32);
    println!("{}", 48 - m);
}

Measured memory_bytes: 2112
/*
ID: learnin7
TASK: test
LANG: C++                 
*/
/* LANG can be C++11 or C++14 for those more recent releases */
#include<bits/stdc++.h>

/*  Macros from Endagorion */
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;


int main(){
        
    ios_base::sync_with_stdio(0);
    
    //ofstream fout ("test.out");
    //ifstream fin ("test.in");
    //fin >> a >> b;
    //fout << a+b << endl;
    string s;
    cin>>s;
    int cnt_a=0, cnt_b=0;
    for(int i=0;i<s.length();i++){
        if(s[i]=='A')   cnt_a++;
        else if(s[i]=='B')  cnt_b++;
    }
    if(min(cnt_a,cnt_b)>0)  cout<<"Yes\n";
    else                    cout<<"No\n";
    return 0;
}



Measured memory_bytes: 256
import bisect
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 10**9+7
for i in range(2**N):
    card = [[],[]]
    num = []
    iii = i
    for j in range(N):
        if i&1:
            num.append(B[j])
            card[(j+1)%2].append(j)
        else:
            num.append(A[j])
            card[(j)%2].append(j)
        i >>= 1
    if len(card[1]) != N//2:
        continue
    card[0].sort(key=lambda x:[num[x],x])
    card[1].sort(key=lambda x:[num[x],x])
    hoge = []
    for i in range(N):
        hoge.append(card[i%2][i//2])
    flag = True
    for i in range(N-1):
        if num[hoge[i]] > num[hoge[i+1]]:
            flag = False
    if flag:
        huga = []
        count = 0
        for i in range(N):
            l = bisect.bisect_left(huga,hoge[i])
            huga.insert(l,hoge[i])
            count += i-l
        if count < ans:
            ans = count
if ans >= 10**9:
    print(-1)
else:
    print(ans)

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

class union_find {
	vector<int> par;
	vector<int> rank;
	int find(int a) {
		return par[a] < 0 ? a : par[a] = find(par[a]);
	}
public:
	union_find(int n) : par(n, -1), rank(n, 1) {}
	bool same(int a, int b) {
		return find(a) == find(b);
	}
	void unite(int a, int b) {
		a = find(a);
		b = find(b);
		if (a == b) return;
		if (rank[a] > rank[b]) {
			par[a] += par[b];
			par[b] = a;
		}
		else {
			par[b] += par[a];
			par[a] = b;
			if (rank[a] == rank[b]) rank[b]++;
		}
	}
	int size(int a) {
		return -par[find(a)];
	}
};

int main()
{
	ios::sync_with_stdio(false), cin.tie(0);
	int n, q;
	cin >> n >> q;
	union_find uf(n);
	while (q--) {
		int com, x, y;
		cin >> com >> x >> y;
		if (com == 0) {
			uf.unite(x, y);
		}
		else {
			printf("%d\n", uf.same(x, y));
		}
	}
	return 0;
}



Measured memory_bytes: 3328
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class TwoSwitches {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int a = in.nextInt();
            int b = in.nextInt();
            int c = in.nextInt();
            int d = in.nextInt();
            if (d <= b && d > a) {
                out.println(d - Math.max(a, c));
            } else if (b < d && b > c) {
                out.println(b - Math.max(a, c));
            } else {
                out.println(0);
            }
        }

    }

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

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

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

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

    }
}



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

// https://apc001.contest.atcoder.jp/tasks/apc001_b
int main(){
	
	long long n;
	cin>>n;
	long long a[n+1],b[n+1], sa=0, sb=0, k,t=0;
	for(int i=1; i<=n; i++){
		cin>>a[i];
		sa+=a[i];
	}
	for(int i=1; i<=n; i++){
		cin>>b[i];
		sb+=b[i];
	}
	k=sb-sa;
	if(k<0){
		cout<<"No"<<endl;
		return 0;
	}
	//cout<<k<<endl;
	for(int i=1; i<=n; i++){
		if(a[i]<b[i]){
			t+=ceil((b[i]-a[i])/2.0);
			//cout<<t<<" ";
		}
	}
	if(t<=k){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
void alert(vector<int> vec){
  int64_t N = vec.size();
  for(int i=0; i<N-1; i++) cout << vec.at(i) << " ";
  cout << vec.at(N-1) << endl;
}

int main(){
  int64_t K, N;
  cin >> K >> N;
  vector<int64_t> A(N);
  for(int64_t i=0; i<N; i++) cin >> A.at(i);
  vector<int64_t> d(N);
  for(int64_t i=0; i<N-1; i++){
    d.at(i) = A.at(i+1) - A.at(i);
  }
  d.at(N-1) = K-A.at(N-1) + A.at(0);
  sort(d.begin(), d.end());
  cout << K - d.at(N-1) << endl;
}

Measured memory_bytes: 3328
#include<iostream>

int hit=0,blow=0;
char r[5],a[5];

bool exist(char c, char *s){
	for(int i=0; i<4; i++)
		if(c == s[i])
			return true;
	return false;
}

void check(){
	for(int i=0; i<4; i++){
		if(r[i] == a[i])
			hit++;
		else if(exist(r[i],a))
			blow++;
	}
}

int main(){
	while(true){
		std::cin >> r >> a;
		if(r[0] == '0' && a[0] == '0')
			return 0;
		check();
		std::cout << hit << ' ' << blow << std::endl;
		hit = 0;
		blow = 0;
	}
}

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

// nCr mod p(n<p)をキビキビ計算する
// 構築:O(n), クエリ:O(1)
struct combination_mod {
    using lint = long long int;
    int sz;
    lint mod;
    vector<lint> fac;
    vector<lint> finv;
    combination_mod(int _sz, lint _mod) : sz(_sz), mod(_mod) {
        fac.assign(sz + 1, 1);
        finv.assign(sz + 1, 1);
        vector<lint> inv(sz + 1, 1);
        for (int i = 2; i <= sz; i++) {
            fac[i] = fac[i - 1] * i % mod;
            inv[i] = mod - inv[mod % i] * (mod / i) % mod;
            finv[i] = finv[i - 1] * inv[i] % mod;
        }
    }
    lint query(int n, int r) {
        return fac[n] * (finv[r] * finv[n - r] % mod) % mod;
    }
};

lint s;
lint mod = 1e9 + 7;

int main() {
    cin >> s;
    combination_mod comb(2 * s, mod);
    lint ans = 0;
    for (lint i = 1; (s - 3 * i) >= 0; i++) {
        lint add = comb.query(s - 2 * i - 1, i - 1);
        ans = (ans + add) % mod;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3668
#include<stdio.h>
#include<stdlib.h> 
int main () {
    int a;
    int b;
    do{
      scanf("%d",&a);
      scanf("%d",&b);
    /*  if(b<=a||a<0||b<0||499500<=a||499500<=b){
        exit(0);
      }*/
    }while(b<=a||a<0||b<0||499500<=a||499500<=b);
    int h = b-a;
    int ta;
    for(int i=0;i<h;i++){
      ta+=i;
    }
    printf("%d",(ta-a));
}

Measured memory_bytes: 128
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {
	private final static int FIVE = 5;
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		List<Integer> numbers = new ArrayList<Integer>();
		for(int count = 0; count < FIVE; count++) {
			numbers.add(sc.nextInt());
		}

		Collections.sort(numbers);


		for(int count = FIVE - 1; count >= 0; count--) {
			if(count != 0) {
				System.out.print(numbers.get(count) + " ");
			} else {
				System.out.println(numbers.get(count));
			}
		}

	}

}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
using V = vector<ll>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i, n) for(ll i=1;i<=(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define MOD 1000000007
#define INF 1000000000

void solve_abc_c() {
	ll n, m;
	ll ans = 0;
	//float ans = 0;
	cin >> n >> m;

	V h(n);
	rep(i, n) cin >> h[i];

	vector<V> hv(n);
	ll a, b;
	rep(i, m) {
		cin >> a >> b;
		hv[a - 1].push_back(b - 1);
		hv[b - 1].push_back(a - 1);
	}

	ll me, you;
	bool high;
	rep(i, n) {
		me = h[i];
		high = true;
		rep(j, hv[i].size()) {
			you = h[hv[i][j]];
			if (you >= me) {
				high = false;
				break;
			}
		}
		if (high) ans++;
	}

	cout << ans << "\n";
}

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed;
	//cout << setprecision(7);

	solve_abc_c();

	return 0;
}


Measured memory_bytes: 9808
#include <algorithm>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
const int INF = 1 << 25;
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};

int main() {
  int H, W, K;
  while (cin >> H >> W >> K) {
    vector<string> A(H);
    for (int i = 0; i < H; i++) {
      cin >> A[i];
    }
    int sy, sx;
    for (int i = 0; i < H; i++) {
      for (int j = 0; j < W; j++) {
        if (A[i][j] == 'S') {
          sy = i;
          sx = j;
        }
      }
    }
    vector<vector<int>> dist(H, vector<int>(W, INF));
    queue<pair<int, int>> q;
    q.emplace(sy, sx);
    dist[sy][sx] = 0;
    int res = INF;
    while (!q.empty()) {
      auto p = q.front();
      q.pop();
      int y = p.first, x = p.second;
      int cost = 1 + (min({y, H - y - 1, x, W - x - 1}) + K - 1) / K;
      res = min(res, cost);
      if (dist[y][x] >= K) {
        continue;
      }
      for (int i = 0; i < 4; i++) {
        int ny = y + dy[i], nx = x + dx[i];
        if (ny < 0 || ny >= H || nx < 0 || nx >= W || A[ny][nx] == '#') {
          continue;
        }
        if (dist[ny][nx] <= dist[y][x] + 1) {
          continue;
        }
        dist[ny][nx] = dist[y][x] + 1;
        q.emplace(ny, nx);
      }
    }
    cout << res << endl;
  }
  return 0;
}


Measured memory_bytes: 3584