akhauriyash/Code-Regression huggingface dataset:
//BISMILLAHIR RAHMANIR RAHEEM
                                                //ALLAH IS WATCHING ME

//█▀█─█──█──█▀█─█─█
//█▄█─█──█──█▄█─█▄█
//█─█─█▄─█▄─█─█─█─█


#include<bits/stdc++.h>
using namespace std;

#define ull    unsigned long long
#define ll    long long
#define ios    ios::sync_with_stdio(0);cin.tie(0);
#define ses   "\n"

string digit="0123456789";
string small="abcdefghijklmnopqrstuvwxyz";

int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1}; // 8-direction.......
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[]= {1,-1,0,0}; // 4-direction...........
int dy4[]= {0,0,1,-1};

/////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////

//main function is here.........

int main()
{
    //ios
ll h,a;
cin>>h>>a;
cout<<ceil((double)h/a);
}




//Alhamdulillah


Measured memory_bytes: 256
n, k = map(int, input().split())
a_list = [int(input()) for _ in range(n)]

dp = [1] * n

for i in range(n):
    for j in range(max(0, i - 100), i):
        if abs(a_list[i] - a_list[j]) <= k:
            dp[i] = max(dp[i], dp[j] + 1)

ans = max(dp)
print(ans)

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

int main()
{
    int A, B, C;
    cin >> A >> B >> C;
    bool flag = false;
    for (int i = 1; i <= B; ++i)
    {
        if( (i*A)%B ==C ){
            flag = true;
        }
    }

    if(flag){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		
		Dice dice1 = new Dice(sc);
		Dice dice2 = new Dice(sc);
		boolean a = false;
		
		a = a || Dice.check(dice1, dice2);
		dice1.turnN();
		a = a || Dice.check(dice1, dice2);
		dice1.turnE();
		a = a || Dice.check(dice1, dice2);
		dice1.turnE();
		a = a || Dice.check(dice1, dice2);
		dice1.turnE();
		a = a || Dice.check(dice1, dice2);
		dice1.turnN();
		a = a || Dice.check(dice1, dice2);
		
		if(a) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}

class Dice{
	int[] s = new int[4];
	int[] t = new int[2];
	
	Dice(Scanner sc) {
		t[0] = sc.nextInt();
		s[0] = sc.nextInt();
		s[3] = sc.nextInt();
		s[1] = sc.nextInt();
		s[2] = sc.nextInt();
		t[1] = sc.nextInt();
	}
	
	static boolean check(Dice dice1, Dice dice2){
		boolean a = false;
		
		if(dice2.t[0] == dice2.t[0]) {
			for(int its = 0; its < 4; its++) {
				if(dice2.s[0] == dice1.s[its]) {
					if(dice2.s[1] == dice1.s[(its+1)%4] 
						&& dice2.s[2] == dice1.s[(its+2)%4] 
						&& dice2.s[3] == dice1.s[(its+3)%4] 
						&& dice2.t[1] == dice1.t[1]) {
						a = true;
					}
				}
			}
		}
		
		return a;
	}
	
	void turnN() {
		int x = t[0];
		t[0] = s[0];
		s[0] = t[1];
		t[1] = s[2];
		s[2] = x;
	}
	
	void turnS() {
		int x = t[0];
		t[0] = s[2];
		s[2] = t[1];
		t[1] = s[0];
		s[0] = x;
	}
	
	void turnE() {
		int x = t[0];
		t[0] = s[1];
		s[1] = t[1];
		t[1] = s[3];
		s[3] = x;
	}
	
	void turnW() {
		int x = t[0];
		t[0] = s[3];
		s[3] = t[1];
		t[1] = s[1];
		s[1] = x;
	}
}


Measured memory_bytes: 26368
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int X,Y,Z;
  cin>>X>>Y>>Z;
  int a,b,c;
  a=X;
  b=Y;
  c=Z;
  X=c;
  Y=a;
  Z=b;
  cout<<X<<" "<<Y<<" "<<Z;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#define FPEN freopen("in.txt", "r", stdin);
#else
#define FPEN
#endif
const int maxn = 200009;
typedef long long i64;
typedef pair<i64, i64> pi64;
typedef pair<int, int> pi;
const i64 MOD = 119 << 23 | 1;
class {
 public:
  int a, b, c, n;
  string s[maxn];
  string ans[maxn];
  int cnt[555];
  void solve() {
    cin >> n >> a >> b >> c;
    for (int i = 0; i < n; ++i) cin >> s[i];
    cnt['A'] = a;
    cnt['B'] = b;
    cnt['C'] = c;
    s[n] = "AB";
    for (int i = 0; i < n; ++i) {
      // cout << cnt['A'] << " " << cnt['B'] << " " << cnt['C'] << endl;
      if (cnt[s[i][0]] == cnt[s[i][1]] && cnt[s[i][0]] == 0) {
        cout << "No\n";
        return;
      }
      if (cnt[s[i][0]] + cnt[s[i][1]] == 1) {
        if (cnt[s[i][0]])
          ans[i] = s[i][1];
        else
          ans[i] = s[i][0];
        swap(cnt[s[i][0]], cnt[s[i][1]]);
      } else {
        int j = i;
        while (j < n && s[j] == s[i]) ++j;
        int L, R;
        if (s[j][0] == s[i][0] || s[j][1] == s[i][0])
          L = s[i][0];
        else
          L = s[i][1];
        R = s[i][1] + s[i][0] - L;
        while (i < j) {
          if (cnt[R] == 0) {
            ans[i] = R;
            cnt[R]++;
            cnt[L]--;
          } else {
            ans[i] = L;
            cnt[L]++;
            cnt[R]--;
          }
          ++i;
        }
        --i;
      }
    }
    cout << "Yes\n";
    for (int i = 0; i < n; ++i) {
      cout << ans[i] << '\n';
    }
  }
} NSPACE;
int main() {
  FPEN;
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  NSPACE.solve();
}

Measured memory_bytes: 16156
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

const int inf = 41234;
int N, Ma, Mb;
std::vector<int>a, b, c;
std::vector<std::vector<std::vector<int>>>memo(41, std::vector<std::vector<int>>(412, std::vector<int>(412, -1)));

int dp(int i, int j, int k)
{
	if (j > 0 && k > 0 && Ma*k == Mb * j) return 0;
	if (i == N) return inf;
	if (memo[i][j][k] != -1) return memo[i][j][k];
	int res1 = dp(i + 1, j + a[i], k + b[i]) + c[i];
	int res2 = dp(i + 1, j, k);
	return memo[i][j][k] = std::min(res1, res2);
}

int main()
{
	in >> N >> Ma >> Mb;
	a.resize(N); b.resize(N); c.resize(N);
	rep(i, N) in >> a[i] >> b[i] >> c[i];
	out << (dp(0, 0, 0) >= inf ? -1 : dp(0, 0, 0)) << std::endl;
	return 0;
}


Measured memory_bytes: 28800
//by yjz
#include<bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
#define foreach(it,s) for(__typeof((s).begin()) it=(s).begin();it!=(s).end();it++)
#ifndef LOCAL
#define cerr if(0)cout
#endif
typedef long long ll;
const int mod = 1e9+7;
const int maxn = 1000111;
ll qpow(ll x, ll k) {return k==0? 1: 1ll*qpow(1ll*x*x%mod,k>>1)*(k&1?x:1)%mod;}
ll inv3 = qpow(3, mod-2);
ll fac[maxn], ifac[maxn], inv[maxn];
ll C(int x, int y) {return fac[x]*ifac[y]%mod*ifac[x-y]%mod;}
int main()
{
	inv[1] = 1;
	for (int i=2; i<maxn; i++) inv[i] = mod-inv[mod%i]*(mod/i)%mod;
	fac[0] = 1;
	for (int i=1; i<maxn; i++) fac[i] = fac[i-1]*i%mod;
	ifac[0] = 1;
	for (int i=1; i<maxn; i++) ifac[i] = ifac[i-1]*inv[i]%mod;
	int N;
	cin>>N;
	ll a=1, b=0, ans=0;
	for (int K=1; K<=N; K++)
	{
		int na = (b+b)%mod, nb = (a+b)%mod;
		a = na; b = nb;
		ans = (ans+1ll*b*C(N, K)%mod*inv[N]%mod*inv[K])%mod;
	}
	cout<<ans*qpow(inv3, N)%mod<<endl;
	return 0;
}


Measured memory_bytes: 23680
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<functional>
#include<queue>
#include<map>
#include<cmath>
#include<tuple>
#include<algorithm>
#include<bitset>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

#define DBG cerr << '!' << endl;
#define REP(i,n) for(int (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(int (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(int (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int i = 0;i < (n);i++)cerr << v[i] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int a = 0;a < i;a++){for(int b = 0;b < j;b++)cerr << v[a][b] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()

using namespace std;

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

#define MMAX 7368795

int main()
{
	int m,n;
	while(cin >> m >> n,m|n)
	{
		int memo[MMAX] = {};
		int i,Mcount = 0;
		for(i = m;i < MMAX;i++)
		{
			if(memo[i] == 0)
			{
				if(Mcount == n)break;

				for(int j = i;j < MMAX;j += i)
				{
					memo[j] = 1;
				}
				Mcount++;			
			}
		}
		
		cout << i << endl;
		
		
	}
	return 0;
}

Measured memory_bytes: 31856
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
typedef long long ll;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    int M1, D1, M2, D2;
    cin >> M1 >> D1 >> M2 >> D2;
    if(M2 > M1) {
        cout << 1 << endl;
    } else {
        cout << 0 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner scn = new Scanner(System.in)) {
			int N = scn.nextInt();
			int M = scn.nextInt();
			int[] Ai = new int[M];

			int sum = 0;
			for(int i = 0; i < M; i++) {
				Ai[i] = scn.nextInt();
				sum = sum + Ai[i];
			}

			if(N < sum) {
				System.out.println(-1);
			}else {
				System.out.println(N-sum);
			}
		}
	}
}

Measured memory_bytes: 39020
#include<algorithm>
#include <iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
#include<string>
using namespace std;
int main(){
   
    int a,b,x;
    cin>>a>>b>>x;
    
    if(a<=x && x<=a+b){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
   
    
    return 0;
   
}






Measured memory_bytes: 256
n = int(input())
Y = [[int(i) for i in input().split()] for i in range(n)] 
X = sorted(Y, key=lambda x:x[1])
A = [a[0] for a in X]
B = [b[1] for b in X]
A.append(0)
sum_A = A[0]
evaluate = 0
for j in range(n):
    if sum_A <= B[j]:
        sum_A = sum_A + A[j+1]
        evaluate += 1
if evaluate == n:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 42832
#include<iostream>

using namespace std;



int main(){
  int A,B,K;
  cin >>A>>B>>K;

  for(int i=0;i<K/2;i++){
    if(A%2){
      A--;
    }
    B += A/2;
    A /=2;
    if(B%2){
      B--;
    }
    A+=B/2;
    B /=2;
  }
 if(K%2){ 
    if(A%2){
      A--;
    }
    B += A/2;
    A /=2;
  }
  
  cout<<A<<'\n'<<B;
  return 0;
}






Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <cstring>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <set>
#include <vector>
#include <sstream>
#include <typeinfo>
#include <fstream>
#include <climits>
#include <functional>

#define REP(i,n) for(int i = 0;i < n;i++)
#define pyfor(j,s,n,i) for(int j = s;j < n;j += i)

using namespace std;
typedef long long ll;
const int INF = INT_MAX;

const int max_n = 1e3;

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

  string pos = "Possible", imp = "Impossible";

  ll N, L;
  cin >> N >> L;

  ll ropes[N];
  REP(i, N){
    cin >> ropes[i];
  }

  int last = 0;
  pyfor(i, 1, N, 1){
    if(ropes[i-1] + ropes[i] >= L){
      last = i;
      break;
    }
  }

  if(last != 0){
    cout << pos << "\n";
    pyfor(i, 1, last, 1)
      cout << i << "\n";
    for(int i = N-1; i > last; i--)
      cout << i << "\n";
    cout << last << "\n";
  }
  else{
    cout << imp << "\n";
  }

  return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <math.h>
#include <string>
#include <string.h>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <set>
#include <map>
#include <stdlib.h>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1000000000000000LL
#define rep(i,n) for(i=0;i<n;i++)

typedef pair<int,int> pii;
int i,j;


int main() {
    while(1){
        ll n;
        cin>>n;
        if(n==0)break;
        ll a[10000]={};
        rep(i,n)
            cin>>a[i];
        sort(a,a+n);
        ll m=INF;
        rep(i,n-1)
            m=min(m,abs(a[i]-a[i+1]));
        cout<<m<<endl;
    }
    return 0;
}

Measured memory_bytes: 3232
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>

#define rep(i, a, b) for ( int i = (a); i < (b); i++ )
#define per(i, a, b) for ( int i = (b)-1; i >= (a); i--)
#define pb push_back
#define bg begin()
#define en end()
#define DEBUG_INT(var) printf("the value of "#var" is %d\n", var)
#define PRINT_ARRAY(name, i) printf("the value of "#name"[%d] is %d\n", (i), name[(i)])
#define DEBUG_ARRAY(name, begin, end) REP(i, begin, end) PRINT_ARRAY(name, i)

#define pr_arr(name, a, b) \
  for (int i = (a); i < (b); i++) { \
    for (int j = (a); j < (b); j++) {\
      if (j > (a)) printf(" "); \
      printf("%2lld", name[i][j]); \
    }\
    printf("\n");\
  }\

#define YES puts("YES")
#define NO  puts("NO")
#define Yes puts("Yes")
#define No  puts("No")

using namespace std;

typedef long long ll;

static const long long MOD = 1e9+7;

ll C[2005][2005];
int N, K;
ll ans[2005];

void combination(int n) {
  for (int i = 1; i <= n; i++) {
    C[i][0] = C[0][i] = 1;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= i; j++) {
      C[i][j] = C[i-1][j-1] + C[i-1][j];
      C[i][j] %= MOD;
    }
  }
  C[0][0] = 1;
}

int main(void) {
    scanf("%d %d", &N, &K);
    combination(N);

    int i = 1;
    while (i <= K && i <= N - K + 1) {
      ans[i] = C[K-1][i-1] * C[N-K+1][i];
      ans[i] %= MOD; 
      i++;
    } 
   

  
    rep(i, 1, K+1) printf("%lld\n", ans[i]);

	return 0;
}


Measured memory_bytes: 30208
using System;
using System.Collections.Generic;
using System.Linq;
using static Atcoder;
using System.Threading.Tasks;
using System.ComponentModel;

public class Hello
{
    public static void Main()
    {
        int N = IntRead();
        Dictionary<int, int> dic = new Dictionary<int, int>();
        int[] box = SpIntRead(' ');
        //int[] box = new int[100000];
        //for (int i = 0; i < 100000; i++) box[i] = 1000000000;
        foreach (var i in box)
        {
            if (!dic.ContainsKey(i)) dic[i] = 1;
            else dic[i]++;
        }
        var sorted = dic.OrderByDescending(k => k.Key);
        int x = 0, y = 0;
        foreach (var v in sorted)
        {
            if (x == 0 &&v.Value >= 4) {
                x = y = v.Key;
                break;
            }
            else if (v.Value >= 2)
            {
                if (x == 0) x = v.Key;
                else
                {
                    y = v.Key;
                    break;
                }
            }
        }
        Console.WriteLine((long)x * y);
    }
}

public class Atcoder
{
    static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
    public static long LCM(long a, long b)
    {
        long c = a * b;
        if (a < b) Swap(ref a, ref b);
        long d = a % b;
        while (d != 0)
        {
            a = b;
            b = d;
            d = a % b;
        }
        return c / b;
    }
    public static string StrReverce(string s)
    {
        return new string(s.Reverse().ToArray());
    }
    public static int IntRead()
    {
        return int.Parse(Console.ReadLine());
    }
    public static bool IsPrime(int n)
    {
        if (n < 2) return false;
        if (n == 2) return true;
        if (n % 2 == 0) return false;

        //double sqrtNum = Math.Sqrt(n);
        for (int i = 3; i < n; i += 2)
        {
            if (n % i == 0) return false;
        }
        return true;
    }
    public static string[] SpRead(char c)
    {
        return Console.ReadLine().Split(c);
    }
    public static int[] SpIntRead(char c)
    {
        return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    }
    public static string ToConvertBit(int N, int e)
    {
        string ret = "";
        int r = 0;
        while (N != 0)
        {
            r = N % e;
            ret += r.ToString();
            N -= r;
            N /= e;
        }
        ret = StrReverce(ret);
        return ret;
    }
}


Measured memory_bytes: 25824
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        double x1 = Double.parseDouble(stdin.next());
        double y1 = Double.parseDouble(stdin.next());
        double x2 = Double.parseDouble(stdin.next());
        double y2 = Double.parseDouble(stdin.next());
        double x3 = Double.parseDouble(stdin.next());
        double y3 = Double.parseDouble(stdin.next());

        double a = Math.hypot(x1 - x2, y1 - y2);
        double b = Math.hypot(x2 - x3, y2 - y3);
        double c = Math.hypot(x3 - x1, y3 - y1);

        double s = Math.abs((x1 - x3) * (y2 - y3) - (x2 - x3) * (y1 -y3)); // 三角形の面積 * 2
        double r = s / (a + b + c); // 内接円の半径

        double d = Math.max(a, Math.max(b, c));
        double x = d / (2 + d / r);
        System.out.println(x);
    }
}

Measured memory_bytes: 23892
def LI():
    return list(map(int, input().split()))


L, R = LI()
ans = 2020
for i in range(L, R+1):
    for j in range(i+1, R+1):
        y = (i*j) % 2019
        ans = min(ans, y)
        if ans == 0:
            break
    if ans == 0:
        break
print(ans)


Measured memory_bytes: 9008
#include<bits/stdc++.h>
using namespace std;
int main(){
	char a[3];
	for(int i=0;i<3;i++){
		cin>>a[i];
	}
	if(a[1]==66){
		printf("ARC\n");
	}else if(a[1]==82){
		printf("ABC\n");
	}
}

Measured memory_bytes: 3624
#include <iostream>
#include <algorithm>
#include <vector>

int main(int argc, char const* argv[])
{
    uint64_t n, c, k;
    std::cin >> n >> c >> k;

    auto vec = std::vector<uint64_t>(n);
    for(auto &a_t: vec)
    {
        std::cin >> a_t;
    }

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

    uint64_t result = 0;
    uint64_t wait_first = -1;
    uint64_t num_of_passenger = 0;
    for(auto a_t: vec)
    {
        if(wait_first == -1)
        {
            wait_first = a_t;
            num_of_passenger = 1;
            continue;
        }

        if((a_t - wait_first) <= k)
        {
            if(num_of_passenger >= c)
            {
                result++;
                wait_first = a_t;
                num_of_passenger = 1;
            }
            else
            {
                num_of_passenger++;
            }
        }
        else
        {
            result++;
            wait_first = a_t;
            num_of_passenger = 1;
        }
    }

    std::cout << ++result << std::endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <cstdint>
using namespace std;

void solve() {
	int n;
	cin >> n;
	string s;
	s.reserve(n);
	cin >> s;
	int ans = 0;
	for (int i = 0; i + 2 < n; i++) {
		if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') {
			ans++;
		}
	}
	cout << ans << endl;
}

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


Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Pair> list = new ArrayList<>();
		for (int i = 0; i < n; i++) {
			list.add(new Pair(i + 1, sc.nextInt()));
		}
		list.sort(new ComparatorByValue());
		for (int i = 0; i < n; i++) {
			System.out.print(list.get(i).key + " ");
		}
		System.out.println();
	}
}

class Pair {
	public int key;
	public long value;
	public Pair(int key, long value) {
		this.key = key;
		this.value = value;
	}
}

class ComparatorByValue implements Comparator<Pair> {
	@Override
	public int compare(Pair sort1, Pair sort2) {
		if (sort1.value == sort2.value) {
			return 0;
		} else if (sort1.value > sort2.value) {
			return 1;
		} else {
			return -1;
		}
	}
}

class ComparatorByKey implements Comparator<Pair> {
	@Override
	public int compare(Pair sort1, Pair sort2) {
		if (sort1.key == sort2.key) {
			return 0;
		} else if (sort1.key > sort2.key) {
			return 1;
		} else {
			return -1;
		}
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;
	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}
	private int readByte() {
		if (hasNextByte()) {
			return buffer[ptr++];
		} else {
			return -1;
		}
	}
	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}
	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
			ptr++;
		}
		return hasNextByte();
	}
	public String next() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public long nextLong() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || Integer.MAX_VALUE < nl) {
			throw new NumberFormatException();
		}
		return (int) nl;
	}
	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

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

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

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

  vector<int> dp(n + 1, 100010);
  dp.at(0) = 0;
  for (int i = 1; i <= n; i++) {
    int power = 1;
    while (power <= i) {
      chmin(dp.at(i), dp.at(i - power) + 1);
      power *= 6;
    }
    power = 1;
    while (power <= i) {
      chmin(dp.at(i), dp.at(i - power) + 1);
      power *= 9;
    }
  }

  cout << dp.at(n) << endl;
  return 0;
}

Measured memory_bytes: 3664
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <random>
#include <iomanip>

using namespace std;
using P = pair<long, long>;

typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define fillInt(xs, x)        \
  for (int i = 0; i < (x); i++) \
    scanf("%d", &xs[i]);
#define fillLong(xs, x)       \
  for (int i = 0; i < (x); i++) \
    scanf("%ld", &xs[i]);
#define fillString(xs, x)       \
  for (int i = 0; i < (x); i++) \
    cin >> xs[i];
#define sortv(xs) sort(xs.begin(), xs.end())
#define sortvinv(xs) sort(xs.begin(), xs.end(), std::greater<long>())
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin()
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin()
#define bs(xs, x) binary_search(xs.begin(), xs.end(), x)
#define index_of(as, x) \
  distance(as.begin(), lower_bound(as.begin(), as.end(), x))

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

const int mod = 1000000007;

int counts[105];

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

  int n;
  cin >> n;

  vector<int> b(n);
  fillInt(b, n);

  vector<int> v;
  bool canDo = true;

  while(b.size() > 0) {
    int i = b.size() - 1;
    for(; i >= 0; i--) {
      if(i+1 == b[i]) {
        v.push_back(i+1);
        b.erase(b.begin() + i);
        break;
      }
    }
    if (i < 0 && b.size() > 0) {
      canDo = false;
      break;
    }
  }

  
  if(canDo) {
    rep(i, n) {
      cout << v[n-i-1] << endl;
    }
  } else {
    cout << -1 << endl;
  }
}


Measured memory_bytes: 256
// Problem : B - Judge Status Summary
// Contest : AtCoder - AtCoder Beginner Contest 173
// URL : https://atcoder.jp/contests/abc173/tasks/abc173_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#define int long long
#define fastio                      \
  ios_base::sync_with_stdio(false); \
  cin.tie(0);                       \
  cout.tie(0);
#define sz(a) (int)((a).size())
#define pb push_back
#define mp make_pair
#define db1(x) cout << #x << "=" << x << endl
#define db2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z)                                                       \
  cout << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z \
       << endl
#define dbp(x) \
  cout << #x << "= {" << (x.first) << ", " << (x.second) << "}" << endl;
#define dbv(v)                         \
  {                                    \
    cout << #v << " : ";               \
    for (auto x : v) cout << x << ' '; \
    cout << endl;                      \
  }
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define rep2(i, a, b) for (int i = a; i >= b; i--)
#define die(x) return cout << x << '\n', 0;

using namespace std;

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

int32_t main() {
  fastio;
  //  freopen("input.txt", "r", stdin);
  //  freopen("output.txt", "w", stdout);
  int testcases;
  testcases = 1;
  // cin>>testcases;

  while (testcases--) {
    int n;
    cin >> n;
    string s;
    unordered_map<string, int> mp;
    while (n--) {
      cin >> s;
      mp[s]++;
    }
    cout << "AC x " << mp["AC"] << '\n';
    cout << "WA x " << mp["WA"] << '\n';
    cout << "TLE x " << mp["TLE"] << '\n';
    cout << "RE x " << mp["RE"] << '\n';
  }

  return 0;
}


Measured memory_bytes: 3664
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
const int INF = 2147483647;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

int main() {
    ll n;
    cin >> n;
    ll power = 1;
    for(int i = 1;i<=n;i++)power = power*i%MOD;
    cout << power << endl;
    return 0;
}
/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
typedef long long ll;
using namespace std;
#define mod 1000000007
int main(void){
    int n; cin >> n;
    string s[n];
    rep(i,n){
        cin >> s[i];
        sort(s[i].begin(),s[i].end());
    }
    //rep(i,n) cout << s[i] << endl;
    ll ans = 0;
    map<string,ll> mp;
    rep(i,n){
        mp[s[i]]++;
        if(mp[s[i]]>=2) ans += mp[s[i]] - 1ll;
    }
    cout << ans << endl;
}




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

struct position{
  double x ;
  double y ;
} ;

double c60 = 0.5 ;
double s60 = sin(M_PI/3) ;

void kock( int n, position p, position q ) {
  if (n == 0) return ;

  position s, t, u ;
  s.x = p.x *2 /3 + q.x /3 ;
  s.y = p.y *2 /3 + q.y /3 ;
  t.x = p.x /3 + q.x *2 /3 ;
  t.y = p.y /3 + q.y *2 /3 ;
  u.x = (t.x - s.x) *c60 - (t.y - s.y) * s60 + s.x ;
  u.y = (t.x - s.x) *s60 + (t.y - s.y) * c60 + s.y ;

  kock(n-1, p, s) ;
  cout << s.x << " " << s.y << endl ;
  kock(n-1, s, u) ;
  cout << u.x << " " << u.y << endl ;
  kock(n-1, u, t) ;
  cout << t.x << " " << t.y << endl ;
  kock(n-1, t, q) ;
 }

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

  position p, q ;
  p.x = 0 ; p.y = 0 ;
  q.x = 100 ; q.y = 0 ;

  cout << fixed << setprecision(8) ;

  cout << p.x << " " << p.y << endl ;
  kock(n, p, q) ;
  cout << q.x << " " << q.y << endl ;

  return 0 ;
}


Measured memory_bytes: 3264
import java.util.Scanner;
public class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        if(s.charAt(2) == s.charAt(3) &&
        s.charAt(4) == s.charAt(5)){
            System.out.println("Yes");
            
        }else{
        System.out.println("No");
        }
    }
}


Measured memory_bytes: 21716
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	k := nextInt()

	sunu := make([]int, n)

	for i := 1; i < k+1; i++ {
		d := nextInt()
		for j := 0; j < d; j++ {
			tmp := nextInt()
			sunu[tmp-1] += i
		}
	}

	count := 0
	for _, v := range sunu {
		if v == 0 {
			count++
		}
	}
	fmt.Println(count)
}


Measured memory_bytes: 1760
n = int(input())
alist = list(map(int, input().split()))

ans = 0
cnt = 0
while alist != []:
    a = alist.pop(0)

    if a == 1:
        cnt += 1
    else:
        cnt = 0

    if cnt > ans:
        ans = cnt

print(ans + 1)



Measured memory_bytes: 5596
#include <iostream>
#include <limits.h>
#include <string>
using namespace std;

int main(void){
    int w, h, n, x, y, a, ans = 0;
    bool bl[105][105];
    cin >> w >> h >> n;
    for (int i = 1; i <= w; i++) {
        for (int j = 1; j <= h; j++) bl[i][j] = false;
    }
    for (int i = 1; i <= n; i++) {
        cin >> x >> y >> a;
        if (a == 1) {
            for (int j = 1; j <= x; j++) {
                for (int k = 1; k <= h; k++) bl[j][k]++;
            }
        }
        if (a == 2) {
            for (int j = x + 1; j <= w; j++) {
                for (int k = 1; k <= h; k++) bl[j][k]++;
            }
        }
        if (a == 3) {
            for (int j = 1; j <= y; j++) {
                for (int k = 1; k <= w; k++) bl[k][j]++;
            }
        }
        if (a == 4) {
            for (int j = y + 1; j <= h; j++) {
                for (int k = 1; k <= w; k++) bl[k][j]++;
            }
        }
    }
    for (int i = 1; i <= w; i++) {
        for (int j = 1; j <= h; j++) {
            if (bl[i][j] == false) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int main() {
  int N, M;
  cin >> N >> M;
  vector<pair<pair<int, int>, int>> city(M);
  vector<string> ans(M);
  for (int i = 0; i < M; ++i) {
    int p, y;
    cin >> p >> y;
    city[i] = make_pair(make_pair(p, y), i);
  }
  sort(city.begin(), city.end());
  int cnt = 1;
  for (int i = 0; i < M; ++i) {
    int l = city[i].first.first;
    int r = city[i].first.second;
    if (i > 0 && city[i - 1].first.first == l) cnt++;
    else cnt = 1;
    char x[7], y[7];
    sprintf(x, "%06d", l);
    sprintf(y, "%06d", cnt);
    ans[city[i].second] = (string)x + (string)y;
  }
  for (int i = 0; i < M; ++i) cout << ans[i] << endl;
}

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

int main (){
  string s;
  cin >> s;
  rep(i,19){
    if(s[i] == ','){
      cout << " ";
    }else{
      cout << s[i];
    }
  }
  return 0;
}

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

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

struct Vertex {
    vector<ll> node;
};

Vertex V[100005];
ll C[100005];
ll A[100005];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, M;
    cin >> N >> M;
    REP(i, M) {
        ll a, b;
        cin >> a >> b;
        a--;
        b--;
        V[a].node.push_back(b);
        V[b].node.push_back(a);
    }
    REP(i, N) {
        C[i] = INF;
    }
    queue<pll> q;
    q.push(pll(0, 0));
    C[0] = 0;
    while (!q.empty()) {
        pll t = q.front();
        q.pop();
        ll cost = t.second;
        REP(i, V[t.first].node.size()) {
            ll n = V[t.first].node[i];
            if (C[n] <= cost)
                continue;
            C[n] = cost;
            A[n] = t.first + 1;
            q.push(pll(n, cost));
        }
    }
    REP(i, N) {
        if (C[i] == INF) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
    REP(i, N - 1) {
        cout << A[i + 1] << endl;
    }
    return 0;
}

Measured memory_bytes: 14440
#include <bits/stdc++.h>
using namespace std;
struct node{
	int x,y;
}a[100001];
int n;
bool cmp(node a,node b)
{
	return a.x<b.x;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n;
	for (int i=1;i<=n;++i) cin>>a[i].x,a[i].y=i;
	sort(a+1,a+n+1,cmp);
	for (int i=1;i<=n;++i) cout<<a[i].y<<" ";
	return 0;
}

Measured memory_bytes: 1664
#include <stdio.h>

int main(){

int W,H;


while(scanf("%d %d\n", &H, &W)){

if(W == 0 && H == 0) return 0;

for (int i = 0 ; i < H; i++){
for (int j = 0; j < W; j++)
printf("#");
printf("\n");

}
printf("\n");
}

}


Measured memory_bytes: 2024
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  vector<int> zahyou(5);
  for (int i=0; i<5; i++) {
    cin >> zahyou.at(i);
  }
  
  int k;
  cin >> k;
  
  bool a = false;
  
  for (int i=0; i<5; i++) {
    for (int j=0; j<i; j++) {
      if (zahyou.at(i) - zahyou.at(j) > k) {
        a = true;
      }
    }
  }
  
  if (a) {
    cout << ":(" << endl;
  }
  else {
    cout << "Yay!" << endl;
  }
      
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &x)
#define sz(v) (int) v.size()
#define pr(v) For(i, 0, sz(v)) {cout<<v[i]<<" ";} cout<<endl;
#define slld(x) scanf("%lld", &x)
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(ll i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define ll long long
#define int long long
#define mp make_pair
#define F first
#define S second
typedef pair<int, int> pii;
typedef vector<int> vi;
#define MOD 1000000007
#define INF 1000000000000000007LL

const int N = 100005;
 
// it's swapnil07 ;)
 
#ifdef SWAPNIL07
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
int begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define endl '\n'
#define trace(...)
#define end_routine()
#endif

char arr[11][1005];
int h, w, k;
vector<pii> vect;

bool fl;

int process(vector<pii> &vect){
    int val[vect.size()][w];
    memset(val, 0, sizeof(val));
    for(int l=0; l<sz(vect); l++){
        int ss = vect[l].F;
        int e = vect[l].S;
        for(int i=ss; i<=e; i++){
            for(int j=0; j<w; j++){
                if(arr[i][j]=='1')
                    val[l][j]++;
            }
        }
    }
    int ct = 0;
    For(l, 0, sz(vect)){
        For(i, 0, w){
            if(val[l][i]>k){
                fl=false;
                return 0;
            }
        }
    }
    int cur[sz(vect)];
    memset(cur, 0, sizeof(cur));
    For(i, 0, w){
        int mxv = 0;
        For(l, 0, sz(vect)){
            cur[l]+=val[l][i];
            mxv = max(mxv, cur[l]);
        }
        if(mxv <= k){
            continue;
        }
        ct++;
        For(l, 0, sz(vect)){
            cur[l]=val[l][i];
        }
    }
    return ct;
}

signed main()
{
    fast
    #ifdef SWAPNIL07
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    cin>>h>>w>>k;
    For(i, 0, h){
        For(j, 0, w){
            cin>>arr[i][j];
        }
    }
    int v = pow(2, h-1);
    int ans = INF;
    For(z, 0, v){
        int mask = z;
        int li = 0;
        int cuts = 0;
        fl = true;
        vect.clear();
        For(i, 0, h-1){
            if(mask%2){
                vect.pb({li, i});
                cuts++;
                li = i+1;
            }
            mask /= 2;
        }
        vect.pb({li, h-1});
        cuts += process(vect);
        // trace(z, cuts);
        if(fl)
            ans = min(ans, cuts);
    }
    cout<<ans;
    return 0;
}





Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	int n;
	cin >> n;
	bool ans = true;
	for (int i = 0; i < n; ++i){
		int in;
		cin >> in;
		if (in % 2 == 0){
			if (in % 3 && in % 5){
				ans = false;
			}
		}
	}
	cout << (ans ? "APPROVED" : "DENIED");
}


Measured memory_bytes: 384
from collections import deque

n, m = map(int, input().split())
to = [[] for _ in range(n)]
INF = float('inf')
for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)

q = deque()
q.append(0)
dist = [INF] * n
prev = [-1] * n

while len(q) != 0:
    v = q.popleft()
    for u in to[v]:
        if prev[u] == -1:
            
            prev[u] = v
            q.append(u)


print("Yes")
for i in range(1,len(prev)):
    print(prev[i] + 1)

Measured memory_bytes: 34984
//----AUTHOR:kkdrummer----/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include<ext/rope>
using namespace __gnu_cxx;
using namespace __gnu_pbds;
using namespace std;
typedef    long long   ll;
typedef    long double   ld;
typedef    complex<ld>   P;
#define    X   real()
#define    Y   imag()
ld restant(P p){return abs(p);}
//polar(x,y) mag=l,arg=y
//typedef    unordered_set<ll>   usll;
//typedef    unordered_multiset<ll>   umsll;
typedef    multiset<ll>   msll;
typedef    set<ll>   sll;
typedef    vector<ll>   vll;
typedef    pair<ll,ll>   pll;
typedef    vector<pair<ll,ll> >   vpll;
typedef    priority_queue<ll>   pqll;
typedef    vector<int>   vi;
typedef    set<int>   si;
typedef    multiset<int>   msi;
//typedef    unordered_multiset<int>   umsi;
//typedef    unordered_set<int>   usi;
typedef     pair<int,int>   pi;
typedef    vector<pair<int,int> >   vpi;
typedef    vector<pair<double,double> >   vpd;
typedef    pair<double,double>   pd;
typedef    priority_queue<int>   pqi;
typedef    tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>   ind_set;
typedef    tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>   ind_setll;
#define    in   insert
#define    fi   first
#define    se   second
#define    pb   push_back
#define    mp   make_pair
#define    be   begin
#define    en   end
#define    itr   iterator
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define    mo   1000000007
#define    inf  9223372036854775807
#define    ninf   -inf
#define    ima   2147483647
#define    imi   -ima
#define    oncnt    __builtin_popcount
#define    zerobegin   __builtin_clz
#define    zeroend   __builtin_ctz
#define    parity   __builtin_parity
#define all(x) x.be(),x.en()
#define    eps   1e-9
const    ld   PI=3.14159265359;
inline ll modpow(ll x,ll n){if(n==0)return 1;if(n==1)return(x%mo);ll u=(modpow(x,n/2));u=(u*u)%mo;if(n%2!=0)u=(u*x%mo)%mo;return u;}
inline ll modinv(ll x){return modpow(x,mo-2);}
inline ll mmul(ll a,ll b){    if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll madd(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;if(a+b>=mo)return(a+b)%mo;return(a+b);}
inline ll msub(ll a, ll b){if(a>=mo)a=a%mo;if(b>=mo)b=b%mo;return((a-b+mo)%mo);}
inline ll mdiv(ll a,ll bb){if(a>=mo)a=a%mo;ll b=modinv(bb);if(b>=mo)b=b%mo;if(a*b>=mo)return(a*b)%mo;return(a*b);}
inline ll gcd(ll a,ll b){return __gcd(a,b);}


int main()
{
io
int testcases=1;//cin>>testcases;
while(testcases--)
{
ll m,k;
cin>>m>>k;
  if(m==1&&k==1)
    cout<<-1;
  else
  {
if(k>pow(2,m)-1)
cout<<-1;
else
{
if(k==0)
{
	for(int i=0;i<=pow(2,m)-1;i++)
	{
		cout<<i<<" "<<i<<" ";
	}
	
}
	else
	{
		cout<<0<<" "<<k<<" "<<0<<" ";
		for(int i=1;i<=pow(2,m)-1;i++)
		{
			if(i!=k)
			cout<<i<<" ";
		}
		cout<<k<<" ";
		for(int i=pow(2,m)-1;i>0;i--)
		{
			if(i!=k)
			cout<<i<<" ";
		}
	}
}
  }


}return 0;}


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

#define ll long long
int main() {
  	ll n;
  	cin >> n;
  	ll temp = n;
  	ll sum = 0;
  	while (n > 0) {
      sum += (n % 10);
      n /= 10;
    }
  	if (temp % sum == 0) {
      cout << "Yes\n";
    }
  	else {
      cout << "No\n";
    }
      return 0; 
}

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

int main() {
    int k;
    string s;
    cin >> k >> s;
    if (s.size() <= k) {
        cout << s << endl;
    } else {
        cout << s.substr(0,k) << "..." << endl;
    }
    return 0;
}

Measured memory_bytes: 3628
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.MathContext;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Deque;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Random;
import java.util.Scanner;
import java.util.Set;
import java.util.Stack;
import java.util.TreeMap;
import java.util.TreeSet;

import static java.util.Comparator.*;

public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        Solver solver = new Solver(System.in, out);
        solver.solve();
        out.close();
    }
}
class Solver {
	Scanner sc;
	PrintWriter out;
    public Solver(InputStream in, PrintWriter out) {
    	sc = new Scanner(in);
    	this.out = out;
    }
    // ==========================================================
	List<PP> list = new ArrayList<>();
	PriorityQueue<PP> PQ = new PriorityQueue<>(comparing(PP::getVal)); 
    public void solve() {
		int N = ni();
		int K = ni();
		int S = ni();
		for (int i = 0; i < K; i++) {
			out.print(S + " ");
		}
		int X = (S == 1000000000 ? S-1 : S+1);
		for (int i = 0; i < N-K; i++) {
			out.print(X + " ");
		}
		out.println("");
    }
    // Set に入れるなら　PPKEY　を使う！
    static class PP{
    	public int key, val;
    	public PP(int key, int val) {
    		this.key = key;
    		this.val = val;
    	}
		public int getKey() {
			return key;
		}
		public void setKey(int key) {
			this.key = key;
		}
		public int getVal() {
			return val;
		}
		public void setVal(int val) {
			this.val = val;
		}
    }
    // ------------------------------------------
    // 入力
    // ------------------------------------------
    public int ni() {
    	return sc.nextInt();
    }
    public long nl() {
    	return sc.nextLong();
    }
    public String ns() {
    	return sc.next();
    }
    public char[] nc() {
    	return sc.next().toCharArray();
    }
    public int[] ndi(int N) {
    	int[] ans = new int[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = ni();
		}
    	return ans;
    }
    public long[] ndl(int N) {
    	long[] ans = new long[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = nl();
		}
    	return ans;
    }
    public String[] nds(int N) {
    	String[] ans = new String[N];
    	for (int i = 0; i < N; i++) {
			ans[i] = ns();
		}
    	return ans;
    }
    public char[][] ndc(int N) {
    	char[][] ans = new char[N][];
    	for (int i = 0; i < N; i++) {
			ans[i] = nc();
		}
    	return ans;
    }
    public int[][] nddi(int N, int S) {
    	int[][] ans = new int[N][S];
    	for (int i = 0; i < N; i++) {
			for (int j = 0; j < S; j++) {
				ans[i][j] = ni();
			}
		}
    	return ans;
    }
}


Measured memory_bytes: 43660
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#include <utility>
#define mp make_pair
#define maxn 100005
using namespace std;
const int inf = 0x3f3f3f3f;
const int neginf = 0xc0c0c0c0;
typedef long long ll;
typedef pair<int,int> P;
int n,dp[maxn],dp1[maxn];
vector <P> adj[maxn];//to,cst.
void dfs(int u,int f){
	for(int i=0;i<(int)adj[u].size();i++){
		P p = adj[u][i];
		int v = p.first;
		if(v == f) continue;
		dfs(v,u);
		dp[u] = max(dp[u],dp[v] + p.second);
	}
}
void dfs1(int u,int f){//work dp1 for u's sons.
	int maxi = 0,maxpos,secmax = 0;
	for(int i=0;i<(int)adj[u].size();i++){
		P p = adj[u][i];
		int v = p.first;
		if(v == f) continue;
		if(dp[v] + p.second > maxi){
			secmax = maxi;
			maxi = dp[v] + p.second;
			maxpos = i;
		}else if(dp[v] + p.second > secmax){
			secmax = dp[v] + p.second;
		}
	}
	for(int i=0;i<(int)adj[u].size();i++){
		P p = adj[u][i];
		int v = p.first;
		if(v == f) continue;
		dp1[v] = dp1[u];
		if(i == maxpos) dp1[v] = max(dp1[v],secmax);
		else dp1[v] = max(dp1[v],maxi);
		dp1[v] += p.second;
		dfs1(v,u);
	}
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<n;i++){
		int u,v,w;
		scanf("%d%d%d",&u,&v,&w);
		adj[u + 1].push_back(mp(v + 1,w));
		adj[v + 1].push_back(mp(u + 1,w));
	}
	dfs(1,-1);
	dp1[1] = 0;
	dfs1(1,-1);
	int ans = 0;
	for(int i=1;i<=n;i++){
		ans = max(ans,dp[i] + dp1[i]);
	}
	printf("%d\n",ans);
	return 0;
}



Measured memory_bytes: 17268
## coding: UTF-8
N = int(input())
a = []

for i in range(N):
    a.append(int(input()))

#print(a) #入力されたリストの受け取り

b = [] #被りがなかったものに関しては取り入れる
for i in range(len(a)):
    if( (a[i] in b) == False ):
        b.append(a[i])
    #print(a[i] in b)
    #b.append(a[i])
#print(b)
print(len(b))

Measured memory_bytes: 3060
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <algorithm>
using namespace std;
const int MaxN = 1e5;

int n;
char s[MaxN + 5], ans[MaxN + 5];
bool check(int x, int y)
{
	if(x == 1 && y == 1) ans[1] = 'S', ans[2] = 'S';
	else if(x == 1 && y == 2) ans[1] = 'S', ans[2] = 'W';
	else if(x == 2 && y == 1) ans[1] = 'W', ans[2] = 'S';
	else if(x == 2 && y == 2) ans[1] = 'W', ans[2] = 'W';
	for(int i = 2; i < n; i++)
	{
		if(s[i] == 'o')
		{
			if(ans[i] == 'S') ans[i + 1] = ans[i - 1];
			else 
			{
				if(ans[i - 1] == 'S') ans[i + 1] = 'W';
				else ans[i + 1] = 'S';
			}
		}
		else 
		{
			if(ans[i] == 'W') ans[i + 1] = ans[i - 1];
			else
			{
				if(ans[i - 1] == 'S') ans[i + 1] = 'W';
				else ans[i + 1] = 'S';
			}
		}
	}
	if(ans[1] == 'S' && s[1] == 'o')
		if(ans[n] != ans[2])
			return 0;
	if(ans[1] == 'S' && s[1] == 'x')
		if(ans[n] == ans[2])
			return 0;
	if(ans[1] == 'W' && s[1] == 'o')
		if(ans[n] == ans[2])
			return 0;
	if(ans[1] == 'W' && s[1] == 'x')
		if(ans[n] != ans[2])
			return 0;
	if(ans[n] == 'S' && s[n] == 'o')
		if(ans[n - 1] != ans[1])
			return 0;
	if(ans[n] == 'S' && s[n] == 'x') 
		if(ans[n - 1]  == ans[1])
			return 0;
	if(ans[n] == 'W' && s[n] == 'o')
		if(ans[n - 1] == ans[1])
			return 0;
	if(ans[n] == 'W' && s[n] == 'x')
		if(ans[n - 1] != ans[1])
			return 0;
	return 1;
}
int main()
{
	while(scanf("%d", &n) != EOF)
	{
		bool flag = 0;
		for(int i = 1; i <= n; i++)
			scanf(" %c", &s[i]);
		for(int i = 1; i <= 2; i++)
		{
			for(int j = 1; j <= 2; j++)
			{
				memset(ans, 0, sizeof(ans));
				if(check(i, j))
				{
					flag = 1;
					i = j = 3;
				}
			}
		}
		if(flag)
		{
			for(int i = 1; i <= n; i++)
				printf("%c", ans[i]);
			printf("\n");
		}
		else printf("-1\n");
		memset(s, 0, sizeof(s));
		memset(ans, 0, sizeof(ans));
	}
}

Measured memory_bytes: 512
N, *D = [list(map(int, s.split())) for s in open(0)]
N, D = N[0], D[0]

cnt = 1
min_v = D[0]
for i in range(1, len(D)):
    if min_v >= D[i]:
        cnt += 1
        min_v = D[i]
print(cnt)

Measured memory_bytes: 24956
import java.util.Scanner;

class Main{
	static Scanner s=new Scanner(System.in);
	static int gInt() {return Integer.parseInt(s.next());}
	static long gLong() {return Long.parseLong(s.next());}

	public static void main(String[]$){
		int l=gInt()+gInt(),r=gInt()+gInt();
		System.out.println(l>r?"Left":l<r?"Right":"Balanced");
	}
}

Measured memory_bytes: 21844