akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define show(x) cout << #x << " = " << (x) << endl
#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl
#define show3(x,y,z) cout << #x << " = " << (x) << ", " << #y << " = " << (y) <<  ", " << #z << " = " << (z) << endl
#define showv(v) rep(i,v.size()) printf("%d%c", v[i], i==v.size()-1?'\n':' ')
#define showv2(v) rep(j,v.size()) showv(v[j])
#define showt(t,n) rep(i,n) printf("%d%c", t[i], i==n-1?'\n':' ')
#define showt2(t,r,c) rep(j,r) showt(t[j],c)
#define showvp(p) rep(i,p.size()) printf("%d %d\n", p[i].first, p[i].second);
#define printv(v) rep(i,v.size()) printf("%d\n", v[i])
#define printt(t,n) rep(i,n) printf("%d\n", t[i])
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
typedef vector<pii> vp;
typedef vector<tiii> vt;
const int mod = 1000000007;
const double EPS = 1e-9;
const int INF = (1<<30)-1;
const ll INFLL = (1LL<<62)-1;
#define dame { puts("No"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
inline int in() { int x; scanf("%d",&x); return x;}
//cout << fixed << setprecision(10);
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; }

int main () {
  int n = in();
  vi h(n);
  rep(i,n) cin >> h[i];
  
  int ma = h[0];
  int ans = 0;
  rep(i,n) {
    if (ma <= h[i]) {
      ans++;
      ma = h[i];
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
N = int(input())
hs = list(map(int,input().split(" ")))
dp = [0] * N

dp[0]=0
dp[1]= abs(hs[0]-hs[1]) 

for i in range(2,N):
    c1 = dp[i-1]+abs(hs[i]-hs[i-1])
    c2 = dp[i-2]+abs(hs[i]-hs[i-2])
    dp[i] = min(c1,c2)
print(dp[-1])

Measured memory_bytes: 13980
#include<bits/stdc++.h>
#define lli long long int
#define MOD 1000000007
#define KING 1000000002
#define queen 1000002
#define fi first
#define all(a) a.begin(), a.end()
#define se second
#define se second
#define lsb(i) (i & -i)
#define nl cout<<'\n'
#define TEST cout<<"TEST",nl
#define pr pair<lli,lli>
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define vi vector<lli>
#define vpi vector<pr> 
#define P pair<lli,pr>
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL)
#define NA(i,s,n) for(lli i=s;i<n;i++)
using namespace std;

void solve(){
    lli a,b,k; cin>>k>>a>>b;
    lli f = a/k;
    if( ((f*k)>=a && (f*k)<=b) || ( ((f+1)*k)>=a && ((f+1)*k) <= b ) ) cout<<"OK";
    else cout<<"NG";
    return;
}
int main(){
    fastIO;
    lli t = 1; 
    // cin>>t;
    NA(i,0,t) solve();
    return 0;
}

Measured memory_bytes: 3692
#include<cstdio>
int numofbits(int bits){
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}
int msb(int bits){
    bits |= (bits >> 1);
    bits |= (bits >> 2);
    bits |= (bits >> 4);
    bits |= (bits >> 8);
    bits |= (bits >> 16);
    return (bits + 1) >> 1;
}
int lsb(int bits){
    return bits & (-bits);
}
//nビットの数字の列{x=a_0,a_1,...,a_{2^n-1}=y} を出力する
//（ただしnumofbits(a_i xor a_{i+1})=1, n=numofbits(mask), a_iで変化するビットはmaskだけ）
void print_gray(int x,int y,int mask){
    if(numofbits(mask)==1){
        printf("%d %d",x,y);
    }else{
        //aはxとyが異なる最小ビット、bはmaskのどれかでaと異なるもの
        //中間地点として、xから1bitずらしたものを使う
        int a=lsb(x^y),b=msb(mask);
        if(a==b)b=lsb(mask);//maskが2bit以上あれば別のbitが出てくる
        int z=x^b;
        //前半はaをxと同じ状態にfixしてxからzまで
        print_gray(x,z,mask^a);
        printf(" ");
        //後半はaをyと同じ状態にfixしてzからyまで
        print_gray(z^a,y,mask^a);
    }
}
int main(){
    int n,a,b;
    scanf("%d%d%d",&n,&a,&b);
    if(numofbits(a^b)%2==0)printf("NO\n");
    else{
        printf("YES\n");
        print_gray(a,b,(1<<n)-1);
        printf("\n");
    }
    return 0;
}

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

typedef long long LL;
using std::max;
using std::min;

const int N=2e5+10;

struct Edge{ int to,next;} way[N<<1];
int n,num[N],tot,sum[N],dis[N];
LL ans;
char A[N];

void Build(int a,int b) { way[++tot]=(Edge){b,num[a]}; num[a]=tot; }

void Init() {
	scanf("%d",&n);
	int a,b;
	for (int i=2;i<=n;++i) {
		scanf("%d%d",&a,&b);
		Build(a,b); Build(b,a);
	}
	scanf("%s",A+1);
}

void Dfs(int x,int fa) {
	sum[x]=(A[x]=='1');
	for (int i=num[x];i;i=way[i].next) {
		int v=way[i].to;
		if (v==fa) continue;
		Dfs(v,x);
		sum[x]+=sum[v];
		dis[x]=max(dis[x],dis[v]+1);
	}
}

void Getmx(int &mx,int &mx2,int v) {
	if (v>mx) { mx2=mx; mx=v; }
	else if (v>mx2) mx2=v;
}

void Dfs_2(int x,int fa,int mxx) {
	int mn=1e9+10,mx=0,mx2=0; if (A[x]=='1') mn=0;
	if (sum[x]!=sum[1]) mn=min(mn,mxx);
	mx=max(mx,mxx);
	for (int i=num[x];i;i=way[i].next) {
		int v=way[i].to;
		if (v==fa) continue;
		Getmx(mx,mx2,dis[v]+1);
		if (sum[v]) mn=min(mn,dis[v]+1);
	}
	ans+=max(min(mx-1,mx2+1)-mn+1,0);
	for (int i=num[x];i;i=way[i].next) {
		int v=way[i].to;
		if (v==fa) continue;
		Dfs_2(v,x,dis[v]+1==mx?mx2+1:mx+1);
	}
}

void Solve() {
	Dfs(1,0);
	Dfs_2(1,0,0);
	printf("%lld\n",ans+1);
}

int main() {
	Init();
	Solve();
	return 0;
}


Measured memory_bytes: 15488
#include <iostream>
#include <cmath>
#include <vector>
#include <iomanip>
#include <algorithm>
using namespace std;

void BubbleSort(vector<string> &A)
{	
	for(int i = 0; i <= A.size() - 1; i++){
		for(int j = A.size() - 1; j >= i + 1; j--){
			if(A[j][1] < A[j - 1][1]){
				string a = A[j];
				A[j] = A[j - 1];
				A[j - 1] = a;
			}
		}
	}
}

void SelectionSort(vector<string> &A)
{	
	for(int i = 0; i <= A.size() - 1; i++){
		int mini= i;
		for(int j = i; j <= A.size() - 1; j++){
			if(A[j][1] < A[mini][1]){
				mini = j;
			}
		}
		if(i != mini){
			string a = A[i];
			A[i] = A[mini];
			A[mini] = a;
		}
	}
}
void print_vector(vector<string> num)
{
	for(int i = 0; i < num.size(); i++){
		if(i){
			cout << " ";
		}
		cout << num[i];
	}
	cout << endl;
}
int main(void)
{
	int n;
	cin >> n;
	vector<string> A(n);
	for(int i = 0; i < n; i++){
		cin >> A[i];
	}
	vector<string> B = A;
	
	BubbleSort(A);
	print_vector(A);
	cout << "Stable" << endl;
	
	SelectionSort(B);
	print_vector(B);
	if(A == B){
		cout << "Stable" << endl;
	}
	else{
		cout << "Not stable" << endl;
	}
	return 0;
}

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

using namespace std;

typedef long long ll;

const int INF = (1<<29);
const int INFF = 0x7fffffff;
const ll LINF = (1ll<<60);
const ll LINFF = 0x7fffffffffffffff;
const long double PI = 3.14159265359;

#define _fi(n) for(int i = 0;i < n;i++)
#define _fj(n) for(int j = 0;j < n;j++)
#define _fk(n) for(int k = 0;k < n;k++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define prec(x) cout << fixed << setprecision(x)
#define sz(x) (int)x.size()
#define _log2(x) 31-__builtin_clz(x)

#define hash sodnf9843bsd
#define right iadjfof23n3okd
#define pqueue priority_queue
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define len length
#define endl '\n'

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll a, ll b){return uniform_int_distribution<ll>(a, b)(rng);}

char arr[1010][1010] = {};
int dist[1010][1010] = {};

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


    int n, m;cin>>n>>m;
    int a, b;cin>>a>>b;
    int c, d;cin>>c>>d;
    _fi(n)_fj(m) cin>>arr[i][j];
    a--;b--;c--;d--;

    _fi(n)_fj(m) dist[i][j] = INF;
    dist[a][b] = 0;

    pqueue<tuple<int, int, int>>pq;
    pq.push({0, a, b});
    while(!pq.empty()){
        int i = get<1>(pq.top());
        int j = get<2>(pq.top());
        pq.pop();

        if (i+1 < n && arr[i+1][j] == '.' && dist[i][j] < dist[i+1][j]){
            dist[i+1][j] = dist[i][j];
            pq.push({-dist[i+1][j], i+1, j});
        }
        if (i-1 >= 0 && arr[i-1][j] == '.' && dist[i][j] < dist[i-1][j]){
            dist[i-1][j] = dist[i][j];
            pq.push({-dist[i-1][j], i-1, j});
        }
        if (j+1 < m && arr[i][j+1] == '.' && dist[i][j] < dist[i][j+1]){
            dist[i][j+1] = dist[i][j];
            pq.push({-dist[i][j+1], i, j+1});
        }
        if (j-1 >= 0 && arr[i][j-1] == '.' && dist[i][j] < dist[i][j-1]){
            dist[i][j-1] = dist[i][j];
            pq.push({-dist[i][j-1], i, j-1});
        }

        for(int rr = -2;rr <= 2;rr++){
            for(int cc = -2;cc <= 2;cc++){
                if (i+rr < 0 || j+cc < 0) continue;

                if (arr[i+rr][j+cc] == '.' && dist[i][j]+1 < dist[i+rr][j+cc]){
                    dist[i+rr][j+cc] = dist[i][j]+1;
                    pq.push({-dist[i+rr][j+cc], i+rr, j+cc});
                }
            }
        }
    }

    if (dist[c][d] == INF) dist[c][d] = -1;
    cout << dist[c][d] << endl;

    return 0;
}


Measured memory_bytes: 8692
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<iomanip>
#define RREP(i,s,e) for (i = s; i >= e; i--)
#define rrep(i,n) RREP(i,n,0)
#define REP(i,s,e) for (i = s; i < e; i++)
#define rep(i,n) REP(i,0,n)
#define INF 100000000
using namespace std;


int main(){
	int x, a, b;
	cin >> x;
	cin >> a;
	cin >> b;
	int ans = x - a;
	ans = ans % b;

	cout << ans <<endl;
	return 0;

}


Measured memory_bytes: 256
a = input().split()
x=a[0]
y=a[1]
z=a[2]
if x==y:
    if x==z:
        print("No")
    else:
        print("Yes")
else:
    if x==z:
        print("Yes")
    else:
        if y==z:
            print("Yes")
        else:
            print("No")

            

Measured memory_bytes: 3060
#define _USE_MATH_DEFINES
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <functional>
#include <typeinfo>

#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REP1(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREP1(i, x) for (int i = ((int)(x)); i > 0; i--)
/*
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

#define all(x) (x).begin(),(x).end()
*/

using namespace std;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;

    int a = x2 - x1, b = y2 - y1;

    cout << x2 - b;
    cout << " ";
    cout << y2 + a;
    cout << " ";
    cout << x1 - b;
    cout << " ";
    cout << y1 + a;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int N, K;
int parent[100005];
int doub[32][100005];
int depth[100005];
int ok[100005];
vector<vector<int> > edge(100005);

void prepare() {
  for(ll i=0;i<N;++i) {
    doub[0][i] = parent[i];
  }
  for(ll i=1;i<32;++i) {
    for(ll j=0;j<N;++j) {
      doub[i][j] = doub[i-1][doub[i-1][j]];
    }
  }
}

void getdepth(ll u, ll dist) {
  depth[u] = dist;
  for(ll i=0;i<edge[u].size();++i) {
    getdepth(edge[u][i], dist+1);
  }
  return;
}

int main() {
  cin>>N>>K;
  ll tmp;
  ll ans = 0;
  for(ll i=0;i<N;++i) {
    cin>>tmp;
    tmp--;
    if(i==0 && tmp!=0) ans++;
    if(i!=0) {
      parent[i] = tmp;
      edge[tmp].push_back(i);
    }
  }
  prepare();
  getdepth(0, 0);
  vector<pair<ll, ll> > arr(N);
  for(ll i=0;i<N;++i) arr[i] = mp(depth[i], i);
  sort(arr.begin(), arr.end(), greater<pair<ll, ll> >());
  ll cut;
  ll now;
  bool can;
  for(ll i=0;i<N;++i) {
    if(ok[arr[i].se]) continue;
    if(arr[i].fi<=K) continue;
    now = arr[i].se;
    can = false;
    for(ll j=0;j<K;++j) {
      if(ok[now]) {
        can = true;
        break;
      }
      ok[now] = true;
      now = parent[now];
    }
    if(!can) ans++;
  }
  cout<<ans<<endl;
}



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

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

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

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

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

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

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

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

fn main() {
    input! {
        a: i32,
        b: i32,
        c: i32,
    }
    println!("{}", std::cmp::max(c - (a - b), 0))
}

Measured memory_bytes: 4352
def get_next_ints(delim=" "):
    return tuple([int(float(x)) for x in input().split(delim)])

def main():
    n, m = get_next_ints()
    numbers = get_next_ints()
    costs = [0,2,5,5,4,5,6,3,7,6]
    from collections import defaultdict
    
    cost_number = defaultdict(int)
    for number in numbers:
        cost = costs[number]
        cost_number[cost] = max(cost_number[cost], number)
    use_numbers = cost_number.values()
    costs_numbers = list(zip( cost_number.values(),list(cost_number.keys())))
    costs_numbers.sort(reverse=True)
    #print(costs_numbers)
    
    dp = {0:0}
    for i in range(1,n+1):
        answers = []
        for number, cost in costs_numbers:
            if (i - cost) in dp:
                answers.append(dp[(i - cost)])
        if answers:
            dp[i] = max(answers) + 1
    #print(dp)
    digits = []
    
    remain = n
    while remain > 0:
        current = dp[remain]
        for number, cost in costs_numbers:
            if (remain - cost) in dp:
                if dp[(remain - cost)] == current - 1:
                    digits.append(str(number))
                    remain -= cost
                    break
                    
    print("".join(digits))
        
    
if __name__ == '__main__':
    main()
    

Measured memory_bytes: 4716
#include <stdio.h>

int main(void){
	int n, k, x, y;
	int sum = 0;

	scanf("%d%d%d%d", &n, &k, &x, &y);

	for(int i=0; i < n; i++) {
		if(i < k)
			sum += x;
		else
			sum += y;
	}
	printf("%d", sum);

	return 0;
}


Measured memory_bytes: 128
/* ---------- STL Libraries ---------- */
// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>

/* ---------- Namespace ---------- */
using namespace std;

/* ---------- Type ---------- */
using ll = long long;
#define int ll
#define P pair<ll, ll>

/* ---------- Constants  */
const ll MOD = 1e9 + 7;
const int INF = 1LL << 55;

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */
signed main() {
    int H, W;
    cin >> H >> W;
    char table[H][W];
    for (int i = 0; i < H; i++) {
        string line;
        cin >> line;
        for (int j = 0; j < W; j++) {
            table[i][j] = line[j];
        }
    }

    int dp[H][W];
    fill(dp[0], dp[H], 0);
    dp[0][0] = 1;

    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if (table[i][j] == '#') continue;
            if (i < H - 1) {
                dp[i+1][j] += dp[i][j];
                dp[i+1][j] %= MOD;
            }

            if (j < W - 1) {
                dp[i][j+1] += dp[i][j];
                dp[i][j+1] %= MOD;
            }
        }
    }

    cout << dp[H-1][W-1] << endl;
}

Measured memory_bytes: 9088
from collections import deque
from itertools import islice

S = input()

result = deque(S)


def input_str(line):
    r = line.split()
    if len(r) == 1:
        return int(r[0]), None, None
    else:
        return int(r[0]), int(r[1]), r[2]


reverse_flag = False

for _ in range(int(input())):
    Q, F, C = input_str(input())
    if Q == 1:
        reverse_flag ^= True
    if Q == 2:
        if reverse_flag:
            if F == 1:
                result.append(C)
            else:
                result.appendleft(C)
        else:
            if F == 1:
                result.appendleft(C)
            else:
                result.append(C)

if reverse_flag:
    result.reverse()
print(''.join(result))


Measured memory_bytes: 14584
#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def ini():
  fac[0] = 1 % mod
  for i in range(1,N):
    fac[i] = fac[i-1] * i % mod"""

"""mod = 1e9+7
N = 10000000
pw = [0] * N
def ini(c):
  pw[0] = 1 % mod
  for i in range(1,N):
    pw[i] = pw[i-1] * c % mod"""

"""
def YEILD():
  yield 'one'
  yield 'two'
  yield 'three'
generator = YEILD()
print(next(generator))
print(next(generator))
print(next(generator))
"""
"""def gcd_(a,b):
  if b == 0:#結局はc,0の最大公約数はcなのに
    return a
  return gcd_(a,a % b) # a = p * b + q"""
"""def extgcd(a,b,x,y):
  d = a
  if b!=0:
    d = extgcd(b,a%b,y,x)
    y -= (a//b) * x
    print(x,y)
  else:
    x = 1
    y = 0
  return d"""


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

def main():
  sx,sy,tx,ty = readInts()
  h  =ty - sy
  w = tx-sx
  a = 'U' * h + 'R' * w
  b  = 'D' * h + 'L' * w
  print(a + b + 'LU' + a + 'RDRD' + b + 'LU')
if __name__ == '__main__':
  main()

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

using namespace std;

int main() {
    int N;
    long long int K;
    cin >> N >> K;

    vector<long long int> A(N);
    long long int maxA=0;
    for(int n=0; n<N; n++) {
        cin >> A[n];
        maxA = max(maxA, A[n]);
    }
    
    long long int k=1;
    vector<long long int> power;
    int po_num=0;
    long long int lim_k=max(maxA, K);
    while(k<lim_k) {
        power.push_back(k);
        po_num++;
        k *= (long long int)2;
    }
    if(k!=lim_k) k/=2;
    else power.push_back(k);

    // cout << k << endl;
    // cout << po_num << endl;


    vector<long long int> counter1(po_num, 0);
    vector<long long int> counter0(po_num, 0);

    for(int n=0; n<N; n++) {
        for(int p=0; p<po_num; p++) {
            if(A[n] & (1LL<<p)) {
                counter0[p] += power[p];
            } else {
                counter1[p] += power[p];
            }
        }
    }

    // for(int p=0; p<po_num; p++) {
    //     cout << counter0[p] << endl;
    // }

    // cout << counter1[0] << endl;
    // cout << counter0[1] << endl;
    // cout << counter0[2] << endl;

    long long int ans=0, tmp_ans;
    
    if(K==0) {
        for(int n=0; n<N; n++) {
            ans += A[n];
        }
        cout << ans << endl;
        return 0;
    }

    for(int p=0; p<po_num; p++) {
        if(K & (1LL<<p)) {
            // cout << 1;
            ans += counter1[p];
        } else {
            // cout << 0;
            ans += counter0[p];
        }
    }
    // cout << endl;
    // cout << ans << endl;

    for(int p=0; p<po_num; p++) {
        tmp_ans = 0;
        // cout << p << endl;
        if(K & (1LL<<p)) {
            for(int pi=0; pi<po_num; pi++) {
                if(pi>p) {
                    if(K & (1LL<<pi)) {
                        // cout << 1;
                        tmp_ans += counter1[pi];
                    } else {
                        // cout << 0;
                        tmp_ans += counter0[pi];
                    }
                } else if(pi==p) {
                    // cout << 0;
                    tmp_ans += counter0[pi];
                } else {
                    // if(counter1[pi]>counter0[pi]) {
                    //     cout << 1;
                    // } else {
                    //     cout << 0;
                    // }
                    tmp_ans += max(counter1[pi], counter0[pi]);
                }
            }
            // cout << endl;
        }
        // cout << tmp_ans << endl;
        ans = max(ans, tmp_ans);
    }
    
    cout << ans << endl;

    return 0;
    
}

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

int main(void){
    ll n;
    scanf("%lld",&n);
    
    ll all=0;
    vector<ll> a(n);
    for(ll i=0;i<n;i++){
        scanf("%lld",&a[i]);
        all ^= a[i];
    }

    for(ll i=0;i<n-1;i++){
        printf("%lld ",a[i]^all);
    }
    printf("%lld\n",a[n-1]^all);
}


Measured memory_bytes: 4824
#include <iostream>
#include <cassert>
#include <limits>
#include <cmath>
#include <algorithm>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <array>
#include <map>
#include <set>
#include <deque>
#include <list>
#include <sstream>
#include <iomanip>
#include <numeric>
#include <climits>
#include <cstring>
#include <bitset>
#include <stack>
#include <queue>

#define MOD (1e9 + 7);
#define PI (3.14159265358979323846)

using ll = int64_t;
using ull = uint64_t;

using namespace std;

[[maybe_unused]] static auto __x = [](){ios_base::sync_with_stdio(0); cin.tie(0);};

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if (a == b) {
        cout << c;
    }
    else {
        int needed = a - b;
        c -= needed;
        cout << max({0, c});
    }
}


Measured memory_bytes: 256
/*
 *  Lang    : C++
 *  Author  : little_angel
 */
#include <bits/stdc++.h>

using namespace std;
#define int long long
const int mod = 1e9 + 7;

void add(int &a, int b) {
    a += b;
    if (a >= mod)a -= mod;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    unsigned int n;
    cin >> n;
    vector<vector<int>> a(n, vector<int>(n));
    for (int i = 0; i < n; ++i)
        for (int j = 0; j < n; ++j)
            cin >> a[i][j];

    vector<int> dp(1u << n);
    dp[0] = 1;
    for (unsigned int mask = 0; mask < (1u << n) - 1; ++mask) {
        unsigned int m = __builtin_popcountll(mask);
        for (unsigned int w = 0; w < n; ++w) {
            if (a[m][w] && !(mask & (1u << w)))add(dp[mask ^ (1u << w)], dp[mask]);
        }
    }
    cout << dp[(1u << n) - 1] << endl;
}

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

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

    int A, B;
    cin >> A >> B;

    if (A > 12)
    {
        cout << B << endl;
    }
    else if (6 <= A && A <= 12)
    {
        cout << B / 2 << endl;
    }
    else
    {
        cout << 0 << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
from fractions  import gcd
#input=sys.stdin.readline
#import bisect
h,n=map(int,input().split())
inf=10**9
ab = [map(int, input().split()) for _ in range(n)]
a,b=[list(i) for i in zip(*ab)]
dp=[[inf]*(h+1) for _ in range(n+1)]
dp[0][0]=0
for i in range(n):
    for j in range(h+1):
        dp[i+1][j]=min(dp[i+1][j],dp[i][j])
        dp[i+1][min(h,j+a[i])]=min(dp[i+1][min(h,j+a[i])],dp[i+1][j]+b[i])
print(dp[-1][-1])

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

int main() {
  int n;
  cin >> n;
  vector<int> s(n);
  for (int i = 0; i < n; i++) {
    cin >> s.at(i);
  }
  
  int sum = 0;
  
  for (int i = 0; i < n; i ++) {
    if (s.at(i) != 0) {
      sum++;
      for (int j = i + 1; j < n; j++) {
        if (s.at(i) == s.at(j))
          s.at(j) = 0;
      }
    }
  }
  cout << sum << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using ld = long double;
const ll ATCODER_AMARI = 1000000007; //10^9 + 7
const ll INF = 10000000000000;

//階乗関数　ATCODER_AMARIに注意
ll factorial(ll k){
  ll sum = 1;
  for(int i = 1 ; i < k + 1; i++) {
    sum *= i;
    //sum = sum % ATCODER_AMARI;
  }
  return sum;
}

int main() {
  ll n,m,k; cin >> n >> m >> k;
  vector<ll> a(n + 1,0);
  vector<ll> b(m + 1,0);

  rep(i,n) {
    ll tmp;
    if(i == 0) {
      cin >> tmp;
      a.at(i + 1) = tmp;
    }
    else {
      cin >> tmp;
      a.at(i + 1) = a.at(i) + tmp;
    }
  }


  rep(i,m) {
    ll tmp;
    cin >> tmp;
    if(i == 0) b.at(i + 1) = tmp;
    else b.at(i + 1) = b.at(i) + tmp;
  }

  ll best_b = m;
  ll ans_count = 0;

  rep(i,n + 1) {
    ll tmp_sumtime = a.at(i);

    for(ll j = best_b; j >= 0; j-- ) {
      
      if(tmp_sumtime + b.at(j) <= k) {
        best_b = j;
        ans_count = max(ans_count,(i + j));
        break;
      }
        
      
    }
  }

  cout << ans_count << endl;
}


Measured memory_bytes: 6428
#include <iostream>
#include <algorithm>
#include <string> 
#include <vector>
#include <iomanip>
#include <math.h>
#include <map>
using namespace std;

int main()
{
	vector<int> A(26,0);
	string w;
	cin >> w;
	bool ANS = true;
	for (int i = 0; i < w.size(); i++) {
		A[w[i] - 'a']++;
	}
	for (int i = 0; i < 26; i++) {
		if (A[i] % 2 != 0) {
			ANS = false;
		}
	}
	if (ANS) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int N = sc.nextInt();
    	sc.close();
    	long ans = 1;
    	long L1 = 2;
    	long L2 = 1;
    	for(int i = 1; i < N; i++){
    		ans = L1 + L2;
    		L1 = L2;
    		L2 = ans;
    	}
    	System.out.println(ans);
    }
}

Measured memory_bytes: 23252
using System;

namespace B___Kagami_Mochi
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var d = new int[n];
            var ans = 1;
            for (var i = 0; i < n; i++)
            {
                d[i] = int.Parse(Console.ReadLine());
            }
            Array.Sort(d);
            Array.Reverse(d);
            for (var i = 0; i < n - 1; i++)
            {
                if (d[i + 1] < d[i])
                {
                    ans += 1;
                }
            }
            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 11092
from collections import Counter

n=int(input())
s=list(input())

cnt = Counter(s)

rn=cnt['R']
gn=cnt['G']
bn=n-rn-gn

ans=bn*gn*rn
if n>2:
  
  for x in range(n-2):
    
    y=(n-1-x)//2
    for i in range(1,y+1):
      if  (not s[x]==s[x+i]) & (not s[x]==s[x+i+i]) & (not s[x+i]==s[x+i+i]):
        ans-=1
        
  print(ans)
    
else:
  print(0)


Measured memory_bytes: 9440
#include<iostream>
#include<cmath>
#include <stdlib.h>

using namespace std;


int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

int main(){
	int n,a[200001],t;
	bool bl=true;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	qsort(a, n, sizeof(int), compare_int);
	for(int i=1;i<n;i++){
		if(a[i-1]==a[i])bl=false;
	}
	if(bl) cout <<"YES\n";
	else cout <<"NO\n";
	return 0;
}

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


using namespace std;

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

ll xor_to(ll a) {
	if (a < 0) {
		return 0;
	}
	ll ans = ((a + 1) / 2) % 2;

	if (a % 2 == 0) {
		ans = (a / 2) % 2;
		ans ^= a;
	}
	return ans;
}

int main() {
	ll a, b;
	cin >> a >> b; 
	cout << (xor_to(b) ^ xor_to(a - 1)) << endl;

	
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize "trapv"
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int M = 1000000007;
#define pb push_back
#define fs first
#define sc second
#define forn(i,k,n) for(int i = k; i < n; ++i)
#define nfor(i,n,k) for(int i = n; i >= k; --i)
#define vi vector<int>
#define vvi vector<vector<int>>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
#define vvpii vector<vector<pait<int,int>>>
#define all(arr) arr.begin(), arr.end()
#define endl '\n'
#define dbgarr(V,n) forn(i,0,n) cout << V[i] << " "; cout << endl;
#define dbgarrrev(V,n) nfor(i,n,0) cout << V[i] << " "; cout << endl;
#define dbgmaze(V) for(auto x: V) {for(auto y : x) cout << y <<  " ";cout << endl;}
#define dbg2d(V,n,m) forn(i,0,n) {forn(j,0,m) cout << V[i][j] <<  " ";cout << endl;}
void solve(){
	int n , m; cin >> n >> m;
	string maze[n];
	forn(i,0,n) cin >> maze[i];
	int dp[n + 1][m + 1] = {};
	forn(i,0,m) if(maze[0][i] != '#')dp[0][i] = 1; else break;
	forn(i,0,n) if(maze[i][0] != '#')dp[i][0] = 1; else break;
	forn(i,1,n){
		forn(j,1,m){
			if(maze[i][j] != '#') dp[i][j] = (dp[i - 1][j] % M + dp[i][j - 1] % M ) % M;
		}
	}
	cout << dp[n - 1][m - 1] << endl;
}
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	solve();
    return 0;
}


Measured memory_bytes: 8648
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;

int main() {
	int N;
	cin >> N;
	map<string, int> list;
	vector<int>time(N);
	string S;
	for (size_t i = 0; i < N; i++)
	{
		cin >> S;
		list[S] = i;
		cin >> time.at(i);
	}
	cin >> S;
	int ans = 0;
	for (size_t i = list.at(S)+1; i < N; i++)
	{
		ans += time.at(i);
	}
	cout << ans;
    
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int w,h,x,y,r;
    cin >> w >> h >> x >> y >> r;
    if(x+r>w  || x-r<0 || y+r>h || y-r <0){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
}


Measured memory_bytes: 3120
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
class Main
{
	static void merge(int arr[], int l, int m, int r) 
    { 
        int n1 = m - l + 1; 
        int n2 = r - m; 
        int L[] = new int [n1]; 
        int R[] = new int [n2]; 
        for (int i=0; i<n1; ++i) 
            L[i] = arr[l + i]; 
        for (int j=0; j<n2; ++j) 
            R[j] = arr[m + 1+ j]; 
        int i = 0, j = 0; 
        int k = l; 
        while (i < n1 && j < n2) 
        { 
            if (L[i] <= R[j]) 
            { 
                arr[k] = L[i]; 
                i++; 
            } 
            else
            { 
                arr[k] = R[j]; 
                j++; 
            } 
            k++; 
        } 
        while (i < n1) 
        { 
            arr[k] = L[i]; 
            i++; 
            k++; 
        } 
        while (j < n2) 
        { 
            arr[k] = R[j]; 
            j++; 
            k++; 
        } 
    } 
    static void sort(int arr[], int l, int r) 
    { 
        if (l < r) 
        { 
            int m = (l+r)/2; 
            sort(arr, l, m); 
            sort(arr , m+1, r); 
            merge(arr, l, m, r); 
        } 
    } 
    static int gcd(int a, int b) 
    { 
      if (b == 0) 
        return a; 
      return gcd(b, a % b);  
    } 
    static long power(long n,long m)
    {
    	if(m==0)
    		return 1;
    	long ans=1;
    	while(m>0)
    	{
    		ans=ans*n;
    		m--;
    	}
    	return ans;
    }
	static int binarySearch(ArrayList<Integer> arr, int x) 
    { 
        int l = 0, r = arr.size() - 1,m=l + (r - l) / 2; 
        while (l <= r) { 
            m = l + (r - l) / 2; 
            if (arr.get(m) == x) 
                return m; 
            if (arr.get(m) < x) 
                l = m + 1; 
            else
                r = m - 1; 
        } 
        return (int)Math.max(l, m); 
    } 
	public static void main(String args[])throws Exception
	{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int t=1;//Integer.parseInt(br.readLine());
	    for(int i=1;i<=t;i++)
	    {
	        int n=Integer.parseInt(br.readLine());
	        
	        HashMap <String,Integer> mp=new HashMap<String,Integer>();
	        int ans=0;
	        for(int j=0;j<n;j++)
	        {
	        	String s=br.readLine();
	        	if(mp.containsKey(s))
	        		continue;
	        	else
	        	{
	        		mp.put(s,1);
	        		ans++;
	        	}
	        		
	        }
	        System.out.println(ans);
	    }
	}
}


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

#define FOR(i,a,b)  for(ll (i)=a;(i)<(b);++(i))
#define RFOR(i,a,b) for(ll (i)=a;(i)>=(b);--(i))
#define REP(i,n)    FOR(i,0,n)
#define RREP(i,n)   RFOR(i,n,0)
#define ALL(v)      v.begin(), v.end()
#define UNIQ(v)     sort(ALL(v)); v.erase(unique(ALL(v)), v.end())
#define BIT(n)      (1LL<<(n))
#define DBG(a)      cout << #a << " = " << a << endl

const ll inf = 1e15;
const ll mod = 1e9+7;

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

ll abc[26][100002];

int main() {
    string s; cin >> s;
    ll n = s.length();
    
    memset(abc, 0, sizeof(abc));
    REP(i, 26) REP(j, n) if (s[j] == i + 'a') abc[i][j+1] = 1;
    REP(i, 26) REP(j, n) abc[i][j+1] += abc[i][j];
    
    FOR(k, 2, 4) REP(i, 26) FOR(j, k, n+1) {
        if (abc[i][j] - abc[i][j-k] >= (k / 2 + 1)) {
            cout << j - k + 1 << " " << j << endl;
            return 0;
        }
    }
    cout << "-1 -1" << endl;
    
    return 0;
}


Measured memory_bytes: 20736
N = int(input())
P = list(map(int, input().split()))

ans = 0
if P[-1] == N:
    tmp = P[-1]
    P[-1] = P[-2]
    P[-2] = tmp
    ans += 1

for i in range(N-1):
    if P[i] == i+1:
        tmp = P[i]
        P[i] = P[i+1]
        P[i+1] = tmp
        ans += 1


for i in range(N):
    if P[i] == i+1:
        ans += 1

print(ans)

Measured memory_bytes: 14004
//AtCoder ABC129
#include <bits/stdc++.h>
using namespace std;
using ll=int64_t;
constexpr ll MOD=1000000007;

int main() {
#if LOCAL&0
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    ll N,M;
    cin>>N>>M;
    vector<ll> am(M,0);
    unordered_map<ll,int> br;
    for(auto&& a:am){
        cin>>a;
        br.insert(make_pair(a,1));
    }
    vector<ll> dp(N+1);
    dp[0]=1;
    for(int i=1;i<=N;++i){
        if(!br[i-1]) {
            dp[i]+=dp[i-1];
            dp[i]%=MOD;
        }
        if(i-2>=0&&!br[i-2]){
            dp[i]+=dp[i-2];
            dp[i]%=MOD;
        }
    }
    cout<<dp[N]<<endl;
    return 0;
}

Measured memory_bytes: 5924
H,W = gets.split.map &:to_i
A = Array.new(H){gets.chomp.chars}

B = Array.new(W,true)
C = Array.new(H,true)

H.times do |h|
  C[h] = false if A[h].all?{|a| a == "."}
end

W.times do |w|
  B[w] = false if A.map{|v|v[w]}.all?{|a|a == "."}
end

H.times do |h|
  W.times do |w|
    print A[h][w] if C[h] && B[w]
  end
  print "\n" if C[h]
end

Measured memory_bytes: 2684
import java.util.Scanner;
public class Main{
    public static void main(String args[]){
        int n,r,ans;
        Scanner reader = new Scanner(System.in);
        n=reader.nextInt();
        r=reader.nextInt();
        if(n>=10){
            ans=r;
        }
        else{
            ans=100*(10-n)+r;
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 21844
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define dbg(x) cerr << #x << ": " << x << endl
int main() {
  ll n, k;
  cin >> n >> k;
  ll x = n % k;
  ll y = -n % k;
  y += k;
  cout << min(x, y) << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<cmath>
#include<algorithm>
#define N 500000
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    if (a*b%2==0)
        cout << "Even" << endl;
    else
        cout << "Odd" << endl;
    return 0;
}


Measured memory_bytes: 764
import java.util.*;
import java.io.*;

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

        int n = Integer.parseInt(in.next());
        Stack<Integer> stack = new Stack<>();

        for(int i = 0; i < n; i++){
            stack.push(Integer.parseInt(in.next()));
        }

        PrintWriter out = new PrintWriter(System.out);
        for(int i = 0; i < n-1; i++){
            out.printf("%d ", stack.pop());
        }
        
        out.println(stack.pop());
        out.flush();
    }
}


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

#define rep(i,n) for(int i = 0; i < n; i++)
#define REP(i,n) for(int i = 1; i < n; i++)
#define per(i,n) for(int i = n; i >= 0; i--)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using vs = vector<string>;
using vb = vector<bool>;
using vc = vector<char>;
using vcc = vector<vc>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }



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

  int n, m;
  cin >> n >> m;
  vector<P> city(m);
  map<int, vector<int>> mp;
  rep(i,m) {
    int p, y;
    cin >> p >> y;
    city[i] = make_pair(p,y);
    mp[p].push_back(y);
  }
  for(auto it = mp.begin(); it != mp.end(); it++) {
    sort(all(it->se));
  }
  rep(i,m) {
    int p = city[i].fi;
    int y = city[i].se;
    int l = 0;
    int r = sz(mp[p]);
    for(;;) {
      int mid = (l+r) / 2;
      if(mp[p][mid] == y) {
        printf("%06d%06d\n", p, mid+1);
        break;
      }
      if(mp[p][mid] > y) r = mid;
      else l = mid;
    }
  }
}

Measured memory_bytes: 13184
#include <iostream>
using namespace std;
int main()
{
    int n1,n2,n3,sum;
    cin>>n1>>n2>>n3;
    sum=n1+n2+n3;
    if(sum>=22)
    cout<<"bust"<<endl;
    else
    cout<<"win"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;
int n;
long long a[60];
 
bool F(long long k){
	long long cnt=0;
	for(int i=0;i<n;i++){
		long long b=a[i]-n+1+k;
		cnt+=b/(n+1);
		if(b%(n+1)>0)cnt++;
	}
	if(cnt<=k)return true;
	return false;
}
 
int main(){
	cin>>n;
	for(int i=0;i<n;i++)cin>>a[i];
	long long left=0,right=600000000000000000,mid;
	long long ret=914514114514114514;
	while(left<right){
		mid=(left+right)/2;
		if(F(mid)==true){
			right=mid;
			if(ret>mid)ret=mid;
		}
		else left=mid+1;
	}
	long long w=ret;
	for(int i=0;i<999;i++){
		if(w-i<0)break;
		if(F(w-i)==true){
			ret=w-i;
		}
	}
	cout<<ret<<endl;
	return 0;
}

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

#define vi vector<int>
#define pb push_back

int main(){
//    ifstream in("b_in.txt");
//    cin.rdbuf(in.rdbuf());
    int n;
    while(cin >> n,n){
        string w[50];
        int l[50];
        rep(i,n) cin >> w[i];
        l[0] = 0;
        REP(i,1,n+1) {
            l[i] = l[i-1] + w[i-1].size();
        }

        REP(jj, 1, n) {
            bool finished = false;
            rep(ii, jj) {
                bool muri = false;
                int base = l[jj];
                int cur = jj+1;
                if(l[jj] - l[ii] == 5) {
                    for(; cur<n; cur++) {
                        if(l[cur] == base+7) break;
                        else if(l[cur] > base+7) {
                            muri = true;
                            break;
                        }
                    }
                    if(muri) break;
                    cur++;

                    for(; cur<n; cur++) {
                        if(l[cur] == base+12) break;
                        else if(l[cur] > base+12) {
                            muri = true;
                            break;
                        }
                    }
                    if(muri) break;
                    cur++;

                    for(; cur<n; cur++) {
                        if(l[cur] == base+19) break;
                        else if(l[cur] > base+19) {
                            muri = true;
                            break;
                        }
                    }
                    if(muri) break;
                    cur++;

                    for(; cur<n+1; cur++) {
                        if(l[cur] == base+26) {
                            cout << ii+1 << endl;
                            finished = true;
                            break;
                        }
                        else if(l[cur] > base+26) {
                            break;
                        }
                    }
                }
            }
            if(finished) break;
        }
    }

    return 0;
}


Measured memory_bytes: 3184
# ABC054a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b = map(int, input().split())
card = [i for i in range(1, 15)]
card[0] = None
card[13] = 1
# Aprint(card)

if card.index(a) > card.index(b):
    print('Alice')
elif card.index(a) == card.index(b):
    print('Draw')
else:
    print('Bob')


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main()
{
int a;int cn=0;
cin>>a;
int arr[a];
for(int i=0;i<a;i++)
{cin>>arr[i];
if(i%2==0&&arr[i]%2==1)cn++;
}
cout<<cn<<endl;
return 0;


}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define dbg(x) cerr << #x << " : " << x << endl;
#define endl '\n'
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n ;
    vector<vector<int>> a(n,vector<int>(n));
    for(int i=0;i<n;i++) for(int j=0;j<n-1;j++) {cin >> a[i][j];a[i][j]--;}
    vector<int> p(n,0);
    bool done=0;
    vector<int> cur;
    for(int i=0;i<n;i++) cur.push_back(i);
    int ans=0;
    while(!done){
        ans++;
        set<int> interesting;
        for(int x:cur){
            int my=a[x][p[x]];
            int their=a[my][p[my]];
            if(x==their) {interesting.insert(x);interesting.insert(my);}
        }
        cur.clear();
        for(int x:interesting){
            p[x]++;
            if(p[x]!=n-1) cur.push_back(x);
        }
        done=(cur.size()==0);
    }
    for(int i=0;i<n;i++) done&=(p[i]==n-1);
    if(done) cout << ans << endl;
    else cout << -1 << endl;
    return 0;
}

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




int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int n;
	cin >> n;
	long long s = 0;
	for (int i = 1; i <= n; ++i){
		if (i % 3 != 0 && i % 5 != 0)
			s += i;
	}
	cout << s << "\n";
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    int e,f,g,h;
    e = c - (d - b);
    f = d + (c - a);
    g = a - (d - b); 
    h = b + (c - a);
    cout << e << " " << f <<  " " << g << " " << h << endl;
}

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

using namespace std;
typedef long long ll;
#define INF 1999999999
#define MODA 1000000007 
#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()


int main() {
  ll N, X, T;
  cin >> N >> X >> T;

  ll time = 0;
  ll count = 0;
  while (count < N) {
    count += X;
    time += T;
  }
  cout << time << endl;                                                                                          
  return 0;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i,n) for(lli i=0;i<n;i++)
#define repb(i,n) for(lli i=n-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define bg() begin()
#define en() end()
#define ft first
#define sc second
#define vect_lli_it vector<lli>::iterator
#define set_lli_it set<lli>::iterator
#define inf 1e18
#define all(X) X.begin(),X.end()
#define iterate(X) for(it=X.begin();it!=X.end();it++)
lli combi(lli n,lli k)
{
    lli ans=1;
    k=k>n-k?n-k:k;
    lli j=1;
    for(;j<=k;j++,n--)
    {
        if(n%j==0)
        {
            ans*=n/j;
        }else
        if(ans%j==0)
        {
            ans=ans/j*n;
        }else
        {
            ans=(ans*n)/j;
        }
    }
    return ans;
}
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli findlcm(vector <lli> arr, lli n)
{
    lli ans = arr[0];
    for (lli i = 1; i < n; i++)
        ans = (((arr[i] * ans)) /
                (gcd(arr[i], ans)));

    return ans;
}
lli power(lli x, lli y, lli p)
{
    lli res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
lli gcdExtended(lli a, lli b, lli *x, lli *y);
lli modInverse(lli b, lli m)
{
    lli x, y;
    lli g = gcdExtended(b, m, &x, &y);
    if (g != 1)
        return -1;
    return (x%m + m) % m;
}
lli modDivide(lli a, lli b, lli m)
{
    a = a % m;
    lli inv = modInverse(b, m);
    return (inv * a) % m;
}
lli gcdExtended(lli a, lli b, lli *x, lli *y)
{
    if (a == 0)
    {
        *x = 0, *y = 1;
        return b;
    }
    lli x1, y1;
    lli gcd = gcdExtended(b%a, a, &x1, &y1);
    *x = y1 - (b/a) * x1;
    *y = x1;
    return gcd;
}
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli n;
    cin>>n;
    vector <lli> arr;
    lli tot=0;
    lli x;
    rep(i,n){
    	cin>>x;
    	arr.pb(x);
    	tot=tot^x;
	}
	vector <lli> ans;
	rep(i,n){
		ans.pb(tot^arr[i]);
	}
	rep(i,ans.size())
	cout<<ans[i]<<" ";
    return 0;
}


Measured memory_bytes: 7880