akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
#define N 500000 + 5

int n, Go[N][3], Deg[N], Dp[N], q[N];
char s[N];
LL sum;

int main()
{
	scanf("%s", s + 1);
	n = strlen(s + 1) + 1;
	for (int i = 0; i < n - 1; i ++)
	{
		if (s[i + 1] == '<')
			Go[i][++ Go[i][0]] = i + 1, Deg[i + 1] ++;
		else Go[i + 1][++ Go[i + 1][0]] = i, Deg[i] ++;
	}
	int l = 1, r = 0;
	for (int i = 0; i < n; i ++)
		if (!Deg[i])
			q[++ r] = i;
	while (l <= r)
	{
		int z = q[l ++];
		for (int i = 1; i <= Go[z][0]; i ++)
		{
			int d = Go[z][i];
			Dp[d] = max(Dp[d], Dp[z] + 1), Deg[d] --;
			if (!Deg[d])
				q[++ r] = d;
		}
	}
	for (int i = 0; i < n; i ++)
		sum += Dp[i];
	printf("%lld\n", sum);
	return 0;
}

Measured memory_bytes: 12416
n,a,b,c = map(int, input().split())
s = [input() for i in range(n)]
ans = []
if a+b+c == 2:
  s.append("AB")
  for k,i in enumerate(s[:-1]):
    NEXT = s[k+1]
    if i == "AB":
      if a > b:
        a-=1
        b+=1
        ans.append("B")
      elif a==b:
        if NEXT == "AB" or NEXT == "AC":
          a+=1
          b-=1
          ans.append("A")
        else:
          a-=1
          b+=1
          ans.append("B")
      else:
        a+=1
        b-=1
        ans.append("A")
    elif i == "AC":
      if a > c:
        a-= 1
        c+=1
        ans.append("C")
      elif a == c:
        if NEXT == "AB" or NEXT == "AC":
          a+=1
          c-=1
          ans.append("A")
        else:
          a-=1
          c+=1
          ans.append("C")
      else:
        a+=1
        c-=1
        ans.append("A")
    else:
      if b > c:
        b-=1
        c+=1
        ans.append("C")
      elif b==c:
        if NEXT == "AB" or NEXT == "BC":
          b+=1
          c-=1
          ans.append("B")
        else:
          b-=1
          c+=1
          ans.append("C")
      else:
        b+=1
        c-=1
        ans.append("B")
    if a == -1 or b == -1 or c == -1:
      print("No")
      exit()
else:
  for i in s:
    if i == "AB":
      if a > b:
        a-=1
        b+=1
        ans.append("B")
      else:
        a+=1
        b-=1
        ans.append("A")
    elif i == "AC":
      if a > c:
        a-= 1
        c+=1
        ans.append("C")
      else:
        a+=1
        c-=1
        ans.append("A")
    else:
      if b > c:
        b-=1
        c+=1
        ans.append("C")
      else:
        b+=1
        c-=1
        ans.append("B")
    if a == -1 or b == -1 or c == -1:
      print("No")
      exit()
print("Yes")
for i in ans:
  print(i)

Measured memory_bytes: 85952
#include<iostream>
#include<string>
#include<vector>

int main(){
    std::string S;
    std::cin >> S;
    int Q;
    std::cin >> Q;
    std::vector< int > T(Q);
    std::vector< int > F(Q);
    std::vector< char > C(Q);
    for(int i=0; i<Q; i++){
        std::cin >> T[i];
        if(T[i] == 2){
             std::cin >> F[i] >> C[i];
        }
    }
    
    std::string head, tail;
    bool reverse = false;
    
    for(int i=0; i<Q; i++){
        if(T[i] == 1){
            reverse = reverse ^ 1;
        }else{
            bool head_f = F[i] == 1;
            if(head_f ^ reverse){
                head = head + C[i];
            }else{
                tail = tail + C[i];
            }
        }
    }
    
    std::string ans;
    if(!reverse){
        for(int i=0; i<head.size(); i++){
            ans = ans + head[head.size() - i - 1];
        }
        ans = ans + S;
        ans = ans + tail;
    }else{
        for(int i=0; i<tail.size(); i++){
            ans = ans + tail[tail.size() - i - 1];
        }
        for(int i=0; i<S.size(); i++){
            ans = ans + S[S.size() - i - 1];
        }
        ans = ans + head;
    }
    std::cout << ans;
    
}


Measured memory_bytes: 3568
#include <stdio.h>
#include<string.h>
int main(){
  char s[1000],t[1000];
  scanf("%s%s",s,t);
  int lens=strlen(s),lent=strlen(t),i,j,k,ans=lent;
  for(i=0;i<(lens-lent+1);i++){
    int curans=0;
    for (j=i,k=0;(k<lent)&&(curans<ans);j++,k++)
    {
      if (s[j]!=t[k]) curans++;
    }
    if (curans<ans) ans=curans;
  }
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 1692
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    string str;
    cin>>str;
    vector<unordered_map<char,int>>arr(n);
    arr[n-1][str[n-1]]++;
    for(int i=n-2;i>=0;i--)
    {
        arr[i]=arr[i+1];
        arr[i][str[i]]++;
    }
    unordered_set<char>s;
    s.insert('R');
    s.insert('G');
    s.insert('B');
    long long ans=0;
    char a;
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(str[i]!=str[j])
            {
                for(auto it=s.begin();it!=s.end();it++)
                {
                    if(*it!=str[i] && *it!=str[j])
                    {
                        a=*it;
                        break;
                    }
                }
                if(j+1<n)
                {
                    ans+=(arr[j+1][a]);
                    if(j+(j-i)<n)
                    {
                        if(str[j+(j-i)]==a)
                        {
                            ans--;
                        }
                    }
                }
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 4172
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <algorithm>
#include <functional>
#include <deque>
#include <cctype>
#include <ctime>
#include <cstdlib>
#include <iomanip>
using namespace std;

int main(){
   int n, m, x;
   cin >> n >> m >> x;
   int a[m];
   for (int i = 0; i < m; i++) cin >> a[i];
   int l = 0, r = 0;
   for (int i = 0; i < m; i++){
      if (a[i]<x) l++;
      else r++;
   }
   cout << min(l, r) << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;

const int Maxn = 1000;
const int Maxm = 2000;

vector<int> G[Maxn + 5];

int N, M;
bool vis[Maxn + 5];
int dep[Maxn + 5], ed;
vector<int> ans;

bool DFS(int u) {
	vector<int> tmp;
	int t = -1;
	for(int i = 0; i < (int)G[u].size(); i++) {
		int v = G[u][i];
		if(dep[v] != -1) {
			if(t == -1) t = v;
			else if(dep[v] > dep[t]) t = v;
		}
		if(!vis[v]) tmp.push_back(v);
		vis[v] = true;
	}
	if(t == -1) {
		for(int i = 0; i < (int)tmp.size(); i++) {
			int v = tmp[i];
			dep[v] = dep[u] + 1;
			if(DFS(v)) {
				if(dep[u] >= dep[ed])
					ans.push_back(u);
				return true;
			}
			dep[v] = -1;
		}
		for(int i = 0; i < (int)tmp.size(); i++)
			vis[tmp[i]] = false;
		return false;
	} else {
		ed = t;
		ans.push_back(u);
		return true;
	}
}

int main() {
#ifdef LOACL
	freopen("in.txt", "r", stdin);
	freopen("out.txt", "w", stdout);
#endif
	scanf("%d %d", &N, &M);
	for(int i = 1; i <= M; i++) {
		int u, v;
		scanf("%d %d", &u, &v);
		G[u].push_back(v);
	}
	memset(dep, -1, sizeof dep);
	for(int i = 1; i <= N; i++) {
		memset(vis, false, sizeof vis);
		vis[i] = true, dep[i] = 0;
		if(DFS(i)) {
			printf("%d\n", ans.size());
			for(int i = (int)ans.size() - 1; i >= 0; i--)
				printf("%d\n", ans[i]);
			return 0;
		}
		dep[i] = -1;
	}
	puts("-1");
	return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <utility>
#include <iomanip>
#include <cmath>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
#define rep(i,a,b) for(int i=a;i<(b);++i)
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;}
using ll = long long;
constexpr ll INF = 1LL << 60;
constexpr ll MOD = 1e9 + 7;

int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    int A,B,X; cin >> A >> B >> X;
    if(A > X){cout << "NO" << endl;return 0;}
    else if(B-(X-A)>0) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner b = new Scanner(System.in);
		
		int n = b.nextInt();
		
		if(n/10 < 1) {
			if(n == 2 || n == 4 || n == 5 || n == 7 || n == 9) {
				System.out.println("hon");
			}
			if(n == 0 || n == 1 || n == 6 || n == 8) {
				System.out.println("pon");
			}
			if(n == 3) {
				System.out.println("bon");
			}
		}
		else if(n/10 >= 1 && n/10 < 10) {
			n = n%10;
			if(n == 2 || n == 4 || n == 5 || n == 7 || n == 9) {
				System.out.println("hon");
			}
			if(n == 0 || n == 1 || n == 6 || n == 8) {
				System.out.println("pon");
			}
			if(n == 3) {
				System.out.println("bon");
			}
		}
		else {
			n = n%100;
			n = n%10;
			if(n == 2 || n == 4 || n == 5 || n == 7 || n == 9) {
				System.out.println("hon");
			}
			if(n == 0 || n == 1 || n == 6 || n == 8) {
				System.out.println("pon");
			}
			if(n == 3) {
				System.out.println("bon");
			}
		}
		
	}

}


Measured memory_bytes: 35704
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;

const int MAX_N = 1005;

int f[1005][5005], fa[MAX_N], X[MAX_N];
int g[5005];

inline void chmin(int &x, int y) {
  if (x > y) x = y;
}

int main() {
  int N;
  scanf("%d", &N);
  for (int i = 2; i <= N; ++i)
    scanf("%d", &fa[i]);
  for (int i = 1; i <= N; ++i)
    scanf("%d", &X[i]);
  
  memset(f, 0x3f, sizeof f);
  for (int i = 1; i <= N; ++i) f[i][0] = 0;
  
  for (int i = N; i; --i) {
    int mn = 0x3f3f3f3f;
    for (int j = 0; j <= X[i]; ++j)
      mn = min(mn, f[i][j]);
    if (mn == 0x3f3f3f3f) {
      puts("IMPOSSIBLE");
      return 0;
    }
    
    if (fa[i]) {
      memset(g, 0x3f, sizeof g);
      for (int j = 0; j <= X[fa[i]]; ++j) {
	chmin(g[j + X[i]], f[fa[i]][j] + mn);
	chmin(g[j + mn], f[fa[i]][j] + X[i]);
      }
      memcpy(f[fa[i]], g, sizeof g);
    }
  }

  puts("POSSIBLE");
  
  return 0;
}


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

void Main()
{
    long w, h, x, y;
    cin >> w >> h >> x >> y;
    int f = 0;
    if(x*2 == w && y*2 == h) f = 1;
    cout << fixed << setprecision(15) 
        << w*h/2.0 << " " << f << endl;
}

int main(int argc, char **argv)
{
    Main();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define reps(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define repi(i, x) \
	for (auto i = (x).begin(), i##_fin = (x).end(); i != i##_fin; i++)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
string solve(bool a) { return ((a) ? "Yes" : "No"); }
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef pair<int, int> Pi;
typedef vector<Pi> VPi;
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long, long long> P;
typedef vector<P> VP;
template <class T>
inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return 1;
	}
	return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return 1;
	}
	return 0;
}
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
	os << "(" << p.first << "," << p.second << ")";
	return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
	os << "{";
	rep(i, v.size()) {
		if (i) os << ",";
		os << v[i];
	}
	os << "}";
	return os;
}
template <class T, class U>
istream& operator>>(istream& is, pair<T, U>& p) {
	is >> p.first >> p.second;
	return is;
}
template <class T>
istream& operator>>(istream& is, vector<T>& v) {
	rep(i, v.size()) { is >> v[i]; }
	return is;
}
const long long INFLL = 1LL << 60;
const int INF         = 1 << 30;
const double PI       = acos(-1);

int main() {
	int n;
	int ans = 0;
	cin >> n;
	rep(i, n) { cout << "ACL"; }

}


Measured memory_bytes: 3604
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(a) (a).begin(),(a).end()
using namespace std;
using ll = long long int;
using vec = vector<int>;
using P = pair<int,int>;
const int INF = 1e9+7;

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

  while (k > 0) {
    if (a >= b) {
      b *= 2;
    } else {
      c *= 2;
    }
    k--;
  }

  if (a < b && b < c) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_CAT_I(x,y) x ## y

using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using ll = long long;
constexpr i64 INF = 1010000000000000017LL;
constexpr i64 MOD = 1000000007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) xmax = x; return true;
    return false;
}
template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) xmin = x; return true;
    return false;
}
template<typename Val>
bool bitcheck(Val bit, size_t idx) {
    return bit & (1 << idx);
}
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;
    ProconInit() {
        cin.tie(nullptr); ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH) cout << unitbuf;
    }
} PROCON_INIT;

void solve() {
    ll n, m, x; cin >> n >> m >> x;
    vector<ll> c(n);
    vector<vector<ll>> a(n, vector<ll>(m, 0));
    FOR(i, 0, n) {
        cin >> c[i];
        FOR(j, 0, m) {
            cin >> a[i][j];
        }
    }

    ll ret = INF;
    FOR(bit, 0, 1<<n) {
        vector<ll> now(m);
        ll cost = 0;
        FOR(i, 0, n) {
            if (bit & 1 << i) {
                cost += c[i];
                FOR(j, 0, m) {
                    now[j] += a[i][j];
                }
            }
        }
        if (std::all_of(now.begin(), now.end(), [x](ll ix) {return x <= ix;})) {
            chmin(ret, cost);
        }
    }

    if (ret == INF) ret = -1;
    cout << ret << endl;
}

signed main() {
    solve();
    return 0;
}

Measured memory_bytes: 3680
#pragma GCC optimize("O3")   //
#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define per(i, b, a) for(int i = b - 1; i >= a; i--)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;
typedef unsigned long long ull;

unsigned seed = std::chrono::system_clock::now().time_since_epoch().count();
std::mt19937 eng(seed);

uniform_int_distribution<> DD(0, (1ll << 31));

ll random2(){
    return (ll(DD(eng))*(1ll << 31) + ll(DD(eng))) & ((1ll << 62ll)-1);
}

ll n,m,k,q,T;

const ll big = 1000000007;
const ll big2 = 1000000009;
const ll mod =  998244353;

const int MAXN = 800001;


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

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

    ll a,b,c,d,e;

    ll F[20][20] = {0};

    ll ans = 0;
    cin >> n;
    rep(c1,0,n){
        ld x;
        cin >> x;
        a = round(x*1000000000.0);
        b = 0;
        c = 0;
        while(a%5 == 0){
            b++;
            a /= 5;
        }
        while(a%2 == 0){
            c++;
            a /= 2;
        }
        c = min(19ll, c);
        rep(c2,0,20){
            rep(c3,0,20){
                if(b+c2 >= 18 && c+c3 >= 18)ans += F[c2][c3];
            }
        }
        F[b][c]++;
    }
    cout << ans << "\n";

    return 0;
}


Measured memory_bytes: 3812
#include <algorithm>
#include <climits>
#include <deque>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <string.h>
#include <utility>
#include <vector>
using namespace std;

// デバッグ用
#define _DEBUG
#ifdef _DEBUG
#define dlog(str) cout << "====" << str << endl;
#else
#define dlog(str)
#endif
// ここまで
#define INF 999999999
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define REPR(i, n) for(int i = n - 1; 0 <= i; i--)
#define FOR(i, s, e) for(int i = s; i <= e; i++)
#define FORR(i, s, e) for(int i = s; e <= i; i--)
#define LLI long long int
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))

// int 2.14E±9    lli 9.2E±18    double 1.7E±380

int main() {
    int N, K;
    cin >> N >> K;
    double p = 0;
    FOR(i, 1, N) {
        int s = log2((K - 1) / i) + 1;
        if(s < 0)
            s = 0;
        p += pow(0.5, s) / N;
    }
    printf("%1.16f", p);
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <sstream>
#include <cmath>
#include <set>
#include <iomanip>
#include <deque>
#include <stdio.h>
using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define RREP(i,n) for(int (i)=(int)(n)-1;i>=0;i--)
#define iREP(i,Itr) for(auto (i)=(Itr).begin();(i)!=(Itr).end();(i)++)
#define REMOVE(Itr,n) (Itr).erase(remove((Itr).begin(),(Itr).end(),n),(Itr).end())
#define PB_VEC(Itr1,Itr2) (Itr1).insert((Itr1).end(),(Itr2).begin(),(Itr2).end())
#define UNIQUE(Itr) sort((Itr).begin(),(Itr).end()); (Itr).erase(unique((Itr).begin(),(Itr).end()),(Itr).end())
#define LBOUND(Itr,val) lower_bound((Itr).begin(),(Itr).end(),(val))
#define UBOUND(Itr,val) upper_bound((Itr).begin(),(Itr).end(),(val))
typedef long long ll;

int N;

bool judge(int x){
    int sum=0;
    for(int i=x;i>=1;i--){
        if(i+sum<=N)sum+=i;
    }
    if(sum==N)return true;
    return false;
}

int main(){
    
    cin>>N;
    int low=1, high=1e7;
    while(high-low>1){
        int mid=(low+high)/2;
        if(judge(mid)){
            high=mid;
        }else{
            low=mid;
        }
    }
    
    int sum=0;
    for(int i=high;i>=1;i--){
        if(sum+i<=N){
            sum+=i;
            cout<<i<<endl;
        }
    }
    
    return 0;
}


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

int main() {
    string a, b;
    cin >> a >> b;
    if (a.size() > b.size())
        cout << "GREATER" << endl;
    else if (a.size() < b.size())
        cout << "LESS" << endl;
    else
        if (a > b)
            cout << "GREATER" << endl;
        else if (a < b)
            cout << "LESS" << endl;
        else
            cout << "EQUAL" << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SZ(x) ((int)x.size())
#define FOR(i,a,b) for (int i=a;i<=b;++i)
#define FORD(i,a,b) for (int i=a;i>=b;--i)
using namespace std;
typedef long long LL;
typedef pair<int,int> pa;
typedef vector<int> vec;
void getint(int &v){
    char ch,fu=0;
    for(ch='*'; (ch<'0'||ch>'9')&&ch!='-'; ch=getchar());
    if(ch=='-') fu=1, ch=getchar();
    for(v=0; ch>='0'&&ch<='9'; ch=getchar()) v=v*10+ch-'0';
    if(fu) v=-v;
}
multiset<int> S;
int n,a[500010],t,l,r,m,b[500010],ts,tmp[500100];
int main(){
	cin>>n;
	FOR(i,1,n){
		getint(a[i]);
		tmp[++ts]=a[i];
		S.insert(a[i]);
	}
	sort(tmp+1,tmp+ts+1);
	b[1]=tmp[1];
	b[2]=tmp[ts];
	S.erase(S.find(b[1]));
	S.erase(S.find(b[2]));
	FOR(i,3,n){
		if (S.find(b[i-1]^b[i-2])==S.end()) return puts("No"),0;
		b[i]=b[i-1]^b[i-2];
		S.erase(S.find(b[i]));
	}
	m=n;
	FOR(i,2,m-1) if (b[i]!=(b[i-1]^b[i+1])) return puts("No"),0;
	if (b[1]!=(b[2]^b[m])) return puts("No"),0;
	if (b[m]!=(b[m-1]^b[1])) return puts("No"),0;
	puts("Yes");
	return 0;
}

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

int main() {

  int N;
  cin >> N;

  int answer = 0;

  vector<int> dp(100010);

  dp[0] = 0;

  for (int i = 1; i <= 100000; i++){
    dp[i] = 100010;
    int cost = 1;
    while (cost <= i) {
      dp[i] = min(dp[i], dp[i - cost] + 1);
      cost *= 6;
    }
    cost = 9;
    while (cost <= i) {
      dp[i] = min(dp[i], dp[i - cost] + 1);
      cost *= 9;
    }
  }

  cout << dp[N] << endl;

  return 0;

}

Measured memory_bytes: 640
import java.util.Scanner;

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

        String s = sc.next();

        System.out.println(solve(s));

        sc.close();
    }

    static String solve(String s) {
        return String.format("%c%d%c", s.charAt(0), s.length() - 2, s.charAt(s.length() - 1));
    }
}

Measured memory_bytes: 23892
year, month, date = map(int, input().split("/"))
if year < 2019:
        print("Heisei")
elif year == 2019:
        if month<4:
                print("Heisei")
        elif month == 4:
                if date <= 30:
                        print("Heisei")
                else:
                        print("TBD")
        else:
                print("TBD")
else:
        print()

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main(){
    int k,n;
    cin >> k >>n;
    vector<int>a(n);
    for(int i=0;i<n;i++)cin >> a[i];
    int max=0;
    for(int i=0;i<n-1;i++){
        if(a[i+1]-a[i]>max)
        max=a[i+1]-a[i];
    }
    if(a[0]+k-a[n-1]>max)
    max=a[0]+k-a[n-1];
    cout <<k-max;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(v) push_back(v)
#define uniq(v) (v).erase(unique(all(v)),(v).end())
#define bitcnt(x) __builtin_popcount(x)
#define fst first
#define snd second
#define Pqaz(T) priority_queue<T,vector<T>,greater<T>>
#define Pqza(T) priority_queue<T>
#define ENJYU std::ios::sync_with_stdio(false);std::cin.tie(0);

typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;

//vector の中身を出力
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

void solve(void){
	string S;
	cin >> S;
	rep(12, i) {
		cout << S[i];
		if (i == 3) cout << ' ';
	}
	cout << endl;
}

int main(void){
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3

def main():
    N = int(input())
    [T, A] = list(map(int, input().split()))
    H = list(map(int, input().split()))

    min_d = abs(T - H[0] * 0.006 - A)
    min_i = 0
    for i in range(N):
        d = abs(T - H[i] * 0.006 - A)
        if d < min_d:
            min_i, min_d = i, d

    print(min_i + 1)


if __name__ == '__main__':
    main()



Measured memory_bytes: 3060
/*

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

*/

#include <bits/stdc++.h>

using namespace std;

#define F first
#define S second
#define pb push_back
#define np next_permutation
#define bs binary_search
#define mp make_pair
#define all(x) x.begin(), x.end()
#define bp __builtin_popcountll
#define sqr(x) ((llong)sqrt (x))
#define b_ctz __builtin_ctzll
#define b_clz __builtin_clzll

#define y1 road_to_respa_top_6
#define prev road_to_respa_top_6
#define Abdrakhman abcdefghijklmnopqrstuvwxyzRakhman
#define left kotoriy_levee_chem_right
#define right kotoriy_pravee_chem_left

#define android ios_base::sync_with_stdio(0), cin.tie (0), cout.tie (0)
#define fn ""

typedef long long llong;
typedef long double ldouble;
typedef unsigned long long ullong;

typedef vector <llong> vl;
typedef vector <string> vs;
typedef vector <vector <llong>> matrix;

typedef pair <llong, llong> pll;

typedef map <llong, llong> mll;

typedef set <llong> sl;

const llong MXN = 1e6 + 1;
const llong MNN = 1e3 + 1;
const llong MOD = 1e9 + 7;
const llong INF = 1e18;
const llong MAGIC = 1000;
const ldouble EPS = 1e-9;
const ldouble PI = 3.1415926536;
const string TIME = "rovno_ushten_push_ketti";

inline llong log2 (llong x) {return 64 - b_clz (x) - 1;};
inline llong __lcm (llong a, llong b) {return a / __gcd (a, b) * b;};

llong l, r, ans;

int main () {
    android;
    random_device rand;
    #ifdef I_LOVE_DILYA
        freopen ("input.txt", "r", stdin);
    #endif
    cin >> l >> r;
    for (llong i = 1; i <= r; i *= 2) {
        if (l * i <= r) ++ ans;
        else break;
    } cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
vector<int> left(vector<int> a,vector<int> l);
vector<int> right(vector<int> a,vector<int> r);
int gcd(int x, int y);
int n;

int main(){
    cin>>n;
    vector<int> a(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    vector<int> l(n);
    vector<int> r(n);
    l[0] = a[0];
    for(int i=1;i<n;i++){
        l[i]= gcd(l[i-1],a[i]);
    }
    r[n-1] = a[n-1];
    for(int i=n-2;i>=0;i--){
        r[i]=gcd(r[i+1],a[i]);
    }
    int ans=0;
    for(int i=1;i<n-1;i++){
        ans=max(ans,gcd(l[i-1],r[i+1]));
        //cout<<gcd(l[i-1],r[i+1])<<endl;
    }
    ans=max(ans,r[1]);
    ans=max(ans,l[n-2]);
    cout<<ans<<endl;
}
int gcd(int x, int y){
    if(y==0)return x;
    else return gcd(y,x%y);
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int a,b,h,m;
    cin >> a >> b >> h >> m;
    int mi = 60*h+m;
    double aa = 0.5*mi;
    double bb = 6*m;
    double c = abs(aa-bb)*(M_PI/180);
    double ans = a*a+b*b-2*a*b*cos(c);
    ans = pow(ans,0.5);
    cout << fixed << setprecision(12) << ans << endl;
    
}

Measured memory_bytes: 4352
a, b, k = io.read("*n", "*n", "*n")
for i = 1, k do
  if i % 2 == 1 then
    if a % 2 == 1 then a = a - 1 end
    a = a // 2
    b = b + a
  else
    if b % 2 == 1 then b = b - 1 end
    b = b // 2
    a = a + b
  end
end
print(a .. " " .. b)


Measured memory_bytes: 2616
#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i,a,b) for(int64_t i=(a); i<(b); ++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define RANGE(a,b,c) (a).begin()+b,(a).begin()+c // コンテナ a の 要素 b から c へのイテレータ
#define MOD 1000000007
#define INF 1000000000
typedef pair<int64_t, int64_t> PII;
typedef vector<int64_t> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

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

int64_t N, M; cin>> N >> M;

// Mの約数
int64_t maxi = 0;
for (int64_t i = 1; i * i <= M; ++i){
    if (M % i == 0) {
        if (i * N <= M) maxi = max(maxi, i);
        if (N <= i) maxi = max(maxi, M/i);
    }
}

cout << maxi << "\n";
}

// 境界，出力文字列 チェック
// 可読性優先．高速化次点．
// まずは全探索，分割統治，次にDP
// 制限を見る．境界に注意．求めたい量の変域．
// 偶奇，逆から，ソート，出現回数，出現位置，DP， 余事象，包除
// データ構造． 問題の特徴量．単調性，二分探索
// 存在判定：構成方法，入力の特徴
// gcd, lcm ,素因数分解．
// 例外を十分に含む一般化．想像力の限界
// 小さい系から例示
// 始めは過剰に例示・場合分けしてもいい．各場合を確実に対処．
// 自明な例から処理，除外．
// 小数のときは，精度の設定する．doubel 変数に数値を入力するときは 123. とする．
// テストケース作成は数表あり



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

namespace ABC154 {
    public class D {
        public static void Main() {
            var input = Console.ReadLine().Split(' ');
            var allCount = int.Parse(input[0]);
            var sectionCount = int.Parse(input[1]);

            var ps = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            var queue = new Queue<decimal>(ps.Take(sectionCount).Select(CalcKitaichi));
            var currentSum = queue.Sum();
            var maxSum = currentSum;
            for (int i = sectionCount; i < allCount; i++) {
                var newKitaichi = CalcKitaichi(ps[i]);
                currentSum -= queue.Dequeue();
                currentSum += newKitaichi;
                queue.Enqueue(newKitaichi);

                if(maxSum < currentSum) maxSum = currentSum;
            }

            Console.WriteLine(maxSum);
        }

        private static decimal CalcKitaichi(int maxNumber) {
            if (!cache.ContainsKey(maxNumber)) cache[maxNumber] = ((decimal)(maxNumber - 1)) / 2 + 1;
            return cache[maxNumber];
        }

        private static Dictionary<int, decimal> cache = new Dictionary<int, decimal>();
    }
}


Measured memory_bytes: 35804
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second
// 多倍長
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using boost::rational;
using boost::multiprecision::cpp_int;

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;

int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int n, m;
    cin >> n >> m;
    vector<string> a(n);
    vector<string> b(m);
    rep(i, n){
        cin >> a[i];
    }
    rep(i, m){
        cin >> b[i];
    }
    bool exist = false;
    rep(i, n - m + 1){
        rep(j, n - m + 1){
            bool match = true;
            rep(k, m){
                rep(l, m){
                    if(a[i + k][j + l] != b[k][l]) match = false;
                }
            }
            if(match) exist = true;
        }
    }
    Yes(exist);

}


Measured memory_bytes: 3640
import scala.io.StdIn._
object Main extends App {
  val Array(n, l, k) = readLine.trim.split(' ').map(_.toLong)
  val sequence = Array.tabulate(n.toInt){_ ⇒
    val Array(a, d) = readLine.trim.split(' ').map(_.toLong)
    (a, d)
  }
  val sums = sequence.map{seq ⇒ all(seq)}
  var max = 0L
  for (i ← 1 until n.toInt) sums(i) += sums(i - 1)
  for (left ← 0 until n.toInt) {
    if (k / l >= 1 && (0L until n).contains(left + k / l)) {
      val temp = sums((left + k / l).toInt - 1) - sums(left) + calMaxSum(sequence(left), sequence((left + k / l).toInt), k - l * (k / l - 1))
      if (temp > max) max = temp
    }
    if ((0L until n).contains(left + k / l + 1)) {
      val temp = sums((left + k / l).toInt) - sums(left) + calMaxSum(sequence(left), sequence((left + k / l).toInt + 1), k - l * (k / l))
      if (temp > max) max = temp
    }
  }
  if (k == l * n) max = sums.last
  println(max)
  def calMaxSum(left: (Long, Long), right: (Long, Long), length: Long): Long = {
    if (length >= l) {
      val initialDiff = right._1 + right._2 * (length % l) - left._1
      val diffDiff = right._2 - left._2
      if (initialDiff >= 0 && diffDiff < 0) {
          val shift = (initialDiff - diffDiff - 1) / -diffDiff
          if (length % l + shift >= l) sum_seq(left, length % l, right, l)
          else sum_seq(left, l - shift, right, length % l + shift)
      }else {
        math.max(sum_seq(left, l, right, length % l), sum_seq(left, length % l, right, l))
      }
    }else {
      val initialDiff = right._1 - left._1 - left._2 * (l - length)
      val diffDiff = right._2 - left._2
      if (initialDiff >= 0 && diffDiff < 0) {
        val shift = (initialDiff - diffDiff - 1) / -diffDiff
        if (length < shift) sum_seq(right, length)
        else sum_seq(left, length - shift, right, shift)
      }else {
        math.max(sum_seq(left, length, right, 0), sum_seq(left, 0, right, length))
      }
    }
  }
  def all(sequence: (Long, Long)): Long = {
    sequence._1 * l + l * (l - 1) / 2 * sequence._2
  }
  def sum_seq(left: (Long, Long), leftCount: Long, right: (Long, Long), rightCount: Long): Long = {
    sum_seq(left, l - leftCount, l) + sum_seq(right, rightCount)
  }
  def sum_seq(sequence: (Long, Long), from: Long, until: Long): Long = {
    sum_seq(sequence, until) - sum_seq(sequence, from)
  }
  def sum_seq(sequence: (Long, Long), until: Long): Long = {
    sequence._1 * until + until * (until - 1) / 2 * sequence._2
  }
}


Measured memory_bytes: 218232
#include<stdio.h>
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define INFTY 1000000000
#define MAX 100

typedef struct{
  int color; //全て白(0)に初期化済み
  int id;
  int distance;
  int parent;
}DOT;

DOT A[MAX];//本体
int G[MAX][MAX];//グラフ

int MinTree(int n){
  int total=0;
  int min_box;
  int flag;
  int i;
  int u,v;

  A[0].distance=0;
  
  while(1){
    int min_box=INFTY;
    int flag=0;
    int u,v;

    for(i=0;i<n;i++){
      if(A[i].color!=BLACK && A[i].distance<min_box){//グループで最も最小の手を持つ先にある番号

	min_box=A[i].distance;
	u=i;
	flag=1;
      }
    }
      
    if(flag==0)break;
    A[u].color=BLACK;//最少の手
    
    for(v=0;v<n;v++){//uの隣vを調べつくす
      if(G[u][v]!=-1 && A[v].color!=BLACK)//まだグループではなく、存在する
	if(A[v].distance>G[u][v]){//A[v]はvからuへの最短を記録したい 
	  A[v].distance=G[u][v];
	  A[v].parent=u;
	  A[v].color=GRAY;
	}
    }
  }
   

  
  for(v=1;v<n;v++){
    total+=G[v][A[v].parent];
  }
  return total;//最少ルートで回ったときの距離の合計
}


int main(){
  int n;
  int i,j;
  
  scanf("%d",&n);//INPUT
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      scanf("%d",&G[i][j]);
    }
  }

  for(i=0;i<n;i++){//INITIATE
    A[i].parent=-1;
    A[i].distance=INFTY;
  }
 
  printf("%d\n",MinTree(n));//PRINT
  
  return 0;
}



Measured memory_bytes: 2084
S = input()

flag = 1
N = len(S)+1

if S != S[::-1]:
    flag = 0

Stemp = S[0:int(N/2-1)]

if S[0:int(N/2-1)] != Stemp[::-1]:
    flag = 0

Stemp = S[int((N+2)/2-1):]
if S[int((N+2)/2-1):] != Stemp[::-1]:
    flag = 0

if flag == 1:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int n;
int main(){
	cin>>n;
	if(n>=64)
	cout<<64<<endl;
	if(n>=32&&n<64)
	cout<<32<<endl;
	if(n>=16&&n<32)
	cout<<16<<endl;
	if(n>=8&&n<16)
	cout<<8<<endl;
	if(n>=4&&n<8)
	cout<<4<<endl;
	if(n>=2&&n<4)
	cout<<2<<endl;
	if(n==1)
	cout<<1<<endl;
	if(n==0)
	cout<<0<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int dp[100001][2];

int main(void) {
	dp[0][0] = dp[0][1] = 0;

	int i, c;
	for (i = 0; (c = getchar()) != EOF; i++) {
		if (c != '0' && c != '1') break;
		int x = c == '1';
		dp[i+1][x] = dp[i][!x];
		dp[i+1][!x] = dp[i][x]+1;
	}
	printf("%d\n", dp[i][0] < dp[i][1] ? dp[i][0] : dp[i][1]);
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define rep2(i,j,n) for(int j=i;j<n;j++)
#define rep3(i,j,n) for(int j=i;j<=n;j++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define sp(n) cout << fixed << setprecision(n)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef long long ll;
using namespace std;
int main(void){
    int n,k;cin>>n>>k;
    vector<ll> h(n);
    rep(i,n)cin>>h[i];
    sort(h.begin(),h.end());
    ll res=1e+9+3;
    rep(i,n-k+1){
        chmin(res,h[i+k-1]-h[i]);
    }
    cout<<res<<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
typedef long long lt;
typedef double dd;
#define eps 1e-6
#define sqr(x) ((x)*(x))

int read()
{
    int f=1,x=0;
    char ss=getchar();
    while(ss<'0'||ss>'9'){if(ss=='-')f=-1;ss=getchar();}
    while(ss>='0'&&ss<='9'){x=x*10+ss-'0';ss=getchar();}
    return f*x;
}

const int maxn=1000010;
int n;
struct point{dd x,y;}p[maxn],O;
dd R;

dd getd(point a,point b){ return sqrt(sqr(a.x-b.x)+sqr(a.y-b.y));}
point getO(point p1,point p2,point p3)
{
    point res;
    dd a=p2.x-p1.x,b=p2.y-p1.y,c=p3.x-p2.x,d=p3.y-p2.y;
    dd e=sqr(p2.x)+sqr(p2.y)-sqr(p1.x)-sqr(p1.y);
    dd f=sqr(p3.x)+sqr(p3.y)-sqr(p2.x)-sqr(p2.y);
    res.x=(f*b-e*d)/(c*b-a*d)/2.0;
    res.y=(a*f-e*c)/(a*d-b*c)/2.0;
    return res;
}

void qqq()
{
    O=p[1]; R=0;
    for(int i=1;i<=n;++i)
    if(getd(p[i],O)-R>eps)
    {
        O=p[i]; R=0;
        for(int j=1;j<i;j++)
        if(getd(p[j],O)-R>eps)
        {
            O=(point){(p[i].x+p[j].x)/2.0,(p[i].y+p[j].y)/2.0};
            R=getd(p[i],p[j])/2.0;

            for(int k=1;k<j;++k)
            if(getd(p[k],O)-R>eps)
            {
                O=getO(p[i],p[j],p[k]);
                R=getd(p[i],O);
            }
        }
    }
}

int main()
{
    scanf("%d", &n);
    for(int i=1;i<=n;++i)
    scanf("%lf%lf",&p[i].x,&p[i].y);

    random_shuffle(p+1,p+1+n);

    qqq();
    printf("%.7lf",R);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
	int x;
	cin >> x;
	if (x >= 30) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 3600
from collections import defaultdict
from itertools import combinations

d = defaultdict(int)

n = int(input())

for _ in range(n):
    initial = input()[0]
    if initial in 'MARCH':
        d[initial] += 1

a = list(d.items())

ans = 0

for x in combinations(range(min(len(a),5)),3):
    ans += a[x[0]][1] * a[x[1]][1] * a[x[2]][1]

print(ans)

Measured memory_bytes: 3316
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		int res = 0;
		for (int i = 0; i < N; i++) {
			if (K <= sc.nextInt()) {
				res++;
			}
		}
		System.out.println(res);
	}
}


Measured memory_bytes: 58032
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<lint, lint>;
using vec = vector<lint>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    int n;
    cin >> n;
    vec a(n+1);
    rep(i, n+1) cin >> a[i];

    lint res = 0;

    vector<P> lr(n+1);
    lr[n] = {a[n], a[n]};

    for (int i = n-1; i >= 0; --i) {
        auto prev = lr[i+1];
        lint r = prev.second + a[i];
        lint l = (prev.first + 1) / 2 + a[i];
        lr[i] = {l, r};
    }

    if (lr[0].first > 1 || lr[0].second < 1) {
        cout << "-1" << endl;
        exit(0);
    }

    lint nodes = 1;

    for (int i = 0; i <= n; ++i) {
        lint mx = lr[i].second;
        res += min(mx, nodes);
        if (nodes > 100000000000000) continue;
        nodes -= a[i];
        nodes *= 2;
    }

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 5784
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int min = Integer.MAX_VALUE;
        int max = Integer.MIN_VALUE;
        for (int i=0; i<n; i++) {
            int a = sc.nextInt();
            min = Math.min(min, a);
            max = Math.max(max, a);
        }
        System.out.println(max-min);
    }
}

Measured memory_bytes: 19796
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> ip;
typedef pair<ll,ll> lp;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const ll MOD = 1e9 + 7;

int main(){
	ll N,a,b; cin>>N>>a>>b;
	vector<ll> dot(N);
	rep(i,N)cin>>dot[i];
	ll ans = 0;
	rep(i,N-1){
		ans += min(b, (dot[i+1]-dot[i]) * a);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
 
using namespace std;
 
typedef unsigned long long ull;
typedef unsigned int        uint;

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

int main()
{
    ull N;
    ull d;
    vector<pair<uint, uint>> A;
    cin >> N;
    rep(i, N){
        cin >> d;
        A.push_back(make_pair(d, i+1));
    }
    sort(A.begin(), A.end());
    rep(i, N){
        cout << A[i].second << " ";
    }
    cout << endl;
    
    return 0;
}

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

#define endl '\n'
#define db(x) cerr << #x << " == " << x << endl
#define dbs(x) cerr << x << endl
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define inf 0x3f3f3f3f
#define linf 0x3f3f3f3f3f3f3f3f

typedef long long ll;
typedef pair <int, int> pii;
typedef vector<int> vi;
const ll MOD = 1e9+7;
const int N = 1e5+5;
int n;
vi adj[N];
ll b[N], w[N];

void dfs(int u, int par){
  w[u]=b[u]=1;
  for(auto v : adj[u]){
    if(v==par) continue;
    dfs(v, u);
    b[u]*=w[v]%MOD;
    b[u]%=MOD;
    w[u]*=(w[v]+b[v])%MOD;
    w[u]%=MOD; 
  }
}

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

  cin >> n;
  for(int i=1; i<n; i++){
    int x, y;
    cin >> x >> y;
    adj[x].pb(y);
    adj[y].pb(x);
  }

  dfs(1, 0);
  cout << (b[1] + w[1])%MOD << endl;
}

Measured memory_bytes: 14208
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String args[])throws IOException{
		BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
		int x[]=new int[5];
		for(int i=0;i<5;i++){
			x[i]=Integer.parseInt(input.readLine());
		}
		int i=((x[1]%x[3]==0)?x[1]/x[3]:x[1]/x[3]+1);
		int j=((x[2]%x[4]==0)?x[2]/x[4]:x[2]/x[4]+1);
		System.out.println(x[0]-((i>j)?i:j));
	}
}

Measured memory_bytes: 24268
#include<bits/stdc++.h>
#define ll long long
#define P pair<ll,ll>
using namespace std;

#define N 200000

void radix_sort(P *from,P *to){
	int n = to - from;
	P *res = new P[n];
	P *tmp = new P[n];
	for(int i=0;i<n;++i){
		res[i] = from[i];
	}
	int itr[256];
	int cnt[256];
	ll mask = 255;
	ll num;
	P *t;
	for(int i=0;mask;i+=8,mask<<=8){
		for(int j=0;j<256;++j){
			itr[j]=-1;
			cnt[j]=0;
		}
		for(int j=0;j<n;++j){
			++cnt[((res[j].first&mask)>>i)+1];
		}
		for(int j=0;j<255;++j){
			cnt[j+1] += cnt[j];
		}
		for(int j=0;j<n;++j){
			num = (res[j].first&mask)>>i;
			tmp[cnt[num]+(++itr[num])] = res[j];
		}
		t = res;
		res = tmp;
		tmp = t;
	}
	for(int i=0;i<n;++i){
		from[i] = res[i];
	}
}
int main(){
	int n;
	ll d;
	ll a;
	P monsters[N];
	scanf("%d%lld%lld",&n,&d,&a);
	d *= 2;
	for(int i=0;i<n;++i){
		scanf("%lld%lld",&monsters[i].first,&monsters[i].second);
	}
	radix_sort(monsters,monsters+n);

	ll ans = 0;
	ll sum_damage = 0;
	int rp = 0;
	for(int i=0;i<n;++i){
		while(rp<n&&monsters[rp].first<=monsters[i].first+d){
			monsters[rp].second += sum_damage;
			++rp;
		}
		ll hp = monsters[i].second - sum_damage;
		if(hp>0){
			ll time = (hp + a - 1) / a;
			ans += time;
			sum_damage += time * a;
		}

	}

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

}


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

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

    int a, b, c;
    cin >> a >> b >> c;

    cout << min(abs(b-a) + abs(c-b), min(abs(b-a) + abs(c-a), abs(c-a) + abs(c-b))) << endl;
}

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

int main(){
  int N;
  string S, T;

  cin >> N;
  cin >> S >> T;

  string dstStr = "";
  for( int i = 0; i < N; ++i ){
    dstStr += S.at(i);
    dstStr += T.at(i);
  }

  cout << dstStr << endl;
}


Measured memory_bytes: 256
using System;

namespace ConsoleApplication10
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');

            int W = int.Parse(s[0]);
            int H = int.Parse(s[1]);
            int x = int.Parse(s[2]);
            int y = int.Parse(s[3]);
            int r = int.Parse(s[4]);

            if (x + r <= W && y + r <= H && x-r>=0 && y-r>=0)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}

Measured memory_bytes: 9032
#include <iostream>

using namespace std;

int main() {
	int a, b, c, k; cin >> a >> b >> c >> k;
	while (k && a >= b) b *= 2, k--;
	while (k && b >= c) c *= 2, k--;
	cout << (a < b&& b < c ? "Yes" : "No") << endl;

	return 0;
}

Measured memory_bytes: 3620
#include <stdio.h>
int main(void)
{
  int a;
  int result=0;
  scanf("%d",&a);
  if(a/100==7){
   result++;
  }
  a=a%100;
  if(a/10==7)
  {
   result++;
  }
  a=a%10;
  if(a==7)
  {
   result++;
  }
  if(result>=1){
  printf("Yes");
  }
  else if(result==0)
  {
   printf("No");
  }
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=998244353;
const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

ll n,k;

int main(){
	cin>>n>>k;
	ll res=n*n;
	for(ll i=1;i<=n;i++){
		res-=n/i*min(k,i)+min(n%i,k);
		if(k) res++;
		if(n%i<k) res--;
	}
	cout<<res<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <complex>
#include <fstream>
#include <cmath>

using namespace std;

int main(void){
    vector<int >arr(3);
    cin >> arr[0] >> arr[1] >> arr[2];
    sort(arr.begin(),arr.end());
    cout << arr[0] + arr[1] << endl;
    return 0;
}


Measured memory_bytes: 256