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

int main(){
  int W,H;
  cin >> H >> W;
  vector<vector<char>> Board(H,vector<char>(W));
  for(int i = 0; i < H; ++i){
    for(int j = 0; j < W; ++j){
      cin >> Board.at(i).at(j);
    }
  }
  bool flag;
  for(int i = 0; i < H; ++i){
    flag = true;
    for(int j = 0; j < W; ++j){
      flag = (flag && (Board.at(i).at(j)=='.'));
    }
    if(flag){
      //cout << "H" << i << endl; //for debug
      for(int j = 0; j < W; ++j){
        Board.at(i).at(j) = 'e';
      }
    }
  }
  for(int i = 0; i < W; ++i){
    flag = true;
    for(int j = 0; j < H; ++j){
      flag = (flag && ( (Board.at(j).at(i) == '.') || (Board.at(j).at(i) == 'e') ) );
    }
    if(flag){
      //cout << "W" << i << endl; //for debug
      for(int j = 0; j < H; ++j){
        Board.at(j).at(i) = 'e';
      }
    }
  }
  
  bool end = true;
  for(int i = 0; i < H; ++i){
    end = false;
    for(int j = 0; j < W; ++j){
      if(Board.at(i).at(j) != 'e') {
        cout << Board.at(i).at(j);
        end = true;
      }
    }
    if(end) cout << endl;
  }
}

Measured memory_bytes: 256
import java.io.InputStream
import java.io.PrintStream
import java.util.*

class Abc085C(
    val input: InputStream,
    val output: PrintStream
) {
    /**
     * 1000 ≤ Y ≤ 200,000,000
     */
    fun proc() {
        val sc = Scanner(input)
        val N = sc.nextInt()
        val Y = sc.nextInt()

        val xn = Math.min(N, Y / 10000)
        for (x in xn downTo 0) {
            if (x * 10000 > Y) {
                continue
            }

            val yn = Math.min(N - x, Y / 5000)
            for (y in yn downTo 0) {
                if (x * 10000 + y * 5000 > Y) {
                    continue
                }

                val zn = Math.min(N - x - y, Y / 1000)
                for (z in zn downTo 0) {
                    if (x + y + z != N) {
                        continue
                    }

                    if (x * 10000 + y * 5000 + z * 1000 == Y) {
                        output.print("$x $y $z")
                        return
                    }
                }
            }
        }
        output.print("-1 -1 -1")
    }
}

fun main(args: Array<String>) {
    Abc085C(System.`in`, System.out).proc()
}


Measured memory_bytes: 31132
# 前の回答が気に食わなかったのでもう一回

N = int(input())
A = list(map(int, input().split()))
A.sort()

for i, a in enumerate(A):
    if N % 2 == 0:
        if a != i // 2 * 2 + 1:
            print(0)
            exit()
    else:
        if a != (i + 1) // 2 * 2:
            print(0)
            exit()

print(pow(2, N // 2, 10 ** 9 + 7))

Measured memory_bytes: 14008
n = int(input())
H = list(map(int, input().split()))

dp = [0]*(10**5)
dp[0] = 0
dp[1] = abs(H[0]-H[1])

for i in range(2, n):
    dp[i] = min(dp[i-1]+abs(H[i]-H[i-1]), dp[i-2]+abs(H[i]-H[i-2]))

print(dp[n-1])


Measured memory_bytes: 13924
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;
typedef pair<int,int> P;
const int INF=-2000000000;
int main() {
  int n,m;
  cin >> n >> m;
  if(n==m) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <cmath>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <stack>
#include <unordered_map>
#include <utility>
#include <vector>

// Aliases
using i32 = int32_t;
using i64 = int64_t;
using u32 = uint32_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;

using std::cout;
using std::cerr;
using std::cin;
using std::endl;
template <class T>
using vector = std::vector<T>;
template <class T, u64 N>
using array = std::array<T, N>;
template <class T>
constexpr T inf = std::numeric_limits<T>::max();
template <class T>
constexpr T neg_inf = -std::numeric_limits<T>::max();
template <class T>
constexpr T pi = static_cast<T>(3.141592653589793);

template <class T = i64>
vector<T> read_vector(const u64 n)
{
    vector<T> vec;
    vec.reserve(n);
    for (u64 i = 0; i < n; i++)
    {
        T v;
        cin >> v;
        vec.emplace_back(v);
    }

    return vec;
}

template <class T>
void print(const vector<T>& vec, const bool new_line = false)
{
    const u64 n = vec.size(); 
    if (new_line)
    {
        for (u64 i = 0; i < n; i++)
        {
            cout << vec[i];
            if (i != n - 1) { cout << '\n'; }
        }
    }
    else
    {
        for (u64 i = 0; i < n; i++)
        {
            cout << vec[i];
            if (i != n - 1) { cout << ' '; }
        }
    }

    cout << endl;
}

int main()
{
    std::string s;
    cin >> s;
    if (s == "Sunny") { cout << "Cloudy" << endl; }
    else if (s == "Cloudy") { cout << "Rainy" << endl; }
    else if (s == "Rainy") { cout << "Sunny" << endl; }
    return 0;
}


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

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;

int main(){

    int n;
    cin >> n;

    vector<int> h(n);
    for(int i = 0; i < n; i++){
        cin >> h[i];
    }
    int ans = 1;
    int max_h = h[0];
    for(int i = 1; i < n; i++){
        if((h[i] >= h[i-1]) && (max_h <= h[i])) ans++;
        max_h = max(max_h, h[i]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define per(i, a, b) for(int i = (b) - 1; i >= (a); --i)
#define sz(a) (int)a.size()
#define de(c) cout << #c << " = " << c << endl
#define dd(c) cout << #c << " = " << c << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef double db;
typedef pair<int, int> pii;
typedef vector<int> vi;

typedef db T;
const db eps = 1e-9 , pi = acosl(-1.);
int sgn(T x){return (x>eps)-(x<-eps);}
struct P{
  T x,y; P(){} P(T x,T y):x(x),y(y){}
  P operator - (const P&b) const {return P(x-b.x,y-b.y);}
  P operator + (const P&b) const {return P(x+b.x,y+b.y);}
  T operator * (const P&b) const {return x*b.x+y*b.y;}
  T operator / (const P&b) const {return x*b.y-y*b.x;}
  P operator * (const T&k) const {return P(x*k,y*k);}
  P operator / (const T&k) const {return P(x/k,y/k);}
};
T norm(P a){return a*a;}
P proj(P p,P a,P b){return (b-a)*((p-a)*(b-a)/norm(b-a))+a;}
P reflect(P p,P a,P b){return proj(p,a,b)*2-p;}
T cross(P o,P a,P b){return (a-o)/(b-o);}
int crossOp(P o,P a,P b){return sgn(cross(o,a,b));}
bool onPS(P p,P s,P t){return sgn((t-s)/(p-s))==0&&sgn((p-s)*(p-t))<=0;}

P a, b, c;

int main() {
	std::ios::sync_with_stdio(0);
	std::cin.tie(0);
	cin >> a.x >> a.y >> b.x >> b.y;
	int q;
	cin >> q;
	cout << setiosflags(ios::fixed);
	cout << setprecision(10);
	while(q--) {
		cin >> c.x >> c.y;
		int t = crossOp(a, b, c);
		if(t > 0) {
			cout << "COUNTER_CLOCKWISE" << endl;
		} else if(t < 0) {
			cout << "CLOCKWISE" << endl;
		} else {
			if(onPS(c, a, b)) {
				cout << "ON_SEGMENT" << endl;
			} else if(onPS(b, a, c)) {
				cout << "ONLINE_FRONT" << endl;
			} else {
				cout << "ONLINE_BACK" << endl;
			}
		}
	}
	return 0;
}


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

int main() {
  int N, K;
  cin >> N >> K;
  if (N<1 || N>10 || K<1 || K>10){
    return 0;
  }

  int min = INT_MAX;
  for(int tmp=0; tmp < (1<<N); ++tmp){
    bitset<10> s(tmp);
    int num = 1;
    for(int j=0; j<N; ++j){
      if(s.test(j)){
        num += K;
      }
      else{
        num *= 2;
      }
    }
    if(min > num){
      min = num;
    }
  }
  cout << min << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(void)
{
	int n;
	cin >> n;
	int count=0;
	for(int i=1;i<=n;i++)
	{
		int l,r;
		cin >> l >> r;
		count+=r-l+1;
	}
	cout << count << endl;
}

Measured memory_bytes: 256
#include <sstream>
#include <fstream>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <stack>
#include <map>
#include <string>
#include <queue>
#include <bitset>
using namespace std;

#define int long long
#define FOR(i, a, b) for (int i = (a), _##i = (b); i <= _##i; ++i)
#define FORD(i, a, b) for (int i = (a), _##i = (b); i >= _##i; --i)
#define REP(i, a) for (int i = 0, _##i = (a); i < _##i; ++i)
#define REPD(i,n) for(int i = (n)-1; i >= 0; --i)

#define DEBUG(X) { cerr << #X << " = " << (X) << endl; }
#define PR(A, n) { cerr << #A << " = "; FOR(_, 1, n) cerr << A[_] << ' '; cerr << endl; }
#define PR0(A, n) { cerr << #A << " = "; REP(_, n) cerr << A[_] << ' '; cerr << endl; }

#define sqr(x) ((x) * (x))
#define ll long long
#define double long double
typedef pair<int, int> II;
#define PI (2 * acos((double)0))
#define __builtin_popcount __builtin_popcountll
#define SZ(x) ((int)(x).size())
#define ALL(a) (a).begin(), (a).end()
#define MS(a,x) memset(a, x, sizeof(a))
#define next ackjalscjaowjico
#define prev ajcsoua0wucckjsl
#define y1 alkscj9u20cjeijc
#define left lajcljascjljl
#define right aucouasocjolkjl
#define y0 u9cqu3jioajc

#define TWO(X) (1LL<<(X))
#define CONTAIN(S,X) ((S) & TWO(X))

double safe_sqrt(double x) { return sqrt(max((double)0.0, x)); }
int GI(int& x) { return scanf("%lld", &x); }

const int MN = 100111;

int n;
int visited[11][MN];
vector<int> ke[MN];

struct Query {
    int u, d, col;

    void read() {
        cin >> u >> d >> col;
    }
} queries[MN];

int32_t main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout << (fixed) << setprecision(9) << boolalpha;
    while (cin >> n) {
        FOR(i,1,n) ke[i].clear();
        memset(visited, 0, sizeof visited);

        int m; cin >> m;
        FOR(i,1,m) {
            int u, v; cin >> u >> v;
            ke[u].push_back(v);
            ke[v].push_back(u);
        }

        int q; cin >> q;
        queue<int> qu;
        queue<int> qd;
        queue<int> qc;

        FOR(i,1,q) {
            queries[i].read();
        }

        FORD(i,q,1) {
            int u = queries[i].u;
            int d = queries[i].d;
            int col = queries[i].col;

            FOR(dd,0,d) {
                if (!visited[dd][u]) {
                    visited[dd][u] = col;
                    qu.push(u);
                    qd.push(dd);
                    qc.push(col);
                }
            }
            while (!qu.empty()) {
                int u = qu.front(); qu.pop();
                int d = qd.front(); qd.pop();
                int c = qc.front(); qc.pop();
                if (d == 0) continue;

                for(int v : ke[u]) {
                    if (!visited[d-1][v]) {
                        visited[d-1][v] = c;
                        qu.push(v);
                        qd.push(d-1);
                        qc.push(c);
                    }
                }
            }

        }

        FOR(u,1,n) printf("%lld\n", visited[0][u]);
        puts("");
    }
    return 0;
}


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

int main(){
  int x;cin>>x;
  int tmp1,tmp2,ans=0;
  tmp1=x/500;
  ans+=1000*tmp1;
  x-=tmp1*500;
  tmp2=x/5;
  ans+=5*tmp2;
  cout <<ans<<endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#include<math.h>
#include<algorithm>

int main()
{
    long long int n,k,x,y,val;
    while(scanf("%lld %lld %lld %lld",&n,&k,&x,&y) != EOF){
    if(n >= k){
    val = (k*x) + ((n-k)*y);
    }
    else if(n < k){
        val = (n*x);
    }
    printf("%lld\n",val);
    }
    return 0;
}

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

using namespace std;

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

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


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

	cin >> L >> R;
	for (int i = 0; i < 61; i++) {
		if ((L >> i) & 1)H = i;
		if ((R >> i) & 1)W = i;
	}
	//cout << M << endl;
	// 1 small	2 big	3 both	 4 unused
	vector<vector<vector<long long int>>>dp(62, vector<vector<long long int>>(5, vector<long long int>(5)));
	dp[61][4][4] = 1;
	for (int i = 60; i >= 0; i--) {
		for (int j = 0; j < 2; j++) {
			for (int k = 0; k <= j; k++) {
				for (int l = 0; l < 4; l++) {
					for (int m = 0; m < 4; m++) {
						if (j && (l & 2) && !((R >> i)&1))continue;
						if (!k && (m & 1) && ((L >> i) & 1))continue;
						int nxa = l;
						int nxb = m;
						if ((l & 1) && (j && !((L >> i) & 1)))nxa ^= 1;
						if ((m & 1) && (k && !((L >> i) & 1)))nxb ^= 1;
						if ((l & 2) && (!j && ((R >> i) & 1)))nxa ^= 2;
						if ((m & 2) && (!k && ((R >> i) & 1)))nxb ^= 2;
						dp[i][nxa][nxb] += dp[i + 1][l][m];
					}
				}
			}
		}
		dp[i][4][4] += dp[i + 1][4][4];
		if (i >= H && i <= W) {
			int nx = 0;
			if (i == H)nx ^= 1;
			if (i == W)nx ^= 2;
			dp[i][nx][nx] += dp[i + 1][4][4];
		}
		for (int j = 0; j < 5; j++) {
			for (int k = 0; k < 5; k++)dp[i][j][k] %= MOD;
		}
	}
	long long int ans = 0;
	for (int i = 0; i < 5; i++) {
		for (int j = 0; j < 5; j++)ans += dp.front()[i][j];
	}
	ans -= dp.front().back().back();
	ans %= MOD;
	cout << ans << endl;
}

Measured memory_bytes: 256
<?php

$first = true;
while (TRUE) {
	list($a, $b) = explode(' ', trim(fgets(STDIN)));
	if ($a == 0 && $b == 0) {
		break;
	}
	if (!$first) {
		echo "\n";
	}
	$first = false;

	$found = false;
	for ($i = $a; $i <= $b; $i++) {
		if (isLeapYear($i)) {
			$found = true;
			echo $i . "\n";
		}
	}
	if (!$found) {
		echo "NA\n";
	}
}

function isLeapYear($y) {
	if ($y % 4 == 0) {
		if ($y % 100 == 0) {
			if ($y % 400 == 0) {
				return true;
			} else {
				return false;
			}
		} else {
			return true;
		}
	} else {
		return false;
	}

}

Measured memory_bytes: 6612
#include <bits/stdc++.h>
using namespace std;
// (setq-default c-basic-offset 2)

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

  vector<int> a(n);
  vector<int> b(n);

  for (int i = 0; i < n; ++i) {
    int ai, bi;
    cin >> ai >> bi;
    a[i] = ai;
    b[i] = bi;
  }

  int inf = 1e9;
  vector<int> dp(h + 1, inf);
  dp[0] = 0;
  for (int i = 0; i < n; ++i) {
    int value = a[i];
    int cost = b[i];
    dp[value] = min(dp[value], cost);
  }

  for (int hi = 0; hi <= h; ++hi) {
    for (int i = 0; i < n; ++i) {
      int value = a[i];
      int cost = b[i];
      // if (value + hi <= h) {
      //   dp[hi + value] = min(dp[hi + value], dp[hi] + cost);
      // }
      // if (value + hi <= h) {
      if (hi - value >= 0) {
        dp[hi] = min(dp[hi], dp[hi - value] + cost);
      } else {
        dp[hi] = min(dp[hi], cost);
      }
    }
  }

  cout << dp[h] << endl;
  // for (int el : dp) {
  //   cout << el << endl;
  // }
  return 0;
}


Measured memory_bytes: 3640
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//typedef
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//conversion
inline LL toLong(string s) {LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) LL((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

#define PUTS(x) cout << (x) << endl;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b;
    cin>>a>>b;
    if(a < b){
        REP(i,b)cout<<a;
    }
    else {
        REP(i,a)cout<<b;
    }
    PUTS("");
}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
	string s;
	cin>>s;
	int n = s.size();
	rep(i, n-1){
		if(s[i]==s[i+1]){
			cout<<i+1<<" "<<i+2<<endl;
			return 0;
		}
		if(i+2<n && s[i]==s[i+2]){
			cout<<i+1<<" "<<i+3<<endl;
			return 0;
		}
	}
	cout<<"-1 -1"<<endl;
	return 0;
}


Measured memory_bytes: 512
//Name: JAG-channel
//Level: 2
//Category: 構文解析,実装
//Note:

/**
 * 最初にスレッドツリーを作成してからフォーマットする。
 * ある行の表示を決めるために必要な情報は
 * ・その行の深さ
 * ・それより浅い深さで、兄弟をもつノードが存在するときの深さ（|を出力するために必要）
 * したがって、最初にスレッドツリーを作る段階であるノードが兄弟をもつかを判定しておき、
 * どこに|を出力する必要があるかどうかを管理しながらDFS順でたどって出力すればよい。
 */
#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
#include <stack>

using namespace std;

struct Node {
    string message;
    int depth;
    vector<Node*> children;
    bool has_sibiling;

    Node(const string &m, int depth) : message(m), depth(depth), has_sibiling(false) {}

    void add_child(Node *n) {
        if(children.size() > 0) children.back()->has_sibiling = true;
        children.push_back(n);
    }

    void print(unordered_map<int,int> &bars) {
        for(int i = 0; i < depth-1; ++i) {
            if(bars[i+1] > 0) cout << '|';
            else cout << ' ';
        }
        if(depth > 0) cout << '+';
        cout << message << endl;
        if(has_sibiling) bars[depth]++;
        for(Node *n : children) {
            n->print(bars);
        }
        if(has_sibiling) bars[depth]--;
    }
};

bool solve() {
    int N;
    if(!(cin >> N)) return false;
    if(!N) return false;

    vector<Node*> roots;
    stack<Node*> stk;
    for(int i = 0; i < N; ++i) {
        string str;
        cin >> str;
        int depth = 0;
        while(str[depth] == '.') ++depth;
        string message = str.substr(depth);
        Node *n = new Node(message, depth);
        if(depth == 0) {
            roots.push_back(n);
            stk.push(n);
        } else {
            while(stk.top()->depth != depth-1) stk.pop();
            stk.top()->add_child(n);
            stk.push(n);
        }
    }
    for(Node *n : roots) {
        unordered_map<int,int> bars;
        n->print(bars);
    }
    return true;
}

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

    while(solve()) ;
    return 0;
}

Measured memory_bytes: 8640
<?php
// Your code here!
$number =trim(fgets(STDIN));
$maxNumber=1;

//maxNumber が大きくなったら処理を終了する
 while($number>$maxNumber){
  $maxNumber*=2;
 }
 
 if($number<$maxNumber){
    $maxNumber/=2; 
 }
 
 echo $maxNumber;
?>

Measured memory_bytes: 3576
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <math.h>
#include <vector>
#include <algorithm>
using namespace std;
 
int main(){
	int h, w;
	cin >> h >> w;
	vector<int> cnt(h + w - 1, 0);
 
	for(int i = 0; i < h; i++){
		for(int j = 0; j < w; j++){
			char a;
			cin >> a;
			if(a == '#') cnt[i + j]++;
			if(cnt[i + j] > 1){
				cout << "Impossible" << endl;
				return 0;
			}
		}
	}
	cout << "Possible" << endl;
 
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define brep(index,num) for(int index=num-1;index>=0;index--)
#define brep1(index,num) for(int index=num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int N;
	string S;
	scan(N>>S);
	if(N%2) prin("No");
	else{
		int flag=1;
		rep(i,N/2){
			if(S[i]!=S[i+N/2]) flag=0;
		}
		if(flag) prin("Yes");
		else prin("No");
	}
	return 0;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
A.sort()
countlist = []
tmp = 0
for i in range(0, N):
	if A[i] != tmp:
		countlist.append([A[i], 0])
		tmp = A[i]
	countlist[-1][1] += 1
sum = 0
for i in range(0, len(countlist)):
	if countlist[i][1] < countlist[i][0]: sum += countlist[i][1]
	else: sum += countlist[i][1] - countlist[i][0]
print(sum)

Measured memory_bytes: 70824
from heapq import heappop,heappush
N,M=map(int,input().split())
A=[int(i) for i in input().split()]
table=[]
for i in range(N):
    table.append((A[i],1))
for i in range(M):
    b,c=map(int,input().split())
    table.append((c,b))
table=sorted(table)
#print(table)
s=N
ans=0
while s>0:
    #print(ans,s)
    c,b=table.pop()
    if b>=s:
        ans+=c*s
        break
    ans+=b*c
    s-=b
print(ans)




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

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

typedef long long ll;

const int INF = 1 << 30;
const ll LLINF = 1LL << 62;

int mod = 1000000007;

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int e[3]; rep(i, 3) cin >> e[i];
    sort(e, e+3);
    cout << e[0]*e[1]/2 << endl;
    return 0;
}

Measured memory_bytes: 3596
PROGRAM piyo
      IMPLICIT NONE
      INTEGER,PARAMETER :: p = 8
      integer(p) :: x,y,z ,n, ans, temp, table(1:10**4)=0,i
      
      read*,n
      
      do x = 1,100
      do y = 1,100
      do z = 1,100
        temp = x**2 + y**2 + z**2 + x*y + y*z + z*x
        if( temp>10**4) cycle
        table(temp) = table(temp) + 1
      end do
      end do
      end do
      
      do i = 1,n
        print'(i0)', table(i)
      end do
      
      
      stop
      !debugg
      
      
      
      END PROGRAM

Measured memory_bytes: 2788
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
lint ans;

vector<lint> enum_divisors(lint N) {
    vector<lint> res;
    for (lint i = 1; i * i <= N; ++i) {
        if (N % i == 0) {
            res.push_back(i);
            if (N/i != i) res.push_back(N/i);
        }
    }
    sort(res.begin(), res.end());
    return res;
}

signed main(){
  lint N; cin >> N;
  vector<lint> num = enum_divisors(N);
  lint ans = 0;
  for(lint i = 0; i < num.size(); i++){
    lint x = N / num[i];
    if(num[i] > x + 1) ans += (num[i] - 1);
  }
  cout << ans << endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
using namespace std;
#define MOD 1000000007

int main(){
    int N;
    cin >> N;
    vector<vector<long long>> a(N, vector<long long>(N));
    for(int i=0; i<N; i++)
        for(int j=0; j<N; j++)
            cin >> a[i][j];


    vector<long long> b(1<<N);
    for(int i=0; i<(1<<N); i++){
        long long x = 0;
        for(int j=0; j<N; j++)
            for(int k=j+1; k<N; k++)
                if((i&(1<<j)) && (i&(1<<k)))
                    x += a[j][k];
        b[i] = x;
    }

    for(int i=0; i<(1<<N); i++){
        for(int j=i; j>0; j=i&(j-1)){
            int k = i^j;
            b[i] = max(b[i], b[j]+b[k]);
        }
    }
    cout << b[(1<<N)-1] << endl;
    return 0;
}

Measured memory_bytes: 768
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <stdio.h>

#include <sstream>
#include <algorithm>
#include <iterator>
#include <cmath>
#include <complex>

#include <string>
#include <cstring>
#include <vector>
#include <bitset>

#include <queue>
#include <set>
#include <map>
#include <stack>
#include <list>

#include <ctime>
////
//#include <random>//
/////////

typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;

////定数
const int INF = (int)1e9 + 10;
const LL MOD = (LL)1e9 + 7;
const LL LINF = (LL)4e18 + 20;
const LD PI = acos(-1.0);
const double EPS = 1e-9; 
/////////
using namespace::std;
//////////////

void solve() {
	int X;
	cin >> X;
	LL ans = 0;
	ans += (X / 500) * 1000;
	X %= 500;
	ans += (X / 5) * 5;
	cout << ans << endl;
}

signed main(void) {
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	std::cout << std::fixed;//小数を10進数表示
	cout << setprecision(16);//小数点以下の桁数を指定//coutとcerrで別	

	solve();
}


Measured memory_bytes: 256
#include<stdio.h>

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

int main()
{
	int a,b;
	scanf("%d%d",&a,&b);
	printf("%d\n", gcd(a,b));
	return 0;
}

Measured memory_bytes: 592
#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)++)

int main()
{
    ll a; cin >> a;
    ll ans = a + pow(a, 2) + pow(a, 3);
    cout << ans << endl;

 
    




}


Measured memory_bytes: 4060
/*
         ██╗ ██████╗ ██╗███╗   ██╗    ██╗   ██╗███████╗
         ██║██╔═══██╗██║████╗  ██║    ██║   ██║██╔════╝
         ██║██║   ██║██║██╔██╗ ██║    ██║   ██║███████╗
    ██   ██║██║   ██║██║██║╚██╗██║    ██║   ██║╚════██║
    ╚█████╔╝╚██████╔╝██║██║ ╚████║    ╚██████╔╝███████║
     ╚════╝  ╚═════╝ ╚═╝╚═╝  ╚═══╝     ╚═════╝ ╚══════╝
*/
//password:+BdCHpO8dQvpo5fnV3/u
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;
const int maxn = 5e5 + 5;
const int inf = 0x3f3f3f3f;
int f[5050][5050];
int main() {
     string a,b;
     cin>>a>>b;
     for(int i=1;i<=a.size();i++)
     {
          for(int j=1;j<=b.size();j++)
          {
               if(a[i-1]==b[j-1]) f[i][j]=f[i-1][j-1]+1;
               else f[i][j]=max(f[i-1][j],f[i][j-1]);
          }
     }
     // cout<<f[a.size()][b.size()];
     string s="";
     int r=a.size(),c=b.size();
     while(f[r][c])
     {
          if(f[r][c]==f[r-1][c]) r--;
          else if(f[r][c]==f[r][c-1]) c--;
          else {
               s.insert(0,string(1,a[r-1]));
               r--;
               c--;
          }
     }
     cout<<s<<endl;
     return 0;
}

Measured memory_bytes: 59264
S = input()
K = int(input())


# digit DP
def digit_dp(S,K):
    L = len(S)
    # dp[i][0] = 今のところぴったり
    # dp[i][1] = すでにSより小さいと確定している
    dp = [[[0 for k in range(K+1)] for j in range(2)] for i in range(L+1)]
    dp[0][0][0] = 1

    for i in range(L):
        D = int(S[i])
        for j in range(2):
            for d in range((9 if j else D)+1):
                for k in range(K+1):
                    if d != 0:
                        if k == K:
                            continue
                        dp[i+1][j or d<D][k+1] += dp[i][j][k]
                    else:
                        dp[i+1][j or d<D][k] += dp[i][j][k]

    return dp[L][0][K] + dp[L][1][K]         # 非負整数の数え上げ(0を含む)

print(digit_dp(S,K))


Measured memory_bytes: 3064
import java.util.*;
     
    class Main{
    	public static void main(String[] args){
    		Scanner sc=new Scanner(System.in);
    		int a=sc.nextInt();
    		if(a==1){
    			System.out.println("Hello World");
    		}
    		else{
    			System.out.println((sc.nextInt()+sc.nextInt()));
    		}
    	}
    }

Measured memory_bytes: 21716
import java.util.*;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] a = new int[n];
    int[] b = new int[n];
    int[] c = new int[n-1];
    int num =0;
    int sum = 0;
    for(int i=0;i<n;i++){
      a[i] = sc.nextInt();
    }
    for(int j=0;j<n;j++){
      sum += sc.nextInt();
    }
    for(int k=0;k<n-1;k++){
      c[k] = sc.nextInt();
    }
    for(int l=0;l<n-1;l++){
      if(a[l]+1 == a[l+1])
      { num = a[l]-1 ;
        sum += c[num];
      }
    }
    System.out.println(sum);
  }
}

Measured memory_bytes: 24020
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
const ll INF = 1145141919;
const ll MOD = 1000000007;
template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
template<class T> void chmin(T &a, const T &b){if(a > b){a = b;}}

int main(){

    ll N;
    cin >> N;
    ll T[100];
    ll ans = 0;
    rep(i, N)cin >> T[i];
    for(ll i = 0; i < N; i++){
        for(ll j = 0; j < i; j++)ans += T[i] * T[j];
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <algorithm>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const int c=1300000;
bool prime[c+1];
vector<int> pr;
void makeprime(){
	rep(i,c+1) prime[i]=1;
	prime[0]=0,prime[1]=0;
	for(int i=2;i+i<=c;i++) if(prime[i]) for(int j=2;j*i<=c;j++) prime[i*j]=0;
	rep(i,c+1) if(prime[i]) pr.push_back(i);
}
int main(){
	makeprime();
	while(true){
		int n;
		scanf("%d",&n);
		if(!n) break;
		if(prime[n]){
			printf("0\n");
			continue;
		}
		printf("%d\n",pr[upper_bound(pr.begin(),pr.end(),n)-pr.begin()]-pr[upper_bound(pr.begin(),pr.end(),n)-pr.begin()-1]);
	}
}

Measured memory_bytes: 2704
#include<iostream>
#include<string>
#include<vector>
#include<math.h>
#include<cmath>
#include<stack>
#include <algorithm>
#include <functional>
//#include<stdlib.h>
using namespace std;
int main() {
	int n, m, a = 0;
	cin >> n >> m; vector<int>x(m); vector<int>l(m - 1);
	if (m == 1) { a = 0; }
	else
	{
		for (int i = 0; i < m; i++)
		{
			cin >> x[i];
		}
		std::sort(x.begin(), x.end());
		for (int i = 0; i < m - 1; i++)
		{
			l[i] = x[i + 1] - x[i];
		}
		std::sort(l.begin(), l.end());
		for (int i = 0; i < m  - n; i++)
		{
			a += l[i];
		}
	}
	cout << a;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define range(a) a.begin(), a.end()

constexpr int MOD = 1000000007;

class mint {
  int n;
public:
  mint(int n_ = 0) : n(n_) {}
  explicit operator int() { return n; }
  friend mint operator-(mint a) { return -a.n + MOD * (a.n != 0); }
  friend mint operator+(mint a, mint b) { int x = a.n + b.n; return x - (x >= MOD) * MOD; }
  friend mint operator-(mint a, mint b) { int x = a.n - b.n; return x + (x < 0) * MOD; }
  friend mint operator*(mint a, mint b) { return (long long)a.n * b.n % MOD; }
  friend mint &operator+=(mint &a, mint b) { return a = a + b; }
  friend mint &operator-=(mint &a, mint b) { return a = a - b; }
  friend mint &operator*=(mint &a, mint b) { return a = a * b; }
  friend bool operator==(mint a, mint b) { return a.n == b.n; }
  friend bool operator!=(mint a, mint b) { return a.n != b.n; }
  friend istream &operator>>(istream &i, mint &a) { return i >> a.n; }
  friend ostream &operator<<(ostream &o, mint a) { return o << a.n; }

  friend mint modpow(mint a, long long b) {
    mint res = 1;
    while (b > 0) {
      if (b & 1) res *= a;
      a *= a;
      b >>= 1;
    }
    return res;
  }

  friend mint modinv(mint n) {
    int a = (int)n, b = MOD;
    int s = 1, t = 0;
    while (b != 0) {
      int q = a / b;
      a -= q * b;
      s -= q * t;
      swap(a, b);
      swap(s, t);
    }
    return s >= 0 ? s : s + MOD;
  }

  friend mint operator/(mint a, mint b) { return a * modinv(b); }
  friend mint &operator/=(mint &a, mint b) { return a = a / b; }
};

mint mpow(mint a, long long b) {
  mint res = 1;
  while (b > 0) {
    if (b & 1) res *= a;
    a *= a;
    b >>= 1;
  }
  return res;
}

vector<mint> F_{1, 1}, R_{1, 1}, I_{0, 1};

void check_fact(int n) {
  for (int i = I_.size(); i <= n; i++) {
    I_.push_back(I_[MOD % i] * (MOD - MOD / i));
    F_.push_back(F_[i - 1] * i);
    R_.push_back(R_[i - 1] * I_[i]);
  }
}

mint I(int n) { check_fact(n); return n < 0 ? 0 : I_[n]; }
mint F(int n) { check_fact(n); return n < 0 ? 0 : F_[n]; }
mint R(int n) { check_fact(n); return n < 0 ? 0 : R_[n]; }
mint C(int n, int r) { return F(n) * R(n - r) * R(r); }
mint P(int n, int r) { return F(n) * R(n - r); }
mint H(int n, int r) { return n == 0 ? (r == 0) : C(n + r - 1, r); }

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int N; cin >> N;
  vector<int> A(N); rep(i, N) cin >> A[i];
  sort(range(A), greater<>());
  mint ans;
  rep(i, N) {
    ans += A[i] * (i * mpow(2, i - 1) + mpow(2, i)) * mpow(2, N - i - 1);
  }
  ans *= mpow(2, N);
  cout << ans << endl;
}


Measured memory_bytes: 1024
//It doesn't matter as long as you rise to the top - Katsuki Bakugo
#include<bits/stdc++.h>
using namespace std;
     
     
#define Fast_as_duck ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define pb push_back 
#define forn(i,st,n) for(int i = st; i < n ; i++)
#define rev(i,st,n) for(int i = st; i >= n ; i--)
#define ss second
#define ff first
#define ll long long 

typedef pair <int , int> pii;

const int N = 1e5 + 10 , mod =  1000000007;

void solve(){

    int n; cin >> n;
   if(n >= 30){
    cout << "Yes\n";
   }else cout << "No\n";


    
    

    
    
        


}

int main(){
    Fast_as_duck;

/*
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
*/
    int t = 1; 
    
    // cin >> t;
    

    while(t--){
        solve();
    }




    return 0;
}
      
       


Measured memory_bytes: 3640
import java.util.*;
import java.io.*;

 public class Main{
// taking inputs
static BufferedReader s1;
static BufferedWriter out;
static String read() throws IOException{String line="";while(line.length()==0){line=s1.readLine();continue;}return line;}
static int int_v (String s1){return Integer.parseInt(s1);}
static long long_v(String s1){return Long.parseLong(s1);}
static int[] int_arr() throws IOException{String[] a=read().split(" ");int[] b=new int[a.length];for(int i=0;i<a.length;i++){b[i]=int_v(a[i]);}return b;}
static long[] long_arr() throws IOException{String[] a=read().split(" ");long[] b=new long[a.length];for(int i=0;i<a.length;i++){b[i]=long_v(a[i]);}return b;}
static void assign(){s1=new BufferedReader(new InputStreamReader(System.in));out=new BufferedWriter(new OutputStreamWriter(System.out));}

//......................................@uthor_Alx..............................................


   public static void main(String[] args) throws  IOException{
	        		  assign();
	        		  //aint n=int_v(read());
	        		  String s=read();
	        		  if(s.equals("ABC")){out.write("ARC");}
	        		  else{out.write("ABC");}
	        	
	        		// if(n[0]>0){out.write("Yes");}
	        		 //else{out.write("No");}
                      out.flush();
	        		 
	}
}
	       
	          



	
  





Measured memory_bytes: 32588
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <string.h>

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()

typedef long long lint;

using namespace std;

int main(){
  int N;
  cin>>N;
  cout<<(1000-N%1000)%1000<<endl;
  return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
const auto start_time = std::chrono::high_resolution_clock::now();
void timecalculater(){
    #ifndef ONLINE_JUDGE
    auto end_time = std::chrono::high_resolution_clock::now();
    std::chrono::duration<double> diff = end_time-start_time;
    cerr<<"Time Taken : "<<diff.count()<<"\n";
    #endif
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
#define fastio  cin.sync_with_stdio(0); cin.tie(0);cin.exceptions(cin.failbit);
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repA(i, a, n) for(int  i = a; i <= (n); ++i)
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x).size()
#define fill(a,v) memset(a, v, sizeof(a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long int> vll;
typedef vector<pii> vii;
ll p=998244353;
const int N=2e5+5;
int main() {
   
    fastio;
    int T=1;
    // cin>>T;
    while(T--){
        ll a,b,c,d;cin>>a>>b>>c>>d;
        ll dp[c+1][d+1];
        fill(dp,0);
        dp[a][b]=1;
        for(ll i=a;i<=c;i++){
            for(ll j=b;j<=d;j++){
                if(i==a&&j==b)continue;
                ll x=i;ll y=j;
                dp[i][j]=x*dp[i][j-1]+y*dp[i-1][j];
                dp[i][j]%=p;
                ll temp=((x-1)*(y-1))*dp[i-1][j-1];temp%=p;
                dp[i][j]-=(temp);
                dp[i][j]+=p;dp[i][j]%=p;
            }
        }
        cout<<dp[c][d];
    }   
    timecalculater();
    return 0;   
} 

Measured memory_bytes: 73940
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
typedef long long int lli;
const lli inf = 1e18;

int dfs(int node, int depth, vector<int> &div, vector<bool> &used, vector<vector<int> > &adj){
	//cerr << "dfs " << node << endl;
	if(used[node]) return 0;
	used[node] = true;
	div[depth] = max(div[depth], (int)adj[node].size()-1);
	int res = 0;
	for(int i=0; i<(int)adj[node].size(); i++){
		res = max(res, dfs(adj[node][i], depth+1, div, used, adj) );
	}
	return res+1;
}

int main(){
	int n;
	cin >> n;
	vector<vector<int> > adj(n);
	vector<vector<int> > edge(n-1);
	for(int i=0; i<n-1; i++){
		int a,b;
		cin >> a >> b;
		a--; b--;
		adj[a].push_back(b);
		adj[b].push_back(a);
		edge[i].push_back(a);
		edge[i].push_back(b);
	}
	
	lli mincol = inf;
	lli minleaf = inf;
	//頂点について
	for(int i=0; i<n; i++){
		//cerr << "i " << i << endl;
		vector<int> div(n, 0);
		int depth = 0;
		int dir = adj[i].size();
		for(int j=0; j<dir; j++){
			//cerr << "j " << j << endl;
			vector<bool> used(n, false);
			used[i] = true;
			depth = max(depth, dfs(adj[i][j], 0, div, used, adj) );
		}
		if(depth +1 <= mincol){
			lli leaf = dir;
			for(int k=0; k<depth-1; k++){
				leaf *= div[k];
			}
			if(depth +1 == mincol){
				minleaf = min(minleaf, leaf);
			}
			if(depth +1 < mincol){
				mincol = depth+1;
				minleaf = leaf;
			}
		}
	}
	//辺について
	for(int i=0; i<n-1; i++){
		vector<int> div(n, 0);
		int depth = 0;
		int dir = 2;
		for(int j=0; j<2; j++){
			vector<bool> used(n, false);
			used[edge[i][1-j]] = true;
			depth = max(depth, dfs(edge[i][j], 0, div, used, adj));
		}
		if(depth <= mincol){
			lli leaf = dir;
			for(int k=0; k<depth-1; k++){
				leaf *= div[k];
			}
			if(depth == mincol){
				minleaf = min(minleaf, leaf);
			}
			if(depth < mincol){
				mincol = depth;
				minleaf = leaf;
			}
		}
	}
	
	cout << mincol << " " << minleaf << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
using namespace std;
int main(void){
  int N;
  long long a, b;
  cin >> N >> a >> b;
  int x[N];
  long long count = 0;
  
  for (int i = 0; i < N; ++i) {
  scanf("%d", &x[i]);
	}
  for (int i= 0; i< N-1; ++i){
    count += min(a*(x[i+1] -x[i]), b);
  }
  cout << count << endl;
}
  
  

Measured memory_bytes: 764
#include<iostream>
#include<sstream>
#include<ios>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<string>
#include<numeric>
#include<set>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using vi = vector<int>;
using vl = vector<long>;
using vc = vector<char>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
using vpii = vector<pii>;

int main(){
  long N, K;
  cin >> N >> K;
  vl A(N), F(N);
  rep(i, N) cin >> A[i];
  rep(i, N) cin >> F[i];

  stable_sort(A.begin(), A.end());
  stable_sort(F.begin(), F.end(), greater<long>());

  long left = 0, right = 0;

  rep(i, N) right = max(right, A[i]*F[i]);

  long ans = 0;

  while(left <= right){
    long mid = left + (right - left) / 2;
    long cnt = 0;

    rep(i, N){
      if(A[i]*F[i] > mid) cnt += (A[i]*F[i] - mid - 1) / F[i] + 1;
    }

    if(cnt > K){
      left = mid + 1;
    }
    else{
      ans = mid;
      right = mid - 1;
    }
  }

  cout << ans << endl;
  
  return 0;
}

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

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

  if((a+b)%2==0){
    int k = (a+b)/2;
    cout << k << endl;
  }
  else cout << "IMPOSSIBLE" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b;
	cin>>a>>b;
	int c;
	if(a>=10) {
	cout<<b;
	return 0;
	}
	else 
	{
		cout<<b+100*(10-a);
		return 0;
	}
	return 0;
 } 

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
const int dx[]={1,0,-1,0,1,-1,-1,1}; 
const int dy[]={0,1,0,-1,1,1,-1,-1}; 
const int INF = 1e9; 
const long long LINF = 1e18; 
const double EPS = 1e-8; 
#define pb emplace_back 
#define mk make_pair 
#define fr first 
#define sc second 
#define ll long long 
#define reps(i,j,k) for(int i = (j); i < (k); ++i) 
#define rep(i,j) reps(i,0,j) 
#define all(a) (a).begin(),(a).end() 
#define MOD 1000000007 
typedef pair<int,int> Pii; 
typedef vector<int> vi; 
typedef pair<string, int> Psi; 
typedef pair<ll, ll> Pll;

int main(){
	int K;
	while(cin >> K,K){
		int C = K*(K-1)/2;
		int sum = 0;
		rep(i,C){
			int tmp;
			cin >> tmp;
			sum += tmp;
		}
		cout << sum/(K-1) << endl;
	}

	return 0;
}

Measured memory_bytes: 3068
package main

import "fmt"

func main() {

	var s, p string
	fmt.Scan(&s,&p)
	s += s
	rs := []rune(s)
	rp := []rune(p)

	for i:=0; i<len(rs)/2+1; i++ {
		flag := 1
		for j:=0; j<len(rp); j++ {
			if rp[j]==rs[i+j] {
				flag *= 1
			} else {
				flag *= 0
			}
		}
		if flag==1 {
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
	return
}


Measured memory_bytes: 1188
A,B = map(int,input().split())
if A==1:
    C = [["." for _ in range(100)] for _ in range(100)]
    cnt = 0
    flag=0
    for i in range(0,100,2):
        for j in range(0,100,2):
            C[i][j] = "#"
            cnt += 1
            if cnt==B:
                flag = 1
                break
        if flag==1:
            break
elif B==1:
    C = [["#" for _ in range(100)] for _ in range(100)]
    cnt = 0
    flag = 0
    for i in range(0,100,2):
        for j in range(0,100,2):
            C[i][j] = "."
            cnt += 1
            if cnt==A:
                flag = 1
                break
        if flag==1:
            break
else:
    C = [["." for _ in range(100)] for _ in range(100)]
    for i in range(50,100):
        for j in range(100):
            C[i][j] = "#"
    for i in range(1,49):
        for j in range(1,99):
            C[i][j] = "#"
    cnt = 0
    flag = 0
    for i in range(2,47,2):
        for j in range(2,97,2):
            if cnt==A-2:
                flag = 1
                break
            C[i][j] = "."
            cnt += 1
        if flag==1:break
    for i in range(51,99):
        for j in range(1,99):
            C[i][j] = "."
    cnt = 0
    flag = 0
    for i in range(52,97,2):
        for j in range(2,97,2):
            if cnt==B-2:
                flag = 1
                break
            C[i][j] = "#"
            cnt += 1
        if flag==1:break
print(100,100)
for i in range(100):
    print("".join(C[i]))
    

Measured memory_bytes: 39152
#include<bits/stdc++.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
using ll = long long;
int main(){
    std::string s;
    cin >> s;
    int max=0,count=0;
    for(int i=0;i < s.length();i++){
        if(s[i]=='A'||s[i]=='T'||s[i]=='C'||s[i]=='G')
        {
            count++;
        }
        else{
            if(max < count){
                max=count;
            }
            count=0;
        }
        
    }
    if(max < count){
                max=count;
            }
    cout << max << endl;
    return 0;
}

Measured memory_bytes: 256