akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <cstdint>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
#define MP make_pair
#define PB push_back
#define inf 1000000007
#define rep(i,n) for(int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}
 
template<class T> inline bool chmax(T &a, T b){
    if(a<b){
        a = b;
        return true;
    }
    return false;
}

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



ll a,b,c,d;
ll INF = (1LL<<60);
ll MX = 100000000000000000LL; 
map<ll,ll> mp;
ll cnt = 0;
ll dfs(ll n){
    if(mp.find(n)!=mp.end())return mp[n];
    cnt++;
    if(n==1)return d;
    if(n==0)return 0;
    ll res =INF;
    if((MX+n)/n <= d)res =INF; 
    else res = n*d;
    // cerr << res << " " <<n << " " << d << endl;
    ll nxt,s;
    nxt = n/2;
    s = (d*(n%2))+a;
    if(n>nxt)chmin(res,s+dfs(nxt));
    nxt = n/2 + 1;
    s = (d*((ll)2-(n%2)))+a;
    if(n>nxt)chmin(res,s+dfs(nxt));
    nxt = n/3;
    s = (d*(n%3))+b;
    if(n>nxt)chmin(res,s+dfs(nxt));
    nxt = n/3 + 1;
    s = (d*((ll)3-(n%3)))+b;
    if(n>nxt)chmin(res,s+dfs(nxt));
    
    nxt = n/5;
    s = (d*(n%5))+c;
    if(n>nxt)chmin(res,s+dfs(nxt));
    nxt = n/5 + 1;
    s = (d*((ll)5-(n%5)))+c;
    if(n>nxt)chmin(res,s+dfs(nxt));
    return mp[n] = res;
}
int main(){
    ll t;
    cin >> t;
    rep(zz,t){
        ll n;
        cin >> n >> a >> b >> c >> d;
        ll ans = dfs(n);
        mp.clear();
        cout << ans << endl;
        cerr << cnt << endl;
    }
    return 0;
}

Measured memory_bytes: 4420
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define rep(p,a,b)    for(ll p=a;p<b;p++)
#define sz(v) ((int)v.size())
#define all(v) (v).begin(), (v).end()
#define INF 0x3f3f3f3f

ll nextPowerOf2(ll n)   
{ 
	n--; 
	n |= n >> 1ll; 
	n |= n >> 2ll; 
	n |= n >> 4ll; 
	n |= n >> 8ll; 
	n |= n >> 16ll; 
	n++; 
	return n; 
}
const ll maxn = 3010;
const ll mod = 998244353;
ll dp[maxn][maxn];

int main() {
	
	#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
	#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	ll t,i,j,n,a,b,c,d;
	
	//cin>>t;
	//cout<<t;
	t = 1;
	while(t--)
	{
		cin>>a>>b>>c>>d;

		dp[a][b] = 1;

		for(i=a ; i<=c ; i++)
		{
			for(j=b ; j<=d ; j++)
			{
				if(i==a && j==b)continue;
				ll t1 = 1ll * j * dp[i-1][j]%mod;
				ll t2 = 1ll * i * dp[i][j-1]%mod;
				ll t3 = 1ll * (i-1)*(j-1)%mod * dp[i-1][j-1]%mod;

				dp[i][j] = ((t1+t2)%mod + mod-t3)%mod;
			}
		}

		cout<<dp[c][d];
	}

	return 0;
}

Measured memory_bytes: 73996
import java.util.Scanner;

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

        String str = s.next();
        switch (str){
            case "MON":
                System.out.print("6");
                break;
            case "TUE":
                System.out.print("5");
                break;
            case "WED":
                System.out.print("4");
                break;
            case "THU":
                System.out.print("3");
                break;
            case "FRI":
                System.out.print("2");
                break;
            case "SAT":
                System.out.print("1");
                break;
            case "SUN":
                System.out.print("7");
                break;

        }
    }
}


Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
long long dp[101][100001],a[101],w[101];
long long knapsack(long long n, long long k)
{
    if(n==0)
    return 0;
    
    if(dp[n][k]!=-1)
    return dp[n][k];
    
    if(a[n-1]>k)
    {
        dp[n][k]=knapsack(n-1,k);
        return dp[n][k];
    }
    
    dp[n][k]= max((knapsack(n-1,k)),(knapsack(n-1,k-a[n-1])+w[n-1]));
    return dp[n][k];
}
int main() {
     
     long long n,i,j,k,sum=0,count=0;
     cin>>n>>k;
     for(i=0;i<n;i++)
     {
         cin>>a[i]>>w[i];
     }
     for(i=0;i<=n;i++)
     {
         for(j=0;j<=k;j++)
         dp[i][j]=-1;
     }
     sum=knapsack(n,k);
     cout<<sum<<"\n";
     
	return 0;
}

Measured memory_bytes: 82496
#include <iostream>

using namespace std;

int main(void) {
	int r, c;
	int table[101][101];
	cin >> r >> c;
	for (int i = 0; i <= r; i++) {
		for (int j = 0; j <= c; j++) {
			if (i == r || j == c) {
				table[i][j] = 0;
			}
			else {
				cin >> table[i][j];
			}
		}
	}
	for (int i = 0; i < r; i++) {
		for (int j = 0; j < c; j++) {
			table[i][c] += table[i][j];
			table[r][j] += table[i][j];
			table[r][c] += table[i][j];
		}
	}
	for (int i = 0; i < r+1; i++) {
		for (int j = 0; j < c+1; j++) {
			cout << table[i][j];
			if (j != c) {
				cout << " ";
			}
		}
		cout << "\n";
	}

	int ee;
	cin >> ee;
	return 0;
}

Measured memory_bytes: 3104
#include<stdio.h>
int main()
{
	for(int i = 1; i < 10; i++)
	{
		for(int j = 1; j < 10; j++)
		{
			printf("%dx%d=%d\n", i, j, i*j);
		}
	}
		
	return 0;
} 
    


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

int main(){
  vector<int> A;
  A.reserve(100);

  int N, a;
  cin >> N;
  while(N--){
    cin >> a;
    A.push_back(a);
  }

  // Do insertion sort
  for(int i = 0; i < A.size(); i++){
    int v = A[i];
    int j = i - 1;
    while(j >= 0 && A[j] > v){
      A[j + 1] = A[j];
      j--;
    }
    A[j + 1] = v;

    // Print current
    for(int k = 0; k < A.size(); k++) {
      cout << (k == 0 ? "" : " ") << A[k];
    }
    cout << endl;
  }
}


Measured memory_bytes: 3096
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define pa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
#define pb push_back

using ll = long long;
using namespace std;
using pint = pair<int,int>;
using pll = pair<ll,ll>;
const int INFint = 1e9;
const ll INFll = 1e18;
ll MOD=1e9+7;

ll gcd(ll a, ll b) { return __gcd(a,b); } //最大公約数
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; } //最大公倍数

// aのn乗をMODで割りながら計算する
ll modpow(ll a, ll n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % MOD;
    a = a * a % MOD;
    n >>= 1; // right shift
  }
  return res;
}

// MODを法としたaの逆元を計算する
ll modinv(ll a) {
  return modpow(a, MOD - 2);
}
//アリ本 p155
const int MAX_N = 1000000;
int n(1),dat[30][2*MAX_N-1] = {0};

// k番目の値をaに変更
void update(int i,int k,int a){
  k += n - 1;
  dat[i][k] = a;
  while(k>0){
    k = (k-1)/2;
    dat[i][k] = dat[i][k*2+1]+dat[i][k*2+2];
  }
}

// [a,b)の最小値を求める(bは含まない)
// 外からはquery(a,b,0,0,n)として呼ぶ
// kは節点の番号、l,rはその接点が[l,r）に対応している事を示す
int query(int i,int a,int b,int k,int l,int r){
  //cout << i << a << b << k << l << r << endl;
  if (r<=a||b<=l) return 0;
  if (a <= l && r<= b) return dat[i][k];
  else{
    int vl = query(i,a,b,k*2+1,l,(l+r)/2);
    int vr = query(i,a,b,k*2+2,(l+r)/2,r);
    return vl + vr;
  }
}

int main(){
  int Q,_n;
  string s;
  cin>>_n>>s>>Q;
  while(n < _n){
    n *= 2;
  }
  for (int i(0);i<_n;i++){
    //cout << s[i] << endl;
    update(s[i]-'a',i,1);
  }
  //cout << n << endl;
  for (int i(0);i<Q;i++){
    int k;
    cin>>k;
    if (k == 1){
      int i;
      char c;
      cin>>i>>c;
      i--;
      if (s[i] != c){
        update(c-'a',i,1);
        update(s[i]-'a',i,0);
        s[i] = c;
      }
    }else{
      int l,r;
      cin>>l>>r;
      l--;r--;
      int cnt(0);
      for (int k(0);k<30;k++){
        if (query(k,l,r+1,0,0,n) != 0){ 
          cnt++;
     //     cout << (char)(k+'a') <<" " << query(k,l,r+1,0,0,n)<< endl;
        }
      }
      cout << cnt << endl;
    }
    //for (int i(0);i<30;i++) cout << dat[3][i] << " ";
    //cout << endl;
  }
  return 0;
}



Measured memory_bytes: 156548
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{

    static void Main(string[] args)
    {
        var rates = Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();
        var c = rates[0] > 9 ? 0 : (10 - rates[0]);
        Console.WriteLine(rates[1] + 100*c);
        Console.ReadKey();
    }
}


Measured memory_bytes: 13268
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <iostream>
#include <climits>

using namespace std;

typedef long long ll;

vector<pair<ll,ll> >point[4];

ll x[55];
ll y[55];

int main(){

	int N,K;

	scanf("%d %d",&N,&K);

	int i,j,m;
	for(i=0;i<N;i++){
	scanf("%lld %lld",&x[i],&y[i]);
	}

	for(i=0;i<N-1;i++){
		for(j=i+1;j<N;j++){
			point[0].push_back(make_pair(max(x[i],x[j]),max(y[i],y[j])));
		}
	}

	for(i=0;i<N-1;i++){
		for(j=i+1;j<N;j++){
			point[1].push_back(make_pair(max(x[i],x[j]),min(y[i],y[j])));
		}
	}

	for(i=0;i<N-1;i++){
		for(j=i+1;j<N;j++){
			point[2].push_back(make_pair(min(x[i],x[j]),max(y[i],y[j])));
		}
	}

	for(i=0;i<N-1;i++){
		for(j=i+1;j<N;j++){
			point[3].push_back(make_pair(min(x[i],x[j]),min(y[i],y[j])));
		}
	}

	ll ans=LLONG_MAX;

	for(i=0;i<point[2].size();i++){
		for(j=0;j<point[1].size();j++){
			ll leftup_x=point[2][i].first;
			ll leftup_y=point[2][i].second;
			ll rightdown_x=point[1][j].first;
			ll rightdown_y=point[1][j].second;
			int cnt=0;
			for(m=0;m<N;m++){
				if(leftup_x<=x[m]&&x[m]<=rightdown_x&&rightdown_y<=y[m]&&y[m]<=leftup_y){
					cnt++;
				}
			}
			if(cnt>=K){
				ll S=(-leftup_x+rightdown_x)*(leftup_y-rightdown_y);
				if(ans>S){ans=S;}
			}
		}
	}

	for(i=0;i<point[3].size();i++){
		for(j=0;j<point[0].size();j++){
			ll leftdown_x=point[3][i].first;
			ll leftdown_y=point[3][i].second;
			ll rightup_x=point[0][j].first;
			ll rightup_y=point[0][j].second;
			int cnt=0;
			for(m=0;m<N;m++){
				if(leftdown_x<=x[m]&&x[m]<=rightup_x&&leftdown_y<=y[m]&&y[m]<=rightup_y){
					cnt++;
				}
			}
			if(cnt>=K){
				ll S=(-leftdown_x+rightup_x)*(-leftdown_y+rightup_y);
				if(ans>S){ans=S;}
			}
		}
	}

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

	return 0;
}

Measured memory_bytes: 384
n = int(input())
s = input()
r_count = s.count('R')
g_count = s.count('G')
b_count = s.count('B')

count=0
for i in range(n):
    a = s[i]
    for j in range(i+1,n):
        if (2*j-i)>(n-1):
            break
        b=s[j]
        c=s[2*j-i]
        if a!=b and b!=c and a!=c:
            count+=1
print(r_count*g_count*b_count-count)

Measured memory_bytes: 9188
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b;
  double x;
  int x_int;
  cin >> a >> b;
  x = (double)(a + b) / 2.0;
  x_int = (a + b) / 2;
  if(x - x_int > 0){
    x_int++;
  }
  cout << x_int << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<vector>
#include<cstring>
#include<iostream>
#include<cstdio>
#define ull unsigned long long
#define ll long long
const int maxn=100000;
using namespace std;
ll s[1000];
int main()
{ll r,d;
  cin>>r>>d>>s[0];
  for(int i=1;i<=10;i++)
    s[i]=s[i-1]*r-d;
 for(int i=1;i<=10;i++)
    cout<<s[i]<<endl;

}


Measured memory_bytes: 256
use std::io::Read;
use std::cmp::{max, min};

fn main(){
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    let a:i32 = iter.next().unwrap().parse().unwrap();
    let b:i32 = iter.next().unwrap().parse().unwrap();
    let c:i32 = iter.next().unwrap().parse().unwrap();
    println!("{}", c - min(c, a - b));
    
}


Measured memory_bytes: 4352
s = input()
t = input()
min_cor = len(t)

for i in range(len(s) - len(t) + 1):
    cor = 0
    for j in range(len(t)):
        if t[j] != s[i + j]:
            cor = cor + 1
    if min_cor > cor:
        min_cor = cor
print(min_cor)

Measured memory_bytes: 9084
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int p[200010], sz[200010];
int root(int x){
	return x == p[x] ? x : (p[x] = root(p[x]));
}
void merge(int a, int b){
	a = root(a); b = root(b);
	if(a != b){
		p[b] = a;
		sz[a] += sz[b];
	}
}

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	int n; cin >> n;
	vi a(n); rep(i, n) cin >> a[i];
	vector<pi> pos;
	rep(i, n) pos.emplace_back(a[i], i);
	sort(all(pos), greater<pi>());
	
	ll ans  = 0;
	rep(i, n) p[i] = i, sz[i] = 1;
	
	for(pi i : pos){
		int j = i.second;
		
		int l = j && a[j - 1] > a[j] ? sz[root(j - 1)] : 0;
		int r = j + 1 < n && a[j + 1] > a[j] ? sz[root(j + 1)] : 0;
		ans += (l + 1ll) * (r + 1ll) * a[j];
		if(l) merge(j, j - 1);
		if(r) merge(j, j + 1);
		//dbg(j, l, r, i);
	}
	cout << ans << endl;
	
	return 0;
}

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

namespace PGC
{
	class Program
	{
		static void Main(string[] args)
		{
			var N = int.Parse(Console.ReadLine());
			var start = new Point { X = 0, Y = 0 };
			var end = new Point { X = 100, Y = 0 };
			var array = Div(start, end, 0, N);
			var list = new List<Point>();
			list.Add(start);
			list.AddRange(array);

			list.ForEach(p => System.Console.WriteLine($"{p.X} {p.Y}"));
		}

		static Point[] Div(Point left, Point right, int n, int maxN)
		{
			if (maxN <= n)
			{
				return new Point[1] { right };
			}
			var dx = right.X - left.X;
			var dy = right.Y - left.Y;
			var s = new Point()
			{
				X = left.X + dx / 3.0,
				Y = left.Y + dy / 3.0,
			};
			var t = new Point()
			{
				X = left.X + dx * 2.0 / 3.0,
				Y = left.Y + dy * 2.0 / 3.0,
			};
			var rad = 2.0 / 3.0 * Math.PI;
			var tmpU = new Point();
			tmpU.X = Math.Cos(rad) * (right.X - t.X) - Math.Sin(rad) * (right.Y - t.Y);
			tmpU.Y = Math.Sin(rad) * (right.X - t.X) + Math.Cos(rad) * (right.Y - t.Y);
			var u = new Point()
			{
				X = tmpU.X + t.X,
				Y = tmpU.Y + t.Y,
			};
			var list = new List<Point>();
			list.AddRange(Div(left, s, n + 1, maxN));
			list.AddRange(Div(s, u, n + 1, maxN));
			list.AddRange(Div(u, t, n + 1, maxN));
			list.AddRange(Div(t, right, n + 1, maxN));

			return list.ToArray();
		}
	}

	class Point
	{
		public double X { get; set; }
		public double Y { get; set; }
	}
}



Measured memory_bytes: 18056
#include<stdio.h>
int main(){
    int W,H,x,y,r;
    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);

    if(x-r>=0 && x+r<=W && y+r<=H && y+r>=0){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
    return 0;

   }

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

#define rep(i,a,b)      for(int i=a;i<=b;i++)
#define revp(i,a,b)     for(int i=b;i>=a;i--)

char a,b;
int main()
{
   

    cin>>a>>b;
    if(a=='H')
        cout<<b;
    else
    {
        if(b=='H')
            cout<<'D';
        else
            cout<<'H';
    }
}




Measured memory_bytes: 256
import java.util.*;

public class Main {

        public static void main(String[] args){

                Scanner sc = new Scanner(System.in);
                String num1St = sc.next();
                String num2St = sc.next();


                if(num1St.length() > num2St.length()){
                        System.out.println("GREATER");
                }else if(num1St.length() < num2St.length()){
                        System.out.println("LESS");
                }else{
                        char[] first = num1St.toCharArray();
                        char[] secand = num2St.toCharArray();

                        int flugGreater = 0;
                        for(int c=0; c<num1St.length();c++){
                                int firstord = Character.getNumericValue(first[c]);
                                int secandord = Character.getNumericValue(secand[c]);
                                if(firstord > secandord){
                                        flugGreater = 1;
                                        break;
                                }else if(firstord < secandord){
                                        flugGreater = -1;
                                        break;
                                }
                        }
                        if(flugGreater == 1){
                                System.out.println("GREATER");
                        }else if(flugGreater == -1){
                                System.out.println("LESS");
                        }else if(flugGreater == 0){
                                System.out.println("EQUAL");
                        }

                }


        }

}

Measured memory_bytes: 22740
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+100;
int H[maxn];
bool check[maxn];
int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;++i)
    {
        cin>>H[i];
    }
    for(int i=0;i<m;++i)
    {
        int u,v;
        cin>>u>>v;
        if(H[u]>H[v])
            check[v]=true;
        else if(H[u]<H[v])
            check[u]=true;
        else
            check[v]=check[u]=true;
    }
    int cnt=0;
    for(int i=1;i<=n;++i)
        if(!check[i])
        {
            //cout<<i<<endl;
            ++cnt;
        }
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 4120
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	// solve_c()
	solveCQuasi()
}
func solveCQuasi() {
	s := nextLine()
	nums := make([]int, 0, len(s))
	for _, c := range s {
		num := int(c - '0')
		nums = append(nums, num)
	}
	bits := makeBits(len(s) - 1)
	sum := 0
	for _, bit := range bits {
		sum += evalExpression(nums, bit)
	}
	fmt.Println(sum)
}

func array2Int(nums []int) (num int) {
	num = 0
	for i := 0; i < len(nums); i++ {
		num += int(math.Pow10(i)) * nums[len(nums)-1-i]
	}
	return num
}

func evalExpression(nums []int, ops []int) (sum int) {
	sum = 0
	stackedNum := make([]int, 0, len(nums))
	stackedNum = append(stackedNum, nums[0])
	for i, op := range ops {
		if op == 0 {
			stackedNum = append(stackedNum, nums[i+1])
		} else {
			sum += array2Int(stackedNum)
			stackedNum = append(stackedNum[:0], nums[i+1])
		}
	}
	sum += array2Int(stackedNum)
	return sum
}

// take bits[n][0] slice
func makeBits(n int) [][]int {
	patterns := int(math.Pow(2.0, float64(n)))
	bits := make([][]int, patterns)
	for i := 0; i < patterns; i++ {
		bits[i] = int2Bits(i, n)
	}
	return bits
}

func int2Bits(n int, digit int) []int {
	bit := make([]int, digit, digit)
	index := 0
	for n != 0 {
		bit[index] = n % 2
		n /= 2
		index++
	}
	return bit
}

func solveC() {
	s := nextLine()
	var sum = 0
	var seps = make([]int, 0, 10)
	dfs(s, 0, &sum, seps...)
	fmt.Println(sum)
}

func dfs(s string, i int, sum *int, seps ...int) {
	if i > len(s)-2 {
		splitToNums(s, seps, sum)
	} else {
		dfs(s, i+1, sum, seps...)
		seps = append(seps, i)
		dfs(s, i+1, sum, seps...)
	}
}

func splitToNums(s string, seps []int, sum *int) {
	if len(seps) == 0 {
		num, _ := strconv.Atoi(s)
		*sum += num
	} else {
		preindex := 0
		for _, index := range seps {
			newS := s[preindex : index+1]
			num, _ := strconv.Atoi(newS)
			*sum += num
			preindex = index + 1
		}
		newS := s[preindex:]
		num, _ := strconv.Atoi(newS)
		*sum += num
	}
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(int i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(int i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define uniq(x) (x).erase(unique((x).begin(), (x).end()), (x).end())

template<class T>
struct BellmanFord {
    const T INF = numeric_limits<T>::max() / 2 - 1;
    vector<vector<pair<int, T>>> edges;
    int vertex_number;
    bool iinc = false;
    vector<vector<bool>> reachable;
    
    BellmanFord(int n) : edges(n) {
        vertex_number = n;
    }
    
    void add_edge(int from, int to, T cost) {
        edges[from].emplace_back(to, cost);
    }
    
    vector<T> get_distance(int from, int to = -1) {
        vector<T> dist(vertex_number, INF);
        dist[from] = 0;
        for (int i = 0; i < vertex_number; i++) {
            for (int ii = 0, e = edges.size(); ii < e; ii++) {
                if ((to != -1) && (!is_reachable(from, ii))) continue;
                for (int iii = 0, ee = edges[ii].size(); iii < ee; iii++) {
                    if ((to != -1) && (!is_reachable(edges[ii][iii].first, to))) continue;
                    if ((dist[ii] + edges[ii][iii].second) < dist[edges[ii][iii].first]) {
                        if (i != (vertex_number - 1)) {
                            dist[edges[ii][iii].first] = dist[ii] + edges[ii][iii].second;
                        }
                        else {
                            iinc = true;
                            break;
                        }
                    }
                }
            }
        }
        return dist;
    }
    
    bool is_include_negative_circle() {
        return iinc;
    }
    
    void get_reachable_dfs(int from, int to) {
        if (reachable[from][to]) return;
        reachable[from][to] = true;
        for (pair<int, T> e : edges[to]) {
            get_reachable_dfs(from, e.first);
        }
    }
    
    void get_reachable() {
        for (int i = 0; i < reachable.size(); i++) {
            get_reachable_dfs(i, i);
        }
    }
    
    bool is_reachable(int from, int to) {
        if (reachable.size() == 0) {
            reachable.resize(vertex_number, vector<bool>(vertex_number, false));
            get_reachable();
        }
        return reachable[from][to];
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // std::ifstream in("input.txt");
    // std::cin.rdbuf(in.rdbuf());
    int n, m, p;
    cin >> n >> m >> p;
    BellmanFord<ll> bf(n);
    rep(i, m) {
        int a, b, c;
        cin >> a >> b >> c;
        a--; b--;
        c = (c - p) * -1;
        bf.add_edge(a, b, c);
    }
    vector<ll> d = bf.get_distance(0, n - 1);
    if (bf.is_include_negative_circle()) {
        cout << -1 << endl;
        return 0;
    }
    cout << max(0LL, d[n - 1] * -1) << endl;
    return 0;
}


Measured memory_bytes: 1408
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define USE_LLONG_AS_INT
#ifdef USE_LLONG_AS_INT
#define int long long
#define inf (1ll<<60)
#else
#define inf (1<<30)
#endif
#define rep(i,n) for(int i=0;i<(n);i++)
#define Rep(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a,b) for(int i=(a);i<=(b);i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define eb emplace_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

struct UnionFind {
	vector<int> parent;
	int size;
	UnionFind(int n) :parent(n, -1), size(n) {}
	bool unite(int x, int y) {
		x = root(x); y = root(y);
		if (x == y)return false;
		if (sizeOf(x) < sizeOf(y))swap(x, y);
		parent[x] += parent[y]; parent[y] = x; size--;
		return true;
	}
	bool same(int x, int y) { return root(x) == root(y); }
	int root(int x) { return parent[x] < 0 ? x : parent[x] = root(parent[x]); }
	int sizeOf(int x) { return -parent[root(x)]; }
};

void run(){
    int n,m,k;
    cin>>n>>m>>k;
    vi a(m),b(m);
    vvi e(n);
    rep(i,m){
        cin>>a[i]>>b[i];
        a[i]--,b[i]--;
        e[a[i]].eb(b[i]);
        e[b[i]].eb(a[i]);
    }
    vi c(k),d(k);
    vvi f(n);
    rep(i,k){
        cin>>c[i]>>d[i];
        c[i]--,d[i]--;
        f[c[i]].eb(d[i]);
        f[d[i]].eb(c[i]);
    }
    UnionFind uf(n);
    rep(i,m)uf.unite(a[i],b[i]);
    rep(i,n){
        int ans=uf.sizeOf(i)-1;
        for(int p:e[i]){
            if(uf.same(i,p))ans--;
        }
        for(int p:f[i]){
            if(uf.same(i,p))ans--;
        }
        cout<<ans<<sp;
    }
}

Measured memory_bytes: 16884
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#l = list(map(int, input().split()))
a, b, c, k = map(int, input().split())

if (k<=a):
    print(k)
    exit()

# kがaより多い

if (k - a <= b):
    print (a)
    exit()

# kがa+bより多い

print (a - (k -(a+b) ))






Measured memory_bytes: 9136
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<int,int> P;
const LL mod=998244353;
const LL LINF=1LL<<62;
const int INF=1<<20;


int main(){
    LL a,b;cin >> a >> b;
    a--;
    vector<LL> s(100,0LL);
    s[0]=((b%4+1)/2+(4-a%4)/2)%2;
    for (int i = 1; i < 50; i++) {
        LL t = (1LL<<(i+1));
        s[i]=(max(b%t-((t>>1)-1),0LL)+((t>>1)-max(a%t-((t>>1)-1),0LL)))%2;
    }
    LL ans=0;
    for (int i = 0; i < 50; i++) {
        if(s[i]) ans+=(1LL<<i);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int n,i,look,x=0;
  int a[100001];
    int b[100001];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
    b[i]=0;
  }
  look = 1;
  for(i=0;i<n;i++){
    look = a[look-1];
    if(look==2){
      x = 1;
      break;
    }
  }
  if(x==1){
    printf("%d\n",i+1);
  }else{
    printf("%d\n",-1);
  }
  return 0;
}

Measured memory_bytes: 512
#include <algorithm>
#include <cstdint>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <cfloat>

using namespace std;

using lint=int64_t;
using uint=uint32_t;
using ulint=uint64_t;

template<class T>
using vector2d=vector<vector<T>>;

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

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

template <class T>
void OutVec(const vector<T>& vec){
  for(int i = 0; i < vec.size() - 1; ++i){
    cout<<vec[i]<<" ";
  }
  cout<<vec.back()<<endl;
}

template <class T>
void OutVec2d(const vector2d<T>& vec){
  for(auto v:vec){
    OutVec(v);
  }
}

struct State{
      int r, c,depth;
      State(int _r, int _c, int d):r(_r),c(_c),depth(d){}
      State(){}
    };

int main(){
  cout << std::fixed << std::setprecision(16);
  cin.tie(nullptr);
  std::ios::sync_with_stdio(false);

  int h,w;
  cin>>h>>w;
  vector2d<char> field(h+2,vector<char>(w+2));
  for(int c=0;c<=w+1;c++){
    field[0][c]='#';
    field[h+1][c]='#';
  }
  for(int r=1;r<=h;r++){
    field[r][0]='#';
    field[r][w+1]='#';
    for(int c=1;c<=w;c++){
      cin>>field[r][c];
    }
  }

  vector<int> vr{0,1,0,-1},vc{1,0,-1,0};

  int result=0;
  for(int sr=1;sr<=h;sr++){
    for(int sc=1;sc<=w;sc++){
      if(field[sr][sc]=='#') continue;

      vector2d<bool> visited(h+2,vector<bool>(w+2,false));
      visited[sr][sc]=true;
      queue<State> q;
      q.push(State(sr,sc,0));
      while(!q.empty()){
        State curr=q.front();
        q.pop();
        UpdateMax(result,curr.depth);

        for(int vi=0;vi<4;vi++){
          if(field[curr.r+vr[vi]][curr.c+vc[vi]]=='.'&&!visited[curr.r+vr[vi]][curr.c+vc[vi]]){
            visited[curr.r+vr[vi]][curr.c+vc[vi]]=true;
            q.push(State(curr.r+vr[vi],curr.c+vc[vi],curr.depth+1));
          }
        }

      }

    }
  }

  cout<<result<<endl;

  return 0;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long 
using namespace std;
#define w(x) int x; cin>>x; while(x--)

using namespace std; 
int check(long long int x)
{
    int ans=0;
    while(x%2==0)
    {
        x=x/2;
        ans++;
    }
    return ans;
}
int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin>>n;
    string str="";
    for(int i=1;i<=n;i++)
        str+="ACL";
    cout<<str;
}


Measured memory_bytes: 3592
#include<bits/stdc++.h>
//#define ll long long int32_t 
//#define int long long int
#define getFaster ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define rep(i,init,n) for(int i=init;i<n;i++)
#define rev(i,n,init) for(int i=n;i>=init;i--)
#define MAXN 200005
#define MOD2 998244353
#define MOD1 1e9+7
#define f first
#define s second
#define endl '\n'
#define pii pair<int,int>
#define piii pair<pii,int>
#define precise(i) cout<<fixed<<setprecision(i)
using namespace std;
const double PI = atan(1.0)*4;
const int64_t INF=20000000000003;
const int32_t LOG=21;
const int MOD=MOD1;
int32_t main()
{ 
	  getFaster;
      int tests=1;
      //cin>>tests;
      rep(ii,0,tests)
      {
            string s;
            cin>>s;
            int len=s.length();
            if(len&1){cout<<"No"<<endl;return 0;}
            rep(i,0,s.length())
            {
                if(s[i]=='h' && s[i+1]=='i'){i++;continue;}
                cout<<"No"<<endl;
                return 0;
            }
            cout<<"Yes"<<endl;
      }
      return 0;     
}


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

using namespace std;

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

    int x,x1,x2,n,num;
    cin>>x>>n;

    x1=x;
    x2=x;

    set <int> arr;

    for(int i=0;i<n;i++){
        cin>>num;
        arr.insert(num);
    }

    while(arr.find(x1)!=arr.end()){
        x1++;
    }

    while(arr.find(x2)!=arr.end()){
        x2--;
    }

    if(abs(x-x1)<abs(x-x2)){
        cout<<x1<<"\n";
    }
    else{
        cout<<x2<<"\n";
    }




    return 0;
}


Measured memory_bytes: 3660
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <bitset>
#include <complex>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef long long int llint;
#define MM 1000000000
#define MOD MM+7
#define pi pair<int,int>
#define pl pair<ll,ll>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
const long double PI = acos(-1);
const long long INF = 1e15;
const ll DEP = (1LL << 50);
int dx[8] = {-1,0,1,0,-1,-1,1,1};
int dy[8] = {0,-1,0,1,-1,1,1,-1};
template<typename T>
T GCD(T x,T y){
    return y ? GCD(y,x%y) : x;
}
ll N,a,b;
vector<pl> P(0);
int main(){
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> a >> b;
        P.push_back(make_pair(b,a));
    }
    sort(P.begin(),P.end());
    ll time = 0;
    for(int i = 0; i < N; i++){
        time += P[i].second;
        //cout << "time=" << time << endl;
        if (time > P[i].first){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


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

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

#define SIZE(x) ((ll)(x).size()) 
#define MAX(x) *max_element(ALL(x)) 
#define MIN(x) *min_element(ALL(x)) 
#define ALL(x) (x).begin(),(x).end() 

#define INF 1000000000000 
#define MOD 1000000007 
#define MAXR 100000 

#define PB push_back 
#define MP make_pair 
#define F first 
#define S second 



signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, k, i, l, r;
    cin >> n >> k;
    vector<int> a(200005);
    REP(i, n) cin >> a[i];
    vector<int> b(200005, 0);
    REP(_, min(k, 42)){
        REP(i, n) b[i] = 0;
        REP(i, n){
            l = max(0, (int)i-a[i]);
            r = min(n-1, (int)i+a[i]);
            b[l] += 1;
            b[r+1] -= 1;
        }
        REP(i, n-1) b[i+1] += b[i];
        REP(i, n) a[i] = b[i];
    }
    REP(i, n) cout << a[i] << " ";
}


Measured memory_bytes: 4764
#include <iostream>
#include <vector>
#include <cstring>

//isprimeðìÁÄ­êéÖ
int* prime(int num){
	std::vector<int> v;
	int* res = new int[num+1];
	memset(res, 0, sizeof(res));
	res[2] = 1;
	v.push_back(2);

	bool f;
	for(int i=3;i<=num;i+=2){
		f = true;
		for(int j=0;v[j]*v[j]<=i;j++){
			if(i % v[j] == 0){f=false;break;}
		}
		if(f){v.push_back(i),res[i] = 1;}
	}

	return res;
}

int main(){
	int* isprime = prime(1000000);

	int n, res = 0;
	while(std::cin >> n, n){
		res = 0;
		for(int i=2;i<=n/2;i++){
			if(isprime[i] && isprime[n-i])res++;
		}
		std::cout << res << std::endl;
	}
	
	return 0;
}

Measured memory_bytes: 4968
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
#include<vector>
#include<queue>
#include<deque>
#include<iomanip>
#include<map>
using namespace std;
typedef pair<int, pair<int, int> >PP;
typedef long long ll;
typedef pair<int, int>P;
typedef vector<int>vec;
int inf=-1;
ll mod = pow(10, 9) + 7;
 
int main(){
    int a;string s;
    cin>>a>>s;
    if(a>=3200){
        cout<<s<<endl;
    }
    else{
        cout<<"red"<<endl;
    }
    return 0;
}

Measured memory_bytes: 764
#include <bits/stdc++.h>
using namespace std;
#define forr(i, a, b) for(int i = (a); i < (int) (b); i++)
#define forn(i, n) forr(i, 0, n)
#define forall(it, v) for(auto it = v.begin(); it != v.end(); ++it)
#define dforn(i, n) for(int i = ((int) n) - 1; i >= 0; i--)
#define db(v) cerr << #v << " = " << v << endl
#define pb push_back
#define sz(x) ((int)x.size())
#define ff first
#define ss second
typedef long long ll;
const int MAXN = -1;

int n;
string s;
bool T[30];

void solve(int i, int c){
    printf("Vamos a correr %d, %c\n", i, c+'a');
    T[s[i] - 'a'] = false; s[i] = c + 'a'; T[c] = true;
    forr(j, i+1, n){
        forn(i, 26)if(!T[i]){
            T[i] = true;
            s[j] = 'a' + i;
        }
    }
}

void create(int k){
    s.clear();
    forn(i, k)s.pb(i + 'a');
}

int main(){
	while(cin >> s){
        forn(i, 30) T[i] = false;
        if( s == "zyxwvutsrqponmlkjihgfedcba"){
            printf("-1\n");
            continue;
        };
        n = s.size();
        forn(i, n)T [ s[i] - 'a' ] = true;
        if(n == 26){
//            vector<int> V; char t = s.back();
//            forn(i, 26) V.pb(s[i]-'a' +1);
//            next_permutation(V.begin(), V.end());
//            forn(i, 26)s[i] = V[i] + 'a' - 1;
//            while(s.back() != t)s.pop_back();
            while(1){
                int p = s.back() - 'a'; bool win = false;
                forr(i, p, 26){
                    if(!T[i]){win = true; s[s.size() - 1] = i+'a'; break;}
                }
                if(win)break;
                s.pop_back(); T[p] = false;
            }
        }
        else{
            int p = 0; while(T[p])p++;
            s.pb(p + 'a');
        }
        /*bool win = false;
        dforn(i, n){
            bool ch = false; int p = s[i] - 'a', c;
            forr(j, p, 26)if(!T[j]){ch = true; c = j; break;}
            if(ch){solve(i, c); win = true; break;}
            T[s[i]] = false;
        }
        if(!win)create(n+1);*/
        cout << s << endl;
    }
	return 0;
}


Measured memory_bytes: 256
/// In The Name Of God

#include <bits/stdc++.h>

#define f first
#define s second

#define pb push_back
#define pp pop_back
#define mp make_pair

#define sz(x) (int)x.size()
#define sqr(x) ((x) * 1ll * (x))
#define all(x) x.begin(), x.end()

#define rep(i, l, r) for (int i = (l); i <= (r); i++)
#define per(i, l, r) for (int i = (l); i >= (r); i--)

#define Kazakhstan ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0);

#define nl '\n'
#define ioi exit(0);

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const int N = (int)5e5 + 7;
const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const ll linf = (ll)1e18 + 7;

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

using namespace std;

int n, k;
int a[N];
vector <int> g[N];

bool used[N];

struct tree {
	int t[N << 2];
	void upd(int p, int x, int v = 1, int tl = 1, int tr = n) {
		if (tl == tr) {
			t[v] = x;
			return;
		}
		int tm = tl + tr >> 1;
		if (p <= tm) upd(p, x, v << 1, tl, tm);
		else upd(p, x, v << 1 | 1, tm + 1, tr);
		t[v] = min(t[v << 1], t[v << 1 | 1]);
	}
	int get(int l, int r, int v = 1, int tl = 1, int tr = n) {
		if (l <= tl && tr <= r) return t[v];
		if (tl > r || tr < l) return inf;
		int tm = tl + tr >> 1;
		return min(get(l, r, v << 1, tl, tm), get(l, r, v << 1 | 1, tm + 1, tr));
	}
} t;

int tmr;
int tin[N], tout[N], d[N];
void dfs(int v, int p = 0) {
	d[v] = d[p] + 1;
	tin[v] = ++tmr;
	for (auto to : g[v]) {
		if (to != p) dfs(to, v);
	}
	tout[v] = tmr;
}
void go(int v, int p = 0) {
	
	if (!used[v]) {
		int x = a[p] + 1;
		//if (v == 1) cout << " -> " << t.get(tin[v], tout[v]) << ' ' << x;

		if (x + d[v] <= t.get(tin[v], tout[v])) a[v] = x;
		else a[v] = x - 2;
		t.upd(tin[v], a[v] + d[v]);
	}

	for (auto to : g[v]) {
		if (to != p) go(to, v);
	}
}

int main() {
	#ifdef IOI2018
		freopen ("in.txt", "r", stdin);
	#endif
	Kazakhstan
	cin >> n;
	rep(i, 2, n) {
		int v, u;
		cin >> v >> u;
		g[v].pb(u);
		g[u].pb(v);
	}
	cin >> k;
	int st = -1;
	rep(i, 1, k) {
		int v, c;
		cin >> v >> c;
		a[v] = c;
		if (st == -1) st = v;
		used[v] = 1;
	}
	dfs(st);
	rep(i, 1, n) {
		if (used[i]) t.upd(tin[i], a[i] + d[i]);
		else t.upd(tin[i], inf);
	}
	go(st);
	rep(i, 1, n) {
		for (auto to : g[i]) if (abs(a[i] - a[to]) != 1) cout << "No", ioi
	} 
	cout << "Yes\n";
	rep(i, 1, n) cout << a[i] << nl;
	ioi
}


Measured memory_bytes: 35968
def is_correct(i):
    if i % 3 == 0: return True
    while i > 0:
        if i % 10 == 3: return True
        i = i // 10
    return False
 
def main():
    n = int(input())
    answer = ""
    for i in range(1, n + 1):
        if is_correct(i): answer += " " + str(i)
    print(answer)    
 
if __name__ == "__main__":
    main()


Measured memory_bytes: 5636
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(ll i=0;i<n;i++)
#define ll long long
#define double long double
using namespace std;
signed main() {
	string s;
	cin >> s;
	for (int i = 0; i < s.size(); i += 2)cout << s[i];
	cout << endl;
	getchar(); getchar(); return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
	string a,s;
	ll int n=0;
	cin>>a>>s;
	for(int i=0;i<s.size();i++)
	{
		if(s[i]!=a[i])
		n++;
	}
	cout<<n<<endl;
	return 0;
}

Measured memory_bytes: 3884
//
//  main.cpp
//  ABC124
//
//  Created by hiroaki on 2019/05/07.
//  Copyright © 2019年 hiroaki. All rights reserved.
//

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath> 
#include <tuple>
#include <bitset>
//pair sort firstに揃う

#define int long long
#define double long double
#define Rap(n,i) for(int (i)=0;(i)<(n);(i)++)
#define Pr(n) cout<<n<<endl;
#define PairV vector<pair<int , int> >
#define F first
#define S second
#define Vector1 vector<int>
#define VectorS vector<string>
#define vector2 vector<vector<int> >
#define index(v,x) find((v).begin(), (v).end(), (x))-(v).begin()
#define ctoi(c) (int)(c-'0')
#define incin(n) int (n); cin>>(n);
#define incin2(n,m) int (n),(m); cin >> (n)>>(m);
#define stcin(s) string (s); cin>>(s);
#define all(v) (v).begin() , (v).end()
namespace Mathf
{
    const int INF = 1000000000000;
    const double PI = 3.14159274;
    const double Rad2Deg = 57.29578;
    const double log2(double a,double b);
    const double log2(double a,double b){
        return log(b)/log(a);
    }
} // namespace Mathf

using namespace std;

int MD(pair<int,int> a,pair<int,int> b){//ManhattanDisRance
    return abs(a.first-b.first) + abs(a.second-b.second);
}
int MOD(int a,int b){
    return abs(a%b);
}
template <typename T1,typename T2> bool Comp (pair<T1,T2> a,pair<T1,T2> b){
    if(a.first!=b.first){
        return a.first<b.first;//first昇順
    }
    if(a.second!=b.second){
        return a.second > b.second;//second降順
    }else{
        return  true;
    }
}
double Dis(pair<int,int> a,pair<int,int> b){
    return sqrt((a.first-b.first)*(a.first-b.first)+(a.second-b.second)*(a.second-b.second));
}
int Step(int N){
    if(N==0){
        return 1;
    }else{
        return N*Step(N-1);
    }
}
int Pemu(int n,int r){
    int ans = n;
    for(int i=0;i<r;i++){
        ans*=(ans-i);
    }
    return ans;
}
int Comb(int n,int m){
    int ans=n;
    for(int i=0;i<m;m++){
        ans*=(ans-i);
    }
    return ans/Step(m);
}
signed  main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    incin(n);
    Vector1 a(n);

    Rap(n,i){
        cin >> a.at(i);
    }

    sort(all(a));
    Pr(abs(a[n-1]-a[0]));
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long int;
using ld=long double;
using VI=vector<ll>;
using VC=vector<char>;
using VB=vector<bool>;
using VD=vector<ld>;
using VVI=vector<VI>;
using VVC=vector<VC>;
using VS=vector<string>;
using PLL =pair<ll,ll>;
using PLD=pair<ld,ld>;
using VPLL=vector<PLL>;
#define print(x) cout<<x<<"\n
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define repd(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element((x).begin(),(x).end())
#define MIN(x) *min_element((x).begin(),(x).end())
#define SORTR(x) sort((x).rbegin(),(x).rend())
#define SORT(x) sort((x).begin(),(x).end())
#define SUM(x) accumulate((x).begin(),(x).end(), 0)
#define FILL(x,a) fill(x.begin(),x.end(),a)
#define EACH(i,x) for(typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())

const ll INF = 1e18;
const ld EPS   = 1e-10;
const int MOD  = int(1e9)+7;
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; }
template <class BidirectionalIterator>
bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle,BidirectionalIterator last){reverse(middle, last); return next_permutation(first , last);}
ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
ll GCD(VI v){ll a = v[0]; for (ll i = 1; i<SIZE(v); i++) {a = gcd(a, v[i]);} return a;}
ll LCM(VI v){ll a = v[0]; for (ll i = 1; i<SIZE(v); i++) {a = lcm(a, v[i]);} return a;}
VI Bit2Vector(const ll bit, ll n) {	VI s;	rep(i,n) if (bit & (1 << i)) s.push_back(i); return s;}

struct DFS{
public:
	VVI to;
	VB visited;
	//ll start;

	DFS(VVI &t,VB& vis,ll s){
		//to=t;
		//visited=vis;
		//start=s;
	}

	ll search(VVI& to, vector<bool> visited, ll s = 0) {
		visited[s] = true;
		if (!EXIST(visited, false)) return 1;
		ll ret = 0;
		for (auto& v : to[s]) {
			if (visited[v]) continue;
			ret += search(to, visited, v);
		}
		return ret;
	}
};


ll dfs_search(VVI& to, vector<bool> visited, ll s = 0) {
	visited[s] = true;
	if (!EXIST(visited, false)) return 1;
	ll ret = 0;
	for (auto& v : to[s]) {
		if (visited[v]) continue;
		ret += dfs_search(to, visited, v);
	}
	return ret;
}

void Main()
{
	ll n,m,l; ll res=0;
	string s,t,u; string sres="No or NO";

	cin >> n >> m;
	VVI to(n,VI());
	rep(i, m) {
		int a, b; cin >> a >> b; a--; b--;
		to[a].push_back(b);
		to[b].push_back(a);
	}
	vector<bool> visited(n,false);

	DFS dfs(to,visited,0);

	dfs.visited=visited;
	dfs.to=to;

	res=dfs.search(to,visited,0);
	//res=dfs_search(to,visited,0);
	cout << res << "\n";
	return;
}

int main()
{
	std::cin.tie(0);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}


Measured memory_bytes: 3676
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
#include<map>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<numeric>
#include<iomanip>
#define MAX 500005
#define MOD 1000000007
#define lo long long
#define INF 1e18
#define pp pair<long long , long long>
#define ppp pair<long long, pair<long long, long long> >
#define pb(a) push_back(a)
#define fi first
#define se second
#define PI 3.14159265
using namespace std;

lo a[MAX];
int main() {

    lo x;           
    cin>>x;

    if(x == 0) {
        cout<<1<<endl;
    } else {
        cout<<0<<endl;
    }
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
#include <time.h>
using namespace std;
#define ll          long long int
#define pb          push_back
#define pll         pair<ll,ll>
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mod         1000000007
#define inf         1000000000000000000LL
#define vl          vector<ll>
#define F           first
#define S           second
#define ld          long double
#define sz(x)       (ll)x.size()
#define fix(n)      cout<<fixed<<setprecision(n)
#define rep(i,a,b)  for(ll i=a;i<b;i++)
#define all(x)      x.begin(),x.end()
#define pi          3.14159265358979323



void solve()
{
       string s;
       cin>>s;
       int n = s.size();
       int rem = 15 - n;
       int c=0;
       for(int i=0; i<n; i++) if(s[i]=='o') c++;
       if(c+rem >= 8) cout<<"YES\n";
       else cout<<"NO\n";
}

int main()
{
       speed_up;
       //pre();
       ll T=1;
       //cin>>T;
       while(T--) solve();
	return 0;
}


Measured memory_bytes: 256
from collections import defaultdict
from collections import deque
from collections import Counter
import math
import itertools

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()

ans = 0
for a in range(1,10**6):
	if a>n:
		break
	for b in range(1,10**6):
		c = n-a*b
		#print(a,b,c)
		if c>0:
			ans+=1
		else:
			break

print(ans)

Measured memory_bytes: 68384
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <numeric>
#include <climits>
#define LIM 1000007
#define ll long long
using namespace std;
int main() {
  string s;
  cin >> s;
  bool v['z' - 'a' + 1];
  for (int i = 0; i < ('z' - 'a' + 1); i++) {
    v[i] = false;
  }
  for (char c : s) {
    v[c - 'a'] = !v[c - 'a'];
  }
  for (bool b : v) {
    if (b) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 256