akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(),(x).end()
#define R cin>>
#define C cout<<
const int INF = 1000000007;
typedef long long ll;
using namespace std;
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; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
int main(){
  // ios::sync_with_stdio(false);cin.tie(nullptr);
  string s;
  cin >> s;
  cout << s.substr(0,s.size() - 8) << endl;
  return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Deque;
  
public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int n = Integer.parseInt(br.readLine());
         
        Deque<Integer> list = new ArrayDeque<>();
        for(int i = 0; i < n; i++) {
            String cmd = br.readLine();
            if(cmd.charAt(0) == 'i') {
                list.addFirst(Integer.parseInt(cmd.substring(7)));
            }else if(cmd.charAt(6) == ' ') {
                list.remove(Integer.parseInt(cmd.substring(7)));
            }else if(cmd.charAt(6) == 'F') {
                list.removeFirst();
            }else {
                list.removeLast();
            }
        }
 
        StringBuilder sb = new StringBuilder();
        sb.append(list.removeFirst());
        while(!list.isEmpty()) {
            sb.append(" ").append(list.removeFirst());
        }
        System.out.println(sb);
    }
}


Measured memory_bytes: 125188
#include<bits/stdc++.h>
#define fi first
#define sc second
const int N=100010;
using namespace std;
int n,fa[N];
multiset<int> s[N];
map<pair<int,int> ,int> mps1,mps2;
queue<pair<int,int> >q;
inline pair<int,int> makepair(int x,int y){
	if(x>y)return pair<int,int>(y,x);
	return pair<int,int>(x,y);
}
inline int find(int x){return x==fa[x]?x:fa[x]=find(fa[x]);}
inline int read(){
	int f=1,x=0;char ch;
	do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');
	do{x=x*10+ch-'0';ch=getchar();}while(ch>='0'&&ch<='9');
	return f*x;
}
int main(){
	n=read();
	for(int i=1;i<=n;i++)fa[i]=i;
	for(int i=1;i<2*n-1;i++){
		int u=read(),v=read();
		s[u].insert(v);s[v].insert(u);
		pair<int,int> p=makepair(u,v);
		if((++mps1[p]>1)&&!mps2.count(p))mps2[p]=1,q.push(p);
	}
	for(int i=1;i<n;i++){
		int x,y;
		while(1){
			if(q.empty())return puts("NO"),0;
			x=find(q.front().fi);y=find(q.front().sc);q.pop();
			if(x!=y)break;
		}
		if(s[x].size()>s[y].size()) swap(x,y); fa[x]=y;
        for(set<int>::iterator it=s[x].begin();it!=s[x].end();it++){
            int v=find(*it);
            if(v==y)continue;
            s[y].insert(v); s[v].insert(y);
            if((++mps1[makepair(y,v)])>1&&!mps2.count(makepair(y,v)))
                q.push(makepair(y,v)),mps2[makepair(y,v)]=1;
            s[v].erase(s[v].find(x));
        }
        s[y].erase(x);s[x].clear();
	}
	puts("YES");
}

Measured memory_bytes: 41600
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	int sum = 0;
	for (int i = 0; i < k; i++) {
		sum += a[i];
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 3628
#include <cassert>
#include <cstdio>
#include <vector>
#include <set>

#include <map>
#include <unordered_map>
#include <deque>
#include <string>
#include <utility>
#include <algorithm>
#include <iostream>
#include <iostream>
#include <climits>

using namespace std;

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; }

const int INF = 1e9;
const long long LINF = 1e18;


bool isPrime(int X) {
    for (int i = 2; i < X / 2; i++) {
        if (X % i == 0) {
            return false;
        }
    }
    return true;
}

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

    while (true) {
        if (isPrime(X)) {
            cout << X << endl;
            break;
        }
        X++;
    }

    return 0;
}


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

int main(){
  
  int N,K,Q;
  cin >> N >> K >> Q;
  int d = Q - K;
  int answer = 0;
  int score[N] = {};
  
  for(int i = 0; i < Q; ++i){
    cin >> answer;
    ++score[answer - 1];
  }
  
  if(d < 0){
    for(int i = 0; i < N; ++i){
      cout << "Yes" << endl;
    }
  }
  else{
    for(int i = 0; i < N; ++i){
      if(d < score[i]){
        cout << "Yes" << endl;
      }
      else{
        cout << "No" << endl;
      }
    }
  }
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>

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

int main(){
    int n;
    cin >> n;
    int ans = 800 * n - 200 * ((n)/15);

    cout << ans << endl;



    return 0;
}

Measured memory_bytes: 256
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
/*多倍長整数/cpp_intで宣言
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
*/

//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0
#define addf(T) [](T a, T b){return (a + b);}
#define minf(T) [](T a, T b){return min(a, b);}
#define maxf(T) [](T a, T b){return max(a, b);}


using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const long double PI = acos(-1.0L);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

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

ll lcm(ll number1, ll number2) {//lcmを求める
	return number1 / gcd(number1, number2) * number2;
}

ll LSB(ll n) { return (n & (-n)); }

/*-----------------------------------------ここからコード-----------------------------------------*/



int main() {

	int n, m;
	scanf("%d%d", &n, &m);
	int k, p;
	vector<int> a(m);
	rep(i, n) {
		scanf("%d", &k);
		rep(j, k) {
			scanf("%d", &p);
			++a[--p];
		}
	}
	int ans = 0;
	rep(i, m) {
		if (a[i] == n)++ans;
	}
	printf("%d\n", ans);

	Please AC;
}


Measured memory_bytes: 3804
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  //a
  string s;
  cin >> s;
  int k;
  cin >> k;
  vector<long long> v;
  int n = (int) s.size();
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      v.push_back(1);
    } else {
      if (s[i] == s[i - 1]) v[(int) v.size() - 1]++;
      else v.push_back(1);
    }
  }
  long long cnt = 0;
  for (auto i : v) {
    cnt += i / 2;
  }
  cnt *= k;
  if (s[0] != s[n - 1]) {
    cout << cnt << '\n';
    return 0;
  }
  if ((int) v.size() == 1) {
    cout << 1LL * n * k / 2 << '\n';
  } else {
    int a = v[0] + v.back();
    cnt -= 1LL * (v[0] / 2) * (k - 1);
    cnt -= 1LL * (v.back() / 2) * (k - 1);
    cnt += 1LL * a / 2 * (k - 1);
    cout << cnt << '\n';
  }
  return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Runtime.Remoting.Messaging;
using System.Security.Principal;
using System.Text;
class Simple {
    private long A, B;
    void Solve() {
        //input
        A = io.Long;
        B = io.Long;
        //cal
        var sum = A + B;
        var ans = sum < 10 ? sum.ToString() : "error";
        //ret
        Console.WriteLine(ans);
    }
    SimpleIO io = new SimpleIO();
    public static void Main(string[] args) { new Simple().Stream(); }
    void Stream() {
        Solve();
        io.writeFlush();
    }
}
class SimpleIO {
    string[] nextBuffer;
    int BufferCnt;
    char[] cs = new char[] {' '};
    StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
    public SimpleIO() {
        nextBuffer = new string[0];
        BufferCnt = 0;
        Console.SetOut(sw);
    }
    public string Next() {
        if(BufferCnt < nextBuffer.Length) return nextBuffer[BufferCnt++];
        string st = Console.ReadLine();
        while(st == "") st = Console.ReadLine();
        nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        BufferCnt = 0;
        return nextBuffer[BufferCnt++];
    }
    public string String => Next();
    public char Char => char.Parse(String);
    public int Int => int.Parse(String);
    public long Long => long.Parse(String);
    public double Double => double.Parse(String);
    public void writeFlush() { Console.Out.Flush(); }
}

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

int main() {
  string str;
  cin >> str;
  
  int c = 0;
  if(str.at(1) == 'R'){
    if(str.at(0) == 'R' && str.at(2) == 'R'){
      cout << 3 << endl;
    }
    else if(str.at(0) == 'R' || str.at(2) == 'R'){
      cout << 2 << endl;
    }
    else
      cout << 1 << endl;
  }
  else if(str.at(0) == 'R' || str.at(2) == 'R'){
    cout << 1 << endl;
  }
  else
    cout << 0 << endl;
  
}

Measured memory_bytes: 3600
#include<iostream>
using namespace std;
int main() {
long K,A,B,n;
cin >> K;
cin >> A;
cin >> B;
if ( (K==1)or(2>(B-A))or(K<A)) cout << 1+K;
else {
n=(K-(A-1))/2;
cout << A+n*(B-A)+K-(A-1+2*n);
}
cout << endl;

}

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

using namespace std;

#define loop(n) for(int lp=0; lp<(n); lp++)
#define ascent(i, a, b)  for(int (i)=(a); (i)<(b); (i)++)
#define descent(i, a, b) for(int (i)=(a); (i)<(b); (i)--)

int main() {
  int h, w;
  while(cin >> h >> w, h||w) {
    pair<int, int> ans = make_pair(h, w);
    int orig_t = h*h + w*w;
    
    bool flg = false;

    for(int i = 1; i <= 150; i ++) {
      for(int j = i+1; j <= 150; j ++) {
	int pre_h = ans.first;
	int pre_w = ans.second;
	int t1 = pre_h*pre_h + pre_w*pre_w;
	int t2 = i*i+j*j;
	
	if(!flg) {
	  if(t1 < t2 || (t1 == t2 && pre_h < i)) {
	    //	    cout << pre_h << "," << pre_w << " " << i << "," << j << endl;
	    //cout << orig_t << " " << t1 << " " << t2 << endl;

	    ans = make_pair(i, j);
	    flg = true;
	  }
	}
	else {
	  if((orig_t < t2 && t2 < t1) || (orig_t == t2 && t2 < t1 && h < i) || (orig_t < t2 && t2 == t1 && i < pre_h)) {
	    //cout << pre_h << "," << pre_w << " " << i << "," << j << endl;
	    //cout << orig_t << " " << t1 << " " << t2 << endl;

	    ans = make_pair(i, j);
	  } 
	}
      }
    }

    cout << ans.first << " " << ans.second << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#define MYDEBUG
#include <iostream>
#include <vector>
#include <chrono>
#include <random>
#include <algorithm>
#include <map>
#include <unordered_map>

#ifdef MYDEBUG
#define debug(x) cout<<#x<<": "<<x<<endl
#else
#define debug(x)
#endif
#define ll long long
#define ull unsigned long long
#define eps 1e-14
#define all(x) x.begin(), x.end()
#define umap unordered_map
using namespace std;

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  out << "[";
  size_t last = v.size() - 1;
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i];
    if (i != last)
      out << ",";
  }
  out << "]";
  return out;
}
int digit(ull x) {
  int ret = 1;
  while (x >= 10) {
    x /= 10;
    ret++;
  }
  return ret;
}
int main() {
  ull N;
  cin >> N;
  ull a, b;
  int minf = 1000000;
  for (a = 1; a * a <= N; ++a) {
    if (N % a != 0)
      continue;
    else {
      b = N / a;
      int f = digit(b);
      minf = min(f, minf);
    }
  }
  cout << minf << endl;
}


Measured memory_bytes: 384
main :: IO ()
main = do
  s <- getLine
  print (f s)

f :: String -> Int
f = fst. foldr step (0, (0, []))
  where
    step x (m, (l, xs)) = if x `elem` "ACGT" then let l' = succ l in (max l' m, (l', x : xs)) else (m, (0, []))


Measured memory_bytes: 380
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
''' 
------------------------
author : iiou16
------------------------
'''

def main():
    N, A, B, C, D = list(map(int, input().split()))
    S = input()

    # A,Bからみて先が"##"の状態になったら詰み
    if "##" not in S[A:C] and "##" not in S[B:D]:
        if C < D or C < B:
            # 先にBをDまで移動させればAもたどり着ける
            print("Yes")
        else:
            # AがBを追い抜く必要があるので、
            # その瞬間に#B or B#にならないようにしないといけない
            # B-1からD+1の間に ... があればOK
            if "..." in S[B-2:D+1]:
                print("Yes")
            else:
                print("No")
    else:
        print("No")


if __name__ == '__main__':
    main()

Measured memory_bytes: 3572
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

use std::cmp::max;
fn main() {
    input!{
        r: i64,
        g: i64,
    }
    println!("{}", 2 * g - r);
}


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


int main(){
	int N;
	scanf("%d",&N);
	
	while(N>=1000){
		N-=1000;
	}
	if(N==0){
		printf("%d\n",N);
		return 0;
	}
	printf("%d\n",1000-N);
	return 0;
}

Measured memory_bytes: 1728
#include <iostream>

using namespace std;
int main(void){
    int H,W;

    while(true){
        cin >> H >> W;
        
        if(H==0 and W==0) break;
        
        for(int i=0;i<H;i++){
            for(int j=0;j<W;j++){
                cout << "#";
            }
            cout << endl;
        }
        
        cout << endl;
    }

    return 0;
}



Measured memory_bytes: 3080
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    long long cnt=0,sum1=0,sum2=0,tmp=0;
    for(int i=0;i<s.length();i++)
    {
        if(s[i]=='B')
        {
            sum1+=i;
            cnt++;
        }
    }
    for(int i=s.length()-1;i>=0;i--)
    {
        if(cnt==0)break;
        sum2+=i;
        tmp++;
        if(tmp>=cnt)break;
    }
    cout<<abs(sum2-sum1)<<endl;
}




Measured memory_bytes: 640
#include "bits/stdc++.h"

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF 999999999

int n,m,p,a,b;
int t[10];
int pass[100][100];

double d[100][1<<8];
bool used[100][1<<8];


double dijk(int s,int g){
    rep(i,100)rep(j,1<<8)d[i][j]=INF;
    rep(i,100)rep(j,1<<8)used[i][j]=false;
    
    d[s][(1<<n)-1]=0;
    
    while(1){
        int v=-1,w=-1;
        rep(u,m){
            rep(i,(1<<n)){
                if(!used[u][i]&&(v==-1||d[u][i]<d[v][w]))v=u,w=i;
            }
        }
        if(v==-1)break;
        used[v][w]=true;
        rep(u,m){
            rep(i,n){
                if(w&(1<<i)&&pass[v][u]!=INF){
                    if(d[v][w]+(double)pass[v][u]/(double)t[i] < d[u][w^(1<<i)])
                        d[u][w^(1<<i)] = d[v][w]+(double)pass[v][u]/(double)t[i];
//                    cout<<"d["<<u<<"]["<<( w^(1<<i) )<<"] = "<<d[u][w^(1<<i)]<<endl;
                }
            }
        }
    }
    double ret=INF;
    rep(i,1<<n){
        ret = min(ret,d[g][i]);
    }
    return ret;
}


int main(){
    while(cin>>n>>m>>p>>a>>b){
        if(n==0&&m==0&&p==0&&a==0&&b==0)break;
        
        rep(i,100)rep(j,100)pass[i][j]=INF;
        a--,b--;
        rep(i,n) cin>>t[i];
        rep(i,p){
            int x,y,z;
            cin>>x>>y>>z;
            x--,y--;
            pass[x][y] = pass[y][x] =z;
        }
        double res = dijk(a,b);
        if(res>=INF-1e-9)cout<<"Impossible"<<endl;
        else printf("%.10lf\n",res);
    }
}

Measured memory_bytes: 1492
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
       int max = 0;
       int N = stdIn.nextInt();
       int[] V = new int[N];
       int[] C = new int[N];
       for(int i=0;i<V.length;i++)
    	   V[i] = stdIn.nextInt();
       for(int i=0;i<C.length;i++)
    	   C[i] = stdIn.nextInt();
       for(int i=0;i<V.length;i++) {
    	   if((V[i]-C[i])>0)
    		   max +=V[i]-C[i];
    	   else
    		   ;
       }
       System.out.println(max);
	}
}

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

int main(int argc, const char * argv[]) {
    long X,K,D;
    cin>>X;
    cin>>K;
    cin>>D;
    X=abs(X);
    if(X/D<=K){
        long r1=X%D;
        if((K-(X-r1)/D)%2==0){
            cout<<r1<<endl;
        }else{
            cout<<(D-r1)<<endl;
        }
    }else{
        cout<<(X-K*D)<<endl;
    }
    return 0;
}


Measured memory_bytes: 3172
import java.util.Scanner;

public class Main{
	
	public static void maxHeapify(int[] a, int x) {
		int left = 2 * x + 1;
		int right = 2 * x + 2;
		int largest = x;
		if(left < a.length)
			if(a[left] > a[x])
				largest = left;
		if(right < a.length)
			if(a[right] > a[largest])
				largest = right;
		if(largest != x) {
			int temp = a[x];
			a[x] = a[largest];
			a[largest] = temp;
			maxHeapify(a, largest);
		}
	}
	public static void buildMaxHeap(int[] a) {
		for(int i = a.length/2; i >= 0; i--) {
			maxHeapify(a, i);
		}
	}
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int[] a = new int[in.nextInt()];
		for(int i = 0; i < a.length; i++) {
			a[i] = in.nextInt();
		}
		buildMaxHeap(a);
		for(int i = 0; i < a.length; i++) {
			System.out.print(" " + a[i]);
		}
		System.out.println("");
		in.close();
	}
}



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

#define pr16 

#ifdef pr16
  #define pr(x)                 cerr << #x << ": " << x << endl;
  #define pr2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
  #define pr3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
  #define pr4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
  #define pr5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
  #define pr6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl;
  #define prc(a) tr(a, it) cerr<<*(it)<<" "; cerr<<endl
  #define pra(a,n) for(int i=0; i<(n); i++) cerr<<((a)[i])<<" "; cerr<<"\n"
  #define prdd(a,r,c) for(int i=0;i<(r);i++) { for(int j = 0;j<(c);j++) cerr<<a[i][j]<<" "; cerr<<endl; } cerr<<endl; 
  #define prddd(a,x,y,z) for(int i=0;i<x;i++) {cerr<<"layer "<<i<<":\n";prdd(a[i],y,z)}
 
#else
  #define pr(x)
  #define pr2(x, y)
  #define pr3(x, y, z)
  #define pr4(a, b, c, d)
  #define pr5(a, b, c, d, e)
  #define pr6(a, b, c, d, e, f)
  #define prc(a)
  #define pra(a,n)
  #define prdd(a, r, c)
  #define prddd(a,x,y,z)
#endif



int main()
{
  string s;
  cin>>s;
  int cnt = 0;
  int mx = 0;
  for(int i = 0; i<3; i++) {
    if (s[i] == 'R')
      cnt ++;
    else 
      cnt = 0;
    mx = max(cnt, mx);
  }
  cout<<mx<<"\n";
}

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

void read(int &x) {
    x=0;int f=1;char ch=getchar();
    for(;!isdigit(ch);ch=getchar()) if(ch=='-') f=-f;
    for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';x*=f;
}
 
void print(int x) {
    if(x<0) putchar('-'),x=-x;
    if(!x) return ;print(x/10),putchar(x%10+48);
}
void write(int x) {if(!x) putchar('0');else print(x);putchar('\n');}

#define lf double
#define ll long long
#define end puts("NO"),exit(0)

const int maxn = 1e5+10;
const int inf = 1e9;
const lf eps = 1e-8;

int head[maxn],tot=1,cnt[maxn<<1],n,v[maxn],d[maxn],rt;
struct edge{int to,nxt;}e[maxn<<1];

void add(int u,int vv) {e[++tot]=(edge){vv,head[u]},head[u]=tot,d[vv]++;}
void ins(int u,int vv) {add(u,vv),add(vv,u);}

void dfs(int x,int fa) {
    if(d[x]==1) return cnt[head[x]]=cnt[head[x]^1]=v[x],void();
    int rm=v[x]<<1,t=0;
    for(int i=head[x];i;i=e[i].nxt)
        if(e[i].to!=fa) dfs(e[i].to,x),rm-=cnt[i],cnt[i]>v[x]?end,0:0;
        else t=i;
    if(!t) return ;
    if(rm>v[x]||rm<0) end;
    cnt[t]=cnt[t^1]=rm;
}

int main() {
    read(n);for(int i=1;i<=n;i++) read(v[i]);
    if(n==2) puts(v[1]==v[2]?"YES":"NO"),exit(0);
    for(int i=1,x,y;i<n;i++) read(x),read(y),ins(x,y);
    for(int i=1;i<=n;i++) if(d[i]!=1) {rt=i,dfs(i,0);break;}
    int t=0;for(int i=head[rt];i;i=e[i].nxt) t+=cnt[i];
    if(t!=v[rt]<<1) end;else puts("YES");
    return 0;
}


Measured memory_bytes: 9088
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <stack>
#include <climits>
#include <map>
#include <set>

using namespace std;

int main(){
    vector<char> N(10);
    int count=0;
   
    cin >> N.at(0)>>N.at(1)>>N.at(2);
  
  for(int i=0;i<3;i++){ 
  if(N.at(i)==55){
        count++;
    }
}
if(count>0)
 cout << "Yes" <<endl;
else
{
    cout << "No" <<endl;
}

}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
using namespace std ;
typedef long long ll ;
const ll N = 200222 ;
ll n, fen[N], an, a[N], h[N];
void up(int idx, ll x){
	while(idx < N){
		fen[idx] = max(fen[idx], x) ;
		idx += (idx & -idx) ;
	}
}
ll qu(int idx){
	ll ans = 0 ; 
	while(idx){
		ans = max(ans, fen[idx]) ;
		idx -= (idx & -idx) ; 
	}
	return ans ;
}
int main()
{
	scanf("%lld", &n) ;
	for(int i = 1 ; i <= n ; i ++) scanf("%lld", &h[i]) ;
	for(int i = 1 ; i <= n ; i ++) scanf("%lld", &a[i]) ;
	for(int i = 1 ; i <= n ; i ++){
		ll now = qu(h[i]) + a[i]; up(h[i], now) ; 
		an = max(an, now) ;
	}
	cout << an ;
}

Measured memory_bytes: 4992
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

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

bool judge(int a, int b, int c){
	if(a + b == c)return true;
	if(c + b == a)return true;
	if(a + c == b)return true;
	return false;
}
int main(void){
	int a, b, c;
	scanf("%d%d%d", &a, &b, &c);
	puts(judge(a, b, c) ? "Yes" : "No");

	return 0;
}

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

int main(){
	int num = 100;
	int n;
	cin >> n;
	for(int i=0;i<n;i++){
		num=(int)ceil((double)num*1.05);
	}
	cout << num*1000 << endl;

	return 0;
}

Measured memory_bytes: 3096
import java.util.*

fun main() = Thread(null, ::abc173c, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun abc173c() {
    val (h, w, k) = readLine()!!.split(' ').map { it.toInt() }
    val grid = (1..h).map { readLine()!!.map { it == '#' }.toBooleanArray() }.toTypedArray()

    var answer = 0

    for (i in 0L until (1L shl h + w)) {
        val bitSet = BitSet.valueOf(longArrayOf(i))
        var count = 0
        for (y in 0 until h) for (x in 0 until w) if (bitSet[y] && bitSet[h + x] && grid[y][x]) count++
        if (count == k) answer++
    }

    println(answer)
}



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

#define st first
#define nd second
#define ll long long
#define ld long double
#define pb push_back
#define emp emplace_back
#define pii pair<int, int>
#define usg unsigned
#define sg signed
#define mp make_pair

using namespace std;

void setIO(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
}

const ld PI = 4*atan((ld)1);
const int INF = 1e9+7;

int main(){
	setIO();
	ll n, ct=0; cin>>n;
	for (ll i = 2; i*i <= n; i++){
		int rq = 1, ct1 = 0;
		while (n%i==0){
			ct1++;
			n/=i;
			if(ct1 == rq){
				ct++;
				rq++;
				ct1=0;
			}
		}
	}
	if (n>1) ct++;
	cout<<ct<<endl;
}

Measured memory_bytes: 3692
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;



int main() {

    ios::sync_with_stdio(false);
    cin.tie(NULL);

    int n;
    cin >> n;

    vector<int> val;
    val.resize(n);

    int pos[n+1];

    for (int i=0; i<n; i++) {
        cin >> val[i];

        pos[val[i]] = i;
    }

    int in_order[n+1];
    memset(in_order, 0, sizeof(in_order));

    in_order[n] = 0;

    for (int z=n-1; z>=1; z--) {

        if (pos[z] < pos[z+1]) {
            in_order[z] = in_order[z+1] + 1;
        }
    }


    int best = 1000000000;


    for (int front=0; front <= n; front++) {

        int start = front;
        int current = start;

        int next = start+1;
        int remaining = (n-next+1);
        if (next <= n) {
            int good = in_order[next] + 1;
            current = current + (remaining - good);
        }

        best = min(best, current);
    }

    cout << best << endl;
    return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <sstream>
#include <string>

using namespace std;

int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

int main(void)
{
	int q;
	cin >> q;
	while (q--){
		int n;
		cin >> n;
		
		int cnt = 0;
		while (cnt < 50000){
			string str = toString(n);
			if (str.length() == 1) break;
			long long maxnum = 0;
			for (int i = 1; i < str.length(); i++){
				int a = toInt(str.substr(0, i)), b = toInt(str.substr(i));
				maxnum = max(maxnum, (long long)a * b);
				// cout << a << " " << b << endl;
			}
			n = maxnum;
			cnt++;
		}
		if (cnt == 50000) cout << -1 << endl;
		else cout << cnt << endl;
	}

	return 0;
}

Measured memory_bytes: 1228
//#include <ext/pb_ds/assoc_container.hpp> 
 //#include <ext/pb_ds/tree_policy.hpp>
// #include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <iterator>
#include <functional>
#include <limits>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <stack>
using namespace std;
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define trace(x) cerr << #x << ": " << x << " " << endl;

typedef int64_t ll;
 
#define endl '\n'
#define int ll
ll mod=1e17;
ll mod1=1e9+5;
ll power(ll a,ll b)
{
    if(b==0) return 1;
    else if(b%2==0)
        return power(((((a)%mod)*((a)%mod))%mod),b/2)%mod;
    else return (((a)%mod)*(power(((((a)%mod)*((a)%mod))%mod),b/2)%mod))%mod;
}
inline ll inverse(ll a,ll md) {
  a %= md;
  if (a < 0) a += md;
  ll b = md, u = 0, v = 1;
  while (a) {
    ll t = b / a;
    b -= t * a; swap(a, b);
    u -= t * v; swap(u, v);
  }
  assert(b == 1);
  if (u < 0) u += md;
  return u;
}
  
  
 //using namespace __gnu_pbds;
 //#define ordered_set tree<pair<int,int>, null_type,less<pair<int,int>>, rb_tree_tag,tree_order_statistics_node_update>
//find_by_order(k)  returns iterator to kth element starting from 0;
//order_of_key(k) returns count of elements strictly smaller than k;
//erase,insert same as normal set
// mt19937 mrand(chrono::high_resolution_clock::now().time_since_epoch().count()); for randomized solution
const int ce=1e9+7;
ll fast_mod(ll input)
{
    return input < ce ? input : input%ce;
}
#define pi acos(-1)
vector<int> v;
int ans=0;
int a[51],b[51],c[51],d[51];
int n,m,q;
void brute(int pos,int last)
{
    if(pos==n)
    {
        int te=0;
        for(int k=0;k<q;k++)
        {
            if(v[b[k]-1]-v[a[k]-1]==c[k])
            {
                te+=d[k];
            }
        }
        ans=max(ans,te);
        return;
    }
    for(int i=last;i<=m;i++)
    {
        v.push_back(i);
        brute(pos+1,i);
        v.pop_back();
    }
}
int32_t main()
{
    IOS


    cin>>n>>m>>q;
    for(int i=0;i<q;i++)
    {
        cin>>a[i]>>b[i]>>c[i]>>d[i];
    }
    brute(0,1);
    cout<<ans;

}       


Measured memory_bytes: 3656
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;

int main() {
  string s;
  while(cin >>s){
    int a = 0, b = 0;
    REP(i, (int)(s.length()) - 2){
      if(s.substr(i, 3) == "JOI") ++a;
      if(s.substr(i, 3) == "IOI") ++b;
    }
    cout <<a <<endl <<b <<endl;
  }
  
  return 0;
}

Measured memory_bytes: 1216
#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdint.h>
#include<vector>
#include<deque>
#include<stack>
#include<functional>
#include<string>
#include<cstring>
#include<time.h>
#include<array>
#include<iomanip>
#include<list>
#include<set>
#include<map>
#include<random>
#include<unordered_map>
#include<unordered_set>
#include<bitset>
#include <queue>
#include<boost/multiprecision/cpp_int.hpp>


using namespace std;
using namespace boost::multiprecision;

using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using ldb = long double;

#define REP(i,a,b) for(ll i = a; i < b; ++i)
#define PRI(s) cout << s << endl
#define PRIF(v, n) printf("%."#n"f\n", v)
#define PRIY PRI("Yes")
#define PRIN PRI("No")
template<typename A, typename B>
void mins(A & a, const B & b) { a = min(a, (A)b); };
template<typename A, typename B>
void maxs(A & a, const B & b) { a = max(a, (A)b); };

//素因数分解
ll factorize(long long n) {
	ll ans = 1;
	for (long long i = 2; i * i <= n; ++i) {
		if (n % i != 0) continue;
		ll cnt = 0;
		while (n % i == 0) {
			n /= i;
			++cnt;
		}
		ans *= (cnt + 1);
	}
	if (n != 1) ans *= 2;
	return ans;
}

int main() {
	ll N; cin >> N;
	ll ans = 0;
	for (ll C = 1; C <= N - 1; ++C) {
		auto ret = factorize(N - C);
		ans += ret;
	}
	PRI(ans);
	return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>

using namespace std;

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mkp(a, b) make_pair(a, b)
const int inf = 1e+9;

const ll mod = 1000000007;





int main() {

	ll k, a, b;
	cin >> k >> a >> b;

	for (int i = a; i <= b ;i++) {
		if (i % k == 0) {
			cout << "OK" << endl;
			return 0;
		}
	}

	cout << "NG" << endl;
	return 0;
}


Measured memory_bytes: 3136
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define FOR(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#define FORD(i, x, y) for (decay<decltype(x)>::type i = (x), _##i = (y); i > _##i; --i)
#ifdef zerol
#define dbg(x...) do { cout << "\033[32;1m" << #x << " -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) { for (auto v: a) cout << v << ' '; err(x...); }
template<typename T, typename... A>
void err(T a, A... x) { cout << a << ' '; err(x...); }
#else
#define dbg(...)
#endif
// -----------------------------------------------------------------------------

const int N = 2E5 + 100;
int a[N];

namespace sol {
    int ans, bin[N], c[N];
    void update(int p, int delta) {
        if (p > 0) {
            int prev = c[p];
            c[p] += delta;
            if (prev == 0 && c[p] > 0) ans--;
            else if (prev > 0 && c[p] == 0) ans++;
        }
    }

    void incr(int pos) {
        update(pos - bin[pos]++, 1);
    }
    void decr(int pos) {
        update(pos - --bin[pos], -1);
    }
}

int main() {
    int n, q; cin >> n >> q;
    sol::ans = n;
    FOR (i, 1, n + 1) {
        cin >> a[i];
        sol::incr(a[i]);
    }
    while (q--) {
        int x, v; cin >> x >> v;
        sol::decr(a[x]);
        sol::incr(a[x] = v);
        cout << sol::ans << endl;
    }
}

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

int main() {
  int N, Q;
  cin >> N >> Q;
  string s;
  cin >> s;
  int l[LIMIT], r[LIMIT];
  for(int i=0;i<Q;i++) {
    cin >> l[i] >> r[i];
  }
  
  int allac = 0;
  for(int i=0;i<N-1;i++) {
    if(s[i] == 'A' && s[i+1] == 'C') {
      allac++;
      i++;
    }
  }
  int forward[LIMIT] = {};
  int back[LIMIT] = {};
  
  for(int i=0; i<N;i++) {
    if(i==0) continue;
    if (s[i] == 'C' && s[i-1] == 'A') {
      forward[i] = forward[i-1] + 1;
    } else {
      forward[i] = forward[i-1];
    }
  }
  reverse(s.begin(), s.end());
  for(int i=0; i<N;i++) {
    if(i==0) continue;
    if (s[i] == 'A' && s[i-1] == 'C') {
      back[i] = back[i-1] + 1;
    } else {
      back[i] = back[i-1];
    }
  }
  
  rep(i, Q){
    //cout << forward[l[i-1]] << endl;
    cout << allac - forward[l[i]-1] - back[N-r[i]] << endl;
  }
}



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

typedef long long ll;

using namespace std;

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


int main(){
    int n,m;
    double sum = 0;
    cin >> n >> m;
    vector<int> A(n);
    rep(i,n) {
        cin >> A[i];
        sum += A[i];
    }
    sort(A.begin(),A.end(),greater<int>());
    if(A[m-1] < sum/(4*m)) cout << "No" << endl;
    else cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 256
/*DavitMarg*/
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <cstring>
#include <map>
#include <set>
#include <queue>
#include <iomanip>
#include <stack>
#include <cassert>
#include <iterator>
#include <ctype.h>
#include <fstream>
#include <unordered_map>
#define mod 1000000007ll
#define LL long long
#define LD long double
#define MP make_pair
#define PB push_back
#define all(v) v.begin(),v.end()
using namespace std;

LL n, a[3005], dp[3005][3005],sum;

void dfs(LL l, LL r)
{
	if (dp[l][r] != -1)
		return;
	if (l == r)
	{
		dp[l][r] = a[l];
		return;
	}
	else if (l + 1 == r)
	{
		dp[l][r] = max(a[l], a[r]);
		return;
	}

	dfs(l + 1, r);
	dfs(l + 2, r);
	dfs(l + 1, r - 1);
	dp[l][r] = a[l] + min(dp[l + 2][r], dp[l + 1][r - 1]);

	dfs(l, r-1);
	dfs(l, r - 2);
	dfs(l + 1, r - 1);
	dp[l][r] = max(a[r] + min(dp[l][r - 2], dp[l + 1][r - 1]),dp[l][r]);
	
}

int main()
{
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		scanf("%lld", a + i);
		sum += a[i];
	}
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
			dp[i][j] = -1;
	dfs(1,n);
	cout << dp[1][n] * 2 - sum << endl;
	return 0;
}
/*

*/

Measured memory_bytes: 71040
#include <bits/stdc++.h>
#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 N;
    cin >> N;
    vector<int> L(N);
    for(int i = 0; i < N; i++) {
        cin >> L[i];
    }
    sort(L.begin(), L.end());

    int ans = 0;
    for (int i = 0; i < N; i++){
        for (int j = i + 1; j < N; j++)
        {
            auto temp = upper_bound(L.begin(), L.end(), L[j] - L[i]);
            int k = temp - L.begin();
            ans += max(i - k, 0);        
        }      
    }
    cout << ans << endl;
  return 0;
}


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

int main()
{
	long long N,A,B;
	cin >> N >> A >> B;
	if(N==1 && A!=B) cout << 0 << '\n';
	else if(A > B) cout << 0 << '\n';
	else cout << (N-2)*(B-A)+1 << '\n';
}

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

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define en '\n'
#define fs first
#define sd second
# define PI        3.141592653589793238462643383279502884L

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, m;
    cin >> n >> m;
    vector<vector<int>> g(n);
    int l, r;
    for(int i = 0; i < m; ++i){
        cin >> l >> r;
        --l; --r;
        g[l].push_back(r);
        g[r].push_back(l);
    }
    int s = 0;
    queue<int> q;
    q.push (s);
    vector<bool> used (n);
    vector<int> d (n), p (n);
    used[s] = true;
    p[s] = -1;
    while (!q.empty()) {
        int v = q.front();
        q.pop();
        for (size_t i=0; i<g[v].size(); ++i) {
            int to = g[v][i];
            if (!used[to]) {
                used[to] = true;
                q.push (to);
                d[to] = d[v] + 1;
                p[to] = v;
            }
        }
    }
    bool have_res = true;
    for(int i = 0; i < n; ++i){
        if(!used[i]){
            have_res = false;
            break;
        }
    }
    if(have_res){
        cout << "Yes" << en;
        for(int i = 1; i < n; ++i){
            cout << p[i]+1 << en;
        }
    }else{
        cout << "No" << en;
    }
}

Measured memory_bytes: 10640
x,y = map(int, input().split())

a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
c = [2]

if x in a and y in a:
  print('Yes')
elif x in b and y in b:
  print('Yes')
elif x in c and y in c:
  print('Yes')
else:
  print('No')


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define INF 1000000000

int x[110];

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

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

    int ans=INF;
    for(int i=1;i<=100;i++)
    {
        int sum=0;
        for(int j=0;j<n;j++)sum+=(x[j]-i)*(x[j]-i);
        ans=min(ans,sum);
    }

    cout<<ans<<"\n";

    return 0;
}


Measured memory_bytes: 3632
require 'prime'

n = gets.chomp.to_i
MOD = 10 ** 9 + 7
ans = 1
h = Hash.new(0)
 
(2..n).each do |i|
    arr = Prime.prime_division(i)
    arr.each do |num, count|
        h[num] += count
    end
end

h.each do |key, value|
    ans *= value + 1
    ans %= MOD
end

puts ans

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

int main(){
  int n; cin >> n;
  int ans=0;
  for(int j=1;j<=n;j=j+2){
    int count=0;
    for(int i=1;i<=n;i++){
      if(j%i==0)
        count++;
    }
    if(count ==8)
      ans++;
  }
  cout << ans << endl;
}  

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;}
template<typename T>
bool chmax(T &a,T b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2>&p){
  return os << p.first << " " << p.second;
}  
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll h,w,k;cin>>h>>w>>k;
  vector<string>s(h);
  rep(i,0,h)cin>>s[i];
  res=INF;
  rep(i,0,1<<h-1){
    bitset<10>x=i;
    vector<ll>cnt(h);
    ll sum=__builtin_popcountll(i);
    bool judge=true;
    rep(j,0,w){
      rep(o,0,h)cnt[o]+=(s[o][j]=='1');
      ll now=0;
      bool sw=true;
      rep(o,0,h){
        now+=cnt[o];
        if(now>k)sw=false;
        if(x[o])now=0;
      }
      if(!sw){
        sum++;
        rep(o,0,h)cnt[o]=(s[o][j]=='1');
        now=0;
        rep(o,0,h){
          now+=cnt[o];
          if(now>k)judge=false;
          if(x[o])now=0;
        }
      }   
      //cout<<i spa j<<endl;
      //if(i==0)debug(cnt,h);
      if(!judge)break;
    }
    //cout<<i spa judge spa sum<<endl;
    if(judge)chmin(res,sum);
  }
  cout<<res<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
	int a, b;

	while (scanf("%d %d", &a, &b) != EOF) {
		int sum = a + b;
		int i;
		for (i = 0; sum > 0; i++)
			sum /=10;
		printf("%d\n", i);
	}
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_(i, n, m) for (int i = n; i < (int)(m); i++)
#define all(v) v.begin(), v.end()
#define int long long
#define stoi stoll
//#define _GLIBCXX_DEBUG

bool next(vector<int> h) {
  rep(i, h.size()) {
    if(h[i] > 0) return true;
  }
  return false;
}

signed main() {
  int N; cin >> N;
  vector<int> h(N);
  rep(i, N) cin >> h[i];
  
  int ans = 0;
  while(next(h)) {
    int k = 0;
    rep(i, N) {
      if(h[i] > 0) {
        if(k == 0) {
          ans++;
          k = 1;
        }
      } else {
        k = 0;
      }
    }
    rep(i, N) h[i]--;
  }
  
  cout << ans << endl;

}


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

long long N, S, A[1 << 18], B[1 << 18];

int main() {
	cin >> N;
	for (int i = 1; i <= N + 1; i++) cin >> A[i];
	for (int i = 1; i <= N; i++) cin >> B[i];

	for (int i = 1; i <= N; i++) {
		long long v = min(A[i], B[i]); A[i] -= v; B[i] -= v;
		long long w = min(A[i + 1], B[i]); A[i + 1] -= w; B[i] -= w;
		S += (v + w);
	}
	cout << S << endl;
	return 0;
}

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

int N, P, a[55];

ll f[100], g[100];

int main() {
    scanf("%d %d", &N, &P);
    for (int i = 0; i < N; i++) scanf("%d", a+i);
    if (P) g[N] = 1;
    else f[N] = 1;
    for (int i = N-1; i >= 0; i--) {
        if (a[i]&1) f[i] = g[i] = f[i+1]+g[i+1];
        else f[i] = 2*f[i+1], g[i] = 2*g[i+1];
    }
    printf("%lld\n", f[0]);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  int n=s.size();
  stack<char> t;
  for(int i=0;i<n;i++){
    if(s[i]=='S'){
      t.push(s[i]);
    }
    else{
      if(!t.empty()&&t.top()=='S'){
        t.pop();
      }
      else{
        t.push(s[i]);
      }
    }
  }
  cout << t.size() << endl;
}

Measured memory_bytes: 644
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<set>
#include<map>
using namespace std;


int main() {
    int  a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << min(a,b) + min(c,d);
    
    
    cout << endl;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args){
		int MAX = 5637;
		int p[] = new int[MAX];
		int cnt = 0;
		for (int i = 0; i <= 55555; i++) {
			if (isPrimeFive(i)) {
				p[cnt++] = i;
			}
		}

		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = p[i];
		}

		String[] sa = Arrays.stream(a).mapToObj(String::valueOf).toArray(String[]::new);
		String result = String.join(" ", sa);
		System.out.println(result);
  }

	private static boolean isPrimeFive(int x) {
		if (x == 0 || x == 1) {
			return false;
		}
		if (x % 5 != 1) {
			return false;
		}
		for (int i = 2; i*i <= x; i++) {
				if (x % i == 0) {
					return false;
				}
		}
		return true;
	}
}


Measured memory_bytes: 28884
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vc = vector<char>;
using vvc = vector<vc>;
using pll = pair<ll, ll>;
using stkll = vector<pll>;
const ll INF = 1LL << 60;
const ll MOD = 1e9 + 7;
#define rep(i, n) for (ll i = 0; i < (n); i++)
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
#ifndef ONLINE_JUDGE
    #define debug(x) cerr << #x << ": " << x << endl;
#else
    #define debug(x)
#endif


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

    ll n, m;
    cin >> n >> m;
    vll h(n);

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

    vector<bool> ok(n, true);
    rep(i, m) {
        ll a, b;
        cin >> a >> b;
        a--, b--;
        if(h[a] <= h[b]) ok[a] = false;
        if(h[a] >= h[b]) ok[b] = false;
    }

    ll ans = 0;
    rep(i, n) if(ok[i]) ans++;

    cout << ans << endl;
}


Measured memory_bytes: 3976