akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main() {
  int H, W;
  cin >> H >> W;
  vector<string> gyo(H);
  for (int i =0; i < H; i++) {
    cin >> gyo.at(i);
  }
  vector<bool> tate(H, false);
  vector<bool> yoko(W, false);
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (gyo.at(i).at(j) == '#') {
        tate.at(i) = true;
        yoko.at(j) = true;
      }
    }
  }
  for (int i = 0; i < H; i++) {
    if (tate.at(i)) {
      for (int j = 0; j < W; j++) {
        if(yoko.at(j)) {
          cout << gyo.at(i).at(j);
        }
      }
      cout << endl;
    }
  }
}

Measured memory_bytes: 3612
#include "bits/stdc++.h"
using namespace std;

#define OUT(x)  cerr << #x << " = " << x << endl;
#define all(x)  x.begin(), x.end()
#define mp      make_pair
#define pii     pair<int, int>
#define piii    pair<int, pair<int, int>>

vector<int> g[101010];
long long p[101010];

void dfs(int v, int prev) {
        vector<long long> children;
        long long getor = 0;
        for (int u : g[v]) if (u != prev) {
                dfs(u, v);
                children.push_back(p[u]);
                getor |= p[u];
        }
        vector<int> cntbit(64);
        for (int i = 0; i < 64; i ++) {
                int cnt = 0;
                for (long long ch : children) {
                        if (ch & (1LL << i)) {
                                cnt ++;
                        }
                }
                cntbit[i] = cnt;
        }
        int s = 0, t = -1;
        for (int i = 0; i < 64; i ++) {
                if (cntbit[i] >= 2) {
                        s = i + 1;
                }
        }
        for (int i = s; i < 64; i ++) {
                if (cntbit[i] == 0) {
                        t = i;
                        break;
                }
        }
        long long mask = 1LL << t;
        p[v] = (getor & ~(mask - 1)) | mask;
        //cerr << static_cast<bitset<63>>(p[v]) << endl;
}

int main() {
        int i, j;
        int n;
        cin >> n;
        for (i = 0; i < n - 1; i ++) {
                int a, b;
                cin >> a >> b;
                a --, b --;
                g[a].push_back(b);
                g[b].push_back(a);
        }
        dfs(0, -1);
        int ans = 0;
        for (i = 0; i < 64; i ++) {
                if (p[0] & (1LL << i)) {
                        ans = i;
                }
        }
        cout << ans << endl;
        return 0;
}



Measured memory_bytes: 14464
//while (clock()<=69*CLOCKS_PER_SEC)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define shandom_ruffle random_shuffle

string s;

int ile[5];

int main()
{
	cin >> s;
	for (char i : s)
		ile[i-'a']++;
	int mini=1e8;
	int maxi=-1e8;
	for (int i=0; i<3; i++)
	{
		mini=min(mini, ile[i]);
		maxi=max(maxi, ile[i]);
	}
	if (maxi<=mini+1)
		printf("YES\n");
	else
		printf("NO\n");
	return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

int main(){
    long long n, a[50], nmax = -999999999, nmin = 999999999,cnt = 0;
    pair<int, int> ans[500];
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a[i];
        nmax = max(nmax, a[i]);
        nmin = min(nmin, a[i]);
    }
    if(nmin < 0 && nmax > 0){
        long long t,k;
        if(-nmin < nmax){
            t = nmax;
            nmin += nmax;
        }
        else{
            t = nmin;
            nmax += nmin;
        }
        for(k=0;k<n;k++){
            if(a[k]==t)break;
        }
        for(int i=0;i<n;i++){
            if(i==k)continue;
            a[i]+=t;
            ans[cnt] = {k+1,i+1};
            cnt++;
        }
    }
    if(nmin>=0){
        for(int i=0; i<n-1; i++){
            a[i+1]+=a[i];
            ans[cnt] = {i+1,i+2};
            cnt++;
        }
    }
    else{
        for(int i=n-1; i>0; i--){
            a[i-1]+=a[i];
            ans[cnt] = {i+1,i};
            cnt++;
        }
    }
    cout << cnt << endl;
    for(int i=0;i<cnt;i++)cout << ans[i].first << " " << ans[i].second << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include <string>
#include <vector>
using namespace std;
int main(){
    int a;
    int b;
    int c;
    int d;
    int e;
    int k;
    int l;
    cin >> a >> b >> c >> d >> e >> k;
    l = e - a;
    if(l <= k){
        cout << "Yay!";
    }
    if(l > k){
        cout << ":(";
    }
}

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;

#define ll          long long
#define pb          push_back
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define rs(v,n)     v.resize(n)
#define hell        1000000007
#define peak        9123372036854775807
#define pii         acos(-1)
#define clr(a,x)    memset(a,x,sizeof(a))
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
template<typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;
template<class x,class y> x sum(x a,y b){return a+b;}
template<class x,class y> x mul(x a,y b){return a*b;}
template<class x,class y> x sub(x a,y b){return a-b;}
template<class x,class y> x divi(x a,y b){return a/b;}

template<class x,class y>
istream &operator>>(istream &in,pair<x,y> &p) 
{ 
    in>>p.F>>p.S;
    return in;
}
template<class x>
istream &operator>>(istream &in,vector<x> &v) 
{
    for(auto& i:v)
        in>>i;
    return in;
}
template<class x,class y>
ostream &operator<<(ostream &out,pair<x,y> &p) 
{ 
    out<<"("<<p.F<<","<<p.S<<") ";
    return out; 
}
template<class x>
ostream &operator<<(ostream &out,vector<x> &v) 
{ 
    out<<v.size()<<endl;
    for(auto i:v)
        out<<i<<" ";
    out<<endl;
    return out; 
}
#define N  1000005

int main()	
{
    ios;
    
    ll tt=1;
    // cin>>tt;
    while(tt--)
    {
    	ll i,j,k,l,m,n;
    	string s;
    	cin>>s;
    	if(s[2]==s[3]&&s[4]==s[5])
    		cout<<"Yes";
    	else
    		cout<<"No";
    }
    return 0;
}

Measured memory_bytes: 256
using System;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());

            char[] c = Console.ReadLine().ToCharArray();

            int count = 0;

            for(int i=0;i<N;i++)
            {
                if (c[i] == 'R')
                    count++;
            }

            if(count > N/2)
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");

        }
    }
}


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

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

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()
#define dump(x) cout << #x << " = " << (x) << endl

const int MN = 3010;

ll dp[MN][MN];

int main() {
	int N; cin >> N;
	vector<ll> a(N);
	rep(i, N) cin >> a[i];

	for (int l = 1; l <= N; ++l) {
		for (int i = 0; i <= N - l; ++i) {
			int j = i + l - 1;
			if (l == 1) {
				dp[i][j] = a[i];
			} else {
				dp[i][j] = max(a[i] - dp[i+1][j], a[j] - dp[i][j-1]);
			}
		}
	}

	cout << dp[0][N-1] << endl;

	return 0;
}

Measured memory_bytes: 70016
#!/usr/bin/env python3
import sys


def solve(N: int, A: int, B: int):
    dev = N // (A+B)
    rem = N % (A+B) if N % (A+B) <= A else A
    return A*dev + rem


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    print(solve(N, A, B))

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
# -*- coding: utf-8 -*-
from collections import Counter, defaultdict, deque
import math

import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


from  fractions import Fraction

def f(a, b):
    if a== 0 and b == 0:
        return (1, 0, 0)
    if b == 0:
        return (1, 1, 0)
    f = Fraction(a, b)
    a = f.numerator
    b = f.denominator
    if a < 0:
        s = -1
        a *= -1
    else:
        s = 1
    return s, a, b


class Mod:
    def __init__(self, m):
        self.m = m

    def add(self, a, b):
        return (a + b) % self.m

    def sub(self, a, b):
        return (a - b) % self.m

    def mul(self, a, b):
        return ((a % self.m) * (b % self.m)) % self.m

    def div(self, a, b):
        return self.mul(a, pow(b, self.m-2, self.m))

    def pow(self, a, b):
        return pow(a, b, self.m)


@mt
def slv(N, AB):
    adb = Counter()
    for a, b in AB:
        s, a, b = f(a, b)
        adb[(s*a, b)] += 1
    M = Mod(1000000007)
    ans = 1
    done = set()
    for k, v in adb.items():
        if k in done:
            continue
        if k == (0, 0):
            continue
        a, b = k
        if a < 0:
            s = 1
            a = abs(a)
        elif a == 0:
            s = 1
        else:
            s = -1
        n = adb[(s*b, a)]
        done.add(k)
        done.add((s*b, a))
        t = M.sub(M.pow(2, v) + M.pow(2, n), 1)
        ans = M.mul(ans, t)

    return M.add(M.sub(ans, 1), adb[(0, 0)])


def main():
    N = read_int()
    AB = [read_int_n() for _ in range(N)]
    print(slv(N, AB))


if __name__ == '__main__':
    main()


Measured memory_bytes: 172560
#include<algorithm>
#include<array>
#include<cmath>
#include<iostream>
#include<iomanip>
#include<iso646.h>
#include<queue>
#include<stack>
#include<string>
#include<vector>

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

#define FOR(counter,initial_value,condition) for(int counter = initial_value; counter < condition;counter++)


int main()
{
	vector<int> t;
	vector<int> p;
	vector<int>	x;
	int n, m;
	cin >> n;
	t.resize(n+1);
	FOR(i, 1, n+1) {
		cin >> t[i];
	}
	cin >> m;
	p.resize(m+1);
	x.resize(m+1);
	FOR(i, 1, m+1) {
		cin >> p[i] >> x[i];
	}
	int sum;
	FOR(i, 1, m+1) {
		sum = 0;
		FOR(j, 1, n+1) {
			if (p[i] == j) {
				sum += x[i];
			}
			else sum += t[j];
		}
		cout << sum << endl;
	}
}


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

main() {
    int N; cin >> N; int pos=0; int ans=0;
    rep(i,N){
        int H; cin >> H;
        if(pos<=H){
            ans++; pos=H;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<map>

using namespace std;

int main(){
  int n, m, a, b;
  map<int, int> mp;
  cin >> n >> m;
  for(int i=0;i<m;i++){
    cin >> a >> b;
    a--;b--;
    mp[a]++;mp[b]++;
  }
  for(int i=0;i<n;i++){
    cout << mp[i] << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

signed main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int a, b, k;
	cin >> a >> b >> k;
	rep(i, 0, k){
		if(i % 2){
			b = b / 2;
			a = a + b;
		}else{
			a = a / 2;
			b = b + a;
		}	
	}
	cout << a << " " << b << endl;
}

Measured memory_bytes: 256
/*#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>*/
#include <bits/stdc++.h>

using namespace std;
//using namespace __gnu_pbds;
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

const int MOD = 1000000007;
double PI = 4*atan(1);

vector<ll> a,b;
multiset<int> ta, tb;
map<int,int> compress;
int comp[100001], sz[100001];

int getpar(int a) {
    if (comp[comp[a]] != comp[a]) comp[a] = getpar(comp[a]);
    return comp[a];
}

void unite(int a, int b) {
    a = getpar(a), b = getpar(b);
    if (a == b) return;
    if (sz[a]<sz[b]) swap(a,b);
    sz[a] += sz[b];
    comp[b] = a;
}

int S1, S2;

int main() {
	int N; cin >> N;
	a.resize(N), b.resize(N);
    F0R(i,N) {
        cin >> a[i];
        S1 ^= a[i];
        ta.insert(a[i]);
    }
    ta.insert(S1);
    
    F0R(i,N) {
        cin >> b[i];
        S2 ^= b[i];
        tb.insert(b[i]);
    }
    tb.insert(S2);
    
    if (ta != tb) {
        cout << -1;
        return 0;
    }
    for (auto a: ta) compress[a] = 1;
    
    int cur = 0;
    for (auto a: compress) compress[a.f] = cur++;
    
    F0R(i,cur) comp[i] = i, sz[i] = 1;
    int ans = 0;
    F0R(i,N) {
        if (a[i] != b[i]) ans ++;
        unite(compress[a[i]],compress[b[i]]);
    }
    unite(compress[S1],compress[S2]);
    
    F0R(i,cur) if (comp[i] == i && sz[i] > 1 && i != comp[compress[S1]]) ans++;
    cout << ans;
}

Measured memory_bytes: 16640
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pii;
#define fi first
#define se second
#define mod 1000000007
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
int main()
{
	ios;
	ll x,y,z;
	cin>>x>>y>>z;
	cout<<z<<" "<<x<<" "<<y<<endl;
}


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

using namespace std;
using LL = long long;
using P = pair<int, int>;
using Tapris = tuple<int, int, int>;

#define REP(i, n) for(LL i = 0; i < n; ++i)
#define FOR(i, a, n) for(LL i = a; i < n; ++i)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e15;
const int MOD = 1e9 + 7;

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

//#define int long long

/*************** using variables ***************/
int n;
int dp[10000005];
/**********************************************/

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

    cin >> n;
    dp[0] = 0;
    
    int cnt = 0;
    int sum = 0;
    REP(i, n+1){
        if(i > sum){
            cnt++;
            sum += cnt;
        }
        dp[i] = cnt;
    }

    sum = 0;
    for(int i = dp[n]; i > 0; i--){
        if(sum + i <= n) {
            sum += i;
            cout << i << endl;
        }
    }
}


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

const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

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

ull gcd(ull a, ull b) { return b ? gcd(b, a % b) : a; }
ull lcm(ull a, ull b) { return a / gcd(a, b) * b; }

int main(){
    int x, y, a, b, c;
    cin >> x >> y >> a >> b >> c;
    vi p(a), q(b), r(c);
    rep(i, a) cin >> p[i];
    rep(i, b) cin >> q[i];
    rep(i, c) cin >> r[i];
    RSORT(p); RSORT(q);
    vi xy;
    rep(i, x) xy.pb(p[i]);
    rep(i, y) xy.pb(q[i]);
    rep(i, c) xy.pb(r[i]);
    RSORT(xy);
    ll ans = 0;
    rep(i, x+y) ans += xy[i];
    cout << ans << endl;
    return 0;
}


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

char a[100010];
int n, k;

int main(){
	scanf("%s", a);
	cin >> k;
	for(n = 0; a[n]; n++);
	for(int i = 0; i < n; i++){
		if(a[i] == 'a') continue;
		else if('z' + 1 - a[i] <= k){
			k -= ('z' + 1 - a[i]);
			a[i] = 'a';
		}
		else continue;
	}
	k %= 26;
	while(k){
		a[n - 1]++;
		if(a[n - 1] > 'z') a[n - 1] = 'a';
		k--;
	}
	puts(a);
	return 0;
}

Measured memory_bytes: 512
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {

	// エラトステネスのふるい(n以下の素数を求める)
	public static boolean[] sieve (int n) {
		boolean[] isPrime = new boolean[n + 1];
		Arrays.fill(isPrime, true);
		for (int i = 4; i < isPrime.length; i += 2)
			isPrime[i] = false;
		for (int i = 3; i * i <= n; i += 2) {
			for (int j = 3; i * j <= n; j += 2)
				isPrime[i * j] = false;
		}
		return isPrime;
	}

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

		BufferedReader br =
				new BufferedReader(new InputStreamReader(System.in));
		String line = "";

		boolean[] primes = sieve(100000);

		while ((line = br.readLine()) != null) {
			int n = Integer.parseInt(line);
			for (int i = n - 1; i >= 2; i--) {
				if (primes[i]) {
					System.out.print(i + " ");
					break;
				}
			}
			for (int i = n + 1; i < primes.length; i++) {
				if (primes[i]) {
					System.out.println(i);
					break;
				}
			}
			line = null;
		}

	}

}

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

public class Main {
	public static int partition(int[] A, String[] B, int[] C, int p, int r) {
		int x = A[r];
		int i = p - 1;
		int oki = 0;
		String keep;
		for (int j = p; j < r; j++) {
			if (A[j] <= x) {
				i = i + 1;
				oki = A[i];
				A[i] = A[j];
				A[j] = oki;
				keep = B[i];
				B[i] = B[j];
				B[j] = keep;
				oki = C[i];
				C[i] = C[j];
				C[j] = oki;
			}
		}
		oki = A[i + 1];
		A[i + 1] = A[r];
		A[r] = oki;
		keep = B[i + 1];
		B[i + 1] = B[r];
		B[r] = keep;
		oki = C[i + 1];
		C[i + 1] = C[r];
		C[r] = oki;
		return i + 1;

	}

	public static void quicksort(int[] A, String[] B, int[] C, int p, int r) {
		if (p < r) {
			int q = partition(A, B, C, p, r);
			quicksort(A, B, C, p, q - 1);
			quicksort(A, B, C, q + 1, r);
		}

	}

	public static boolean isStable(int[] nums, int[] check, int n) {
		for (int i = 0; i < n - 1; i++) {
			if (nums[i] == nums[i + 1]) {
				if (check[i] > check[i + 1]) {
					return false;
				}
			}
		}
		return true;
	}

	public static void main(String[] args) throws NumberFormatException, IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		String[] cards1 = new String[n];
		int[] check = new int[n];
		int[] nums = new int[n];
		for (int i = 0; i < n; i++) {
			cards1[i] = br.readLine();
			nums[i] = Integer.parseInt(cards1[i].split(" ")[1]);
			check[i] = i;
		}
		quicksort(nums, cards1, check, 0, n - 1);
		if (isStable(nums, check, n)) {
			System.out.println("Stable");
		} else {
			System.out.println("Not stable");
		}
		for (int i = 0; i < n; i++) {
			System.out.println(cards1[i]);
		}

	}

}



Measured memory_bytes: 76484
import java.util.Scanner;

    class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
        String s = scan.next();

        scan.close();

        if (s.equals("SUN"))
        System.out.print(7);
       else if(s.equals("MON"))
        	System.out.print(6);
        else if(s.equals ("TUE"))
        	System.out.print(5);
        else if(s.equals("WED"))
        	System.out.print(4);
        else if(s.equals("THU"))
        	System.out.print(3);
        else if(s.equals ("FRI"))
        	System.out.print(2);
        else
        System.out.print(1);
	}

}


Measured memory_bytes: 21716
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで

#include <bits/stdc++.h>
#define mod 1000000007
#define INF 1001001001
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
using namespace std;

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

    ll a,b,c,d,m,n,maxi=0,f=0,mini=INF,sum=0;
    string str;
    cin>>n;
    n=n%1000;
    if(n==0) cout<<0<<endl;
    else cout<<abs(n-1000)<<endl;

    return 0;
}


Measured memory_bytes: 3668
k,n=map(int,input().split())
a=list(map(int,input().split()))

x=0
for i in range(n-1):
 p=a[i+1]-a[i]
 if p >= x:
  x=p

X=max(x,k-a[n-1]+a[0])
print(k-X)

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

int main(){
    long N;
    long A[100002];
    long minabsA = 1e9+2;
    long long ans = 0;
    long minuscount = 0;

    cin >> N;
    for(long i=0;i<N;i++){
        cin >> A[i];
        minabsA = min(minabsA, abs(A[i]));
        ans += abs(A[i]);
        if(A[i] < 0){
            minuscount++;
        }
    }

    if(minuscount % 2 == 1){
        ans -= 2*minabsA;
    }

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

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  int x, y;
  x = ceil((double)A / (double)D);
  y = ceil((double)C / (double)B);
  
  if(x>=y) {
    cout << "Yes";
  }
  else{
    cout << "No";
  }
}

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

int main()
{
	int a, b, k;
	cin >> a >> b >> k;
	int cnt = 0;
	for(auto i = 100; i > 0; --i){
		if(a % i == 0 && b % i == 0){
			if(++cnt == k){
				cout << i << endl;
				break;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <stdlib.h>
#include <set>
typedef long long ll;
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: 256
import java.io.*;
import java.util.Arrays;
import java.util.Scanner;

class Main{

	public static void bubbleSort(int a[],String sta[]){
		for (int i = 0; i<a.length ; i++ ) {
			for (int j = a.length-1; j>=i+1 ; j-- ) {
				if (a[j] < a[j-1]) {
					int workint = a[j];
					a[j] = a[j-1];
					a[j-1] = workint;

					String workstr = sta[j];
					sta[j] = sta[j-1];
					sta[j-1] = workstr;
				}
			}
		}
	}

	public static void selectionsort(int b[],String stb[]){
		for (int i = 0; i<b.length ; i++ ) {
			int mini = i;
			for (int j = i; j<b.length ;j++ ) {
				if ( b[j] < b[mini]) {
					mini = j;
				}
			}
			int work = b[i];
			b[i] = b[mini];
			b[mini] = work;

			String workst = stb[i];
			stb[i] = stb[mini];
			stb[mini] = workst;
		}
	}

	public static void printseq(String[] st){
		for (int i = 0; i<st.length ; i++ ) {
			if (i == st.length-1) {
				System.out.println(st[i]);
			}else{
				System.out.print(st[i] + " ");
			}
		}
	}

	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());
		int[] num = new int[n];
		String[] str = (br.readLine()).split(" ");

		for (int i = 0; i<n ; i++ ) {
			char ch = str[i].charAt(1);
			num[i] = Integer.parseInt("" + ch);
		}

		int[] bubbleint = new int[n];
		String[] bubblestr = new String[n];
		for (int i = 0; i<n ; i++ ) {
			bubbleint[i] = num[i];
			bubblestr[i] = str[i];
		}

		int[] selectint = new int[n];
		String[] selectstr = new String[n];
		for (int i = 0; i<n ; i++ ) {
			selectint[i] = num[i];
			selectstr[i] = str[i];
		}


		bubbleSort(bubbleint,bubblestr);

		printseq(bubblestr);
		System.out.println("Stable");

		selectionsort(selectint,selectstr);

		printseq(selectstr);
		if (Arrays.equals(bubblestr,selectstr)) {
			System.out.println("Stable");
		}else{
			System.out.println("Not stable");
		}
	}
}

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

#define loop(i, n) for(int i = 0;i < int(n);i++)
#define rloop(i, n) for(int i = int(n);i >= 0;i--)
#define range(i, a, b) for(int i = int(a);i <= int(b);i++)
#define sz(c) int(c.size())
#define clr(v, d)   memset(v, d, sizeof(v))
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()
#define PI acos(-1)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define INF             INT64_MAX
#define NINF            INT64_MIN
#define ROW 1001
#define COL 1001

typedef long long ll;
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef vector<ii> vii;
typedef vector<int> vi;
typedef vector<pll> vll;
typedef vector<ll> vl;
int alpha[26];
int main() {

    int n;
    string s;
    cin>>n>>s;
    int cnt=0;
    char last;
    loop(i,n)
    {
        if(s[i]!=last)
            alpha[s[i]-'a']=0;
        if(alpha[s[i]-'a']==0)
        {
            cnt++;
            last=s[i];
            alpha[s[i]-'a']=1;
        }
    }
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 512
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, i321) => {
        read_value!($next, i32) - 1
    };

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

//
// # Examples
//
// # integers
// input! { n: i32, m: i32, ... }
//
// # array
// input! { n: i32, v: [i32; n], }
//
// # matrix
// input! { n: i32, m: i32, mat: [[]] }
//
// # string
// input! { s: chars }
//
// 3 4
// ####
// #..#
// .#.#
//
// input!{
//     h: i32,
//     w: i32,
//     board: [chars; h],
// }

// https://practice.contest.atcoder.jp/tasks/practice_1
//fn main() {
//    input!{
//        a: i32, b: i32, c: i32,
//        foo: chars,
//    }
//    let s: String = foo.into_iter().collect();
//    println!("{} {}", a+b+c, s);
//}
fn main() {
    input! { n: usize }
    println!("ABC{}", n);
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main() {
int N;
  int M;
  cin >>N>>M;
  vector<string> A(N);
  rep(i,N) {
cin >>A.at(i);
  }

  vector<string> B(M);
  rep(j,M) {
cin >>B.at(j);
  }
  bool answer=false;
  int x=M*M;
  int counting=0;
  rep(i,N-M+1) {
    rep(j,N-M+1) {
      int count=0;
      counting++;
      rep(k,M) {
        rep(l,M) {
          
          if(A.at(i+k).at(j+l)==B.at(k).at(l)) {
            
           //cout<<"A"<<endl;
            count++;
          }
        }
      }
        
      if (count==x) {
          answer=true;
        }
          
          
          
          
       
	

        
      }
    }

  
  
  if(answer) {
    cout<<"Yes"<<endl;
  }
  
  if((counting==(N-M+1)*(N-M+1)) &&(!answer)) {
  cout<<"No"<<endl;
}
    
    
    
  }
      
      
  
  

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

int main() {
  int64_t N;
  cin >> N;
  vector<int64_t> A(N);
  for( int64_t i=0; i<N; ++i) {
    cin >> A[i];
  }

  int64_t m1 = 0;
  for( int64_t i=0; i<N; ++i) {
    if (i%2==0) m1 += A[i];
    else m1 -= A[i];
  }
  m1 /= 2;
  cout << m1*2;

  int64_t m = m1;
  for( int64_t i=0; i<N-1; ++i) {
    m = A[i] - m;
    cout << " " << m*2;
  }
}


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


using namespace std;
typedef  long long ll;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
#define  MP make_pair
#define  PB push_back
#define inf  1000000007
#define rep(i,n) for(int i=0;i<(int)(n);++i)

class TreeDiameter
{
public:
    int V;
    vector<vector<int> > G;
    vector<int> diameter;
    TreeDiameter(int node_size) : V(node_size), G(V){}
    void add_edge(int u,int v){
        G[u].push_back(v),G[v].push_back(u);
    }
    void dfs(int u,int p,int d,int& far,int& mx){
        if(mx < d){
            far = u;
            mx = d;
        }
        for(int v : G[u]){
            if(v != p){
                dfs(v,u,d+1,far,mx);
            }
        }
    }
    bool redfs(int u,int p,const int t){
        if(u == t){
            return true;
        }
        for(int v : G[u]){
            if(v != p){
                diameter.push_back(v);
                if(redfs(v,u,t)){
                    return true;
                }else{
                    diameter.pop_back();
                }
            }
        }
        return false;
    }
    void solve(){
        int s,t,mx;
        mx = -1;
        dfs(0,-1,0,s,mx);
        mx = -1;
        dfs(s,-1,0,t,mx);
        diameter.push_back(s);
        redfs(s,-1,t);
    }
};

int main(){
    int n;
    cin >> n;
    TreeDiameter tr(n);
    rep(i,n-1){
        int a,b;
        cin >> a >> b;
        a--;b--;
        tr.add_edge(a,b);
    }
    tr.solve();
    int k = tr.diameter.size();
    if(k%3==2){
        cout << "Second" << endl;
    }else{
        cout << "First" << endl;
    }
    return 0;
}

Measured memory_bytes: 18556
#include <bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(int i=s;i<t;i++)
int co[1<<17],n;
void dfs(int st,int ed,int add,int now,int ban)
{
    if(now==0){
        printf("%d ",st+add);
        return;
    }
    rep(i,0,n)if(((st>>i)&1)!=((ed>>i)&1))
    {
        int k1=(st>>i)&1,k2=(ed>>i)&1;ban+=1<<i;
        st-=k1<<i,ed-=k2<<i;int k=st;
        rep(j,0,n)if(!((ban>>j)&1)){k^=1<<j;break;}
        dfs(st,k,add+(k1<<i),now-1,ban);
        dfs(k,ed,add+(k2<<i),now-1,ban);
        break;
    }
}
int main()
{
    int a,b;
    scanf("%d%d%d",&n,&a,&b);
    rep(i,1,1<<n)co[i]=co[i-(i&(-i))]+1;
    if(!(co[a^b]&1))printf("NO\n");
    else{
        printf("YES\n");
        dfs(a,b,0,n,0);
    }
}

Measured memory_bytes: 1536
arb='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
N = int(input())
S = input()
ans =''
for i in range(len(S)):
    if arb.index(S[i]) + N +1 <= len(arb):
        ans += arb[arb.index(S[i])+N]
    else:
        ans += arb[-len(arb) + arb.index(S[i]) + N]
print(ans)

Measured memory_bytes: 3060
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7


int main() {


	int D;
	scanf("%d", &D);


	if (D == 7 || D == 5 || D == 3)printf("YES");
	else printf("NO");


}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int>P;
#define PI 3.14159265359
#define MOD 1000000007
//ABC166 E 
int main(){
  string s;
  cin >>s;
  int N=s.size();
  int flag=0;
  while(true){
    if(N==0){flag=100;break;}
    if(N<=4){flag=1;break;}
  	if(s[N-2]=='e'&&s[N-1]=='r'){
      	if(N<=5){flag=1;break;}
      	if(s[N-6]=='e'&&s[N-5]=='r'&&s[N-4]=='a'&&s[N-3]=='s'){N-=6;}
    	else if(s[N-7]=='d'&&s[N-6]=='r'&&s[N-5]=='e'&&s[N-4]=='a'&&s[N-3]=='m'){N-=7;}
      	else{flag=1;}
    }
    else if(s[N-5]=='d'&&s[N-4]=='r'&&s[N-3]=='e'&&s[N-2]=='a'&&s[N-1]=='m'){
    	N-=5;
    }
    else if(s[N-5]=='e'&&s[N-4]=='r'&&s[N-3]=='a'&&s[N-2]=='s'&&s[N-1]=='e'){
    	N-=5;
    }
    else{flag=1;}
    if(flag==1){break;}
  }
  if(flag==100){cout<<"YES";}
  if(flag==1){cout<<"NO";}
}

Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        char input = in.next().charAt(0);
        char output = alphabet(input);
        System.out.println(output);
    }

    // alpha = 'B' -> 'A'
    // alpha = 'z' -> 'a'
    public static char alphabet(char alpha) {
        char result = 'a';
        if (alpha >= 'A' && alpha <= 'Z') {
            result = 'A';
        } else {
            result = 'a';
        }
        return result;
    }

}


Measured memory_bytes: 35436
# ??
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, x = MAP()

a = [0] + LIST() + [0]

ans = 0
for i in range(1, N+1):
	if a[i-1] + a[i] >= x:
		ans += a[i-1] + a[i] - x
		a[i] -= a[i-1] + a[i] - x
print(ans)


Measured memory_bytes: 16216
# solution

import io
import sys
from itertools import combinations as comb

n, *S = open(0).read().split()

s = [i[0] for i in S]

array = [s.count(i) for i in 'MARCH']

ret = sum(x * y * z for x, y, z in comb(array, 3))

print(ret)

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

int main() {
int n,k,q;
cin >> n >> k >> q;
vector<int> a(n);
rep(i,q){
  int x;
  cin >> x;
  a.at(x-1)++;
}
rep(i,n){
  if(k-q+a.at(i) > 0) cout <<"Yes" << endl;
  else cout <<"No" << endl;
}
}


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

int main(){
  int x;
  int i=1;
  while(1){
    cin >> x;
    if(x==0)break;
    //if(i!=1)cout << endl;
    cout << "Case " << i << ": " << x << endl;
    i++;
  }
  return 0;
}

Measured memory_bytes: 3088
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9 + 7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
#ifdef LOCAL
#define debug(x) cerr << #x << ": " << x << endl
#else
#define debug(x)
#endif
int dx[4] ={ 1,0,-1,0 };
int dy[4] ={ 0,1,0,-1 };

int N,  A[100000];
vector<pair<int, int>> v;

signed main() {
	cin >> N;
	rep(i, N) cin >> A[i];

	rep(i, N){
		v.pb({ A[i], i+1 });
	}
	sort(all(v));

	rep(i, N){
		if(i != 0) cout << " ";
		cout << v[i].second;
	}
	cout << endl;
}

Measured memory_bytes: 2164
#include <bits/stdc++.h>
using namespace std;
int main() {
  
  int n;
  cin >> n;
  int64_t k;
  cin >> k;
  int64_t mod = 1000000007;
  
  vector<int64_t> cont1(n);
  
  for(int i = 0 ; i < n ; i++){
    cin >> cont1.at(i);
  }
  
  vector<int64_t> cont2(n);
  vector<int64_t> cont3(n);
  
  for(int i = 0 ; i < n ; i++){
    
    for(int j = i+1 ; j < n ; j++){
      if(i == j){
        continue;
      }
        if(cont1.at(i) > cont1.at(j)){
          cont2.at(i)++;
        }
    }
  }
  
  for(int i = 0 ; i < n ; i++){
    
    for(int j = 0 ; j < n ; j++){
      if(i == j){
        continue;
      }
        if(cont1.at(i) > cont1.at(j)){
          cont3.at(i)++;
        }
    }
  }
  int64_t sum = 0; 
  for(int i = 0 ; i < n ; i++){
    sum +=  (k*cont2.at(i) + cont3.at(i)*((k*(k-1)/2) % mod ))% mod;
    sum % mod;
  }
  cout << sum % mod << endl;
}


Measured memory_bytes: 256
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    res = []
    c = n
    if n % 2 != 0:
        c -= 1

    for i in range(1, n + 1):
        for j in range(i + 1, n + 1):
            if j == c:
                continue
            res.append([i, j])
        c -= 1

    print(len(res))
    for i in res:
        print(*i)


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 9532
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N, K = LI()
    D = LS()
    for price in range(N, 100000):
        valid = True
        for dig in D:
            if dig in str(price):
                valid = False
                break
        if valid:
            break
    print(price)

main()



Measured memory_bytes: 66924
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <tuple>
#include <utility>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <iomanip>
#include <map>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};



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

   if(a>=3200)cout << s <<endl;
   else cout << "red"<<endl;

    return 0;
}


Measured memory_bytes: 256
/*input

*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}

//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		
		b>>=1;
	}
	return res;
}

int main()
{
	IOS;
	double t,x;
	cin>>t>>x;
	cout<<t/x<<'\n';
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define ll long long
#define ull unsigned long long
#define ld long double
#define zeros(x) x^(x-1)&x
#define pii pair<ll,ll>
#define cd complex<double>
#define dbg(x) cerr<<x<<endl;
#define Nmax 1000005
#define MOD 1000000007
using namespace std;

ll n;

template<typename T = long long>
T _pow(T a, T b){
    T ans = 1;
    for (; b; b >>= 1){
        if (b % 2) ans = ans * a % MOD;
        a = a * a % MOD;
    }
    return ans;
}

long long P[Nmax], inv[Nmax];
template<typename T = long long>
T comb(T n, T m){
    if (P[1] == 0) cerr << "Apeleaza functia prec!\n";
    if (m > n) return 0;
    return P[n] * inv[m] % MOD * inv[n-m] % MOD;
}

template<typename T = long long>
void add(T &a, T b){
	a += b;
	if (a >= MOD) a -= MOD;
	if (a < 0) a += MOD;
}

void prec(int n = Nmax-1){
    P[0] = inv[0] = 1;
    for (int i=1;i<=n;i++){
        P[i] = P[i-1] * i % MOD;
        inv[i] = _pow(P[i], MOD - 2LL);
    }
}

ll ans[Nmax];
int main()
{
    cin >> n;
    prec();

    for (int i=n-1;i>=1;i--){
        ans[i] = 1LL * comb(i - 1LL, n - i - 1LL) * P[n-i-1] % MOD * P[i] % MOD;
        if (i<n) add(ans[i+1], -ans[i]);
    }

    ll fin = 0;
    for (int i=1;i<n;i++){
        fin = (fin + 1LL * i * ans[i]) % MOD;
    }

    cout << fin << '\n';
    return 0;
}


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

int main()
{
	int n,k;
	int i,j;
	int* list;
	while(scanf("%d %d",&n,&k),n)
	{
		list = (int*)malloc(sizeof(int)*n);
		int sum = 0;
		int max = 0;
		for(i = 0;i < k;i++)
		{
			int ai;
			scanf("%d",&ai);
			list[i] = ai;
			sum += ai;
		}
		max = sum;
		for(;i < n;i++)
		{
			int ai;
			scanf("%d",&ai);
			list[i] = ai;
			sum += ai;
			sum -= list[i-k];
			if(max < sum)
			{
				max = sum;
			}
		}
		printf("%d\n",max);
	}
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>

using namespace std;

string bitstr(long long n) {
	string s = "";
	while (n > 0) {
		s += n % 2 ? "1" : "0";
		n /= 2;
	}

	reverse(s.begin(), s.end());

	if (s.empty()) {
		s = "0";
	}
	return s;
}

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

	long long bits_plus = 0;
	long long bits_minus = 0;

	for (int i = 0; i <= 31; i++) {
		long long x = 1LL << i;

		if (abs(n) % (x << 1) == 0) {
			continue;
		}

		if (i % 2 == 0) {
			bits_plus |= x;
			n -= x;
		} else {
			bits_minus |= x;
			n += x;
		}
	}

	string ans = bitstr(bits_plus | bits_minus);
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	int n; cin >> n;
	if(n / 100 == 1){
       cout << 9;
    }
    else{
       cout << 1;
    }
    if(n % 100 / 10 == 1){
       cout << 9;
    }
  	else{
    cout<<1;
  	}
    if(n % 10 == 1){
       cout << 9 << endl;
    }
  	else{
      cout<<1<<endl;
    }
	cin >> n;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
enum Query
{
    pushBack = 0,
    dump = 1,
    clear = 2,
};
std::istream &operator>>(std::istream &is, Query &i)
{
    int tmp;
    if (is >> tmp)
        i = static_cast<Query>(tmp);
    return is;
} //オペレーターオーバーロード
void print_t(vector<int> A)
{
    std::size_t size = A.size(); //std::size_t 十分に大きい符号なし整数型
    if (size > 0)
    {
        cout << A.at(0);
        for (std::size_t i = 1; i < size; i++)
        {
            cout << ' ' << A.at(i);
        }
    }
    cout << endl;
}
int main()
{
    typedef vector<int> row; //ここでrowを空にコンストラクタすべき？それともここは型？なのでコンストラクタはいらない？→ここは型
    int n;
    cin >> n;
    vector<row> A(n);
    int q;
    cin >> q;
    for (int i = 0; i < q; i++)
    {
        int query;
        int t;
        cin >> query;
        cin >> t;
        row &r = A.at(t); //rがA.at(t)の参照(別名)になる。
        if (query == pushBack)
        {
            int x;
            cin >> x;
            //A[t][末尾] = x;
            r.push_back(x);
        }
        else if (query == dump)
        {
            //A[t]を出力
            print_t(r);
        }
        else if (query == clear)
        {
            //A[t]を空にする
            r.clear();
        }
    }
}
//離れた場所で宣言しない


Measured memory_bytes: 6856
#include<bits/stdc++.h>
#define mo 1000000007
#define add(a,b) (a+b>=mo)?(a+=b-mo):(a+=b)
using namespace std;
int a[110],f[55][110][110];
int main()
{
	int n;scanf("%d",&n);
	for (int i=1;i<2*n;i++) scanf("%d",&a[i]);
	sort(a+1,a+2*n);a[0]=a[1];a[2*n]=a[2*n-1];
	f[n][a[n]!=a[n-1]][a[n]!=a[n+1]]=1;
	for (int i=n;i>1;i--)
	for (int l=0;l<=2*n-1;l++)
	for (int r=0;r<=2*n-1;r++) if (f[i][l][r])
	{
		for (int k=0;k<l;k++) add(f[i-1][k+(a[i-2]!=a[i-1])][r+(a[2*n-i+1]!=a[2*n-i+2])+1],f[i][l][r]);
		add(f[i-1][l+(a[i-2]!=a[i-1])][r+(a[2*n-i+1]!=a[2*n-i+2])],f[i][l][r]);
		for (int k=0;k<r;k++) add(f[i-1][l+(a[i-2]!=a[i-1])+1][k+(a[2*n-i+1]!=a[2*n-i+2])],f[i][l][r]);
	}
	int ans=0;
	for (int l=0;l<=2*n-1;l++)
	for (int r=0;r<=2*n-1;r++) add(ans,f[1][l][r]);
	printf("%d\n",ans);
}

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

int main(){
    int A, N;
    int near = 1000;
    int t = 0;

    string S, T;
    cin >> S;
    for(int i = 0; i < S.size()-2; i++){
        T.push_back(S.at(i));
        T.push_back(S.at(i+1));
        T.push_back(S.at(i+2));
        t = abs(stoi(T) - 753);
        near = min(near, t);
        T = {};
    }
    cout << near << endl;
}

Measured memory_bytes: 256