akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x) int((x).size())
#define debug(x) cout << #x << ":" << x << ' ';
#define debugg(x) cout << #x << ":" << x << ' ' << "\n";
#define endl '\n'
#define ff first
#define ss second
#define L(X) ((X)<<1)
#define R(X) (((X)<<1)|1)
#define M(X,Y) (((X)+(Y))>>1)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int MAXN = 1e5 + 5;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long int LLINF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-9;
const double PI = acos(-1);

template<typename T>   T add(T x, T y, T m) { return ((x % m)  + (y % m)) % m;}
template<typename T>   T mul(T x, T y, T m) { return ((x % m) * (long long)(y % m)) % m;}
template<typename T>   T sub(T x, T y, T m) { return add(x, -y + m);}
template<typename T>   T gcd(T a, T b) { return b ? gcd(b, a % b) : a;}
template<typename T>   T lcm(T a, T b) { return a / gcd(a, b) * b;}

int lg2(long long x)   {   return 64 - __builtin_clzll(x) - 1;	}
int lg2(int x)   {   return 32 - __builtin_clzll(x) - 1;	}

struct pair_hash{
	template<class T1, class T2>
	size_t operator() (const pair<T1, T2> &p) const {
		auto h1 = hash<T1>{}(p.first);
		auto h2 = hash<T2>{}(p.second);
		return h1 ^ h2;
	}
};




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

	int n;
	cin >> n;

	ll sum = 0;

	for(int i = 1 ; i <= n ; ++i) {
		for(int j = 1 ; j <= n ; ++j) {
			for(int k = 1; k <= n ; ++k) {
				sum += __gcd(i, __gcd(j, k));
			}
		}
	}

	cout << sum << endl;

	return 0;
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
#define MAX 100001
int arr[MAX], N;

int main()
{
  int N,L;
  cin >> N >> L;
  int min=500;
  int ans;
  for(int i=1;i<=N;i++){
    if(abs(L+i-1)<min){
      ans = i;
      min = abs(L+i-1);
    }
  }
  long sum=0;
  for(int i=1;i<=N;i++){
    if(i==ans)continue;
    else sum += L+i-1;
  }
  cout << sum << endl;
}


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

typedef long long ll;
typedef pair<int,int> P;
ll const mod = 998244353;

#define p_ary(ary,a,b,i) do { cout << "["; for (int (i) = (a);(i) < (b);++(i)) cout << ary[(i)] << ((b)-1 == (i) ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

ll pow_mod(ll a,ll b) {
    ll ret;
    if (b < 0) ret = pow_mod(a,mod+b-1);
    else if (b == 0) ret = 1;
    else if (b == 1) ret = a;
    else {
        ll c = pow_mod(a,b/2);
        if (b%2) ret = (c*c)%mod*a%mod;
        else ret = c*c%mod;
    }
    return ret;
}

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0;i < n;++i) cin >> a[i];
    vector<vector<ll>> dp(n+1,vector<ll>(90010,0));
    int sum = 0;
    ll ans = pow_mod(3,n);
    for (int i = 0;i < n;++i) sum += a[i];
    dp[0][0] = 1;
    for (int i = 0;i < n;++i) {
        for (int j = 0;j < 90010;++j) if (dp[i][j]) {
            dp[i+1][j] += dp[i][j]*2;
            dp[i+1][j] %= mod;
            if ((j+a[i])*2 >= sum) {
                ans -= dp[i][j]*pow_mod(3,n-i)%mod;
                ans %= mod;
            } else {
                dp[i+1][j+a[i]] += dp[i][j];
                dp[i+1][j+a[i]] %= mod;
            }
        }
    }
    vector<vector<ll>> dp2(n+1,vector<ll>(90010,0));
    dp2[0][0] = 1;
    for (int i = 0;i < n;++i) for (int j = 0;j < 90010;++j) if (dp2[i][j]) {
        dp2[i+1][j] += dp2[i][j];
        dp2[i+1][j] %= mod;
        dp2[i+1][j+a[i]] += dp2[i][j];
        dp2[i+1][j+a[i]] %= mod;
    }
    if (sum%2 == 0) ans += dp2[n][sum/2]*3;
    cout << (ans+mod)%mod << endl;
}

Measured memory_bytes: 424512
#include <iostream>
#include <set>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    while(true) {
        int N, M;
        cin >> N >> M;
        if(!N && !M) break;

        vector<int> points;
        vector<int> points_of_two;
        for(int i = 0; i < N; ++i) {
            int p;
            cin >> p;
            points.push_back(p);
        }
        for(int i = 0; i < N; ++i) {
            if(points[i] <= M) points_of_two.push_back(points[i]);
            for(int j = 0; j < i; ++j) {
                int sum = points[i] + points[j];
                if(sum <= M) points_of_two.push_back(sum);
            }
        }
        points_of_two.push_back(0);
        sort(points_of_two.begin(), points_of_two.end());
        points_of_two.erase(unique(points_of_two.begin(), points_of_two.end()), points_of_two.end());

        int ans = 0;
        for(int i = 0; i < points_of_two.size(); ++i) {
            int rem = M - points_of_two[i];
            int left = 0, right = points_of_two.size();
            while(left < right) {
                int center = (left+right)/2;
                if(points_of_two[center] <= rem) {
                    left = center+1;
                }
                else {
                    right = center;
                }
            }
            if(left != 0) --left;
            int score = points_of_two[i] + points_of_two[left];
            if(score > ans) ans = score;
        }
        cout << ans << endl;
    }
    return 0;
}

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

typedef long long ll;
#define pii pair<int , int>
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define MAXX 1005

int n;

int main()
{
    _FastIO;
    cin >> n;
    int k = n % 10;
    if(k == 3){
        cout << "bon" << endl;
        return 0;
    }
    if(k < 2 || k == 6 || k == 8){
        cout << "pon" << endl;
        return 0;
    }
    cout << "hon" << endl;
    return 0;
}


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

int main()
{
    int n, t=0;
    cin >> n;
    int a[n];
    for (int i=0; i<n; i++)
    {
        cin >> a[n];
        if (a[n] % 2 != 0 && (i+1) % 2 != 0)
            t++;
    }
    cout << t;
    return 0;
}


Measured memory_bytes: 3512
#include<stdio.h>

int main(void){
int x,y;
scanf("%d %d",&x,&y);
if(x<y){
  printf("a < b\n");
}else if(x>y){
  printf("a > b\n");
}else{
  printf("a == b\n");
}
  return 0;
}



Measured memory_bytes: 2088
#include<stdio.h>
int main(){
  int N,p[10],i,high=0,sum=0;
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&p[i]);
    sum=sum+p[i];
    if(p[i]>p[high])high=i;
  }
  sum=sum-(p[high]/2);
  printf("%d",sum);
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>

using namespace std;

//詳しくは解説を参照
int solve(int n){
	int cnt = 0;
	for(int i=2;i<n;i++){//足す回数(和の項数)(2以上)
		if(2*n < i*(2*1 + i - 1)){//初項が1でもnを超えてしまう
			break;
		} 
		if( (2*n - i*i + i)%(2*i) == 0 && (2*n - i*i + i) >= (2*i) ){
			cnt++;
		}
	}
	return cnt;
}

int main(){
	while(true){
		int n;
		cin >> n;
		if(n==0){
			break;
		}
		int result = solve(n);
		cout << result << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(nullptr);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template <typename T>
struct SegTree {
    using F = function<T(T,T)>;
    
    int size;
    vector<T> dat;

    const F f;
    const T INIT;
    
    SegTree(int n, const F func, const T &init) : f(func), INIT(init) {
        size = 1;
        while(size < n) size <<= 1;
        dat.assign(2*size, INIT);
    }

    void update(int k, const T &x) {
        k += size;
        dat[k] = x;
        while(k >>= 1) {
            dat[k] = f(dat[2*k],dat[2*k+1]);
        }
    }

    T query(int a,int b) {
        T l = INIT, r = INIT;
        for(a += size, b += size+1; a < b; a >>= 1, b >>= 1) {
            if (a & 1) l = f(l,dat[a++]);
            if (b & 1) r = f(r,dat[--b]);
        }
        return f(l,r);
    }

    void set(int k, const T &x) {
        dat[k+size] = x;
    }

    void build() {
        for(int k = size - 1; k > 0; k--) {
            dat[k] = f(dat[2*k],dat[2*k+1]);
        }
    }

    T operator[](const int &k) const {
        return dat[k+size];
    }

};

int main(void)
{
    IOS
    const int N = 300000;
    int n, k;
    cin >> n >> k;
    SegTree<int> seg(N,[](int a,int b){return max(a,b);},0);
    int ans = 0;
    REP(_,n) {
        int a; cin >> a;
        int p = seg.query(max(0,a-k),min(N+1,a+k))+1;
        seg.update(a,p);
        ans = max(ans,p);
        //cerr << ans << endl;
    }
    cout << ans << '\n';

    return 0;
}

Measured memory_bytes: 7360
#include<bits/stdc++.h>
const int M = 5e5;
using namespace std;
inline int read() {
    char c = getchar(); int x = 0, f = 1;
    while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
    while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
    return x * f;
}
int N, sa, sb, tot = 0;
int a[M], b[M], ta[M], tb[M], date[M], fa[M];
int find(int x) 
{
    if (fa[x] == x) return x;
    return fa[x] = find(fa[x]);
}
int main() 
{
    N = read();
    for(int i = 1; i <= N; i++) a[i] = read(), sa ^= a[i]; 
	a[N + 1] = sa;
    for(int i = 1; i <= N; i++) b[i] = read(), sb ^= b[i]; 
	b[N + 1] = sb;
    N++;
    memcpy(ta, a, sizeof(a)); 
	memcpy(tb, b, sizeof(b));
    sort(ta + 1, ta + N + 1); 
	sort(tb + 1, tb + N + 1);
    for(int i = 1; i <= N - 1; i++) 
		if(ta[i] != tb[i]) return puts("-1"), 0;
    int ans = 0, num = 0;
    for(int i = 1; i <= N; i++) 
        if(a[i] != b[i] || (i == N)) {
            date[++num] = a[i]; date[++num] = b[i];
            if(i < N)ans++;//最后一块单独考虑
        }
    if(ans == 0) return puts("0"), 0;
    sort(date + 1, date + num + 1);
    num = unique(date + 1, date + num + 1) - date - 1;
    for(int i = 1; i <= num; i++) fa[i] = i;
    for(int i = 1; i <= N; i++)
        if(a[i] != b[i]) {
            a[i] = lower_bound(date + 1, date + num + 1, a[i]) - date,
            b[i] = lower_bound(date + 1, date + num + 1, b[i]) - date;
            fa[find(a[i])] = find(b[i]);
        }
    for(int i = 1; i <= num; i++)
        if(fa[i] == i) ans++;
    printf("%d", ans - 1);
    return 0;
}

Measured memory_bytes: 10496
const main = stdin => {
  const input = stdin.trim().split('\n')
  const S = input[0]
  switch (S) {
    case 'SUN':
      console.log(7)
      break;
    case 'MON':
      console.log(6)
      break;
    case 'TUE':
      console.log(5)
      break;
    case 'WED':
      console.log(4)
      break;
    case 'THU':
      console.log(3)
      break;
    case 'FRI':
      console.log(2)
      break;
    case 'SAT':
      console.log(1)
      break;

    default:
      break;
  }
}

// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))


Measured memory_bytes: 29288
#include <iostream>
#include <algorithm>
#include <map>

using namespace std;

const int N = 1000;

int n;
pair<int, int> data[N];

int calc(int emp){
  bool dp[N][N+1];
  fill(dp[0], dp[N], false);
  dp[0][0] = true;
  for(int i=0;i<n-1;i++){
    for(int j=0;j<=emp;j++){
      if(!dp[i][j]) continue;
      dp[i+1][j] = true;
      if(j+data[i].second <= emp) dp[i+1][j+data[i].second] = true;
    }
  }
  int tmp = 0;
  for(int i=0;i<=emp;i++) if(dp[n-1][i]) tmp = i;
  int res = data[n-1].first * 2;
  for(int i=0;i<n;i++) res += data[i].second;
  return res - tmp;
}

main(){
  while(cin >> n && n){
    for(int i=0;i<n;i++){
      int a, b;
      cin >> a >> b;
      data[i] = make_pair(a, b);
    }
    sort(data, data+n);
    int sum = 0;
    for(int i=0;i<n-1;i++) sum += data[i].first;
    int ans = 0;
    if(sum >= data[n-1].first) for(int i=0;i<n;i++) ans += data[i].first + data[i].second;
    else ans = calc(data[n-1].first - sum);
    cout << ans << endl;
  }
}

Measured memory_bytes: 2148
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    int n;
    cin >> n;
    VVI a(n, VI(26));
    string s;
    REP(i,0,n) {
        cin >> s;
        REP(j,0,s.size()) a[i][s[j] - 'a']++;
    }
    VI b(26, 50);
    REP(i,0,n) REP(j,0,26) b[j] = min(b[j], a[i][j]);
    REP(i,0,26) {
        REP(j,0,b[i]) cout << char('a' + i);
    }
    cout << endl;
}

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

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = int_fast64_t;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
    int n;
    cin >> n;
    int tx,ty,th;
    VI x(n), y(n), h(n);
    REP(i,0,n) {
        cin >> tx >> ty >> th;
        //if (th > 0) {
            x[i] = tx;
            y[i] = ty;
            h[i] = th;
        //}
    }
    int ansx = -1, ansy = -1, ansh = -1;
    if (h[0] == 0) {
        REP(i,1,n) {
            if (h[i] != 0) {
                swap(x[0], x[i]);
                swap(y[0], y[i]);
                swap(h[0], h[i]);
                break;
            }
        }
    }
    REP(i,0,101) REP(j,0,101) {
        int H = h[0] + abs(x[0] - i) + abs(y[0] - j);
        bool b = true;
        REP(k,0,n) {
            int tmp = h[k] + abs(x[k] - i) + abs(y[k] - j);
            if ((h[k] == 0 && tmp < H) || (h[k] > 0 && tmp != H)) {
            //if (tmp != H) {
                b = false;
                break;
            }
        }
        if (b) {
            if (ansx == -1 || ansh < H) {
                ansx = i;
                ansy = j;
                ansh = H;
            }
            //cout << i << " " << j << " " << H << endl;
            //return;
        }
    }
    cout << ansx << " " << ansy << " " << ansh << endl;
}

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fint register int
#define p 479853
#define h 5001
#define int long long
using namespace std;
int a[p];
signed main()
{
	int n;
	cin>>n;
	for(fint i=1;i<=n;i++)
	cin>>a[i];
	int ans=0;
	for(fint i=1;i<=n;i++)
	for(fint j=i;j<=n;j++)
	for(fint k=j;k<=n;k++)
	if(i!=j&&j!=k&&i!=k&&a[i]+a[j]>a[k]&&a[j]+a[k]>a[i]&&a[i]+a[k]>a[j]&&a[i]!=a[j]&&a[i]!=a[k]&&a[j]!=a[k])
	ans++;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 3684
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repA(i, a, n) for(int i = a; i <= (n); ++i)
#define repD(i, a, n) for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a) memset(a, 0, sizeof (a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	string a; cin >> a;
	set <char> se;
	int n = sz(a);
	vi sep; sep.pb(n);
	repD(i,n-1,0){
		se.insert(a[i]);
		if(sz(se) == 26){
			sep.pb(i);
			se.clear();
		}
	}
	sort(all(sep));
	string ans = "";
	rep(i,26){
		if(se.find('a' + i) == se.end()){
			ans += char('a'+ i);
			break;
		}
	}
	se.clear();
	int m = sz(sep);
	int ind = 0;
	rep(i,n) if(a[i] == ans[0]){ ind = i; break; }
	repA(i,1,m-1){
		ind++;
		for(int j = ind; j < sep[i]; j++){
			se.insert(a[j]);
		}
		rep(j,26){
			if(se.find('a' + j) == se.end()){
				ans += char('a'+ j);
				break;
			}
		}
		se.clear();
		if(i != m-1) for(; a[ind] != ans[i]; ind++);
	}
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 720
import java.util.*;

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

    int N = scn.nextInt();

    int[] A = new int[N];
    for (int i = 0; i < N; i++) {
      A[i] = scn.nextInt();
    }

    int[] L = new int[N + 1];
    L[0] = 0;
    L[1] = A[0];
    int[] R = new int[N];
    R[N - 1] = 0;
    R[N - 2] = A[N - 1];
    for (int i = 2; i < N; i++) {
      L[i] = gcd(L[i - 1], A[i - 1]);
    }
    for (int i = N - 3; i >= 0; i--) {
      R[i] = gcd(R[i + 1], A[i + 1]);
    }

    int max = 1;
    for (int i = 0; i < N; i++) {
      max = Math.max(gcd(L[i], R[i]), max);

    }
    System.out.println(max);

  }

  public static int gcd(int a, int b) {
    if (b == 0) {
      return a;
    }
    return gcd(b, a % b);
  }

}

Measured memory_bytes: 52396
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll> > vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;
const long long INF = numeric_limits<ll>::max();
const long long MOD = 1000000007;
const long double PI = 3.1415926;
template <class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
//char c;
 
#define Endl endl
 
/*--------------------template--------------------*/
 
int main() {
    vi a(3);
    REP(i,3)cin>>a[i];
    sort(a.begin(),a.end());
    ll pre=0;
    if(a[0]%2!=a[1]%2){
        a[0]+=1;
        a[2]+=1;
        pre=1;
    }
    ans=INF;
    REP(i,a[2]-a[1]+1){
        ll a1=a[2]-a[0]-i;
        ll a2=a[2]-a[1]-i;
        if (a1%2!=0||a2%2!=0)continue;
        ans=min(ans,a1/2+a2/2+i+pre);
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        String S = sc.next();
        S = S.substring(0,K-1)+S.substring(K-1,K).toLowerCase()+S.substring(K);
        System.out.println(S);
        }
}



Measured memory_bytes: 21588
#include <bits/stdc++.h>
using namespace std;
typedef long long  ll;
int coun(ll n){
  int res=0;
  while(n>0){
    res =res + n%2;
    n/=2;
  }
  return res;
}
int main(){
  ll n;
  cin>>n;
  string x;
  cin>>x;
  vector<ll> kai(n+1);
  ll pc =0;
  vector<ll> mop(n+1),mom(n+1);
  for(int i=0; i<n; i++){
    if(x.at(i)=='1'){
      pc++;
    }
  }
  if(pc == 0&&n!=1){
    for(int i =0; i<n; i++){
      cout<<0<<endl;
    }
    return 0;
  }
  else if(pc==0&&n==1){
    cout<<1<<endl;
    return 0;
  }
  mop[0]=1;
  if(pc !=1)mom[0]=1;
  else mom[0] =0;
  for(int i =1; i<n; i++){
    mop.at(i) = (mop.at(i-1) * 2) %(pc+1);
    if(pc!=1) mom.at(i) = (mom.at(i-1) * 2) %(pc-1);
    else mom.at(i)=0;
  }
  kai.at(1) = 1;
  for(int i =1; i<=n; i++){
    int tmp = coun(i);
    int tt = i%tmp;
    if(tt==0) kai.at(i)=1;
    else kai.at(i) = kai.at(tt) +1;
  }
  ll xp =0;
  ll xm =0;
  for(int i=0;i<n;i++){
    if(x.at(n-i-1)=='1'){
      xp +=mop.at(i);
      xp %= (pc+1);
      xm += mom.at(i);
      if(pc!=1) xm %= (pc-1);
    }
  }
  for(int i=n-1; i>=0; i--){
    if(x.at(n-i-1)=='1'){
      ll tmod = pc-1;
      ll tmp = xm - mom.at(i);
      if(tmp<0) tmp += pc-1;
      if(pc!=1) tmp %= tmod;
      if(tmod !=0){  
        cout<<(tmp==0||tmod ==0? 1: kai.at(tmp)+1)<<endl;
      }
      else cout<<0<<endl;
    }
    else{
      ll tmod = pc+1;
      ll tmp = xp + mop.at(i);
      tmp %= tmod;
      cout<<(tmp==0? 1 :kai.at(tmp)+1)<<endl;
    }
  }
//    cout << fixed << setprecision(10);
}


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

int main()
{
	double a[10001];
	double n;
	double max,min,sum;

	cin>>n;	
	sum=0;
	max=1000000*(-1);
	min=1000000;
	for( int i=0; i<n; i++ ) {
		cin>>a[i];
		sum+=a[i];
		if( max < a[i] ) {
			max=a[i];
		}
		if( a[i] < min ) {
			min=a[i];
		}
	}
	
	cout <<setprecision(12)<<min<<" "<<max<<" "<<sum<<endl;  
    return 0;
}

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

int main(void){
	string S;
	cin >> S;
	int c = 0;
	rep(i,S.size()){
		c += (S[i]-'0');
		c %= 9;
	}

	if (c%9==0) cout << "Yes" << endl;
	else cout << "No" << endl;
return 0;
}


Measured memory_bytes: 3752
#![allow(unused, non_snake_case, dead_code, non_upper_case_globals)]
use {
    proconio::{marker::*, *},
    std::{cmp::*, collections::*, mem::*},
};

#[fastout]
fn main() {
    input! {//
        n:usize,
        a:[i64;n],
    }
    let mut ans = 0;
    for i in 0..n {
        if i % 2 == 0 && a[i] % 2 == 1 {
            ans += 1;
        }
    }
    println!("{}", ans);
}


Measured memory_bytes: 2172
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>

using namespace std;
using ll = long long;
using ull = unsigned long long;

#ifndef __MACRO_H__
#define __MACRO_H__

#define all(collection)  (collection).begin(), (collection).end()		// begin to end
#define rep(i, begin, end) for (ll i = begin; i < end; i++)					// repeat
#define repr(i, begin, end) for (ll i = begin - 1; end <= i; i--)		// repeat reverse

std::chrono::system_clock::time_point  start;

void TimeStart(void)
{
	start = std::chrono::system_clock::now();
}

void TimeEnd(void)
{
	auto time = std::chrono::system_clock::now() - start;
	auto msec = std::chrono::duration_cast<std::chrono::milliseconds>(time).count();
	cerr << endl << msec << " msec " << endl;
}

#endif

int main(void)
{
	ll n; cin >> n;
	ll k; cin >> k;

	cout << n - k + 1;
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#define pb push_back
using namespace std;

int A[200005],res[200005];
vector<int> adj[200005];
int lis[200005];
int bin_search(int sz,int v){
  int l=0,r=sz-1;
  while(l<=r){
    int mid=(l+r)>>1;
    int prev=lis[mid];
    int next=lis[mid+1];
    if(prev<v && v<=next) return mid+1;
    if(next<v) l=mid+1;
    else r=mid-1;
  }
}
void solve(int node,int sz,int parent){
  res[node]=sz;
  for(int i=0; i<(int)adj[node].size(); i++){
    int next=adj[node][i];
    if(next==parent) continue;
    if(lis[0]>=A[next-1]){
      int v=lis[0];
      lis[0]=A[next-1];
      solve(next,sz,node);
      lis[0]=v;
    }
    else if(lis[sz-1]<A[next-1]){
      lis[sz]=A[next-1];
      solve(next,sz+1,node);
      lis[sz]=0;
    }
    else{
      int pos=bin_search(sz,A[next-1]);
      int v=lis[pos];
      lis[pos]=A[next-1];
      solve(next,sz,node);
      lis[pos]=v;
    }
  }
}
int main(){
  int N;
  cin>>N;
  for(int i=0; i<N; i++) cin>>A[i];
  for(int i=0; i<N-1; i++){
    int n1,n2;
    cin>>n1>>n2;
    adj[n1].pb(n2);
    adj[n2].pb(n1);
  }
  lis[0]=A[0];
  solve(1,1,-1);
  for(int i=1; i<=N; i++){
    cout<<res[i]<<endl;
  }
  return 0;
}


Measured memory_bytes: 33212
import argparse
import collections
import logging.config
import sys
import csv
import numpy as np

def tester(x, y, p):
    c = []
    c.append(x)
    for i in range(y+1):
        c.append(int(x+(i//2+1)*(1-i%2-0.5)*-2))
    for i in range(y+1):
        if not(c[i] in p):
            return(c[i])
            break

def main():

    sa = input().split()
    x = int(sa[0])
    y = int(sa[1])
    p = []
    if sa[1] != "0":
      sb = input().split()
      for d in sb:
      	p.append(int(d))        
    print (tester(x,y,p))


if __name__ == '__main__':
    main()


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

using namespace std;
typedef long long ll;

struct Fenwick {
    vector<int> seg;
    int n;
    Fenwick(int _n) : seg(_n+1), n(_n) {}
    void add(int k, int v) {
        k++;
        while (k <= n) {
            seg[k] += v;
            k += k & -k;
        }
    }
    int sum(int k) {
        int r = 0;
        k++;
        while (k) {
            r += seg[k];
            k -= k & -k;
        }
        return r;
    }
};

const int MN = 200010;
int n;
ll K;
ll a[MN];

int main() {
    scanf("%d %lld", &n, &K);
    for (int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        a[i+1] = a[i] + x;
    }
    vector<ll> v;
    for (int i = 0; i <= n; i++) {
        a[i] = a[i] - K * i;
        v.push_back(a[i]);
    }
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());

    Fenwick fw(int(v.size()));
    ll ans = 0;
    for (int i = 0; i <= n; i++) {
        int k = int(lower_bound(v.begin(), v.end(), a[i]) - v.begin());
        assert(v[k] == a[i]);
        ans += fw.sum(k);
        fw.add(k, 1);
    }
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 4208
<?php
fscanf(STDIN, '%s', $a);
for($i = 0; $i <  count( captalChr()); $i++ ) {
  if($a === captalChr()[$i]) {  print(captalChr()[$i + 1]);}
}
function captalChr() {
  $alphabet = [];
  for($i = 0; $i < 26; $i++ ) {
// ord関数は、文字列をASC||に変換してくれる
// chrで、文字列に戻す。
  array_push($alphabet, chr(ord('a') + $i));
  }
 return $alphabet;
}
?>

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

#define ll long long
#define F first
#define S second
#define ii pair < int , int >
#define ever (;;)

const int N = 1010;

int n,m,x1,Y1,x2,y2,dis[N][N],inf=1e9,mx[4]={1,-1,0,0},my[4]={0,0,1,-1};
char A[N][N],a[N][N];
deque <ii> q;

bool inline inside(int x,int y) { return x >= 1 && x <= n && y >= 1 && y <= m; }

void bfs()
{
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            dis[i][j] = inf;

    dis[x1][Y1] = 0;
    q.push_front( { x1 , Y1 } );

    while( !q.empty() )
    {
        int x = q.front().F;
        int y = q.front().S;

        q.pop_front();

        for(int i=0;i<4;i++)
        {
            int nx = x + mx[i];
            int ny = y + my[i];

            if( inside(nx,ny) && a[nx][ny] == '.' && dis[nx][ny] > dis[x][y] )
            {
                dis[nx][ny] = dis[x][y];
                q.push_front( { nx , ny } );
            }
        }

        for(int i=x-2;i<=x+2;i++)
            for(int j=y-2;j<=y+2;j++)
                if( inside(i,j) && a[i][j] == '.' && dis[i][j] > dis[x][y] + 1 )
                {
                    dis[i][j] = dis[x][y] + 1;
                    q.push_back( { i , j } );
                }
    }
}

int main()
{
    scanf("%d%d%d%d%d%d",&n,&m,&x1,&Y1,&x2,&y2);
    for(int i=0;i<n;i++)
        scanf("%s",&A[i]);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            a[i][j] = A[i-1][j-1];

    bfs();

    if( dis[x2][y2] == inf )
        printf("-1\n");
    else
        printf("%d\n",dis[x2][y2]);
}


Measured memory_bytes: 9808
program ccc

implicit none
integer :: n, i, one, two
integer, dimension(1) :: o
integer, allocatable, dimension(:) :: a

read*, n
allocate(a(n))
read*, a

one=maxval(a)
o=maxloc(a)
a(o)=0
two=maxval(a)

do i=1,n
if(i/=o(1)) write(*,'(i0)') one
if(i==o(1)) write(*,'(i0)') two
end do

end program

Measured memory_bytes: 2944
// A. 

#include <iostream>
#include <algorithm>
#include <sstream>
#include <cstdio>
#include <cstring>

using namespace std;

int main(int argc, char *argv[])
{
	int a, b;
	cin >> a >> b;
	if (a == 0 || b == 0 || a < 0 && b > 0) {
		cout << "Zero" << endl;
	} else if (a < 0 && ((b - a) % 2) == 0) {
		cout << "Negative" << endl;
	} else {
		cout << "Positive" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
// package agc.apc001;

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

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

        int x = in.nextInt();
        int y = in.nextInt();

        out.println(x % y == 0 ? -1 : x);
        out.flush();
    }

    public static void debug(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }

    public static class InputReader {
        private static final int BUFFER_LENGTH = 1 << 12;
        private InputStream stream;
        private byte[] buf = new byte[BUFFER_LENGTH];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        private int next() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public char nextChar() {
            return (char) skipWhileSpace();
        }

        public String nextToken() {
            int c = skipWhileSpace();
            StringBuilder res = new StringBuilder();
            do {
                res.append((char) c);
                c = next();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public int nextInt() {
            return (int) nextLong();
        }

        public long nextLong() {
            int c = skipWhileSpace();
            long sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = next();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = next();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public double nextDouble() {
            return Double.valueOf(nextToken());
        }

        int skipWhileSpace() {
            int c = next();
            while (isSpaceChar(c)) {
                c = next();
            }
            return c;
        }

        boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }
    }
}

Measured memory_bytes: 23124
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int x[520][520], l[520], r[520], n, s, dp[520];
vector<pair<int, int>>ti, vec;
int main() {
	cin >> n >> s; s--; ti.push_back(make_pair(0, -1)); for (int i = 0; i < 520; i++) { dp[i] = -999999999; }
	for (int i = 0; i < n; i++) { cin >> l[i] >> r[i]; ti.push_back(make_pair(r[i], i)); }
	for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { cin >> x[i][j]; } }
	sort(ti.begin(), ti.end()); dp[s] = 0; vec.push_back(ti[0]); for (int i = 1; i < ti.size(); i++) { if (ti[i - 1] != ti[i])vec.push_back(ti[i]); }
	for (int k = 0; k < n; k++) { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { x[i][j] = min(x[i][j], x[i][k] + x[k][j]); } } }
	for (int i = 0; i < vec.size(); i++) {
		int a1 = vec[i].first, spot = vec[i].second;
		if (spot >= 0) {
			for (int j = 0; j < n; j++) {
				int a3 = a1 + x[spot][j];
				if (a3 >= r[j])continue;
				dp[j] = max(dp[j], dp[spot] + min(r[j] - l[j], (r[j] - a3)));
			}
		}
		if (spot == -1) {
			spot = s;
			for (int j = 0; j < n; j++) {
				if (j == s)continue;
				int a3 = a1 + x[spot][j];
				if (a3 >= r[j])continue;
				dp[j] = max(dp[j], dp[spot] + min(r[j] - l[j], (r[j] - a3)));
			}
			dp[s] = r[s] - l[s];
		}
	}
	int maxn = 0; for (int i = 0; i < n; i++)maxn = max(maxn, dp[i]);
	cout << maxn << endl;
	return 0;
}

Measured memory_bytes: 4124
#include <bits/stdc++.h>
#define PI 3.1415926535897
using namespace std;
typedef long long ll;
const int INF = 1000000000;
const ll LINF = 1000000000000000000; //1e18
const double EPS = 1e-10;

int main(void)
{
    string S;
    cin >> S;

    int ans = 0;
    for (int i = 0; i < S.size() - 1; i++)
    {
        if (S[i] != S[i + 1])
        {
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 512
import std.stdio, std.string, std.conv, std.algorithm, std.numeric;
import std.range, std.array, std.math, std.typecons, std.container, core.bitop;

void main() {
    while (true) {
        int n, a, b, c, x;
        scan(n, a, b, c, x);

        if (!n) return;

        auto y = readln.split.to!(int[]);
        solve(n, a, b, c, x, y);
    }
}

void solve(int n, int a, int b, int c, int x, int[] y) {
    int pos;

    foreach (i ; 0 .. 10^^4 + 1) {
        if (i > 0) x = nextrand(a, b, c, x);
        if (x == y[pos]) {
            pos++;
            if (pos == n) {
                writeln(i);
                return;
            }
        }
    }

    writeln(-1);
}

int nextrand(int a, int b, int c, int x) {
    return (a*x + b) % c;
}

void scan(T...)(ref T args) {
    string[] line = readln.split;
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

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

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;

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

  vector< int > a(3);
  REP(i, 3)
    cin >> a[i];

  sort(ALL(a));

  int ans = 0;
  REP(i, 2) {
    ans += a[i + 1] - a[i];
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

#define INF (1<<29) //53687091
#define INFLL (1ll<<58)

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())
#define DBG(x) cerr << #x << ": " << x << "\n";

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }


int
main(void){  
  ll d, g;
  cin >> d >> g;

  ll p[d], c[d];
  REP(i, d) cin >> p[i] >> c[i];

  /*
  ll sum = g;
  ll ans = 0LL;
  ROF(i, d-1, 0){
    //cout << "Currenc sum: " << sum << endl;
    if(sum > p[i] * (i+1) * 100 + c[i]){
      sum -= p[i] * (i+1) * 100 + c[i];
      ans += p[i];
    }
    else{
      ll count = p[i];
      for(;;){
	if(count < 0) break;	
	sum -= (i+1) *100;
	if(sum < 0) break;
	++ans;
	--count;
	//cout << "While sum: " << sum << " count: " << count << endl;	
      }      
    }
  }
  */

  int ans = INF, max_rest = 0;
  for(int mask=0; mask<(1<<d); mask++){
    int num=0, score=0;
    REP(i, d){
      if((mask>>i) & 1){
	num += p[i];
	score += p[i]*(i+1)*100 + c[i];
      }
      else{
	max_rest = i;
      }
    }
    //cout << mask << " : " << max_rest << " score: "<< score << " num: " << num <<  endl;
    if(score < g){
      int itmp = (max_rest+1)*100;
      int need = (g - score + itmp - 100) / itmp;
      //needが多すぎると, その単一のpだけでまかないきれないからやめる.
      if(p[max_rest] <= need) continue;
      //cout << "need:" << need << " p:" << p[max_rest]<<  endl;
      num += need;
    }
    ans = min(ans, num);
  }

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


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
int main(void)
{
    long long int H,i;
    long long int count=0;
    long long int ans=1;
    scanf("%lld",&H);
    while(H>=1){
        count++;
        H=H/2;
    }
    for(i=1;i<count;i++){
        ans=ans*2+1;
    }
    printf("%lld",ans);
	return 0;
    }

Measured memory_bytes: 128
#include <algorithm>
#include <bitset>
#include <cctype>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

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

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

#define X first.first
#define Y first.second
#define R second.first
#define C second.second

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 29;

int main(void){
    for(int n; cin >> n, n;){

        vector< pair<pii, pii> > discs(n);
        rep(i, n) cin >> discs[i].X >> discs[i].Y >>
                         discs[i].R >> discs[i].C;
    
        vi confDiscs(n);
        rep(i, n) rep(j, i){
            if(sqr(discs[i].X - discs[j].X) + sqr(discs[i].Y - discs[j].Y) < sqr(discs[i].R + discs[j].R))
                confDiscs[i] |= (1 << j);
        }

        vector<char> dp(1 << n, -1);
        dp[0] = 0;

        rep(i, 1 << n){
            if(dp[i] == -1) continue;

            rep(j, n){
                if(((1 << j) & i) != 0 || (confDiscs[j] & i) != confDiscs[j])
                    continue;

                range(k, j + 1, n){
                    if(((1 << k) & i) != 0 || (confDiscs[k] & i) != confDiscs[k] || discs[j].C != discs[k].C)
                        continue;

                    int next = i | (1 << j) | (1 << k);
                    dp[next] = max((int)dp[next], dp[i] + 2);
                }
            }
        }
        
        cout << (int)*max_element(all(dp)) << endl;
    }

	return 0;
}

Measured memory_bytes: 17708
//#include <bits/stdc++.h>
#include <iostream>
using namespace std;
using Int = int_fast64_t;

Int n, ans;
string s;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> n >> s;
	char t = '0';
	for(Int i=0; i<n; ++i)
		if(t != s[i]){
			++ans;
			t = s[i];
		}
	cout << ans << "\n";
}

Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<list>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1 << 28;
const double EPS = 1e-10;
//cout << fixed << std::setprecision(9)
//memset(a, 0, sizeof(a));
//--------------------------

int n;
int h[111];

int main()
{
	cin >> n;
	for (int i = 1;i <= n;i++) {
		cin >> h[i];
	}

	int ans = 0;
	while (1) {

		int l = 0;
		while (h[l] == 0 && l <= n) l++;
		if (l > n) break;

		int r = l;
		while (h[r]) r++;
		if (l < r) r--;

		//cout << l << " " << r << endl;

		for (int i = l;i <= r;i++) {
			h[i] -= 1;
		}
		ans++;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
std::vector<int> v;
int main() {
	int N;
	cin >> N;
	for(int i=0;i<2*N;i+=1){
	     int x;
	     cin >> x;
	     v.push_back(x);
	}
	sort(v.begin(),v.end());
	int a = floor(N/2);
	int ans = 0;
	for(int i=0;i<(N*2);i+=2){
	     ans+=v[i];
	    // cout << v[i]<<endl;
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
long long int arr[500005];
long long int size1[500005];
long long int m = 1000000007;
bool vis[200005] = {0};
vector<pair<ll, ll>> vec[300005];
ll count1 = 0;
vector<pair<ll, pair<ll, ll>>> vec1;
ll count2 = 0;
long long int fin(long long int node)
{
    if (node == arr[node])
        return node;
    node = arr[arr[node]];
}

void union1(long long int x, long long int y)

{
    long long int node1 = fin(x);
    long long int node2 = fin(y);

    if (size1[node1] > size1[node2])
    {
        size1[node1] += size1[node2];
        arr[node2] = node1;
    }
    else
    {
        size1[node2] += size1[node1];
        arr[node1] = node2;
    }
}
long long int fastexpo(long long int a, long long int b)
{
    long long int ans = 1;
    while (b)
    {
        if (b & 1)
            ans = (ans * a) % m;
        b = b / 2;
        a = (a * a) % m;
    }
    return ans;
}
void dfs(ll node)
{
    vis[node] = 1;
    //  vec1.push_back({count1, {node1, node}});

    size1[node] = count1;
    count1++;
    for (int i = 0; i < vec[node].size(); i++)
    {

        // arr[vec[node][i]] = count1;
        if (!vis[vec[node][i].first])
        {
            dfs(vec[node][i].first);
            arr[node] += arr[vec[node][i].first];
        }
    }
    count1--;
}
void dijkstra(ll s, vector<pair<ll, ll>> vec2[], ll dis5[])
{
    priority_queue<pair<ll, ll>, vector<pair<ll, ll>>, greater<pair<ll, ll>>> pq;
    pq.push(make_pair(0, s));
    dis5[s] = 0;
    while (!pq.empty())
    {
        ll u = pq.top().second;
        //  vis[u] = 1;
        pq.pop();
        for (ll i = 0; i < (ll)vec2[u].size(); i++)
        {

            ll q = vec2[u][i].second;
            ll w = vec2[u][i].first;

            if (dis5[u] + w < dis5[q])
            {
                dis5[q] = dis5[u] + w;
                pq.push(make_pair(dis5[q], q));
            }
        }
    }
}
int main()
{
    ll t;
    cin >> t;
    cout << double(2 * 3.1415926535 * t);

    return 0;
}

Measured memory_bytes: 10744
import sys,math,itertools,bisect,copy,re

from collections import Counter, deque, defaultdict
from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
from functools import reduce
from math import ceil, floor, log10, log2, factorial
from pprint import pprint
# 10倍速いらしい
input = sys.stdin.readline

INF = float('inf')
MOD = 10**9+7
EPS = 10**-7
sys.setrecursionlimit(1000000)

# N = int(input())
# N,M = [int(x) for x in input().split()]
# V = [[0] * 100 for _ in range(100)]
# A = [int(input()) for _ in range(N)]
# DP = [[0] * 100 for _ in range(100)]
# DP = defaultdict(lambda: float('inf'))

a = int(input())
s = input().strip()

if a >= 3200:
    print(s)
else:
    print('red')



Measured memory_bytes: 3828