akhauriyash/Code-Regression huggingface dataset:
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from decimal import *
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
INF = float('inf') #無限大
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(sys.stdin.readline()) #整数読み込み
def ifn(): return float(sys.stdin.readline()) #浮動小数点読み込み
def isn(): return sys.stdin.readline().split() #文字列読み込み
def imn(): return map(int, sys.stdin.readline().split()) #整数map取得
def imnn(): return map(lambda x:int(x)-1, sys.stdin.readline().split()) #整数-1map取得
def fmn(): return map(float, sys.stdin.readline().split()) #浮動小数点map取得
def iln(): return list(map(int, sys.stdin.readline().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, sys.stdin.readline().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD
def print_list(l): print(*l, sep='\n')
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def No(): print('No')

def sieves_of_e(n):
    is_prime = [True] * (n+1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i * 2, n+1, i): is_prime[j] = False
    return is_prime

sx,sy,tx,ty=imn()

x_distance = tx-sx
y_distance = ty-sy
ans = ''
ans += 'U'*y_distance+'R'*x_distance
ans += 'U'+'L'*(x_distance+1)+'D'*(y_distance+1)+'R'
ans += 'R'*(tx-sx)+'U'*(ty-sy)
ans += 'R'+'D'*(y_distance+1)+'L'*(x_distance+1)+'U'
print(ans)

Measured memory_bytes: 5288
#include<bits/stdc++.h>
using namespace std;
inline int read(){
	char c=getchar();int t=0,f=1;
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){t=(t<<3)+(t<<1)+(c^48);c=getchar();}
	return t*f;
}
int a,b;
int main(){
	a=read(),b=read();
	if(b==1){puts("0");return 0;}
	int tot=1;
	for(int i=1;;i++){
		tot+=a-1;
		if(tot>=b){
			printf("%d\n",i);
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(a) ((a).begin(),(a).end())
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

ll dp[330][330];
ll sum[330][330];

inline ll cost(ll x, ll y){
  ll res = 0, k = 1, c = 0;
  for(;;){
    if(x<k && y<k)break;
    ll xi = (x/k)%10LL, yi = (y/k)%10LL;
    res += xi*yi+c;
    if(xi+yi+c>=10LL)c = 1;
    else c = 0;
    k *= 10LL;
  }
  res += c;
  return res;
}

int main(){
  int n;
  ll a[330];
  cin >> n;
  rep(i,n)cin >> a[i];
  
  rep(i,n){
    sum[i][i] = 0;
    for(int j=i;j<n;j++){
      sum[i][j+1] += sum[i][j] + a[j];
    }
  }

  memset(dp,-1,sizeof(dp));
  rep(i,n)dp[i][i+1] = 0;

  for(int len=2;len<=n;len++){
    rep(l,n){
      int r = l+len;
      if(r>n)break;

      ll tmp = 1e18;
      for(int k=l+1;k<r;k++){
	tmp = min(tmp, dp[l][k] + dp[k][r] + cost(sum[l][k],sum[k][r]));
      }
      dp[l][r] = tmp;
    }
  }

  cout << dp[0][n] << endl;
}

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

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<int> hv, hc;
	hv.reserve(n);
	int input = 0;
	for (int i = 0; i < n; i++) {
		cin >> input;
		hv.push_back(input);
		hc.push_back(-1);
	}

	hc[0] = 0;
	hc[1] = abs(hv[0] - hv[1]);
	for (int i = 2; i < n; i++) {
		hc[i] = min(hc[i - 1] + abs(hv[i] - hv[i - 1]), hc[i - 2] + abs(hv[i] - hv[i - 2]));
	}
	cout << hc[n - 1];
}


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

int main() {
  int a,b,c, a_1;
  cin >> a;
  b = a % 10;
  c = c + b;
  a_1 = (a - b) / 10;
  b = (a_1) % 10;
  c = c + b;
  b = ((a_1 - b) / 10) % 10;
  c = c + b;
  cout << c << endl;
}



Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;

int n, a, b, c;
int l[8];
int ans = 1 << 30;
void calc(vector<int>& pattern){
    int A = 0, B = 0, C = 0;
    int a_cnt = 0, b_cnt = 0, c_cnt = 0;
    rep(i, n){
        if(pattern[i] == 0){
            A += l[i];
            a_cnt++;
        }
        else if(pattern[i] == 1){
            B += l[i];
            b_cnt++;
        }
        else if(pattern[i] == 2){
            C += l[i];
            c_cnt++;
        }
    }
    if(a_cnt > 0 && b_cnt > 0 && c_cnt > 0){
        int res = abs(A-a) + abs(B-b) + abs(C-c) + 10 * (a_cnt + b_cnt + c_cnt - 3);
        ans = min(ans, res);
    }
}

void dfs(int depth, vector<int>& pattern){
    if(depth == n){
        calc(pattern);
        return;
    }

    rep(i, 4){
        pattern[depth] = i;
        dfs(depth+1, pattern);
    }
}

int main() {

    cin >> n >> a >> b >> c;
    rep(i, n){
        cin >> l[i];
    }
    vector<int> pattern(n);
    dfs(0, pattern);

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
N, C, K = list(map(int, input().split()))
T = [int(input()) for _ in range(N)]
T.sort()
i = 0
res = 0
while i < N:
    j = 0
    while i < N and j < C and T[i] - T[i - j] <= K:
        i += 1
        j += 1
    res += 1
print(res)


Measured memory_bytes: 13200
#include <bits/stdc++.h>
#include  <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
#define endl '\n'
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> index_set;
using vi = vector<int>;
#define pb push_back
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()

using ii = pair<int,int>;
#define f first
#define s second
#define mp make_pair
#define pb push_back

int main() {
	//ios::sync_with_stdio(false);
	//cin.tie(nullptr);
	int n;
	cin >> n;
	if(n >=30)
		cout << "Yes\n";
	else
		cout << "No\n";
	return 0;    
}


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

typedef long long ll;
int main(){
  double a,b;
  cin >> a >> b;
  // a = A * 0.08 の切り捨て
  double tmpmin = a / 0.08;
  double tmpmax = b / 0.10;
  tmpmin = min(tmpmin, tmpmax);
  
  bool flg = false;
  for(int i = (int)tmpmin; i < (int)tmpmin+100; i++){
    int x = i * 0.08;
    int y = i * 0.10;
    if(x == a && y == b){
      cout << i << endl;
      flg = true;
      break;
    }
  }
  if(!flg) { 
    cout << -1 << endl;
  }


}

Measured memory_bytes: 256
#pragma region
#include <bits/stdc++.h>
using namespace std;
inline void ci(void){
  return;
}
template <typename First, typename... Rest>
void ci(First& first, Rest&... rest){
  cin >> first;
  ci(rest...);
  return;
}
inline void co(void){
  cout << "\n";
  return;
}
template <typename First, typename... Rest>
void co(First first, Rest... rest){
  cout << first << " ";
  co(rest...);
  return;
}
#define ll long long
#define ld long double
#define st string
#define dl double
#define wh while
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tp tuple
#define ft first
#define sc second
#define ve vector
#define tos to_string
#define len length
#define rt return 0
#define br break
#define con continue
#define lcm(n, m) (n * m / gcd(n, m))
#define np next_permutation
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define repill(i, m, n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define repll(i, n) repill(i, 0, n)
#define revi(i, m, n) for(int i=(int)(m);i>(int)(n);i--)
#define rev(i, m) revi(i, m, 0)
#define revill(i, m, n) for(ll i=(ll)(m);i>(ll)(n);i--)
#define revll(i, n) revill(i, 0, n)
#define sz(v) ((int)(v).size()) 
#define each(i, n) for(auto&& i: n)
#define all(n) (n.begin(), n.end())
#define allr(n) (n.rbegin(), n.rend())
#define sp(n) cout << fixed << setprecision(n)
#pragma endregion
// sqrt ルート, int 2*10^9, gcd　最大公約数
// __builtin_popcount bitの個数

int main() {
  int N;
  ci(N);
  map<int, int> A;
  rep(i, N - 1){
    A[i + 1] = 0;
    int x;
    ci(x);
    A[x]++;
  }
  each(i, A){
    co(i.sc);
  }
  co(0);
}

Measured memory_bytes: 12984
/*Read the problem carefully before starting to work on it*/
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;

//ll ncr(ll n,ll r){ll ans=1;r=min(r,n-r);for (int i=1;i<=r;i++){ans*=(n-r+i);ans/=i;}return ans;}

#define pb push_back
#define eb emplace_back
#define mp(x,y) make_pair(x,y)
#define mod 1000000007

double PI=3.1415926535897932384626;

//template<typename T> T power(T x,T y,ll m=mod){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1LL;x=(x*x)%m;}return ans%m;}

//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;

#define fi first
#define se second

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n;
	cin>>n;
	map<string,ll>mm;
	for(ll i=0;i<n;i++)
	{
	    string temp;
	    cin>>temp;
	    sort(temp.begin(),temp.end());
	    mm[temp]++;
	}
	ll ans=0;
	for(auto &x:mm)
	{
	    if(x.se<2)
	        continue;
	    ll val=x.se;
	    ans+=( (val*(val-1))/2 );
	}
	cout<<ans;
    return 0;
}


//252908XL

Measured memory_bytes: 11264
//#pragma GCC optimize(3,"Ofast","inline")
#include<bits/stdc++.h>
#define in inline
#define reg register
#define MAX 20030813
#define int long long
using namespace std;
namespace qwq{
	in void read(int &o)
	{
		o=0;
		int w=1;
		char c=getchar();
		while(c<'0'||c>'9')
		{
			if(c=='-')w*=-1;
			c=getchar();
		}
		while(c>='0'&&c<='9')
		{
			o=(o<<3)+(o<<1)+(c^48);
			c=getchar();
		}
		o*=w;
	}
	in void write(int x)
	{
	   	if(x<0)putchar('-'),x=-x;
    	if(x>9)write(x/10);
    	putchar(x%10+48);
	}
	in int max(int x,int y)
	{
		return x>y?x:y;
	}
	in int min(int x,int y)
	{
		return x<y?x:y;
	}
}
using namespace qwq;
int H,W,A,B;
bool f[1111][1111];
signed main()
{
	read(H),read(W),read(A),read(B);
	for(reg int i=1;i<=H;++i)
	{
		if(i<=B)for(reg int j=1;j<=A;++j)f[i][j]=1;
		else for(reg int j=W;j>A;--j)f[i][j]=1;
	} 
	for(reg int i=1;i<=H;++i)
	{
		for(reg int j=1;j<=W;++j)cout<<f[i][j];
		puts("");
	}
	return 0;
}




Measured memory_bytes: 2304
// ABC177-D
#include <bits/stdc++.h>
#define endl "\n"
#define rep(i,n) for(int i=0;i<int(n);i++)
#define e_b emplace_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> ipair;
typedef pair<ll,ll> lpair;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v) //vectorの中身を見る
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
void map_p(map<int,int>& d){cout<<"map: ";for(auto a : d){cout<<"{"<<a.first<<":"<<a.second<<"}";}cout<<endl;} //mapの中身を見る
void set_p(set<int>& d){cout<<"set: ";for(int a : d){cout<<a<<" ";}cout<<endl;} //setの中身を見る

struct unionfind{
    vector<int> par;
    void init(int n){
        par.assign(n,-1);
    }
    int find(int x){
        if(par[x]<=-1) return x;
        par[x]=find(par[x]);
        return par[x];
    }
    int size(int x){
        return -1*par[find(x)];
    }
    void unite(int x,int y){
        x=find(x),y=find(y);
        if(x==y) return;
        if(size(x)<size(y)) swap(x,y);
        par[x]+=par[y];
        par[y]=x;
    }
    bool same_set(int x,int y){
        return find(x)==find(y);
    }
};
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);

    int n,m,ans=0,a,b;
    cin>>n>>m;
    unionfind uf;
    uf.init(n);
    rep(i,m){
        cin>>a>>b;
        uf.unite(a,b);
    }
    rep(i,n){
        ans=max(ans,uf.size(i));
    }
    cout<<ans<<endl;
    return 0;
}

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

const int N = 3010;
const int mod = 998244353;

int a[N];
ll f[N][N];

int main() {
	int n, s;
	scanf("%d%d", &n, &s);
	for(int i=1; i<=n; i++)
		scanf("%d", &a[i]);
	// for(int i=0; i<=n; i++)
	// 	f[i][0] = 1;
	f[0][0] = 1;
	for(int i=1; i<=n; i++) {
		for(int j=0; j<=s; j++) {
			f[i][j] = f[i-1][j]*2%mod;
			if(j>=a[i])
				f[i][j] = (f[i][j]+f[i-1][j-a[i]])%mod;
		}
 	}
 	printf("%lld\n", f[n][s]);
	return 0;
}

Measured memory_bytes: 74288
n = int(input())
s = [input() for i in range(n)]
dic = {}
for i in range(n):
    if s[i] in dic.keys():
        dic[s[i]] += 1
    else:
        dic[s[i]] = 1
max1 = max(dic.values())
ans = []
for keys in dic.keys():
    if dic[keys] == max1:
        ans.append(keys)
ans.sort()
for i in ans:
    print(i)

Measured memory_bytes: 38440
#include <bits/stdc++.h>
#define DAU  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define PLEC return 0;
using namespace std;
int n;
int main() {
    DAU
    cin >> n;
    cout << (n + 1) / 2;
    PLEC
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Math;
using static System.Console;
using static exMath;
using static exReadLine;


class Program
{
    static void Main(string[] args)
    {
        int N;
        intReadLine(out N);
        int[] A = ReadLine().Split().Select(int.Parse).ToArray();
        Array.Sort(A);
        bool ans = true;
        for(int i = 1; i < N; i++)
        {
            if(A[i - 1] == A[i])
            {
                ans = false;
                break;
            }
        }
        if (ans)
        {
            WriteLine("YES");
        }
        else
        {
            WriteLine("NO");
        }
    }
}

static class exReadLine
{
    public static void intReadLine(out int a)
    {
        a = int.Parse(ReadLine());
    }
    public static void intReadLine(out int a, out int b)
    {
        int[] input = ReadLine().Split().Select(int.Parse).ToArray();
        a = input[0];
        b = input[1];
    }
    public static void intReadLine(out int a, out int b, out int c)
    {
        int[] input = ReadLine().Split().Select(int.Parse).ToArray();
        a = input[0];
        b = input[1];
        c = input[2];
    }
    public static void intReadLine(out int a, out int b, out int c, out int d)
    {
        int[] input = ReadLine().Split().Select(int.Parse).ToArray();
        a = input[0];
        b = input[1];
        c = input[2];
        d = input[3];
    }

    public static void longReadLine(out long a)
    {
        a = long.Parse(ReadLine());
    }
    public static void longReadLine(out long a, out long b)
    {
        long[] input = ReadLine().Split().Select(long.Parse).ToArray();
        a = input[0];
        b = input[1];
    }
    public static void longReadLine(out long a, out long b, out long c)
    {
        long[] input = ReadLine().Split().Select(long.Parse).ToArray();
        a = input[0];
        b = input[1];
        c = input[2];
    }
    public static void longReadLine(out long a, out long b, out long c, out long d)
    {
        long[] input = ReadLine().Split().Select(long.Parse).ToArray();
        a = input[0];
        b = input[1];
        c = input[2];
        d = input[3];
    }
}

static class exMath
{
    // 最大公約数
    public static int Gcd(int a, int b)
    {
        if (a < b) return Gcd(b, a);
        while (b != 0)
        {
            var r = a % b;
            a = b;
            b = r;
        }
        return a;
    }
    public static long Gcd(long a, long b)
    {
        if (a < b) return Gcd(b, a);
        while (b != 0)
        {
            var r = a % b;
            a = b;
            b = r;
        }
        return a;
    }

    // 最小公倍数
    public static long Lcm(int a, int b)
    {
        return BigMul(a, b) / Gcd(a, b);
    }
    public static long Lcm(long a, long b)
    {
        return a * b / Gcd(a, b);
    }
}

Measured memory_bytes: 34268
#include<iostream>
#include<string>
#include<algorithm>
#include <cmath>

using namespace std;

int main(){
 string a;
  cin >> a;
  string b;
  for(int i=0; i< a.length(); i+=2){
  	b+= a[i];
  }
  
  
  
  cout << b << endl;
 
  return 0;
}

Measured memory_bytes: 512
str = input()
lstr = list(str)

num = int(input())

for i in range(num):
    order = input().split()

    if (order[0] == "print"):
        onum = list(map(int,order[1:3]))

        for i in range(onum[0],onum[1]+1):
            print(lstr[i],end = "")
        print("")

    elif (order[0] == "reverse"):
        onum = list(map(int,order[1:3]))
        if (onum[0] == 0):
            tmp1 = lstr[0:onum[1]+1]
            tmp1.reverse()
            tmp2 = lstr[onum[1]+1:]
            lstr = tmp1 + tmp2

        else:
            tmp1 = lstr[:onum[0]]
            tmp2 = lstr[onum[0]:onum[1]+1]
            tmp2.reverse()
            tmp3 = lstr[onum[1]+1:]
            lstr = tmp1 + tmp2 +tmp3

    elif (order[0] == "replace"):
        onum = list(map(int,order[1:3]))
        restr = list(order[3])

        for i in range(onum[0],onum[1]+1):
            lstr[i] = restr[i-onum[0]]



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

#define sz(x) int(x.size())
#define pii pair<int, int>
#define Task "abc"
#define For(i, a, b) for(int i = (a), _b = (b); i <= b; ++i)
#define Debug(X) cout << #X << " = " << X << '\n'
#define All(x) (x).begin(), (x).end()
#define mp make_pair

typedef unsigned long long ull;
typedef long long ll;

const int maxn = 1e5 + 10;
const int inf = 0x3f3f3f3f;
const ll mod = 1e9 + 7;

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);cout.tie(0);
//  freopen(Task".inp", "r", stdin);
//  freopen(Task".out", "w", stdout);
  int a, b;
  cin >> a >> b;
  for (int ans = b * 10; ans < b * 10 + 10; ++ans){
    if ( (ans * 2) / 25 == a){
      cout << ans;
      return 0;
    }
  }
  cout << -1;
}



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


int main() {
    string s;
    cin >> s;
    int n=s.size()-1;
    ll ans=0;
    for (int bit=0;bit<(1<<n);bit++) {
        ll tans=s[0]-'0';
        for (int i=0;i<n;i++) {
            if (bit & (1<<i)) { // 列挙に i が含まれるか
                ans+=tans;
                tans=0;
            }
            tans=tans*10+(s[i+1]-'0');
        }
        ans+=tans;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
h, w, m = map(int, input().split())
R = [0] * h
C = [0] * w
XY = [tuple(map(lambda x:int(x) - 1, input().split())) for i in range(m)]
for x, y in XY:
    R[x] += 1
    C[y] += 1
maxR, maxC = max(R), max(C)
cnt0 = R.count(maxR) * C.count(maxC)
cnt1 = sum(R[x] == maxR and C[y] == maxC for x, y in XY)
print(maxR + maxC - int(cnt0 == cnt1))


Measured memory_bytes: 54160
package main

import (
	"fmt"
	"strings"
)

func main() {
	var s string
	fmt.Scan(&s)

	chars := strings.Split(s,"")
	if chars[0] == chars[1] || chars[1] == chars[2] || chars[2] == chars[3] {
		fmt.Println("Bad")
	} else {
		fmt.Println("Good")
	}
}

Measured memory_bytes: 640
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#include <unordered_map>

using namespace std;

typedef long long ll;

void solve() {
	ll a, b, v, w, t;
	cin >> a >> v >> b >> w >> t;
	if (v <= w) {
		cout << "NO";
		return;
	}
	if (abs(a - b) <= t * (v - w)) {
		cout << "YES";
		return;
	}

	cout << "NO";
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#if defined(_DEBUG)
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int q = 1;
	//cin >> q;
	for (; q > 0; q--) {
		solve();
		cout << '\n';
	}
}

Measured memory_bytes: 3612
n = input()

t_now = 0
x_now = 0
y_now = 0
can_travel = True
for i in range(int(n)):
  next_value = list(map(int,input().split()))
  dt = next_value[0]-t_now
  dist = abs(next_value[1]-x_now)+abs(next_value[2]-y_now)
  if dt < dist:
    can_travel = False
    break
  elif dt%2 != dist%2:
    can_travel = False
    break

if can_travel:
  print("Yes")
else:
  print("No")

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

using namespace std;

const int N = 1e5 + 5;
int dp[N][3], a[N], b[N], c[N];
int main() {
    int n;
    cin >> n;
    for (int i = 1; i<=n; i++)
        cin >> a[i] >> b[i] >> c[i];

    dp[1][0] = a[1], dp[1][1] = b[1], dp[1][2] = c[1];
    for (int i = 2; i<=n; i++) {
        dp[i][0] = a[i] + max(dp[i-1][1], dp[i-1][2]);
        dp[i][1] = b[i] + max(dp[i-1][0], dp[i-1][2]);
        dp[i][2] = c[i] + max(dp[i-1][0], dp[i-1][1]);
    }
    cout << max({dp[n][0], dp[n][1], dp[n][2]});
    return 0;
}


Measured memory_bytes: 2560
#!usr/bin/env python3
from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007
#A
def A():
    t,x = LI()
    print(t/x)

#B
def B():
    n = I()
    a = LI()
    m = max(a)
    if m >= sum(a)-m:
        print("No")
    else:
        print("Yes")


#C
def C():
    n,m = LI()
    x = LI()
    x.sort()
    l = [x[i+1]-x[i] for i in range(m-1)]
    l.sort()
    l = l[::-1]
    ans = sum(l[max(n-1,0):])
    print(ans)

#D
def D():
    n,k = LI()
    a = LI()
    k = list(map(int,list(bin(k)[2:])))
    l = len(k)
    for i in range(n):
        a[i] = list(map(int,list(bin(a[i])[2:])))
        l = max(l,len(a[i]))
    for i in range(n):
        for j in range(l-len(a[i])):
            a[i].insert(0,0)
    for j in range(l-len(k)):
        k.insert(0,0)
    s = [[0,0] for i in range(l)]
    pow2 = [1 for i in range(l)]
    for i in range(l-1)[::-1]:
        pow2[i] = pow2[i+1]*2
    for i in a:
        for j in range(l):
            s[j][0] += pow2[j]*i[j]
            s[j][1] += pow2[j]*(not i[j])
    dp = [0 for i in range(l+1)]
    small = False
    for i in range(l):
        if not small:
            if not k[i]:
                dp[i+1] += dp[i]+s[i][0]
            else:
                if s[i][0] >= s[i][1]:
                    dp[i+1] += dp[i]+s[i][0]
                    small = True
                else:
                    dp[i+1] += dp[i]+s[i][1]
        else:
            dp[i+1] += dp[i]+max(s[i])
    print(dp[l])

#E
if __name__ == "__main__":
    D()

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T


Measured memory_bytes: 116768
import java.io.*;
import java.util.*;
public class Main{
    private static void solver(InputReader sc, PrintWriter out) throws Exception {
       double pi = 3.14;
        int r =  sc.nextInt();
        out.println(2 * pi * r);
    }
    private static boolean helper(long x){
        double ans = Math.sqrt(x);
        return ans%1!=0;
    }

    private static int gcd(int a, int b){
        if(b==0)
            return a;
        return gcd(b, a%b);
    }
    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solver(in,out);
        out.close();
    }
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int[] readIntArray(int n){
            int arr[] = new int[n];
            for(int i=0;i<n;i++) arr[i] = nextInt();
            return arr;
        }
    }
}
class Pair  {
    int x;
    int y;

    Pair(int x, int y) {
        this.x = x;
        this.y = y;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Pair pair = (Pair) o;
        return x == pair.x &&
                y == pair.y;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y);
    }
}

Measured memory_bytes: 33460
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>
using namespace std;
int k,x;
int main()
{
	cin>>k>>x;
	for(int i=x-k+1;i<=x+k-1;i++)
	{
		cout<<i<<' ';
	}
	cout<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>

#define rep(i,n) for(int i=0;i<(n);i++)
#define EPS (1e-7)
#define INF (3e9)

using namespace std;
typedef long long int ll;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef priority_queue<int> PQI;
typedef priority_queue<int,vector<int>,greater<int> > PQSI;
typedef priority_queue<ll> PQL;
typedef priority_queue<ll,vector<ll>,greater<ll> > PQSL;

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

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

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

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; }
template<typename T>
vector<T> enum_div(T n){
    vector<T> ret;
    for(T i=1;i*i<=n;i++){
        if(n%i==0){
            ret.push_back(i);
            if(i*i!=n) ret.push_back(n/i);
        }
    }
    //sort(ret.begin(), ret.end());
    return ret;
}
template<typename T>
T gcd(T x, T y){
    if (y == 0) return x;
    else return gcd(y, x % y);
}
template<typename T>
T lcm(T x, T y){
    return (x / gcd(x, y)) * y;
}

int N;
ll K;
int A[2000];
ll F1[2000], F2[2000];
int main(void){
    cin >> N >> K;
    rep(i,N) cin >> A[i];

    for(int i=0;i<N;i++){
        for(int j=i+1;j<N;j++){
            if(A[i] > A[j]) F1[i]++;
        }
        for(int j=0;j<N;j++){
            if(A[i] > A[j]) F2[i]++;
        }
    }

    ll count = 0;
    for(int i=0;i<N;i++){
        count += (K*F1[i])%1000000007;
        count += (F2[i]*((K*(K-1)/2)%1000000007))%1000000007;
        count %= 1000000007;
    }

    cout << count << endl;

    return 0;
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#ifdef LOCAL
#define debug(x)   cerr<<#x<<" = "<<x<<endl
#else
#define debug(x) 
#endif
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define input_from_file freopen("input.txt","r",stdin)
#define output_to_file freopen("output.txt" , "w",stdout)
#define pii pair<int,int>
#define endl '\n'
#define pb push_back
#define fi first
#define se second 
#define mp make_pair
#define int long long
const int inf = 1e18 + 5;
signed main()
{
  #ifdef LOCAL
      input_from_file;
      output_to_file;
    #endif 
    IOS
    int n; cin>>n;
    int ans;
    ans = (n+1)/2;
    double res = ans/(double)n;
    cout<<fixed<<setprecision(8)<<res<<endl;
    return 0;
}

Measured memory_bytes: 256
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n=int(input())
a=lnii()
b=lnii()
c=lnii()

ans=0
for i in range(n):
  ans+=b[a[i]-1]
  if i<n-1 and a[i]+1==a[i+1]:
    ans+=c[a[i]-1]

print(ans)

Measured memory_bytes: 9096
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll mod = 1000000007;
//const ll mod = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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 (a>b) { a=b; return 1; } return 0; }



int main() {
  string s;
  cin >> s;

  if (s.length() == 3) reverse(s.begin(), s.end());
  cout << s << endl;


  
  return 0;
}

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

using namespace std;

int main(int argc, char *argv[]) {
	int A, B, C;
	cin >> A >> B >> C;

	int ans = 0;
	if (A == B) {
		ans = C;
	}
	if (B == C) {
		ans = A;
	}
	if (C == A) {
		ans = B;
	}

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


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

using namespace std;

int main(){
	int N, M;
	
	vector< pair<int,int> > cajas;

	cin>>N>>M;


	for(int i=0; i<N; i++){
		if(i==0){
			pair<int,int> aux(1,1);
			cajas.push_back(aux);
		}
		else{
			pair<int,int> aux(1,0);
			cajas.push_back(aux);
		}

	}

	/*printf("Cajas al inicio:\n");
	for(int i=0; i<N; i++){
		cout<<"Caja "<<i+1<<" Con: "<<cajas[i].first <<" "<<cajas[i].second<< "|||";
	}
	cout<<endl;*/
	
	while(M--){
		int x,y;
		cin>>x>>y;

		if(cajas[x-1].first > 1 ){
			if(cajas[x-1].second == 1){
				cajas[y-1].first +=1;
				cajas[y-1].second = 1;
			}
			else{
				cajas[y-1].first +=1;
			}
			cajas[x-1].first -= 1;
		}
		else if(cajas[x-1].first == 1 ){
			if(cajas[x-1].second == 1){
				cajas[y-1].first +=1;
				cajas[y-1].second = 1;
			}
			else{
				cajas[y-1].first +=1;
			}
			cajas[x-1].first = 0;
			cajas[x-1].second = 0;
		}

	}

	int acu=0;
	for(int i=0; i<N; i++){
		if(cajas[i].second == 1) acu++;
	}
	
	printf("%d\n", acu);

	
	
}

Measured memory_bytes: 1400
//ABC160 D

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

int N,X,Y;
int A[2001];
int ans = 0;

int main() {
  cin >> N >> X >> Y;
  
  for(int i=1;i<N;i++){
    for(int j=i+1;j<=N;j++){
      if(j<=X){
        A[j-i]++;
      }
      else if(i>=Y){
        A[j-i]++;
      }
      else if(i<=X && j>=Y){
        A[(X-i)+1+(j-Y)]++;
      }
      else if(i<=X && j<Y){
        A[min(j-X,Y-j+1)+X-i]++;
      }
      else if(i>X && j>=Y){
        A[min(Y-i,i-X+1)+j-Y]++;
      }
      else{
        A[min(j-i,Y-j+i-X+1)]++;
      }

    }
  }

  
  for(int i=1;i<N;i++){
    printf("%d\n",A[i]);
  }

}


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

#define ll long long
#define ar array

void solve() {
	int n;
	cin >> n;
	if(n%10==3)
    {
        cout<<"bon"<<endl;
    }
    else if(n%10==0 || n%10==1 || n%10== 8 || n%10==6)
    {
        cout<<"pon"<<endl;
    }
        else
    {
        cout<<"hon"<<endl;

    }
}

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

	int t;
	//cin >> t;
	//while(t--)
		solve();
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define puf push_front
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
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 (a>b) { a=b; return 1; } return 0; }

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

    rep(i,K) {
      if(i % 2 == 0){
        if(A % 2 == 1) {A--; B += A/2; A /= 2;}
        else {B += A/2; A /= 2;}
      }
      else {
        if(B % 2 == 1) {B--; A += B/2; B /= 2;}
        else {A += B/2; B /= 2;}
      }
    }
    cout << A << " " << B << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;

const int MAX_N = 5005;
const ll MAX_K = 5005;
const ll INF = 1LL << 40;

bool dp[MAX_N][MAX_K];

int main() {
    int N;
    ll K, A;
    cin >> N >> K;
    vector<ll> a;
    for (int i = 0; i < N; i++) {
        cin >> A;
        a.push_back(A);
    }
    a.push_back(-1);
    a.push_back(INF);
    sort(a.begin(), a.end()); // 0とN+1番目は0とINFが入っている
    int left = 0, right = a.size() - 1; // left:必ず不要, right:必ず必要
    while (right - left > 1) {
        int mid = (right + left) / 2;
        // i番目のカードが不要かどうかを確かめる
        vector<ll> other_a;
        for (int j = 1; j <= N; j++) {
            if (mid == j) continue;
            other_a.push_back(a[j]);
        }
        for (int j = 0; j <= N; j++) {
            for (int k = 0; k < K; k++) dp[j][k] = false;
        }
        for (int j = 0; j < N; j++) dp[j][0] = true;
        for (int j = 1; j <= other_a.size(); j++) {
            for (ll k = 0; k < K; k++) {
                dp[j][k] = dp[j - 1][k];
                if (k - other_a[j - 1] >= 0) dp[j][k] |= dp[j - 1][k - other_a[j - 1]];
            }
        }
        bool is_needed = false;
        for (ll j = 0; j < K; j++) {
            if (dp[N - 1][j] && j + a[mid] >= K) {
                is_needed = true;
                break;
            }
        }
        if (!is_needed) left = mid;
        else right = mid;
    }
    cout << left << endl;
    return 0;
}

Measured memory_bytes: 24960
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
SOTO:
	for i := 1; i <= 9; i++ {
		for j := 1; j <= 9; j++ {
			if i*j == n {
				fmt.Println("Yes")
				break SOTO
			}
		}
		if i == 9 {
			fmt.Println("No")
		}
	}
}


Measured memory_bytes: 512
program lucky_pin
  implicit none
  integer :: n, i, a(0:30000,0:9) = -1, m = 0, x, d0, d1, d2
  character(30000) :: s
  read(*,*) n
  read(*,*) s
  do i = n-1, 0, -1
    a(i,:) = a(i+1,:)
    x = ord(s(i+1:i+1))
    a(i,x) = i+1
  end do
  do i = 0, 999
    d0 = mod(i,10)
    d1 = mod(i,100)/10
    d2 = i/100
    x = a(0,d2)
    if (x < 0) cycle
    x = a(x,d1)
    if (x < 0) cycle
    x = a(x,d0)
    if (x < 0) cycle
    m = m+1
  end do
  write(*,'(i0)') m
contains
  integer function ord(s)
    character(1), intent(in) :: s
    ord = ichar(s)-48
  end
end program lucky_pin

Measured memory_bytes: 1536
#include<stdio.h>
int main()
{
	int p[5],g=0,c=0,pa=0,w;
	while(1){
	for(int i=0;i<5;i++){
		scanf("%d",&p[i]);
		if(p[i]==1)g++;
		else if(p[i]==2)c++;
		else if(p[i]==3)pa++;
		else goto A;
	}
	if(g>0&&c>0&&pa>0||g==5||c==5||pa==5){
		for(int i=0;i<5;i++)printf("3\n");
	}
	else
	{
		if(g>0&&c>0){
			w=1;
		}
		else if(c>0&&p>0){
			w=2;
		}
		else{
			w=3;
		}
		for(int i=0;i<5;i++){
			if(p[i]==w)
				printf("1\n");
			else
				printf("2\n");
		}

	}
	g=c=pa=0;
	}
	A:
	return 0;
}

Measured memory_bytes: 1016
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(long long i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];cout<<endl;}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int> tp;
typedef vector<tp> vt;
typedef vector<vt>vvt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};
#define yes cout<<"Yes\n"
#define no cout<<"No\n"

//nCr mod m
#define MOD 998244353
#define M 220000
vector<ll> fact;
bool h=false;
void init(){
	h=true;
	fact=vector<ll>(M);
	fact[0]=fact[1]=1;
	loop(i,2,M)fact[i]=fact[i-1]*i%MOD;
}
// a^b mod MOD
ll powmod(ll a,ll b,ll m=MOD){
	ll out=1;
	ll p=a%m;
	while(b){
		if(b&1)out=out*p%m;
		p=p*p%m;
		b>>=1;
	}
	return out;
}
//nCr
ll nCr(ll n,ll r,ll m=MOD){
	if(!h)init();
	if(n<0||r<0||n<r)return 1;//??????
	ll out=fact[n]*powmod(fact[r]*fact[n-r]%m,m-2,m)%m;
	return out;
}
int gcd(int a,int b){
	if(b==0)return a;
	return gcd(b,a%b);
}
int lcm(int a,int b){
	return a/gcd(a,b)*b;
}
vi dp(1000,-1);
int f(int a){
	if(dp[a]+1)return dp[a];
	return dp[a]=powmod(fact[a],MOD-2,MOD);
}
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

	int a,b;
	cin>>a>>b;
	if(a*500>=b)yes;
	else no;
}


Measured memory_bytes: 256
N=int(input())


start=int((2*N+1)**0.5)

for i in range(3):
    i += start
    if i*(i+1) >= 2*N:
        ret = i
        delete=i*(i+1)/2 - N
        break

for k in range(1,ret+1):
    if k != delete:
        print(k)

Measured memory_bytes: 42200
#include <bits/stdc++.h>
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v) sort(v.begin(), v.end(), greater<ll>())
#define ll long long
#define rep(i, s, g) for (ll i = (s); i < (g); i++)
#define MOD 1000000007
#define vfind(v, target) find(v.begin(), v.end(), target)
#define notFound(v, target) (vfind(v, target) == v.end())

using namespace std;

int main()
{
  ll N, M, s, c; cin >> N >> M;
  vector<ll> num(N, -1);
  for(ll i = 0; i < M; i++) {
  	cin >> s >> c; s--;
    if (N >= 2 && s == 0 && c == 0) {
    	cout << -1 << endl;
      	return 0;
    } else if (num[s] == -1) {
      num[s] = c;
    } else if (num[s] != c) {
    	cout << -1 << endl;
      	return 0;
    }
  }
  if (N >= 2 && num[0] == -1) {
  	num[0] = 1;
  }
  for(ll i = 0; i < N; i++) {
  	if (num[i] == -1) num[i] = 0;
  }
  for(ll i = 0; i < N; i++) {
  	cout << num[i];
  }
}

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

    public class Main {

        private static Scanner sc;

        public static void main(String[] args) {
            Main instance = new Main();
            sc = instance.new Scanner();
            instance.solve();
        }
        private void solve() {
            try {
                String c = sc.next();
                switch (c){
                    case "a":
                    case "i":
                    case "u":
                    case "e":
                    case "o":
                        System.out.println("vowel");
                        break;
                    default:
                        System.out.println("consonant");
                        break;
                }

            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        private class Scanner {
            String[] s;
            int i;
            BufferedReader br;
            String regex = " ";

            public Scanner() {
                s = new String[0];
                i = 0;
                br = new BufferedReader(new InputStreamReader(System.in));
            }

            @Override
            protected void finalize() throws Throwable {
                try {
                    super.finalize();
                } finally {
                    destruction();
                }
            }

            private void destruction() throws IOException {
                if (br != null) br.close();
            }

            public String next() throws IOException {
                if (i < s.length) return s[i++];
                String st = br.readLine();
                while (st == "") st = br.readLine();
                s = st.split(regex, 0);
                i = 0;
                return s[i++];
            }

            public int nextInt() throws NumberFormatException, IOException {
                return Integer.parseInt(next());
            }

            public Long nextLong() throws NumberFormatException, IOException {
                return Long.parseLong(next());
            }

            public Double nextDouble() throws NumberFormatException, IOException {
                return Double.parseDouble(next());
            }
        }
    }


Measured memory_bytes: 8148
N = int(input())
H = list(map(int, input().split()))

for i in range(N-2, 0, -1):
  if H[i] > H[i+1]+1:
    print("No")
    exit()
  elif H[i] == H[i+1]+1:
    H[i] -=  1
    
print("Yes")    
    

Measured memory_bytes: 14396
#include <bits/stdc++.h>
using namespace std;
#define ll long long  
#define pb push_back
#define mk make_pair
#define mod 998244353
#define lb lower_bound
#define ub upper_bound
#define endl "\n"
#define all(x) x.begin(),x.end()
int main()
{
    ios::sync_with_stdio(0) ;
    cin.tie(0); 
    int x,y,n;
    cin>>n>>x>>y;
    map<int,int> mp;
    for(int i=1;i<=n;i++)
    mp[i]=0;
    for(int i=1;i<=n;i++)
    {
        for(int j=i+1;j<=n;j++)
        {
            if(i>=y)
            {
                int u=j-i;
                mp[u]++;
            }
            else if(j<=x)
            {
                 int u=j-i;
                mp[u]++;
            }
            else if(i>=x&&j<=y)
            {
                int u=j-i;
                u=min(u,abs(x-i)+1+abs(y-j));
                mp[u]++;
            }
            else if(i<=x&&j>=y)
            {
                int u=j-i;
                u=min(u,abs(x-i)+1+abs(y-j));mp[u]++;
            }
            else if(i>=x&&i<=y)
            {
                int u=j-i;
                u=min(u,abs(x-i)+1+abs(y-j));mp[u]++;
                
            }
            else
            {
                int u=j-i;
                u=min(u,abs(x-i)+1+abs(y-j));mp[u]++;
            }
            
        }
       
    } for(int i=1;i<=n-1;i++)
        cout<<mp[i]<<endl;
    return 0;
}
//make all values ll



Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MOD2 = 998244353;


int main(){
    int n, m;
    cin >> n >> m;
    ll p = 100 * (n - m) + 1900 * m;

    cout << p * ll(pow(2,m)) << endl;


    return 0;
}


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

template <class T>
class SegmentTree {
public:
    vector<T> node;
    T n;
public:
    SegmentTree(vector<T> v) {
        n = 1;
        while (n < v.size()) n *= 2;
        node.resize(2*n-1, 0);
        for (int i=0; i<v.size(); ++i) node[i+n-1] = v[i];
        for (int i=n-2; i>=0; --i) node[i] = node[2*i+1] + node[2*i+2]; // sumなので
    }

    void update(T x, T val) {
        x += (n-1);
        node[x] += val;
        while (x > 0) {
            x = (x-1)/2;
            node[x] = node[x*2+1] + node[x*2+2];
        }
    }

    T query(int a, int b, int k=0, int l=0, int r=-1) {
        if (r < 0) r = n;
        if (r <= a or b <= l) return 0;
        if (a <= l and r <= b) return node[k];
        T vl = query(a, b, 2*k+1, l, (l+r)/2);
        T vr = query(a, b, 2*k+2, (l+r)/2, r);
        return vl + vr;
    }
};

int main() {
    int n, q;
    cin >> n >> q;
    vector<ll> v(n, 0);
    SegmentTree<ll> st(v);
    rep(i, q) {
        int c, x, y;
        cin >> c >> x >> y;
        x--;
        if (c == 0) st.update(x, y);
        else {
            cout << st.query(x, y) << endl;
        }
    }
}



Measured memory_bytes: 6532
# ペアを一つ作ると、それは「一つのブロックになった」と見做せる
# 1ペアの場合、ペアの選び方は「ブロック同士の隙間」の数と一致する
# 2ペアの場合、ペアの選び方は「ブロック同士の隙間から2個選ぶ」数と一致する
# iペアの場合、ペアの選び方は (N - 1) C i
# i = 0~K
# ブロックがP個ある場合の塗り分け方は、M * ((M - 1) ** (P - 1))

DIV = 998244353
n = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, n + 1 ):
    g1.append( ( g1[-1] * i ) % DIV )
    inverse.append( ( -inverse[DIV % i] * (DIV//i) ) % DIV )
    g2.append( (g2[-1] * inverse[-1]) % DIV )

def nCr(n, r, DIV):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % DIV
  
import sys
readline = sys.stdin.readline

N,M,K = map(int,readline().split())
ans = 0
for i in range(K + 1):
  # i個のペアを作る場合
  a = nCr(N-1,i,DIV)

  # ブロックの数はN-i個
  # ブロックがP個ある場合の塗り分け方は、M * ((M - 1) ** (P - 1))
  P = N - i
  b = ((M % DIV) * pow(M-1,P-1,DIV)) % DIV
  
  ans += (a * b) % DIV
  ans %= DIV
  
print(ans)

Measured memory_bytes: 127928
#include <bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define fr(i,a,n) for(i=a;i<n;i++)
#define frn(i,a,n) for(i=a;i<=n;i++)
#define vll vector<ll>
#define pll pair<ll,ll>
#define vp vector<pll>
#define ub upper_bound
#define lb lower_bound
//#define map map<ll,ll>
#define mem(x,y) memset(x,y,sizeof(x))
#define all(v) v.begin(),v.end()
#define bs binary_search
#define qll queue<ll>
#define sll set<ll>



int main()
{
    fastio;
    ll n,sum=0;
cin>>n;
for(ll i=1;i<n;i++){
if(n%i==0) sum+=n/i -1;
else sum+=n/i;
//sum+=(n-2*i)*2 +1;
}
cout<<sum<<"\n";
}


Measured memory_bytes: 3652